/* Gemeinsamer Vorspann der Explore-Startseiten (Thalwil, Friesenberg): eine Person im Nebel, die Geschichte mit Namensleiste,
   der Ort heute, dann die Tour. Was je Ort verschieden ist (Bildfolgen, Fusshöhe, Lage des Namens), steht im HTML an den Szenen. */
:root {
  --ivory: #f7f4ee; --ivory-2: #efe9de; --line: #ddd5c7; --ink: #16161a; --muted: #5f5b54;
  --accent: #5b5ce2; --accent-dark: #3d3eb8;
  --display: "Instrument Serif", Georgia, serif; --ui: "Figtree", system-ui, -apple-system, sans-serif;
  --gross: "Anton", "Impact", "Arial Narrow", sans-serif;
  --rand: clamp(20px, 5vw, 72px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scrollbar-gutter: stable; overscroll-behavior-y: none; }  /* kein Nachfedern, das unten den hellen Hintergrund zeigt */  /* die grossen Jahreszahlen ragen über den Rand, verschieben darf sich trotzdem nichts */
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--ui); font-size: 17px; line-height: 1.55;
       -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: rgba(91,92,226,.15); }
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Knopf oben rechts, immer da */
.direkt { position: fixed; z-index: 30; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
          font-size: 15px; font-weight: 600; text-decoration: none; color: var(--accent-dark); background: transparent;
          padding: 10px 6px; transition: opacity .4s, transform .4s; }
.direkt:hover { text-decoration: underline; }
.am-ende .direkt { opacity: 0; pointer-events: none; transform: translateY(-6px); }
/* Auf ganz schmalen Handys passt neben «Tour direkt starten» nur «← Explore» ohne Ortsnamen */
@media (max-width: 359px) { .direkt .ort-name { display: none; } }
/* Weicher Rand oben während der Geschichte: der Text blendet aus, bevor er den Link erreicht */
.rand-oben { position: fixed; z-index: 25; left: 0; right: 0; top: 0; height: calc(env(safe-area-inset-top, 0px) + 88px); pointer-events: none;
             background: linear-gradient(to bottom, rgba(239,235,228,.98) 58%, rgba(239,235,228,0)); opacity: 0; transition: opacity .5s; }
.rand-an .rand-oben { opacity: 1; }

/* Nebelschwaden hinter allem, sichtbar in der Geschichte */
/* so hoch wie der Bildschirm ohne Adressleiste: blendet das Handy sie beim Scrollen aus, rutscht die Seite hoch,
   und eine Schicht mit inset: 0 liesse unten einen hellen Streifen frei */
.nebel-fix { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; background: #e9e5de; }
.nebel-fix video, .nebel-fix img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nebel-fix::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(247,244,238,.2), rgba(247,244,238,.45)); }
main, footer { position: relative; z-index: 1; }

/* ---------- Bühnen für Einstieg und Schluss ---------- */
.szene { position: relative; overflow: clip; }  /* schneidet die Spiegelung unter der Bühne am Ende der Szene ab */
#held { height: 200vh; }     /* das Intro läuft von selbst, der Scrollweg dient nur dem Zurückblättern */
#schluss { height: 170vh; }  /* auch hier lichtet sich der Nebel von selbst */
/* Bühnenhöhe = sichtbare Höhe mit eingeblendeten Browser-Leisten (svh). Sie wächst nicht mit, wenn die Leisten beim Scrollen
   wegfahren: sonst würde jedes Mal das Filmbild neu gemalt und die Leisten haken. Darunter läuft die Spiegelung weiter. */
.buehne { position: sticky; top: 0; --H: 100vh; height: var(--H); overflow: hidden; overflow: clip visible; --S: var(--H);
          /* Ist das Bild höher als der Bildschirm, wird es nicht einfach mittig beschnitten: es rückt hoch, bis die Füsse
             (--fuesse, Anteil der Bildhöhe) bei 88 % der sichtbaren Höhe stehen, oben fällt leerer Himmel weg.
             Nie weiter, als das Bild unten reicht, sonst bliebe ein Streifen. */
          --oben: max(calc(var(--H) - var(--S)), min(calc((var(--H) - var(--S)) / 2), calc(var(--H) * .88 - var(--S) * var(--fuesse, .88)))); }
