/* ==========================================================================
   Dörthe Eickelberg – site styles
   Order: fonts · tokens · base · layout · header/nav · hero · content
          · components (cards, gallery, lightbox, quotes, video, audio, form, cta)
          · footer · utilities
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --sand:   light-dark(#f5efe4, #0d1f26);
  --paper:  light-dark(#fffdf8, #132a33);
  --ink:    light-dark(#11262e, #eef1ec);
  --muted:  light-dark(#4d5f63, #a8b8b9);
  --line:   light-dark(#d9cfbe, #2b4650);
  --accent: light-dark(#b23f24, #f0855f);   /* coral: 5.1:1 on sand, 6.6:1 on dark (WCAG AA) */
  --sea:    light-dark(#1d5c63, #7cc3c4);
  --on-dark: #fffdf8;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.95rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.35rem + 1.1vw, 2.25rem);
  --step-3:  clamp(2.1rem, 1.6rem + 2.2vw, 3.5rem);
  --step-4:  clamp(2.6rem, 1.6rem + 4.5vw, 6rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --space: clamp(3.5rem, 8vw, 7rem);
  --measure: 40rem;
  --wide: 76rem;
  --radius: 0.75rem;
  --header-h: 4rem;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);   /* strong ease-out */
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 400; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p, ul, ol, blockquote, figure { margin: 0 0 1.1em; }
p { text-wrap: pretty; }
img, video { display: block; max-inline-size: 100%; block-size: auto; }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

button { font: inherit; color: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -10rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--sand);
}
.skip-link:focus { inset-block-start: 1rem; }

/* ---------- layout ---------- */

/* Pages that don't end with a CTA box still need room before the footer. */
main:not(:has(> .cta:last-child)) { padding-block-end: var(--space); }

main > :where(section, aside, .prose) {
  inline-size: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}

.section { padding-block: var(--space) 0; }
.section-head { max-inline-size: var(--measure); margin-block-end: 2.5rem; }

.prose { max-inline-size: var(--measure) !important; padding-block-start: var(--space); }
.prose > :first-child { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.45; }

.kicker {
  margin-block-end: 0.75rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
@media (min-width: 52rem) {
  .split { grid-template-columns: 1.1fr 0.9fr; }
}

.split--top { align-items: start; }

.list, .columns { padding: 0; list-style: none; }
.columns { columns: 18rem; column-gap: 2.5rem; }
:is(.list, .columns) li { break-inside: avoid; padding-block: 0.45rem; border-block-end: 1px solid var(--line); }
.list + h3 { margin-block-start: 2rem; }

/* ---------- header & navigation (see modern-web-guidance "navbar") ---------- */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  background: var(--sand);
  border-block-end: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  block-size: var(--header-h);
  inline-size: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}
.header-inner > * { flex-shrink: 0; white-space: nowrap; }

.site-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  text-decoration: none;
}

.menu-button {
  anchor-name: --menu-button;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 600;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block;
  inline-size: 1.1rem;
  block-size: 2px;
  background: currentColor;
  border-radius: 2px;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; }
.menu-icon::before { inset-block-start: -6px; }
.menu-icon::after { inset-block-start: 6px; }

.site-menu, .dropdown-list { list-style: none; margin: 0; padding: 0; }

.site-menu a, .dropdown-trigger {
  display: block;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
}
.site-menu a:hover, .dropdown-trigger:hover { color: var(--accent); }
.site-menu [aria-current="page"], .dropdown-trigger.is-active {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.dropdown-trigger::after { content: " ▾"; font-size: 0.8em; }

.nav-lang-links { display: flex; gap: 0.25rem; }
.nav-lang { margin-block-start: 0.5rem; padding-block-start: 0.5rem; border-block-start: 1px solid var(--line); }
.site-menu .nav-lang a { padding: 0.5rem 0.6rem; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em; }
.site-menu .nav-lang [aria-current="true"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }
.site-header.is-wide .nav-lang { margin: 0 0 0 0.5rem; padding: 0 0 0 0.5rem; border-block-start: 0; border-inline-start: 1px solid var(--line); }

/* Collapsed (default): the menu is a popover anchored to the button. */
.site-header .site-menu {
  position: fixed;
  inset: auto;
  inset-block-start: calc(var(--header-h) - 0.25rem);
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: var(--gutter);
  inline-size: min(85dvw, 22rem);
  max-block-size: calc(100dvh - 6rem);
  margin-block-start: 0.5rem;
  padding: 0.5rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.35);
}
.site-header .dropdown-list { padding-inline-start: 1rem; }
.site-header .site-menu::backdrop { background: rgb(0 0 0 / 0.2); }

