/* ---------- Schrift Barlow – lokal eingebunden (keine Verbindung zu Google) ---------- */

/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/barlow-400-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/barlow-400-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/barlow-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/barlow-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/barlow-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/barlow-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/barlow-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/barlow-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/barlow-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/barlow-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================
   Christin – Illustration
   Ruhiger, warmer Rahmen. Ein großer Satz in Serifenschrift.
   Dann ein dichtes Raster, in dem die Illustrationen die ganze Farbe liefern.
   Farben, Schriften und Abstände stehen hier oben als Variablen.
   ========================================================= */

:root {
  --cream: #F1EBDD;
  --ink: #FF0000;           /* Schriftfarbe: Logo-Rot */
  --ink-soft: #FF0000;      /* Nebentexte – ebenfalls Rot */
  --line: rgb(255 0 0 / 0.22);
  --red: #FF0000;            /* Logo-Rot – einzige Akzentfarbe */
  --tile-empty: #D9D1C3;     /* Kachelfarbe, bis das Bild geladen ist */

  --serif: "Barlow", system-ui, sans-serif;   /* Überschriften */
  --sans: "Barlow", system-ui, sans-serif;    /* Fließtext */

  --gutter: clamp(1rem, 3vw, 2.5rem);
  --gap: clamp(4px, 0.45vw, 6px);   /* Fuge zwischen den Bildern */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ---------- Grundlagen ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  overflow-x: clip;
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
}

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

.serif { font-family: var(--serif); }

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  padding: 0.5rem 0.9rem; background: var(--ink); color: var(--cream);
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem var(--gutter);
  padding-top: max(1.25rem, env(safe-area-inset-top));
}
.logo img { width: clamp(6.5rem, 9vw, 8.5rem); height: auto; }

.top ul {
  display: flex; gap: clamp(1.1rem, 2.5vw, 2rem);
  margin: 0; padding: 0; list-style: none;
  font-size: 0.98rem;
}
.top ul a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .top ul a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
}

/* ---------- Intro ---------- */

.intro { padding: clamp(3.5rem, 9vw, 8.5rem) var(--gutter) clamp(3rem, 7vw, 6.5rem); }
.intro h1 {
  margin: 0; max-width: 19ch;
  font-size: clamp(2.35rem, 5vw, 5.25rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.intro-text {
  max-width: 34ch;
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
  font-size: clamp(1.2rem, 1.15vw + 0.85rem, 1.65rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink-soft);
}

/* ---------- Galerie ---------- */

.work-head { padding: 0 var(--gutter) clamp(0.75rem, 1.5vw, 1.25rem); }
/* Für Screenreader und Google da, aber nicht sichtbar */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Collection-Filter: schlichte Textlinks, aktiver Filter unterstrichen */
.filters {
  display: flex; gap: clamp(1rem, 2vw, 1.75rem);
  margin: 0; padding: 0; list-style: none;
}
.filters button {
  appearance: none; background: none; border: 0; border-radius: 0;
  padding: 0.35rem 0; margin: 0;
  color: inherit; font: inherit; font-size: 1.0625rem; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  text-decoration-color: transparent;
  transition: text-decoration-color 150ms ease;
}
.filters button[aria-pressed="true"] { text-decoration-color: currentColor; }
.filters button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .filters button:hover { text-decoration-color: var(--line); }
  .filters button[aria-pressed="true"]:hover { text-decoration-color: currentColor; }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: 0; padding: 0 var(--gutter);
  list-style: none;
}

.tile {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--tile-empty);
  overflow: hidden;
}

