.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  margin: 0;
}

main {
  background-color: var(--color-surface);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-soft);
}

img,
picture,
video {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;
  clip: rect(0,0,0,0);

  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-extra-small);

  padding: var(--spacing-small) var(--spacing-medium);

  border-radius: var(--radius-medium);
  border: none;

  background: var(--color-accent);
  color: white;

  font-weight: 600;
  text-decoration: none;
  cursor: pointer;

  transition: background var(--transition-fast);
}

.button:hover {
  background: var(--color-accent-hover);
}

.button-ghost {

  background: none;

  color: var(--color-accent);

}

.button-ghost:hover {
  color: var(--color-accent-hover);
}
.card {
  background: var(--color-surface);

  border: 2px solid var(--color-card-border);
  display: flex;
  flex-direction: column;

  gap: var(--spacing-small);

  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.card > img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.content-card {
  display: flex;

  flex-direction: column;

  gap: var(--spacing-extra-medium);
}
.container {
  max-width: var(--content-width-wide);
  margin-inline: auto;
  padding: var(--spacing-medium);
}

.container-narrow {
  max-width: 65ch;
  margin: 0 auto;
  padding: var(--spacing-medium);
}
.disclosure {
  background: var(--color-summary);

  border: 2px solid var(--color-border);

  border-radius: var(--radius-medium);

  padding: var(--spacing-medium);
}

.disclosure-summary {
  font-weight: 700;

  font-size: var(--font-size-medium);

  cursor: pointer;
}

.disclosure-summary::marker {
  color: var(--color-accent);
}

details[open] {
  background: var(--color-surface);
}
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  white-space: nowrap;
  display: none;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-medium);
  list-style: none;
  visibility: hidden;
  margin: 0;
  padding: var(--spacing-extra-small) 0;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);

  transition: 
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.dropdown.open .dropdown-menu {
  display: block;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);

  pointer-events: auto;
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-link:hover {
  background-color: var(--color-surface-hover);
}

.active-theme {
    font-weight: bold;
    outline: 2px solid var(--color-accent);
}
.footer {
    margin-top: var(--spacing-extra-large);
    padding-top: var(--spacing-large);
    border-top: 1px solid var(--color-border);
}

/* Layout */
.footer-grid {
    margin-bottom: var(--spacing-large);
}

/* Sections */
.footer-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-small);
}

/* Titles */
.footer-title {
    font-size: var(--font-size-large);
}

/* Text */
.footer-text {
    color: var(--color-muted-text);
}

/* Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link {
    text-decoration: none;
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-accent);
}

/* Bottom bar */

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-medium);
    text-align: center;
}

.footer-copy {
    font-size: var(--font-size-small);
    color: var(--color-muted-text);
}
.grid {
  display: grid;
  gap: var(--spacing-medium);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}
.center {
  margin-inline: auto;
  max-width: var(--content-width, 60ch);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-medium);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-small);
}

.surface {
  background: var(--color-surface);

  border-radius: var(--radius-medium);

  box-shadow: var(--shadow-soft);

  padding: var(--spacing-medium);
}

.readable {
  max-width: min(65ch, 100%);
}

.flow > * + * {
  margin-top: var(--flow-space, var(--spacing-medium));
}
.media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-small);

}

.media-image {

  width: clamp(
      200px,
      40vw,
      500px
  );

  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-medium);
}