@media (prefers-reduced-motion: no-preference) {
  .site-header:not(.is-wide) .site-menu {
    transition: opacity 0.2s var(--ease), translate 0.2s var(--ease), display 0.2s, overlay 0.2s;
    transition-behavior: allow-discrete;
  }
  .site-header:not(.is-wide) .site-menu:not(:is(:popover-open, .\:popover-open)) { opacity: 0; translate: 0 -0.5rem; }
  @starting-style {
    .site-header:not(.is-wide) .site-menu:is(:popover-open, .\:popover-open) { opacity: 0; translate: 0 -0.5rem; }
  }
}

/* Wide: same list, inline. JS adds .is-wide when the row fits. */
.site-header.is-wide {
  .menu-button { display: none; }
  .site-menu {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    inline-size: auto;
    max-block-size: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .site-menu::backdrop { display: none; }
  .site-menu a, .dropdown-trigger { padding: 0.5rem 0.7rem; }

  .dropdown-list[popover] {
    position: absolute;
    position-area: block-end span-inline-end;
    position-try-fallbacks: flip-block, flip-inline;
    inset: auto;
    height: auto;
    min-inline-size: 15rem;
    margin: 0.5rem 0 0;
    padding: 0.5rem;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.35);
  }
  .dropdown-list::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 100%;
    block-size: 0.5rem;
  }
  .dropdown-list:not(:is(:popover-open, .\:popover-open)) { display: none; }
  .dropdown-list:is(:popover-open, .\:popover-open) { display: grid; }
}
@supports not (position-area: block-end) {
  .site-header.is-wide .dropdown-list[popover] { position: fixed; margin: 0; }
}