@supports (height: 100svh) { .buehne { --H: 100svh; } }
/* wo die Füsse der Person im Bild stehen, als Anteil der Bildhöhe: je Szene im HTML als --fuesse-hoch und --fuesse-quer */
.szene { --fuesse: var(--fuesse-hoch, .88); }
@media (min-aspect-ratio: 1/1) { .szene { --fuesse: var(--fuesse-quer, .88); } }
.unscharf { position: absolute; inset: -6%; width: 112%; height: 112%; filter: blur(34px) saturate(.9); opacity: .9; }
.stage { position: absolute; left: 50%; top: var(--oben); transform: translateX(-50%); height: 100%; aspect-ratio: 1080 / 1912;
         container-type: size; background: var(--ivory-2); }
@media (max-aspect-ratio: 5/8) { .unscharf { display: none; } .buehne { --S: max(var(--H), calc(100vw * 1912 / 1080)); } .stage { height: var(--S); } }
.stage > * { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Spiegelung des unteren Bildrands: füllt den Streifen, der beim Einfahren der Browserleisten kurz frei wird */
.stage > .spiegel { inset: calc(100% - 16px) 0 auto; height: 35%; filter: blur(6px); }
.stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.schrift { -webkit-mask: var(--maske) center / 100% 100% no-repeat; mask: var(--maske) center / 100% 100% no-repeat; pointer-events: none; }
.block { position: absolute; left: 0; right: 0; height: auto; top: var(--mitte, 23.6%); transform: translateY(-50%); text-align: center; opacity: var(--deck, 1); }
.block .zeit { display: block; font-size: max(11px, 3.4cqw); letter-spacing: .24em; text-transform: uppercase; font-weight: 600; color: rgba(22,22,26,.72); margin-bottom: 2cqw; }
.block .name { display: block; font-family: var(--gross); text-transform: uppercase; color: #fbf9f4; white-space: nowrap; line-height: .92; letter-spacing: .005em;
               font-size: min(18.6cqw, 17.2vw); text-shadow: 0 .6cqw 3cqw rgba(22,22,26,.1);
               /* oben Luft für Umlautpunkte (ZÜRICH): die Maske schneidet alles ausserhalb des Kastens ab; der negative Rand hält die Lage gleich */
               padding-top: .2em; margin-top: -.2em;
               -webkit-mask-image: linear-gradient(to bottom, #000 65%, rgba(0,0,0,.5)); mask-image: linear-gradient(to bottom, #000 65%, rgba(0,0,0,.5)); }
.scroll-hinweis { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2;
                  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--ivory); text-align: center;
                  text-shadow: 0 1px 8px rgba(22,22,26,.35); opacity: 0; transition: opacity .3s; }  /* das Skript blendet ihn ein, wenn das Intro vorbei ist */
.scroll-hinweis::after { content: ""; display: block; width: 1px; height: 30px; background: currentColor; margin: 8px auto 0; animation: zieh 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes zieh { 0%, 100% { transform: scaleY(.35); opacity: .5; } 50% { transform: scaleY(1); opacity: 1; } }
/* Klein und im Weg unter ihren Füssen (die stehen bei 90 % der Bildhöhe) */
.start-knopf { position: absolute; left: 50%; transform: translate(-50%, 8px); z-index: 2;
               bottom: max(calc(env(safe-area-inset-bottom, 0px) + 10px), calc(var(--S) * .035 - (var(--oben) + var(--S) - var(--H))));
               display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
               padding: 8px 16px; border-radius: 999px; text-decoration: none; opacity: 0; pointer-events: none; overflow: hidden; isolation: isolate;
               box-shadow: 0 10px 22px -12px rgba(61,62,184,.8); transition: opacity .5s, transform .5s; }
.start-knopf svg { width: 16px; height: 16px; }
/* Füllung zeigt die Zeit bis zum Autostart, sobald der Knopf eingeblendet ist (--einblenden und --zaehlen setzt vorspann.js) */
.start-knopf::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent-dark); transform: scaleX(0); transform-origin: left; }
.zaehlt .start-knopf::before { transform: scaleX(1); transition: transform var(--zaehlen, 4s) linear var(--einblenden, .5s); }
.start-knopf:hover { background: var(--accent-dark); }
.zeig .start-knopf { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
/* Feine Linie, die sich füllt, solange das Intro von selbst läuft: man muss nichts tun */
.verlauf { position: absolute; z-index: 3; left: 50%; bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) + 16px)); transform: translateX(-50%);
           display: grid; gap: 10px; justify-items: center; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
           color: var(--ivory); text-shadow: 0 1px 8px rgba(22,22,26,.35); white-space: nowrap; pointer-events: none; transition: opacity .5s; }