/* Die erste Arbeit wird groß (zwei Spalten, zwei Reihen) */
.tile.feature { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.tile[hidden] { display: none; }
/* In einer gefilterten Ansicht sind alle Kacheln gleich groß – sonst entstehen Lücken */
.gallery.is-filtered .tile.feature { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 5; }
/* class="wide": doppelt breit (für Querformate) – nur am Desktop und ungefiltert, damit das Raster aufgeht.
   Die Höhe kommt von der Nachbarkachel in derselben Reihe. */
@media (min-width: 46.0625rem) {
  .gallery:not(.is-filtered) .tile.wide { grid-column: span 2; aspect-ratio: auto; }
  .gallery:not(.is-filtered) .tile.wide button { position: absolute; inset: 0; }
}

.tile button { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.tile button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* Bilder füllen die Kachel immer ganz aus (an den Rändern wird ggf. etwas beschnitten) */
.tile img { width: 100%; height: 100%; object-fit: cover; }


.tile .caption {
  position: absolute; left: 0; bottom: 0;
  padding: 0.45rem 0.75rem;
  background: var(--cream);
  font-size: 0.9rem; line-height: 1.3;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover .caption,
  .tile:focus-within .caption { opacity: 1; }
}

/* ---------- Über mich + Kontakt (rote Fläche, Foto links bis zum Rand) ---------- */
.closing {
  --on: #F1EBDD;
  margin: clamp(5rem, 10vw, 9rem) 0 0;
  background: var(--red); color: var(--on);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: min(56rem, 100vh);
}
.closing-photo { position: relative; min-height: 28rem; }
.closing-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.closing-text { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 5vw, 5rem) var(--gutter) clamp(2rem, 4vw, 3.5rem) clamp(2rem, 5vw, 5rem); }
.closing h2 { margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); font-size: clamp(2.6rem, 5.6vw, 5.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.022em; }
.closing-text p { max-width: 32ch; margin: 0 0 1em; font-size: clamp(1.15rem, 0.9vw + 0.85rem, 1.5rem); line-height: 1.4; }
.closing-cta { margin-top: clamp(3rem, 6vw, 5rem); }
.closing-ask { max-width: 28ch; margin: 0 0 1.25rem; font-size: clamp(1.15rem, 0.9vw + 0.85rem, 1.5rem); line-height: 1.4; }
.closing-link { color: var(--on); font-size: clamp(1.5rem, 2vw + 1rem, 2.6rem); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.closing-link:focus-visible { outline: 2px solid var(--on); outline-offset: 4px; }
@media (max-width: 46rem) {
  .closing { grid-template-columns: 1fr; min-height: 0; }
  .closing-photo { min-height: 0; aspect-ratio: 4 / 5; }
  .closing-text { padding: 2.5rem var(--gutter) 3rem; }
}

/* ---------- Footer-Kontakt ---------- */

.contact-meta a { overflow-wrap: anywhere; }
.sep { margin: 0 0.4em; }
.contact-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem;
  margin-top: clamp(3.5rem, 8vw, 6rem);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Großansicht ---------- */

.viewer {
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--cream);
  color: var(--ink);
}
.viewer::backdrop { background: var(--cream); }
.viewer:focus { outline: none; }
/* Desktop: Bild links, Titel + Geschichte rechts, Navigation unten */
.viewer[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 24rem);
  grid-template-rows: minmax(0, 1fr) auto;
}
.viewer[open] .v-stage { animation: v-in 220ms var(--ease-out); }
@keyframes v-in { from { opacity: 0; transform: scale(0.98); } }

/* Bild rückt rechts an den Text heran und steht unten auf einer Linie mit ihm */
.v-stage {
  display: grid; justify-items: end; align-items: end;
  min-height: 0;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3.5rem) 0 var(--gutter);
  touch-action: pan-y;
}
.v-stage img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  width: auto; height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.v-text {
  align-self: end;
  max-height: 100%; overflow-y: auto;
  padding: clamp(1rem, 3vw, 2.5rem) var(--gutter) 0 0;
}
.v-title { margin: 0 0 0.75rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.v-story { max-width: 34ch; font-size: 1.05rem; line-height: 1.5; }
.v-story p { margin: 0 0 0.75em; }
.v-story p:last-child { margin-bottom: 0; }
/* Print-Anfrage unter der Geschichte */
.v-print { max-width: 34ch; margin: 2.75rem 0 0; font-size: 1rem; line-height: 1.4; }
.v-print a { display: inline-block; font-weight: 600; white-space: nowrap; text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
.v-print a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.v-bar {
  grid-column: 1 / -1;
  display: flex; justify-content: flex-end;
  padding: 1rem var(--gutter) max(1.25rem, env(safe-area-inset-bottom));
}
.v-nav { display: flex; gap: 1.5rem; align-items: baseline; }
.v-nav button {
  all: unset; cursor: pointer;
  padding: 0.4rem 0;
  font-size: 1rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line);
}
.v-nav button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .v-nav button:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
}
.v-count { color: var(--ink-soft); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */

.site-footer {
  margin: 0 var(--gutter);
  padding: clamp(3.5rem, 8vw, 6rem) 0 max(clamp(2rem, 4vw, 3rem), env(safe-area-inset-bottom));
}
.site-footer .contact-meta { margin-top: 0; }

/* ---------- Find your weird little soulmate ---------- */
/* Zentrierte, kompakte Box – leicht abgesetzt vom Creme der Seite */

.soulmate {
  margin: 0 var(--gutter);
  padding: clamp(1rem, 3vw, 2rem) 0 0;
}
.sm-box {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.75rem) clamp(1.25rem, 5vw, 4rem);
  background: #E8DFCC;
  text-align: center;
  scroll-margin: 1rem;
}
.sm-head h2 {
  margin: 0 auto; max-width: 18ch;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.sm-sub {
  margin: 0.75rem 0 0;
  font-size: clamp(1.1rem, 0.7vw + 0.95rem, 1.35rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink-soft);
}
.sm-stage { margin-top: clamp(1.75rem, 3.5vw, 2.5rem); }

/* Schlichte Text-Buttons im Stil von „Get in touch“ */
.text-button {
  appearance: none; background: none; border: 0; border-radius: 0;
  padding: 0.25rem 0; margin: 0;
  color: inherit; font: inherit;
  font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.2rem);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
  cursor: pointer;
  transition: text-decoration-color 150ms ease;
}
.text-button.cta { font-size: clamp(1.15rem, 0.6vw + 1rem, 1.35rem); }
@media (hover: hover) and (pointer: fine) {
  .text-button:hover, .sm-family:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
}

/* Fortschritt */
.sm-progress {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.sm-bars { display: flex; gap: 4px; }
.sm-bars span { width: clamp(1.25rem, 2.5vw, 2rem); height: 2px; background: var(--line); }
.sm-bars .is-done, .sm-bars .is-current { background: var(--ink); }

.sm-label { margin: 1.25rem 0 0; font-size: 0.98rem; font-weight: 500; }
.sm-question {
  margin: 0.35rem auto clamp(1.25rem, 2.5vw, 1.75rem); max-width: 22ch;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.sm-question:focus { outline: none; }
.sm-question:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Antwort-Kacheln */
.sm-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.5rem, 1.5vw, 1rem); }
.sm-answer {
  appearance: none; background: none; border: 0; border-radius: 0;
  padding: 0; margin: 0; color: inherit; font: inherit; text-align: center;
  display: flex; flex-direction: column; justify-content: flex-start;
  cursor: pointer;
  transition: opacity 200ms ease, transform 160ms var(--ease-out);
}
.sm-answer:active { transform: scale(0.99); }
.sm-answer:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sm-frame {
  display: block; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--tile-empty);
}
.sm-frame img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 450ms var(--ease-out);
}
.sm-frame.is-cover img { object-fit: cover; }
.sm-answer-text {
  display: block;
  padding: 0.75rem 0.25rem 0;
  font-size: clamp(1.05rem, 0.8vw + 0.85rem, 1.35rem);
  font-weight: 400;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: transparent;
  transition: text-decoration-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .sm-answer:hover .sm-frame img { transform: scale(1.03); }
  .sm-answer:hover .sm-answer-text { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
}
.sm-answers.has-choice .sm-answer:not(.is-chosen) { opacity: 0.35; }
.sm-answer.is-chosen .sm-answer-text { text-decoration-color: var(--ink); }

/* Ergebnis */
.sm-result .sm-question { margin-bottom: 0; }
.sm-result > .sm-sub { margin-top: 0.4rem; }
.sm-match {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  text-align: left;
}
.sm-match-frame {
  aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--tile-empty);
  animation: sm-reveal 900ms var(--ease-out) 120ms backwards;
}
.sm-match-frame img { width: 100%; height: 100%; object-fit: contain; }
@keyframes sm-reveal {
  from { opacity: 0; transform: scale(0.94); clip-path: inset(6% 6% 6% 6%); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
.sm-match-text > * { animation: sm-fade 500ms var(--ease-out) backwards; }
.sm-match-text > :nth-child(1) { animation-delay: 450ms; }
.sm-match-text > :nth-child(2) { animation-delay: 520ms; }
.sm-match-text > :nth-child(3) { animation-delay: 590ms; }
.sm-match-text > :nth-child(n + 4) { animation-delay: 660ms; }
@keyframes sm-fade { from { opacity: 0; transform: translateY(6px); } }

.sm-name {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 2.8vw, 2.6rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.sm-description { margin: 0 0 0.6rem; max-width: 28ch; font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.25rem); line-height: 1.4; }
.sm-note { margin: 0; color: var(--ink-soft); font-style: italic; }
.sm-actions {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
}
.sm-actions .text-button { font-size: 1.05rem; text-align: left; }
.sm-family { margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.95rem; }
.sm-share-status { margin: 0.9rem 0 0; color: var(--ink-soft); font-size: 0.92rem; }
.sm-share-status:empty { display: none; }
.sm-share-manual { margin-top: 0.9rem; }
.sm-share-manual label { display: block; margin-bottom: 0.4rem; color: var(--ink-soft); font-size: 0.92rem; }
.sm-share-manual input {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: 0;
  background: var(--cream); color: var(--ink);
  font: inherit; font-size: 16px; /* verhindert Zoom auf dem iPhone */
}

/* ---------- Handy ---------- */

@media (max-width: 46rem) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Breite Kacheln (Querformate) nehmen die ganze Reihe ein */
  .tile.wide { grid-column: span 2; aspect-ratio: 8 / 5; }
  /* Bleibt eine einzelne Kachel ohne Partner übrig, wird sie groß (volle Breite) */
  .gallery .tile.is-lone,
  .gallery.is-filtered .tile.is-lone { grid-column: span 2; grid-row: auto; aspect-ratio: 4 / 5; }
  /* Filter: eine Zeile, bei Bedarf seitlich wischen */
  .filters {
    width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
    overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar { display: none; }
  /* Großansicht: Bild, darunter Geschichte; Navigation bleibt unten stehen */
  .viewer[open] { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; overflow-y: auto; }
  /* min-height: auto – der Bildbereich darf nicht schrumpfen, sonst rutscht der Text über das Bild */
  .v-stage { min-height: auto; justify-items: center; padding: clamp(1rem, 3vw, 2.5rem) var(--gutter) 0; }
  .v-stage img { max-height: 62vh; max-height: 62dvh; }
  .v-text { align-self: start; max-height: none; overflow: visible; padding: 1.25rem var(--gutter) 0; }
  .v-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
  .v-bar { grid-row: 4; position: sticky; bottom: 0; background: var(--cream); }
  .v-nav { width: 100%; justify-content: space-between; }
  .sm-match { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .sm-match-frame { width: min(100%, 15rem); }
  .sm-description { margin-inline: auto; }
  .sm-actions { align-items: center; }
  .sm-actions .text-button { text-align: center; }
}

/* ---------- Kleine Animationen ---------- */

/* Intro: Headline erscheint Wort für Wort, der Text darunter blendet danach ein */
.intro h1 .w {
  display: inline-block;
  animation: word-in 700ms var(--ease-out) backwards;
  animation-delay: calc(var(--w) * 60ms + 80ms);
}
@keyframes word-in { from { opacity: 0; transform: translateY(0.35em); } }
.intro-text { animation: fade-in 700ms var(--ease-out) 420ms backwards; }
@keyframes fade-in { from { opacity: 0; } }

/* Galerie: Kacheln fliegen beim Scrollen leicht von unten ein (js/main.js setzt .is-in) */
.js .tile {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js .tile.is-in { opacity: 1; transform: none; }

/* „Responsible for all of this.“ erscheint Wort für Wort, sobald man dort ankommt */
.js .closing h2 .w { display: inline-block; opacity: 0; }
.js .closing.is-in h2 .w {
  opacity: 1;
  animation: word-in 700ms var(--ease-out) backwards;
  animation-delay: calc(var(--w) * 60ms + 80ms);
}
.js .closing .closing-text p:first-of-type { opacity: 0; transition: opacity 700ms var(--ease-out) 420ms; }
.js .closing.is-in .closing-text p:first-of-type { opacity: 1; }

/* Pfeil ↗ rutscht beim Überfahren ein Stück nach rechts oben */
.arrow { display: inline-block; margin-left: 0.25em; transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  a:hover .arrow { transform: translate(0.12em, -0.12em); }
}

/* ---------- Weniger Bewegung (Systemeinstellung) ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .tile, .js .closing h2 .w, .js .closing .closing-text p:first-of-type { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