.is-measuring * { transition: none !important; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-block-size: min(72svh, 44rem);
  color: var(--on-dark);
  isolation: isolate;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(8 22 28 / 0.8), rgb(8 22 28 / 0.15) 55%, rgb(8 22 28 / 0.35));
}
.hero-text {
  inline-size: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
  padding-block: 3rem clamp(2rem, 6vw, 4.5rem);
}
.hero-text h1 { max-inline-size: 16ch; margin: 0; }
.hero .kicker { color: #ffd3c2; }
.hero-tagline { max-inline-size: 34ch; margin: 1.25rem 0 0; font-size: var(--step-1); }

.hero--home { min-block-size: calc(100svh - var(--header-h)); }
.hero--home h1 { font-size: clamp(3rem, 1.5rem + 7vw, 8.5rem); line-height: 0.95; }
.hero--home h1 em { display: block; font-weight: 300; }


/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 3rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: light-dark(#fff, #10232a);
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms var(--ease), background-color 150ms ease;
  touch-action: manipulation;
}
.button:hover { color: light-dark(#fff, #10232a); }   /* never the accent link hover: text would vanish */
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: color-mix(in oklab, var(--accent) 85%, black); }
}
.button:active { transform: scale(0.97); }

.round-button {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-size: 1.1rem;
  touch-action: manipulation;
  transition: background-color 150ms ease, color 150ms ease, scale 160ms var(--ease);
}
.round-button:active { scale: 0.95; }
@media (hover: hover) and (pointer: fine) {
  .round-button:hover { background: var(--ink); color: var(--sand); }
}
/* First/last slide reached: the arrow stays focusable (aria-disabled) but looks inactive. */
.round-button[aria-disabled="true"] { opacity: 0.35; cursor: default; scale: 1; }
.round-button[aria-disabled="true"]:hover,
.lightbox .round-button[aria-disabled="true"]:hover { background: var(--paper); color: inherit; }
.lightbox .round-button[aria-disabled="true"]:hover { background: rgb(255 255 255 / 0.1); }

/* ---------- tiles (home: "Was ich mache" + projects; projects page) ----------
   First tile leads full width, the rest share a 2-column grid. Text is always visible.
   Hover (real pointers only): the photo zooms in slowly and a coral line grows under the
   title – it says "this is a link" without an icon. Touch: press feedback only. */

.features { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 40rem) {
  .features { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .feature--lead { grid-column: 1 / -1; }
}

.feature a {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-block-size: 100%;
  aspect-ratio: 4 / 3;              /* minimum; grows if the text needs room */
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  isolation: isolate;
  touch-action: manipulation;
  transition: scale 160ms var(--ease);
}
.feature a:hover { color: #fff; }
.feature a:active { scale: 0.985; }
.feature a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.feature--lead a { aspect-ratio: 4 / 5; }
@media (min-width: 40rem) {
  .feature a { aspect-ratio: 3 / 2; }
  .feature--lead a { aspect-ratio: 21 / 9; }
}

.feature-img { position: absolute; inset: 0; z-index: -2; inline-size: 100%; block-size: 100%; object-fit: cover; }
.feature-img--podcast { object-position: 50% 97%; }   /* crop the logo's lettering, the title says it */
@media (min-width: 40rem) { .feature-img--podcast { object-position: 50% 85%; } }
.feature a::after {               /* scrim keeps the text legible on any photo */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(8 22 28 / 0.9) 0%, rgb(8 22 28 / 0.65) 35%, rgb(8 22 28 / 0) 70%);
}
@media (min-width: 60rem) {
  .feature--lead a { align-items: center; }
  .feature--lead a::after {
    background: linear-gradient(to right, rgb(8 22 28 / 0.88) 0%, rgb(8 22 28 / 0.55) 40%, rgb(8 22 28 / 0) 70%);
  }
}

.feature-body { display: grid; justify-items: start; gap: 0.5rem; padding: clamp(1.1rem, 3vw, 2rem); }
.feature-title { position: relative; font-family: var(--font-display); font-size: var(--step-2); line-height: 1.05; }
.feature--lead .feature-title { font-size: var(--step-3); }
.feature-desc { max-inline-size: 44ch; font-size: var(--step--1); line-height: 1.55; color: rgb(255 255 255 / 0.9); }
.feature--lead .feature-desc { font-size: var(--step-0); max-inline-size: 38ch; }

@media (hover: hover) and (pointer: fine) {
  .feature-img { transition: scale 600ms var(--ease); }
  .feature a:is(:hover, :focus-visible) .feature-img { scale: 1.06; }

  .feature-title::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -0.3rem;
    block-size: 2px;
    background: var(--accent);
    transform-origin: left;
    scale: 0 1;
    transition: scale 300ms var(--ease);
  }
  .feature a:is(:hover, :focus-visible) .feature-title::after { scale: 1 1; }
}

/* Phones: text below the photo instead of on it – photo and text form one card. */
@media (max-width: 39.99rem) {
  .feature a { flex-direction: column; align-items: stretch; aspect-ratio: auto; background: var(--paper); color: var(--ink); }
  .feature a:hover { color: var(--ink); }
  .feature a::after { content: none; }
  .feature-img { position: static; z-index: auto; block-size: auto; aspect-ratio: 3 / 2; }
  .feature--lead .feature-img { aspect-ratio: 4 / 3; }
  .feature-body { padding: 1.1rem 1.2rem 1.3rem; }
  .feature-desc { color: var(--muted); }
}

/* Object tile (book cover): the whole object on a calm light ground instead of a cropped
   photo, so a book reads as a book. Fixed light colours in both themes. */
.feature--object a { background: #efe6d8; color: #10232a; }
.feature--object a:hover { color: #10232a; }
.feature--object a::after { content: none; }
.feature--object .feature-body { max-inline-size: 62%; }
.feature--object .feature-desc { color: rgb(16 35 42 / 0.8); }
.feature-object {
  position: absolute;
  z-index: -1;
  inset-block: 9%;
  inset-inline-end: 5%;
  block-size: 82%;
  inline-size: auto;
  max-inline-size: 34%;
  object-fit: contain;
}
.feature--book .feature-object { rotate: -4deg; filter: drop-shadow(0 0.9rem 1.2rem rgb(16 35 42 / 0.35)); }
@media (max-width: 39.99rem) {   /* phones: the object above the text, on the same ground */
  .feature--object a { background: #efe6d8; color: #10232a; }
  .feature--object .feature-body { max-inline-size: none; }
  .feature-object { position: static; align-self: center; block-size: 13rem; max-inline-size: 60%; margin-block-start: 1.5rem; }
}
@media (hover: hover) and (pointer: fine) {
  .feature-object { transition: scale 600ms var(--ease), rotate 600ms var(--ease); }
  .feature a:is(:hover, :focus-visible) .feature-object { scale: 1.06; rotate: 0deg; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-img, .feature-object, .feature-title::after, .feature a { transition: none !important; }
  .feature a:is(:hover, :focus-visible) :is(.feature-img, .feature-object), .feature a:active { scale: none; }
  .feature--book a:is(:hover, :focus-visible) .feature-object { rotate: -4deg; }
}

/* ---------- gallery (see modern-web-guidance "carousel") ---------- */

.gallery { padding-block-start: var(--space); }
.gallery-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-block-end: 1rem;
}
.gallery-count { margin: 0 auto 0 0; font-variant-numeric: tabular-nums; color: var(--muted); }

.gallery-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  border-radius: var(--radius);
}
.gallery-track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .gallery-track, .lightbox-track { scroll-behavior: smooth; }
}

.gallery-slide { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.gallery-open {
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-open img {
  inline-size: auto;
  max-inline-size: 85vw;
  block-size: clamp(15rem, 52svh, 32rem);
  object-fit: cover;
}

/* Mosaic: varied tile sizes; "dense" fills gaps so the pattern stays tight. */
.gallery--grid .gallery-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(40%, 9rem), 1fr));
  grid-auto-rows: clamp(7rem, 18vw, 11rem);
  grid-auto-flow: dense;
  gap: 0.5rem;
  overflow: visible;
}
.gallery--grid .gallery-slide.is-wide { grid-column: span 2; }
.gallery--grid .gallery-slide.is-tall { grid-row: span 2; }
.gallery--grid .gallery-slide.is-big { grid-column: span 2; grid-row: span 2; }
.gallery--grid .gallery-open,
.gallery--grid .gallery-open img {
  inline-size: 100%;
  max-inline-size: none;
  block-size: 100%;
  object-fit: cover;
}
@media (hover: hover) and (pointer: fine) {
  /* Same language as the tiles: a slow, gentle zoom under the pointer. */
  .gallery--grid .gallery-open img { transition: scale 600ms var(--ease); }
  .gallery--grid .gallery-open:is(:hover, :focus-visible) img { scale: 1.06; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery--grid .gallery-open img { transition: none; scale: none !important; }
}
.gallery--grid.is-collapsed .gallery-slide:nth-child(n + 25) { display: none; }
.gallery--grid { padding-block-start: 0; }
.gallery-more { margin: 2rem auto 0; display: flex; }

/* ---------- lightbox (see modern-web-guidance "light-dismiss-a-dialog") ---------- */

.lightbox {
  inline-size: 100dvw;
  max-inline-size: none;
  block-size: 100dvh;
  max-block-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(6 16 20 / 0.94);
  color: #fff;
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.6); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }

.lightbox-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.lightbox-track img {
  flex: 0 0 100%;
  inline-size: 100%;
  block-size: 100%;
  padding: clamp(0.5rem, 3vw, 2rem);
  object-fit: contain;
  scroll-snap-align: center;
}
.lightbox-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}
.lightbox-bar form { margin: 0; }
.lightbox-count { min-inline-size: 5ch; margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
.lightbox .round-button { background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.25); color: #fff; }
.lightbox .round-button:hover { background: #fff; color: #000; }

/* ---------- quotes ---------- */

.quotes {
  columns: 20rem;
  column-gap: 2rem;
}
.quotes blockquote {
  break-inside: avoid;
  margin: 0 0 2rem;
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
  background: var(--paper);
}
.quotes blockquote p {
  margin-block-end: 0.75rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-0);
  line-height: 1.5;
}
.quotes blockquote:nth-child(3n + 1) p { font-size: var(--step-1); line-height: 1.35; }
.quotes footer { font-size: var(--step--1); font-weight: 600; color: var(--sea); }

/* Press quotes carousel: two quotes in full, the third cut off as a hint to swipe. */
.gallery--quotes { padding-block-start: 0; }
.gallery--quotes .gallery-track { gap: 1rem; align-items: stretch; }
.gallery--quotes .quote {
  flex: 0 0 85%;
  margin: 0;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border-radius: var(--radius);
  background: var(--paper);
  scroll-snap-align: start;
}
@media (min-width: 48rem) {
  .gallery--quotes .quote { flex-basis: calc((100% - 2rem) / 2.3); }
}
.gallery--quotes .quote p {
  margin-block-end: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.4;
}
.gallery--quotes .quote footer { font-size: var(--step--1); font-weight: 600; color: var(--sea); }

/* Video links carousel (episodes on YouTube): thumbnail, language, title. */
.gallery--videos { padding-block-start: 0; }
.gallery--videos .gallery-track { gap: 1rem; }
.video-link { flex-basis: 80%; }
@media (min-width: 48rem) {
  .video-link { flex-basis: calc((100% - 2rem) / 3.3); }
}
.video-link a { display: grid; gap: 0.5rem; color: inherit; text-decoration: none; }
.video-link-thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line);
}
.video-link-thumb img { grid-area: 1 / 1; inline-size: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-link-thumb .video-play { grid-area: 1 / 1; inline-size: 3rem; block-size: 3rem; }
.video-link-meta { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); color: var(--muted); }
.video-link-title { font-weight: 600; line-height: 1.35; }
.video-link a:is(:hover, :focus-visible) .video-link-title { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .video-link a:hover .video-play { transform: scale(1.08); }
}