.verlauf i { display: block; width: 100%; min-width: 120px; height: 2px; border-radius: 2px; background: rgba(247,244,238,.35); overflow: hidden;
             box-shadow: 0 1px 6px rgba(22,22,26,.15); }
.verlauf i::after { content: ""; display: block; height: 100%; background: var(--ivory); transform: scaleX(var(--fuell, 0)); transform-origin: left; }
.verlauf.aus { opacity: 0; }
/* Während Intro oder Schluss steht die Seite still */
html.halt { overflow: hidden; }
/* Breite Bildschirme (Desktop, iPad quer, Handy quer): eigene Querbilder, randlos.
   Dort stehen die Füsse tiefer, Hinweis und Knopf weichen an die Ecken aus. */
@media (min-aspect-ratio: 1/1) {
  .unscharf { display: none; }
  .buehne { --S: max(var(--H), calc(100vw * 9 / 16)); }
  .stage { aspect-ratio: 16 / 9; height: var(--S); }
  .schrift { -webkit-mask-image: var(--maske-quer); mask-image: var(--maske-quer); }
  .block .zeit { font-size: max(11px, 1.4cqw); margin-bottom: 1cqw; }
  .block .name { font-size: min(14cqw, 17vw); }
  .scroll-hinweis { left: max(28px, env(safe-area-inset-left)); bottom: max(26px, env(safe-area-inset-bottom)); transform: none; text-align: left; }
  .scroll-hinweis::after { margin: 8px 0 0; }
  .start-knopf { left: auto; right: max(28px, env(safe-area-inset-right)); bottom: max(28px, calc(env(safe-area-inset-bottom) + 12px)); transform: translateY(8px); }
  .zeig .start-knopf { transform: none; }
  .verlauf { left: max(28px, env(safe-area-inset-left)); transform: none; justify-items: start; }
}

/* ---------- Zeitachse ---------- */
.achse { position: relative; padding-bottom: 2vh; }   /* nach «heute» kommt gleich die Frau, kein leerer Nebel dazwischen */
/* Kurze Stationen: gut halb so hoch wie der Bildschirm, die nächste schaut schon herein. Zickzack: jede zweite rechts. */
.epoche { position: relative; min-height: 58vh; min-height: 58svh; display: grid; grid-template-columns: 1.08fr 1fr; align-items: center;
          gap: 0 4vw; padding: 7vh calc(var(--rand) + 52px) 7vh var(--rand); }
.zahl { font-family: var(--display); color: var(--accent-dark); line-height: .78; letter-spacing: -.04em; font-size: clamp(110px, 20vw, 340px);
        margin-left: calc(-1 * var(--rand) - .05em); white-space: nowrap; will-change: transform; }
.zahl.wort { font-size: clamp(90px, 15vw, 260px); }
.zahl i { display: block; font-size: .14em; letter-spacing: 0; margin: 0 0 .25em calc(var(--rand) + .35em); line-height: 1; }
.epoche:nth-of-type(even) .zahl { order: 2; text-align: right; margin-left: 0; }
.epoche:nth-of-type(even) .zahl i { margin: 0 .1em .25em 0; }
.zahl.wort i { font-size: .18em; }
.inhalt { max-width: 30em; }
.inhalt h3 { font-style: italic; font-size: clamp(40px, 5vw, 68px); margin-bottom: 14px; }
.inhalt p { margin: 0; }