.media-caption {
  font-size: var(--font-size-extra-small);
  color: var(--color-muted-text);
  font-style: italic;
}
/* Navbar container */
.navbar {
  background: var(--color-navbar);

  padding-inline: var(--spacing-medium);
  padding-block: var(--spacing-small);

  border-bottom: 1px solid var(--color-border);

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-group {
  display: flex;
  gap: var(--spacing-medium);

  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-right {
  justify-content: flex-end;
}

.util-icon {
  padding-inline: var(--spacing-small);
}

/* Navbar links */
.navbar-link,
.dropdown-button {

  display: flex;
  align-items: center;

  text-decoration: none;
  font-weight: 600;

  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;

  gap: var(--spacing-extra-small);
  padding: 
    var(--spacing-extra-small)
    var(--spacing-small);

  line-height: 1;
}

/* Hover state */
:where(.navbar-link, .dropdown-button):hover {
  color: var(--color-accent);
}


/* Navbar icons */
.navbar-icon {
  width: 20px;
  height: 20px;

  flex-shrink: 0;

  object-fit: contain;
}

.dropdown-link {

  display: flex;
  align-items: center;
  gap: var(--spacing-extra-small);

  width: 100%;

  padding: var(--spacing-extra-small) var(--spacing-medium);

  background: none;
  border: none;

  color: var(--color-text);
  cursor: pointer;
  text-align: left;

}

.dropdown-link:hover {
  background: var(--color-surface-hover);
}

.navbar-link:focus-visible,
.dropdown-button:focus-visible {
  outline: 2px solid var(--color-focus);
}
.page-header {
  text-align: center;
  margin-bottom: var(--spacing-large);
}

.page-title {
  font-size: var(--font-size-extra-large);
}
.contact-list {
  list-style: none;
  padding: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-medium);
}

.contact-icon {
  width: 32px;
  height: 32px;
}

.contact-link {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}

.contact-link:hover {
  color: var(--color-accent);
}

input {
  padding: var(--spacing-small);

  border-radius: var(--radius-small);

  border: 1px solid var(--color-border);

  background: var(--color-surface);

  color: var(--color-text);
}

input:focus {
  border-color: var(--color-focus);
}
.post {
  display: flex;

  flex-direction: column;

  gap: var(--spacing-small);

  padding: var(--spacing-medium);

  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.post-header {
  display: flex;

  flex-direction: column;

  gap: var(--spacing-extra-small);
}

.post-title {
  font-size: var(--font-size-large);
}

.post-date {
  font-size: var(--font-size-extra-small);

  color: var(--color-muted-text);
}
.stats-list {
  display: flex;
  flex-wrap: wrap;

  gap: var(--spacing-small);

  padding: 0;

  list-style: none;

  width: 100%;
}

.stats-item {
  background: var(--color-surface-hover);

  border-radius: var(--radius-small);

  padding:
    var(--spacing-extra-small)
    var(--spacing-small);

  font-size: var(--font-size-extra-small);
}
[data-theme="night"] {
  --color-900: #020617;
  --color-700: #1e293b;
  --color-600: #2563eb;
  --color-500: #3b82f6;
  --color-300: #475569;
  --color-200: #64748b;
  --color-100: #e2e8f0;
}

[data-theme="forest"] {
  --color-900: #041b13;
  --color-700: #1b4332;
  --color-600: #2f7a57;
  --color-500: #40916c;
  --color-300: #5fae86;
  --color-200: #8fd3ad;
  --color-100: #d8f3dc;
}

[data-theme="ocean"] {
  --color-900: #001d3d;
  --color-700: #003566;
  --color-600: #0077b6;
  --color-500: #0096c7;
  --color-300: #48cae4;
  --color-200: #90e0ef;
  --color-100: #caf0f8;
}

[data-theme="sunset"] {
  --color-900: #7c2d12;
  --color-700: #9a3412;
  --color-600: #ea580c;
  --color-500: #f97316;
  --color-300: #fb923c;
  --color-200: #fdba74;
  --color-100: #fff7ed;
}
.text-extra-large {
    font-size: var(--font-size-extra-large);
}

.text-large {
    font-size: var(--font-size-large);
}

.text-extra-medium {
    font-size: var(--font-size-extra-medium);
}

.text-medium {
    font-size: var(--font-size-medium);
}

.text-small {
    font-size: var(--font-size-small);
}

.text-extra-small {
    font-size: var(--font-size-extra-small);
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.3;
}

p {
  color: var(--color-text-muted);
}
:root {
   /* Surfaces */
   --color-background: var(--color-100);
   --color-surface: var(--color-200);
   --color-surface-hover: var(--color-300); 

   /* Text */
   --color-text: var(--color-900);
   --color-text-muted: var(--color-700);

   /* Semantic colors */
   --color-surface-alt: var(--color-100);
   --color-card-border: var(--color-border);
   --color-highlight: var(--color-accent);
   --color-highlight-soft: var(--color-surface-hover);

   --color-article: var(--color-surface);
   --color-summary: var(--color-surface-hover);

   --color-button-text: white;

   /* To do: fill these. */
   --color-success: #22c55e;
   --color-warning: #eab308;
   --color-danger: #ef4444;
   --color-info: #3b82f6;

   /* Accents */
   --color-accent: var(--color-500);
   --color-accent-hover: var(--color-600);

   /* Structure */
   --color-navbar: var(--color-200);
   --color-border: var(--color-300);
   --color-focus: var(--color-500);
   --color-overlay: rgba(0,0,0,0.5);

   /* Spacing scale */
   --spacing-extra-small: 0.25rem;
   --spacing-small: 0.5rem;
   --spacing-medium: 1rem;
   --spacing-extra-medium: 1.5rem;
   --spacing-large: 2rem;
   --spacing-extra-large: 3rem;


   /* Border radius */
   --radius-small: 4px;
   --radius-medium: 8px;
   --radius-large: 12px;


   /* Shadows */
   --shadow-none: none;
   --shadow-soft: 0 2px 6px rgba(0,0,0,0.08);
   --shadow-medium: 0 4px 12px rgba(0,0,0,0.12);
   --shadow-large: 0 8px 24px rgba(0,0,0,0.18);

   /* Font sizes */
   --font-size-extra-small: 0.875rem;
   --font-size-small: 1rem;
   --font-size-medium: 1.25rem;
   --font-size-extra-medium: 1.5rem;
   --font-size-large: clamp(1.5rem, 2vw, 2rem);
   --font-size-extra-large: 2.5rem;

   /* Transition */
   --transition-bounce: 0.2s cubic-bezier(.34,1.56,.64,1);
   --transition-slow: 0.4s ease;
   --transition-medium: 0.25s ease;
   --transition-fast: 0.15s ease;
   
   /* Width */
   --content-width-narrow: clamp(45ch, 60vw, 65ch);
   --content-width-medium: clamp(60ch, 75vw, 85ch);
   --content-width-wide: clamp(75ch, 90vw, 1200px);
}