/* ---------- video & audio ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 2rem;
}
.media-grid--pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
* + .media-grid--pair { margin-block-start: 2.5rem; }

.video { margin: 0; }
.video figcaption { margin-block-start: 0.6rem; font-weight: 600; }
.video-facade, .video iframe {
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
}
.video-facade {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, var(--sea), #0b2229);
  color: #fff;
  isolation: isolate;
}
.video-facade img { position: absolute; inset: 0; z-index: -1; inline-size: 100%; block-size: 100%; object-fit: cover; filter: brightness(0.6); }
.video-play {
  display: grid;
  place-items: center;
  inline-size: 4rem;
  block-size: 4rem;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 160ms var(--ease);
}
.video-play::before { content: ""; margin-inline-start: 0.3rem; border-block: 0.7rem solid transparent; border-inline-start: 1.1rem solid #fff; }
.video-facade:active .video-play { transform: scale(0.95); }
.video-label { display: grid; gap: 0.25rem; margin-block-start: 0.75rem; font-weight: 600; }
.video-label small { font-weight: 400; opacity: 0.8; font-size: 0.8rem; }

.audio {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius);
  background: var(--paper);
}
.audio figcaption { font-family: var(--font-display); font-size: var(--step-1); }
.audio audio { inline-size: 100%; }

/* ---------- podcast ---------- */

.podcast-intro { align-items: start; }
.podcast-platforms {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--step--1);
  line-height: 1.7;
}
.podcast-platforms a { font-weight: 600; white-space: nowrap; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.podcast-cover { margin: 0; }
.podcast-cover img { inline-size: 100%; border-radius: var(--radius); }
.podcast-cover figcaption { margin-block-start: 0.5rem; font-size: var(--step--1); color: var(--muted); }
@media (min-width: 52rem) { .podcast-cover { position: sticky; inset-block-start: calc(var(--header-h) + 2rem); } }

.episodes { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.episode { padding-block: clamp(1.5rem, 3vw, 2.25rem); border-block-end: 1px solid var(--line); }
.episode-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-block-end: 0.6rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.episode-num { font-weight: 600; color: var(--accent); }
.episode-lang {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.episode-title { max-inline-size: 32ch; margin-block-end: 0.6rem; font-size: var(--step-2); }
.episode-desc { max-inline-size: var(--measure); }
.episode-desc p { margin-block-end: 0.75rem; }
.episode-desc details { margin-block-end: 0.75rem; }
.episode-desc summary {
  inline-size: fit-content;
  padding-block: 0.4rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.episode-desc details[open] summary { margin-block-end: 0.5rem; }
.episode-links { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.25rem; margin: 0; color: var(--muted); font-size: var(--step--1); }
.episode-link { display: inline-block; padding-block: 0.4rem; font-size: var(--step-0); font-weight: 600; color: var(--ink); }

/* ---------- facts, pull quotes, figures ---------- */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 1.5rem 0;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius);
  background: var(--paper);
  font-size: var(--step--1);
}
.facts dt { font-weight: 600; color: var(--sea); }
.facts dd { margin: 0; }
.facts--wide { margin: 0; padding: clamp(1.25rem, 3vw, 2rem); font-size: var(--step-0); }
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; gap: 0.15rem; }
  .facts dd + dt { margin-block-start: 0.6rem; }
}

.pullquote { margin: 1.75rem 0; padding-inline-start: 1.25rem; border-inline-start: 3px solid var(--accent); }
.pullquote p { margin-block-end: 0.4rem; font-family: var(--font-display); font-style: italic; font-size: var(--step-1); line-height: 1.35; }
.pullquote footer { font-size: var(--step--1); color: var(--muted); }

.figure { margin: 0; }
.figure img { inline-size: 100%; border-radius: var(--radius); }
.figure figcaption { margin-block-start: 0.5rem; font-size: var(--step--1); color: var(--muted); }

/* ---------- FAQ ----------
   Collapsed behind one quiet pill button; the questions stay in the page (and in the
   structured data) for search engines, find-in-page opens it. */

