/* Jahrgangsbaum. Gerüst nach dem Refero-Style „Fable“ (Cremepapier, ein
   vollflächiges grünes Band, Serife als leise Stimme, Pillen), Wärme nach
   „Hatch“ (weiche Serife, Marker-Schwung, Karten mit Tintenlinie statt
   Schatten). Regel des Hauses: Das Bild ist süß, der Text ist trocken. */

@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-500-italic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('/fonts/courier-prime-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('/fonts/courier-prime-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --papier: #F3EADB;
  --karte: #FBF6EC;
  --karton: #E6D8C3;
  --tinte: #2B2622;
  --tinte-weich: #574E46;
  --tanne: #2F4A3A;
  --laub: #6F8A5B;
  --flechte: #A9B88E;
  --kastanie: #7A4E36;
  --rinde: #8C8478;
  --terrakotta: #C8553A;
  --terrakotta-text: #A8422B;
  --senf: #E0B04A;
  --altrosa: #E3B5A4;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --amt: 'Courier Prime', 'Courier New', monospace;

  --radius: 15px;
  --linie: 1px solid var(--tinte);
  --spalte: 36rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 400 1.125rem/1.5 var(--text);
  overflow-x: hidden;
}
/* Papierkorn: einmal über alles, statt es vom Bildmodell in jedes Bild malen zu lassen. */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: .16; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .33 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--terrakotta); outline-offset: 3px; border-radius: 6px; }

.shell { width: min(100% - 2rem, var(--spalte)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--tinte); color: var(--papier); padding: .5rem 1rem; z-index: 60; }
.skip:focus { left: 1rem; top: 1rem; }

/* ——— Kopf ——— */
.top { display: flex; justify-content: space-between; align-items: baseline; padding-block: .5rem 0; }
.top__mark { font: 600 1.25rem/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.top__lang { margin: 0; font: 400 .85rem/1 var(--amt); letter-spacing: .06em; }
.top__lang a { display: inline-block; text-decoration: none; padding: .75rem .6rem; }
.top__lang a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; }