/* Namensleiste rechts: Linie mit Griff, nur während der Geschichte */
.leiste { position: fixed; z-index: 20; right: max(6px, env(safe-area-inset-right)); top: 14vh; bottom: 14vh; width: 54px;
          opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.leiste-an .leiste { opacity: 1; visibility: visible; transition: opacity .5s, visibility 0s; }
.leiste .linie, .leiste .fuell, .leiste .griff { position: absolute; right: 32px; }
.leiste .linie { width: 1px; background: rgba(22,22,26,.22); }
.leiste .fuell { width: 2px; margin-right: -.5px; background: var(--accent); }
.leiste .griff { width: 44px; height: 44px; margin: -22px -22px 0 0; transform: translateX(.5px); cursor: grab; display: grid; place-items: center; outline: none;
                 touch-action: none; }  /* nur der Griff hält den Finger fest, daneben scrollt die Seite normal */
.leiste .griff::before { content: ""; width: 8px; height: 28px; border-radius: 99px; background: var(--accent);
                         box-shadow: 0 0 0 4px rgba(91,92,226,.18), 0 4px 10px -2px rgba(61,62,184,.5); transition: transform .2s; }
.leiste .griff:focus-visible::before { box-shadow: 0 0 0 4px var(--ivory), 0 0 0 7px var(--accent); }
.leiste.zieht .griff { cursor: grabbing; }
.leiste.zieht .griff::before { transform: scale(1.15); }
.leiste .namen { position: absolute; right: 4px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.leiste .nm { writing-mode: vertical-rl; font: 600 clamp(8px, 1.5vh, 10.5px)/1 var(--ui); letter-spacing: .18em; text-transform: uppercase;
              color: rgba(22,22,26,.42); white-space: nowrap; cursor: pointer; padding: min(6px, .7vh) 4px; border: 0; background: none; transition: color .3s; }
.leiste .nm:hover { color: var(--ink); }
.leiste .nm.an { color: var(--accent-dark); }
.leiste .nm:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
@media (max-height: 500px) { .leiste { display: none; } }  /* Handy quer: zu niedrig für sechs Namen */

@media (max-width: 760px) {
  .epoche { grid-template-columns: 1fr; align-content: center; padding: 6vh 52px 6vh var(--rand); gap: 2.2vh; }
  .zahl { font-size: 42vw; }
  .zahl.wort { font-size: 30vw; }
  /* Zickzack am Handy: jede zweite Station steht rechts, die Zahl bleibt oben */
  .epoche:nth-of-type(even) { justify-items: end; text-align: right; }
  .epoche:nth-of-type(even) .zahl { order: 0; }
  .leiste { width: 46px; }
  .leiste .linie, .leiste .fuell, .leiste .griff { right: 26px; }
  .leiste .nm { font-size: clamp(8px, 1.4vh, 9.5px); letter-spacing: .16em; padding: min(5px, .7vh) 3px; }
}

/* ---------- Tour und Fuss ---------- */
.tour { position: relative; z-index: 2; background: var(--ivory); padding: 14vh var(--rand) 10vh; }
.tour-innen { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 6vw; align-items: start; }
@media (max-width: 760px) { .tour-innen { grid-template-columns: 1fr; } }
.tour h2 { font-size: clamp(44px, 6vw, 80px); margin-bottom: 18px; }
.tour h2 em { font-style: italic; color: var(--accent-dark); }
.eckdaten { display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; margin: 0; align-items: baseline; }
.eckdaten dt { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--accent-dark); }
.eckdaten dd { margin: 0; color: var(--muted); }
.knopf { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; background: var(--accent); color: #fff; font-weight: 600; font-size: 17px;
         padding: 15px 26px; border-radius: 999px; text-decoration: none; box-shadow: 0 14px 30px -14px rgba(61,62,184,.8); }
.knopf svg { width: 20px; height: 20px; }
.knopf:hover { background: var(--accent-dark); }
.hinweis { color: var(--muted); font-size: 15px; margin: 18px 0 0; }
footer { background: var(--ivory-2); padding: 7vh var(--rand) 9vh; font-size: 14px; color: var(--muted); }
footer > div { max-width: 980px; margin: 0 auto; }
footer h2 { font-family: var(--ui); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--ink); margin: 24px 0 8px; }
footer ul { margin: 0; padding-left: 18px; }
footer li { margin-bottom: 6px; }
footer address { font-style: normal; line-height: 1.6; }

/* Wer weniger Bewegung möchte, bekommt ruhige Bilder statt Scroll-Film */
.ruhig .szene, .ruhig #held, .ruhig #schluss { height: auto; }
.ruhig .buehne { position: relative; }
.ruhig .spiegel { display: none; }
.ruhig .scroll-hinweis::after { animation: none; }
.ruhig .verlauf { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }
