/* games.metic.studio
   Die Welt des Spiels (Creme, Tinte, ein Orange, Fredoka) im Rahmen von metic. (Wortmarke, Mono-Etiketten, Pillen mit Kreis).
   Schriften liegen selbst gehostet unter assets/fonts (SIL Open Font License), keine Anfragen an Google. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/fredoka-latin-wght-normal.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;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/fredoka-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nur die Zeichen der Wortmarke „metic.“ */
@font-face {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-display: swap;
  src: url(fonts/space-grotesk-600-wordmark.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500.woff2) format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  --cream: #f4f1ea;
  --ink: #2c2c2a;
  --accent: #d85a30;
  --accent-soft: #f0997b;

  --bg: var(--cream);
  --fg: var(--ink);
  --muted: #66645e;
  --ground: var(--ink);
  --on-ground: var(--cream);
  --surface: #ece8df;
  --surface-2: #e5e0d5;
  --raised: #fbfaf6;
  --line: rgb(44 44 42 / 0.12);
  --ghost-fill: rgb(244 241 234 / 0.62);
  --night: #262523;
  --shadow: 0 1px 2px rgb(44 44 42 / 0.08), 0 8px 24px -8px rgb(44 44 42 / 0.18);

  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --word: 'Space Grotesk', var(--font);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.2, 1.3, 0.4, 1);
  --ease-soft: cubic-bezier(0.23, 1, 0.32, 1);

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 28px;
  --radius-ground: 22px;
  --topbar-h: 68px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --fg: #f1ede4;
    --muted: #aaa59b;
    --ground: #383734;
    --on-ground: #f4f1ea;
    --surface: #22211f;
    --surface-2: #2a2926;
    --raised: #3b3a36;
    --line: rgb(244 241 234 / 0.12);
    --ghost-fill: rgb(27 26 24 / 0.55);
    --night: #0f0f0e;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -10px rgb(0 0 0 / 0.6);
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 18px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ol,
figure {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
}
.skip:focus {
  top: 12px;
}

/* ---------- Typo ---------- */

.kicker {
  font: 500 13px/1.2 var(--mono);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.h2 {
  font-size: clamp(36px, 5.4vw, 66px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.h3 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.lead {
  margin-top: 18px;
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Kopfzeile ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--fg);
  fill: none;
}
.brand__mark path {
  stroke: var(--bg);
  stroke-width: 3;
  stroke-linecap: round;
}
.brand__mark circle {
  fill: var(--accent);
  stroke: none;
}
.brand__word {
  font: 600 22px/1 var(--word);
  letter-spacing: -0.03em;
}
.brand__dot {
  color: var(--accent);
}
.brand__sub {
  margin-left: 2px;
  padding-left: 11px;
  border-left: 1.5px solid var(--line);
  font: 500 13px/1 var(--mono);
  color: var(--muted);
}

/* Sprachwahl */
.lang {
  --i: 0;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.lang[data-lang='en'] {
  --i: 1;
}
.lang__btn {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 36px;
  border-radius: 999px;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
  transition: color 0.3s var(--ease-out);
}
.lang__btn[aria-pressed='true'] {
  color: var(--fg);
}
.lang__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 46px;
  border-radius: 999px;
  background: var(--raised);
  box-shadow: var(--shadow);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.5s var(--ease-spring);
}

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 8px 9px 8px 26px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition:
    transform 0.4s var(--ease-spring),
    background-color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}
.btn__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: transform 0.45s var(--ease-spring);
}
.btn__icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn:active {
  transform: scale(0.97);
}
@media (hover: hover) {
  .btn:hover .btn__icon {
    transform: translateX(3px) rotate(-8deg);
  }
  .btn--ghost:hover .btn__icon {
    transform: translateY(2px);
  }
  .btn--small:hover .btn__icon {
    transform: translate(2px, -2px);
  }
}

.btn--primary {
  background: var(--accent);
  color: var(--cream);
  box-shadow: 0 10px 30px -12px rgb(216 90 48 / 0.7);
}
.btn--primary .btn__icon {
  background: var(--cream);
  color: var(--accent);
}
.btn--primary .btn__icon svg {
  transform: translateX(1px);
}
@media (hover: hover) {
  .btn--primary:hover {
    background: #cf5329;
  }
}