/* ——— Bausteine ——— */
.card { background: var(--karte); border: var(--linie); border-radius: var(--radius); padding: 1.4rem 1.25rem; }
.field-label { display: block; font: 400 .82rem/1.3 var(--amt); letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-weich); margin: 0 0 .45rem; padding: 0; }
.hint { font-size: .93rem; color: var(--tinte-weich); margin: .55rem 0 0; }
.error { color: var(--terrakotta-text); font-weight: 600; margin: .5rem 0 0; }
.section-title { font: 600 clamp(1.9rem, 6vw, 2.5rem)/1.02 var(--serif); letter-spacing: -.02em; margin: 0 0 1.1rem; text-wrap: balance; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .65rem 1.35rem;
  border-radius: 60px; border: var(--linie);
  font: 600 1.05rem/1.1 var(--text); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.pill:active { transform: scale(.98); }
.pill--ink { background: var(--tinte); color: var(--papier); }
.pill--ink:hover { background: #000; }
.pill--line { background: transparent; color: var(--tinte); }
.pill--line:hover { background: var(--karton); }
.pill--big { width: 100%; min-height: 3.5rem; font-size: 1.15rem; margin-top: 1.4rem; }

/* Marker-Schwung hinter genau einem Wort */
.swoosh { position: relative; white-space: nowrap; z-index: 0; }
.swoosh::before {
  content: ''; position: absolute; z-index: -1; inset: 18% -.22em 2% -.22em; transform: rotate(-2.5deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M6 34C10 14 52 6 104 8c46 2 88 8 90 24 2 14-40 22-92 22C54 54 2 52 6 34Z' fill='%23E0B04A'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  opacity: .85;
}

/* ——— Start ——— */
.start { padding-bottom: 3.5rem; }
.start__hero { width: 100%; max-height: 38vh; object-fit: contain; object-position: center bottom; margin: .4rem auto -1.6rem; position: relative; z-index: 1; pointer-events: none; }
.start__card { padding-top: 2.2rem; }
.start__title { font: 600 clamp(2.05rem, 8.4vw, 2.9rem)/1 var(--serif); letter-spacing: -.025em; margin: 0 0 .9rem; text-wrap: balance; hyphens: manual; }
.start__lede { margin: 0 0 1.6rem; color: var(--tinte-weich); }

.year {
  width: 100%; border: var(--linie); border-radius: var(--radius); background: #fff;
  font: 600 clamp(3.4rem, 19vw, 5.2rem)/1 var(--serif); letter-spacing: .02em; text-align: center;
  color: var(--tinte); padding: .28em .2em .2em; font-variant-numeric: lining-nums tabular-nums;
}
.year::placeholder { color: var(--karton); } /* Zierde; das Beispiel steht lesbar im Label */

.chips { border: 0; padding: 0; margin: 1.35rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips legend { width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem 1rem; border: var(--linie); border-radius: 60px; background: transparent; font-size: 1rem; }
.chip input:checked + span { background: var(--tanne); color: var(--papier); border-color: var(--tanne); }
.chip input:focus-visible + span { outline: 3px solid var(--terrakotta); outline-offset: 3px; }

.picker { margin-top: 1rem; }
.picker__hint { margin: 0 0 .5rem; font-size: 1rem; }
.picker__or { margin-top: 1rem; }
.select { width: 100%; min-height: 3rem; border: var(--linie); border-radius: var(--radius); background: #fff; color: var(--tinte); font: 400 1.05rem/1.2 var(--text); padding: .5rem .8rem; }

/* Die Wien-Karte: eigene Zeichnung aus den Bezirksgrenzen, keine Fremdkacheln. */
.map { border: var(--linie); border-radius: var(--radius); background: #fff; overflow: hidden; touch-action: manipulation; }
.map svg { display: block; width: 100%; height: auto; }
.map .bz { fill: #EEF0DF; stroke: var(--tanne); stroke-width: 2.2; stroke-linejoin: round; transition: fill .15s; }
.map--pick .bz { cursor: pointer; }
.map--pick .bz:hover, .map .bz.is-on { fill: var(--flechte); }
.map .bz-nr { font: 700 24px var(--amt); fill: var(--tanne); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.map .pin-you { fill: var(--tinte); stroke: #fff; stroke-width: 3; }
.map .pin-tree { fill: var(--terrakotta); stroke: #fff; stroke-width: 3; }
.map .pin-line { stroke: var(--tinte); stroke-width: 2.5; stroke-dasharray: 3 7; stroke-linecap: round; fill: none; }
.map--small svg { max-height: 17rem; }

/* ——— Ergebnis ——— */
.result { padding-block: 1.5rem 3rem; }
.result__lead { font: 400 1.3rem/1.28 var(--serif); margin: 0 0 .5rem; text-wrap: balance; }
.result__lead + .result__lead { color: var(--tinte-weich); }

.stage { position: relative; aspect-ratio: 5 / 6; max-height: 34rem; margin: 1.2rem auto 1.4rem; container-type: size; --k: 1; --ground: 7cqh; --th: calc(97cqh * var(--k)); --bw: 36cqw; }
.stage--low { aspect-ratio: 4 / 3; }
.stage__ground { position: absolute; left: 4%; right: 4%; bottom: var(--ground); height: 2px; border-radius: 2px; background: var(--rinde); opacity: .55; transform: rotate(-.3deg); }
.stage__tree { position: absolute; left: 41%; bottom: calc(var(--ground) - var(--th) * .12); height: var(--th); width: auto; max-width: none; translate: -50% 0; transform-origin: 50% 88%; }
.stage__bench { position: absolute; right: 1%; bottom: calc(var(--ground) - var(--bw) * .6667 * .15); width: var(--bw); height: auto; }
.stage__wall:not([hidden]) ~ .stage__ground { display: none; }
.stage__wall { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: var(--wall, 34cqh); object-fit: cover; object-position: top; border-bottom: 2px solid var(--rinde); }
.tag { position: absolute; left: 41%; bottom: calc(var(--ground) + 12cqh); translate: -50% 0; rotate: -4deg; margin: 0; background: #fff; border: var(--linie); border-radius: 8px; padding: .3rem .7rem .35rem; text-align: center; box-shadow: 0 2px 0 rgba(43, 38, 34, .18); }
.tag__hello { display: block; font: 400 .62rem/1.2 var(--amt); letter-spacing: .14em; text-transform: uppercase; color: var(--terrakotta-text); }
.tag__nr { display: block; font: 700 1.2rem/1.1 var(--amt); letter-spacing: .04em; }
.stamp { position: absolute; right: 6%; top: 8%; margin: 0; rotate: -8deg; font: 700 1.7rem/1 var(--amt); letter-spacing: .12em; color: var(--terrakotta-text); border: 3px solid currentColor; border-radius: 8px; padding: .3rem .6rem .15rem; opacity: .85; mix-blend-mode: multiply; }

.result__intro:focus { outline: none; }
.section-title:focus { outline: none; }
.result__intro { font: 600 clamp(2rem, 8vw, 2.8rem)/1.02 var(--serif); letter-spacing: -.025em; margin: 0 0 .7rem; text-wrap: balance; hyphens: auto; }
.result__core { font: 400 1.35rem/1.3 var(--serif); margin: 0 0 1rem; text-wrap: pretty; }
.result__note { margin: 0 0 1rem; padding: .85rem 1rem; border-left: 4px solid var(--senf); background: var(--karte); border-radius: 0 var(--radius) var(--radius) 0; }
.result__foot { font-size: 1rem; color: var(--tinte-weich); font-style: italic; margin: 1.4rem 0; }

.nick { margin: 1.6rem 0; }
.nick__input { width: 100%; border: 0; border-bottom: 2px solid var(--tinte); background: transparent; font: italic 500 1.5rem/1.2 var(--serif); color: var(--tinte); padding: .2rem 0 .3rem; border-radius: 0; }
.nick__input::placeholder { color: #6E655B; opacity: 1; }

.sheets { display: grid; gap: 1rem; }
.sheet__title { font: 400 .82rem/1 var(--amt); letter-spacing: .16em; text-transform: uppercase; margin: 0 0 .9rem; color: var(--terrakotta-text); }
.facts { margin: 0; display: grid; gap: .7rem; }
.facts div { display: grid; gap: .1rem; border-bottom: 1px dotted var(--rinde); padding-bottom: .6rem; }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font: 400 .78rem/1.3 var(--amt); letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-weich); }
.facts dd { margin: 0; font-size: 1.1rem; }
.facts dd small { display: block; font-size: .95rem; color: var(--tinte-weich); }
.facts dd i { font-style: italic; color: var(--tinte-weich); }
.sheet--friends { background: #fff; rotate: .6deg; }
.facts--friends dd { font: italic 500 1.25rem/1.25 var(--serif); }

.life { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .5rem; }
.life li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .6rem; align-items: baseline; }
.life b { font: 700 1rem/1.2 var(--amt); color: var(--terrakotta-text); }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0; }
.actions .pill { flex: 1 1 auto; }
.go { margin-top: 1rem; }
.go__where { font: 600 1.6rem/1.1 var(--serif); margin: 0 0 1rem; }
.go__links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.go__links .pill { flex: 1 1 auto; }
.go__photo { margin: 1rem 0 0; font-style: italic; }

/* ——— Klassentreffen: das eine grüne Band ——— */
.band { background: var(--tanne); color: var(--papier); padding-block: 3.2rem 3.4rem; }
.band__title { font: 600 clamp(2rem, 8vw, 2.8rem)/1 var(--serif); letter-spacing: -.025em; margin: 0 0 .7rem; text-wrap: balance; }
.band__lede { font: 400 1.25rem/1.3 var(--serif); margin: 0 0 1.8rem; color: #E9E3D2; }
/* Porträts stehen nie direkt auf Grün, immer auf der Papierkarte. */
.photo { margin: 0 0 2rem; background: var(--papier); color: var(--tinte); border: 10px solid #FBF6EC; border-radius: 6px; rotate: -1.5deg; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); padding: 2.4rem .6rem .7rem; }
.photo__row { display: flex; align-items: flex-start; justify-content: center; }
.kid { flex: 1 1 0; min-width: 0; max-width: 24%; text-align: center; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }
/* Alle Bilderrahmen sind gleich groß, die Bodenlinie läuft durch; der Baum steht mit seinem Stammfuß darauf. */
.kid__pic { position: relative; display: flex; align-items: flex-end; justify-content: center; aspect-ratio: 2 / 3.1; border-bottom: 2px solid rgba(140, 132, 120, .6); }
.kid__pic img { width: calc(100% * var(--s, 1)); max-width: none; margin-bottom: calc(-15% * var(--s, 1)); }
.kid__n { display: block; font: 700 .85rem/1.2 var(--amt); margin-top: 1.1rem; }
.kid__name { display: block; font-size: .72rem; line-height: 1.15; color: var(--tinte-weich); hyphens: auto; overflow-wrap: anywhere; }
.kid.is-me .kid__pic::after { content: ''; position: absolute; left: 50%; bottom: 22%; width: calc(112% * var(--s, 1)); aspect-ratio: 1 / 1.12; translate: -50% 0; border: 3px solid #1F3FA8; border-radius: 50%; rotate: -8deg; opacity: .85; pointer-events: none; }
.kid__me { position: absolute; left: 50%; top: -.4rem; translate: -50% -100%; white-space: nowrap; font: italic 500 .95rem/1 var(--serif); color: #1F3FA8; rotate: -4deg; }
.photo__cap { font: 400 .85rem/1.3 var(--amt); text-align: center; margin-top: 1.3rem; color: var(--tinte-weich); }
.klasse__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.klasse__facts li { border-top: 1px solid rgba(243, 234, 219, .3); padding-top: .8rem; }
.klasse__facts small { display: block; font: 400 .78rem/1.3 var(--amt); letter-spacing: .1em; text-transform: uppercase; color: var(--flechte); }
.klasse__facts button:focus-visible { outline-color: var(--senf); }
.klasse__facts button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }

/* ——— Urkunde & Geschenk ——— */
.deed, .gift { padding-block: 3rem 1rem; }
.deed__canvas { width: 100%; height: auto; margin: 1.4rem 0 0; border-radius: 4px; rotate: -1deg; box-shadow: 0 2px 0 rgba(43, 38, 34, .25), 0 0 0 1px rgba(43, 38, 34, .18); background: var(--karte); }
.gift__lede { font: 400 1.25rem/1.3 var(--serif); margin: 0 0 1.4rem; }
.gift__grid { display: grid; gap: 1.2rem; }
.again { display: flex; flex-wrap: wrap; gap: .6rem; padding-block: 2rem 3.5rem; }
.again .hint { width: 100%; }

.cover { text-align: center; padding-block: 1rem 4rem; }
.cover__img { width: min(78%, 22rem); margin: 0 auto; }
.cover__to { font: 600 clamp(2.2rem, 9vw, 3rem)/1 var(--serif); letter-spacing: -.025em; margin: .6rem 0 .8rem; text-wrap: balance; }
.cover__text { font: 400 1.3rem/1.3 var(--serif); margin: 0 auto 1.6rem; max-width: 26rem; text-wrap: balance; }

/* ——— Fuß ——— */
.foot { background: var(--tinte); color: #D9CFBF; padding-block: 2.6rem 3rem; font-size: .98rem; }
.foot p { margin: 0 0 .9rem; }
.foot__big { font: 400 1.4rem/1.25 var(--serif); color: var(--papier); margin-bottom: 1.5rem !important; text-wrap: balance; }
.foot__links { font: 400 .85rem/1.4 var(--amt); letter-spacing: .04em; margin-top: 1.5rem !important; }
.noscript { padding: 1rem; border: var(--linie); border-radius: var(--radius); margin-block: 1rem; }

/* ——— Bewegung: wenige Momente, nur transform und opacity ——— */
@media (prefers-reduced-motion: no-preference) {
  .is-growing .stage__tree { animation: grow .9s cubic-bezier(.2, 1.3, .4, 1) both; }
  .is-growing .tag { animation: slap .35s cubic-bezier(.2, 1.4, .4, 1) 1s both; }
  .is-growing .stamp { animation: stamp .18s ease-out 1.25s both; }
  .is-settled .stage__tree { animation: sway 7s ease-in-out infinite alternate; }
  .is-growing ~ .result__intro, .is-growing ~ .result__core { animation: rise .5s ease-out .9s both; }
  .cover.is-leaving { animation: leave .7s ease-in both; }
  @keyframes grow { from { transform: scale(.9, .02); } to { transform: scale(1, 1); } }
  @keyframes slap { from { opacity: 0; scale: 1.25; } to { opacity: 1; scale: 1; } }
  @keyframes stamp { from { opacity: 0; scale: 1.5; } to { opacity: .85; scale: 1; } }
  @keyframes sway { from { transform: rotate(-.5deg); } to { transform: rotate(.5deg); } }
  @keyframes rise { from { opacity: 0; translate: 0 .6rem; } to { opacity: 1; translate: 0 0; } }
  @keyframes leave { to { opacity: 0; translate: 0 -2rem; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (min-width: 44rem) {
  body { font-size: 1.15rem; }
  .card { padding: 2rem 2.2rem; }
  .start__hero { max-height: 42vh; margin-bottom: -2.2rem; }
  .sheets { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .gift__grid { grid-template-columns: repeat(3, 1fr); }
  .actions .pill { flex: 0 1 auto; }
}