.faq-toggle > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  transition: color 150ms ease, border-color 150ms ease, scale 160ms var(--ease);
}
.faq-toggle > summary::-webkit-details-marker { display: none; }
.faq-toggle > summary h2 { margin: 0; font-family: inherit; font-size: var(--step-0); font-weight: 600; line-height: 1.2; }
.faq-toggle > summary::after { content: "+"; inline-size: 1.2em; text-align: center; color: var(--accent); }
.faq-toggle[open] > summary::after { content: "–"; }
.faq-toggle > summary:active { scale: 0.97; }
.faq-toggle > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .faq-toggle > summary:hover { color: var(--ink); border-color: var(--ink); }
}
.faq-toggle[open] > summary { margin-block-end: 1.25rem; }

.faq-list { max-inline-size: 52rem; border-block-start: 1px solid var(--line); }
.faq-item { border-block-end: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: var(--step-1); line-height: 1.3; }
.faq-item summary::after {             /* plus that turns into a minus */
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--accent);
  transition: rotate 200ms var(--ease);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .faq-item summary:hover h3 { color: var(--accent); }
}
.faq-answer { max-inline-size: var(--measure); padding-block-end: 1.25rem; }
.faq-answer p { margin-block-end: 0.75rem; }

/* ---------- form (see modern-web-guidance "forms") ---------- */

.form { display: grid; gap: 1.5rem; max-inline-size: 36rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; }
.field input, .field textarea {
  inline-size: 100%;
  min-block-size: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid light-dark(#767676, #6f8a90);
  border-radius: 0.5rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 1em);
}
.field textarea { min-block-size: 10rem; resize: vertical; }
.field :user-invalid { border-color: var(--accent); border-width: 2px; }
.field-hint { font-size: var(--step--1); color: var(--muted); }
.honeypot { position: absolute; inset-inline-start: -100vw; }

/* ---------- CTA ---------- */

.cta {
  margin-block: var(--space);
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 6vw, 5rem);
  border-radius: calc(var(--radius) * 2);
  background: var(--ink);
  color: var(--sand);
  text-align: center;
}
/* The FAQ (and the facts box on Moderation) follow the contact box at the very end: keep them close. */
.section.faq { padding-block-start: 2rem; }
.cta + .section { padding-block-start: 0; }
.cta h2 { font-style: italic; font-weight: 400; }
.cta p { max-inline-size: 40ch; margin-inline: auto; margin-block-end: 2rem; font-size: var(--step-1); }

/* ---------- footer ---------- */

.site-footer { padding-block: 3rem; border-block-start: 1px solid var(--line); font-size: var(--step--1); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  inline-size: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}
.footer-inner p { margin: 0; }
.footer-name { font-family: var(--font-display); font-size: var(--step-1); margin-inline-end: auto !important; }
.footer-links { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer-copy { color: var(--muted); }

/* Social links: icon + name as pills, big enough to spot and to tap. */
.footer-social { gap: 0.75rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.social-icon { inline-size: 1.5rem; block-size: 1.5rem; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .social-link:hover { background: var(--ink); border-color: var(--ink); color: var(--sand); }
}

/* ---------- utilities ---------- */

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.portrait { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; inline-size: 100%; }
.portrait--top { object-position: 50% 0; }
.portrait--left { object-position: 20% 50%; }

@media (forced-colors: active) {
  .site-menu [aria-current="page"] { outline: 2px solid; }
  .button, .round-button { border: 1px solid; }
}

/* ---------- page transitions (see modern-web-guidance "cross-document-transitions") ----------
   Header and menu stay put; only the content cross-fades. Fast out, slightly slower in.
   Browsers without support (e.g. Firefox) simply navigate as before. */

@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation: none; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }

::view-transition-old(root) { animation: 140ms ease-out both page-out; }
::view-transition-new(root) { animation: 260ms var(--ease) 60ms both page-in; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; translate: 0 0.5rem; } }

/* ---------- touch targets in the footer ---------- */

@media (pointer: coarse) {
  .footer-links a:not(.social-link), .footer-inner > p a { display: inline-block; padding-block: 0.6rem; }
}

/* ---------- simple pages ---------- */

.page-message { padding-block: calc(var(--space) * 1.5) var(--space); }
.page-message h1 { font-size: var(--step-3); }
.legal h1 { font-size: var(--step-3); }
.legal h2 { margin-block-start: 2rem; font-size: var(--step-1); }