.btn--ghost {
  color: var(--on-ground);
  background: rgb(244 241 234 / 0.08);
  box-shadow: inset 0 0 0 1.5px rgb(244 241 234 / 0.22);
}
.btn--ghost .btn__icon {
  background: rgb(244 241 234 / 0.12);
}
@media (hover: hover) {
  .btn--ghost:hover {
    background: rgb(244 241 234 / 0.14);
  }
}

.btn--small {
  min-height: 48px;
  padding: 6px 7px 6px 20px;
  font-size: 16px;
  font-weight: 600;
}
.btn--small .btn__icon {
  width: 34px;
  height: 34px;
}
.btn--small .btn__icon svg {
  width: 15px;
  height: 15px;
}

.round {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition:
    transform 0.4s var(--ease-spring),
    opacity 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
}
.round svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.round:active {
  transform: scale(0.92);
}
.round:disabled {
  opacity: 0.35;
  cursor: default;
}
@media (hover: hover) {
  .round:not(:disabled):hover {
    background: var(--surface);
  }
}

/* ---------- Figuren (SVG) ---------- */

.fig--body .fig__shape,
.fig--body .fig__leafshape {
  fill: var(--accent);
}
.fig--body .fig__stem {
  stroke: var(--accent);
  stroke-width: 6.2;
  stroke-linecap: round;
}
.fig--body .fig__eyes circle {
  fill: var(--ink);
}

.fig--ghost .fig__shape,
.fig--soul .fig__shape {
  fill: var(--ghost-fill);
  stroke: var(--accent);
  stroke-width: 4.6;
  stroke-dasharray: 12 8.5;
  stroke-linecap: round;
}
.fig--soul .fig__shape {
  stroke-width: 6.4;
  stroke-dasharray: 0.1 10.5;
}
.fig--ghost .fig__stem,
.fig--soul .fig__stem {
  stroke: var(--accent);
  stroke-width: 4.6;
  stroke-linecap: round;
  opacity: 0.75;
}
.fig--ghost .fig__leafshape,
.fig--soul .fig__leafshape {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.6;
}
.fig--ghost .fig__eyes circle,
.fig--soul .fig__eyes circle {
  fill: var(--accent);
}

.fig__look {
  transform: translate(var(--lx, 0px), var(--ly, 0px));
  transition: transform 0.5s var(--ease-soft);
}
.fig__eyes {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.09s ease-out;
}
.fig.is-blinking .fig__eyes {
  transform: scaleY(0.12);
}
.fig__hop {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.fig[data-fig] {
  cursor: pointer;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
.fig__float {
  animation: float 3.8s ease-in-out infinite;
}
.fig--soul .fig__float {
  animation-duration: 4.4s;
  animation-delay: -1.6s;
}

/* Mini-Figuren in den Umschaltern (wie im Spiel: FigureIcon) */
.mini {
  width: 26px;
  height: 26px;
  flex: none;
  overflow: visible;
}
.mini path {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}
.mini ellipse {
  fill: var(--accent);
}
.mini rect {
  fill: var(--accent);
}
.mini circle {
  fill: var(--ink);
}
.mini--ghost path,
.mini--soul path {
  opacity: 0.7;
}
.mini--ghost ellipse,
.mini--soul ellipse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}
.mini--ghost rect,
.mini--soul rect {
  fill: var(--ghost-fill);
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.mini--soul rect {
  stroke-width: 2.4;
  stroke-dasharray: 1.2 3;
  stroke-linecap: round;
}
.mini--ghost circle,
.mini--soul circle {
  fill: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--topbar-h) - env(safe-area-inset-top));
}

.hero__sky {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
  gap: clamp(8px, 3vw, 24px);
  padding-top: clamp(12px, 4vh, 48px);
}

.hero__copy {
  display: grid;
  gap: 14px;
}

.hero__title {
  font-size: clamp(54px, 14.6vw, 156px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.hero__title .amp {
  color: var(--accent);
  font-weight: 500;
}

.hero__lead {
  max-width: 30ch;
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.scene {
  width: 100%;
  height: auto;
  max-height: 34svh;
  overflow: visible;
  margin-bottom: -1px;
}

.motes circle {
  fill: var(--fg);
  opacity: 0.16;
}
.door__frame,
.grate rect {
  fill: var(--ground);
}
.door__light {
  fill: var(--accent-soft);
}
.thread {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 0.1 9;
}
@keyframes thread-flow {
  to {
    stroke-dashoffset: -91;
  }
}
.thread,
.stage__thread {
  animation: thread-flow 7s linear infinite;
}

.hero__ground {
  padding-top: 0;
}
.ground {
  display: flex;
  min-height: clamp(140px, 20svh, 220px);
  padding: clamp(20px, 3vw, 36px);
  padding-bottom: max(clamp(20px, 3vw, 36px), env(safe-area-inset-bottom));
  border-radius: var(--radius-ground);
  background: var(--ground);
  color: var(--on-ground);
}
.hero__actions {
  display: grid;
  gap: 12px;
  width: 100%;
  align-content: start;
}
.hero__actions .btn {
  width: 100%;
}

/* Tastatur-Hinweis wie auf dem Boden im Spiel – nur mit Maus und Tastatur */
.keys {
  display: none;
}
@media (min-width: 920px) and (hover: hover) and (pointer: fine) {
  .keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: flex-end;
    gap: 10px 22px;
    margin-left: auto;
    font-size: 15px;
    font-weight: 500;
    color: rgb(244 241 234 / 0.7);
  }
  .keys > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgb(244 241 234 / 0.1);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.25), inset 0 0 0 1px rgb(244 241 234 / 0.16);
  font: 500 12.5px/1 var(--mono);
  color: var(--on-ground);
}

@media (min-width: 560px) {
  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    width: auto;
  }
  .hero__actions .btn {
    width: auto;
  }
}

@media (min-width: 920px) {
  .hero__sky {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
    align-items: end;
    gap: 0 clamp(24px, 4vw, 64px);
  }
  .hero__copy {
    align-self: center;
    padding-bottom: clamp(24px, 6vh, 72px);
  }
  .scene {
    max-height: 56svh;
  }
  .hero__title {
    font-size: clamp(88px, 10vw, 156px);
  }
}

/* Nacht: aus den Staubkörnchen werden Sterne (wie der Himmel auf metic.studio) */
@media (prefers-color-scheme: dark) {
  .motes circle {
    fill: var(--cream);
    opacity: 0.75;
  }
  .motes circle:nth-child(3n + 1) {
    animation: twinkle 4.2s ease-in-out infinite;
  }
  .motes circle:nth-child(3n + 2) {
    animation: twinkle 5.6s ease-in-out -2s infinite;
  }
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.2;
  }
}

/* ---------- Auftritt ---------- */

.js [data-enter] {
  opacity: 0;
  transform: translateY(16px);
}
.is-ready [data-enter] {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s var(--ease-out),
    transform 1s var(--ease-soft);
  transition-delay: calc(var(--d, 0) * 90ms + 60ms);
}

.js .hero__ground .ground {
  opacity: 0;
  transform: translateY(28px);
}
.is-ready .hero__ground .ground {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s var(--ease-out),
    transform 1s var(--ease-soft);
}

@keyframes land {
  0% {
    opacity: 0;
    transform: translateY(-90px) scale(0.94, 1.08);
  }
  55% {
    opacity: 1;
    transform: translateY(0) scale(1.12, 0.86);
  }
  75% {
    transform: translateY(-8px) scale(0.97, 1.04);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
.js .scene .fig--body .fig__hop,
.js .scene .fig--ghost,
.js .scene .thread,
.js .scene .door,
.js .scene .grate {
  opacity: 0;
}
.is-ready .scene .fig--body .fig__hop {
  animation: land 0.9s var(--ease-out) 0.45s both;
}
.is-ready .scene .fig--ghost,
.is-ready .scene .thread,
.is-ready .scene .door,
.is-ready .scene .grate {
  opacity: 1;
  transition: opacity 1s var(--ease-out);
}
.is-ready .scene .door,
.is-ready .scene .grate {
  transition-delay: 0.2s;
}
.is-ready .scene .fig--ghost {
  transition-delay: 0.95s;
}
.is-ready .scene .thread {
  transition-delay: 1.25s;
}

/* Beim Scrollen */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 1s var(--ease-soft);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Figuren-Abschnitt ---------- */

.figures {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  padding-top: clamp(96px, 14vw, 180px);
  padding-bottom: clamp(40px, 6vw, 80px);
}
/* Am Handy: erst die Bühne, dann der Umschalter – so sieht man, wer gemeint ist. */
@media (max-width: 919px) {
  .figures {
    gap: 0;
  }
  .figures__intro {
    display: contents;
  }
  .figures .stage {
    order: 1;
    margin-top: 28px;
  }
  .figures .switch {
    order: 2;
  }
  .figures .panels {
    order: 3;
  }
}

.switch {
  --i: 0;
  --count: 3;
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 480px;
  margin-top: 32px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.switch--os {
  --count: 2;
  max-width: 360px;
}
.switch__btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--muted);
  text-align: center;
  transition: color 0.3s var(--ease-out);
}
.switch__btn[aria-selected='true'] {
  color: var(--fg);
}
.switch__thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / var(--count));
  border-radius: 999px;
  background: var(--raised);
  box-shadow: var(--shadow);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.55s var(--ease-spring);
}

@media (max-width: 420px) {
  .switch:not(.switch--os) .switch__btn {
    flex-direction: column;
    gap: 4px;
    min-height: 64px;
    font-size: 14.5px;
  }
  .switch:not(.switch--os) {
    border-radius: 26px;
  }
  .switch:not(.switch--os) .switch__thumb {
    border-radius: 21px;
  }
}

.panels {
  display: grid;
  margin-top: 28px;
}
.panel {
  grid-area: 1 / 1;
  max-width: 38ch;
}
.panel[hidden] {
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
}
.panel:not([hidden]) {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.6s var(--ease-soft);
}
.panel p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 18px;
}

.stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 560 / 360;
}
.stage svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.stage__ground {
  fill: var(--ground);
}
.stage__thread {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 0.1 9;
  transition: opacity 0.5s var(--ease-out);
}
.stage__halo {
  fill: var(--accent-soft);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.stage__fig {
  transition:
    opacity 0.5s var(--ease-out),
    filter 0.5s var(--ease-out);
}
.stage[data-active='body'] .stage__fig:not([data-fig='body']),
.stage[data-active='ghost'] .stage__fig:not([data-fig='ghost']),
.stage[data-active='soul'] .stage__fig:not([data-fig='soul']) {
  opacity: 0.3;
  filter: saturate(0.15);
}
.stage[data-active='body'] .stage__halo {
  opacity: 0.45;
}
.stage[data-active='ghost'] .stage__thread--soul,
.stage[data-active='soul'] .stage__thread--ghost {
  opacity: 0.25;
}

@media (min-width: 920px) {
  .figures {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
  }
}

/* ---------- Reise ---------- */

.journey {
  padding-block: clamp(88px, 12vw, 160px) clamp(40px, 6vw, 80px);
}
.journey__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.journey__nav {
  display: none;
  gap: 10px;
}
@media (min-width: 760px) {
  .journey__nav {
    display: flex;
  }
}

.track-wrap {
  --edge: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  position: relative;
  margin-top: clamp(32px, 4vw, 48px);
  timeline-scope: --journey;
}
.track {
  display: flex;
  gap: 14px;
  padding: 6px var(--edge) 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
  scroll-timeline: --journey x;
  border-radius: 0;
}
.track::-webkit-scrollbar {
  display: none;
}
.track:focus-visible {
  outline-offset: -3px;
}

.stop {
  --tile: var(--surface);
  --tile-fg: var(--fg);
  --tile-muted: var(--muted);
  position: relative;
  flex: 0 0 clamp(232px, 68vw, 288px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(300px, 86vw, 360px);
  padding: 22px 22px 24px;
  border-radius: var(--radius);
  background: var(--tile);
  color: var(--tile-fg);
  scroll-snap-align: start;
  overflow: hidden;
  isolation: isolate;
}
.stop__num {
  position: absolute;
  top: 20px;
  left: 22px;
  font: 500 13px/1 var(--mono);
  color: var(--tile-muted);
}
.stop__icon {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 26px;
  height: 26px;
  fill: currentColor;
  opacity: 0.8;
}
.stop h3 {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.018em;
}
.stop p {
  margin-top: 10px;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--tile-muted);
  text-wrap: pretty;
}

/* Tageszeiten der Reise: Haus, Lager, Abendhimmel, Nebel, Morgenrot, Wald, Fluss, Meer, Nacht, Heimkehr */
.stop:nth-child(1) {
  --tile: var(--surface);
}
.stop:nth-child(2) {
  --tile: var(--surface-2);
}
.stop:nth-child(3) {
  --tile: color-mix(in oklab, var(--accent-soft) 20%, var(--bg));
}
.stop:nth-child(4) {
  background: linear-gradient(180deg, color-mix(in oklab, var(--fg) 20%, var(--bg)) 0%, color-mix(in oklab, var(--fg) 4%, var(--bg)) 78%);
}
.stop:nth-child(5) {
  background: linear-gradient(180deg, var(--accent-soft) 0%, color-mix(in oklab, var(--accent-soft) 22%, var(--bg)) 80%);
  --tile-muted: color-mix(in oklab, var(--fg) 72%, transparent);
}
.stop:nth-child(6) {
  --tile: color-mix(in oklab, var(--accent) 13%, var(--bg));
}
.stop:nth-child(7) {
  --tile: var(--surface);
  /* Strömung */
  background:
    repeating-linear-gradient(176deg, transparent 0 18px, color-mix(in oklab, var(--fg) 7%, transparent) 18px 19.5px, transparent 19.5px 31px),
    var(--surface);
}
.stop:nth-child(8) {
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in oklab, var(--fg) 14%, var(--bg)) 100%);
}
.stop:nth-child(9) {
  --tile-fg: var(--cream);
  --tile-muted: rgb(244 241 234 / 0.7);
  background:
    radial-gradient(circle at 18% 22%, rgb(244 241 234 / 0.9) 0 1.4px, transparent 2px),
    radial-gradient(circle at 72% 14%, rgb(244 241 234 / 0.8) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 84% 38%, rgb(244 241 234 / 0.9) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 44% 30%, rgb(244 241 234 / 0.6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 30% 48%, rgb(244 241 234 / 0.7) 0 1.1px, transparent 1.7px),
    radial-gradient(circle at 62% 52%, rgb(240 153 123 / 0.9) 0 1.8px, transparent 2.4px),
    var(--night);
}
.stop:nth-child(10) {
  --tile: var(--accent);
  --tile-fg: var(--cream);
  --tile-muted: rgb(244 241 234 / 0.86);
}

/* Lineal: 100 Level, alle zehn ein langer Strich (die Lineal-Kante von metic.studio) */
.ruler {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 8px;
  font: 500 12.5px/1 var(--mono);
  color: var(--muted);
}
.ruler__ticks {
  position: relative;
  flex: 1;
  height: 16px;
  background:
    linear-gradient(90deg, var(--fg) 0 1.5px, transparent 1.5px) 0 100% / calc(100% / 10 - 0.0001px) 16px repeat-x,
    linear-gradient(90deg, color-mix(in oklab, var(--fg) 34%, transparent) 0 1px, transparent 1px) 0 100% / calc(100% / 100 - 0.00001px) 7px repeat-x;
  opacity: 0.8;
}
@supports (animation-timeline: scroll()) {
  .ruler__ticks::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 4px;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
    animation: ruler-walk linear both;
    animation-timeline: --journey;
  }
  @keyframes ruler-walk {
    from {
      left: 0%;
    }
    to {
      left: 100%;
    }
  }
}

/* ---------- Installieren ---------- */

.install {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
  padding-top: clamp(96px, 13vw, 170px);
  padding-bottom: clamp(96px, 13vw, 170px);
  scroll-margin-top: 12px;
}
@media (min-width: 980px) {
  .install {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.oneTap {
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-bottom: 26px;
}
.oneTap[hidden],
.installed[hidden] {
  display: none;
}
.btn--solid {
  min-height: 60px;
}

.installed {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 18px;
  background: color-mix(in oklab, var(--accent) 12%, var(--bg));
  font-weight: 600;
}
.installed svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: var(--accent);
}

.steps {
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  font-size: 18px;
  line-height: 1.4;
}
.steps strong {
  font-weight: 600;
}
.steps__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.steps__icon svg {
  width: 20px;
  height: 20px;
  fill: var(--fg);
}
.steps li:first-child .steps__icon svg {
  fill: var(--accent);
  transform: translateX(1px);
}
.steps__note {
  display: block;
  margin-top: 2px;
  font-size: 15.5px;
  color: var(--muted);
}
.inline-link {
  display: inline-block;
  margin-top: 2px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  border-radius: 6px;
}
@media (hover: hover) {
  .inline-link:hover {
    color: var(--accent);
  }
}
.install__turn {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1.5px solid var(--line);
  font-size: 16px;
  color: var(--muted);
}

.device {
  justify-self: center;
  width: 100%;
  max-width: 720px;
}
.device__frame {
  padding: clamp(7px, 1.1vw, 13px);
  border-radius: clamp(24px, 3.4vw, 46px);
  background: #151514;
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / 0.08),
    0 2px 4px rgb(44 44 42 / 0.12),
    0 40px 80px -36px rgb(44 44 42 / 0.55);
  transform: rotate(-1.4deg);
}
.device img {
  width: 100%;
  height: auto;
  aspect-ratio: 1688 / 780;
  border-radius: clamp(17px, 2.5vw, 34px);
  background: var(--cream);
}

/* ---------- Anzeige (nur wenn Werbung aktiv ist, siehe scripts/build.mjs) ---------- */

.ad-slot {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-block: clamp(48px, 7vw, 96px);
}
.ad-slot__label {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.45;
}
.ad-slot ins {
  width: 100%;
  max-width: 970px;
}
/* Kennzeichnung und Abstand erst, wenn Google wirklich eine Anzeige liefert – sonst bleibt nichts Leeres stehen. */
.ad-slot:not(:has(ins[data-ad-status='filled'])) {
  margin-block: 0;
}
.ad-slot:not(:has(ins[data-ad-status='filled'])) .ad-slot__label {
  display: none;
}

/* ---------- Fuß ---------- */

.footer {
  padding-top: clamp(80px, 10vw, 120px);
}
.footer__ground {
  position: relative;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px) calc(24px + env(safe-area-inset-bottom));
  border-radius: var(--radius-ground) var(--radius-ground) 0 0;
  background: var(--ground);
  color: var(--on-ground);
}
.footer__figs {
  position: absolute;
  top: 1px;
  left: clamp(24px, 9vw, 140px);
  width: 108px;
  height: auto;
  transform: translateY(-100%);
  overflow: visible;
}
.footer__main {
  display: grid;
  gap: 22px;
  justify-items: start;
}
.footer__brand .brand__word {
  font-size: clamp(64px, 12vw, 132px);
  letter-spacing: -0.04em;
}
.footer__line {
  max-width: 36ch;
  font-size: 18px;
  color: rgb(244 241 234 / 0.72);
}
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(48px, 7vw, 88px);
  padding-top: 20px;
  border-top: 1px solid rgb(244 241 234 / 0.14);
  font: 500 12.5px/1.4 var(--mono);
  color: rgb(244 241 234 / 0.66);
}
.footer__meta nav {
  display: flex;
  gap: 20px;
}
.footer__meta a {
  padding: 6px 0;
  border-radius: 6px;
}
@media (hover: hover) {
  .footer__meta a:hover {
    color: var(--on-ground);
  }
}
.ground :focus-visible,
.footer__ground :focus-visible {
  outline-color: var(--accent-soft);
}

/* ---------- Weniger Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .ruler__ticks::after {
    display: none;
  }
  .js [data-enter],
  .js [data-reveal],
  .js .hero__ground .ground {
    transform: none;
  }
}
