/* Hey, Jogi! landing page. Colours come from the app's AuraTokens and orb states. */

@font-face {
  font-family: "Michroma";
  src: url("fonts/michroma-latin.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  /* JuliaMono subset, renamed because the OFL reserves the original name for unmodified copies. */
  font-family: "HJMono";
  src: url("fonts/hjmono-latin.woff2") format("woff2");
  font-display: swap;
}

@property --state { syntax: "<color>"; inherits: true; initial-value: #7f94c6; }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --bg: #04060b;
  --night-1: #112064;
  --night-2: #0b1639;
  --night-3: #080e22;
  --ink: #d9e8ff;
  --ink-2: #8fa9de;
  --ink-3: #6e86b8;
  --accent: #4c9aff;
  --accent-ink: #8fc0ff;
  --hair: rgb(76 154 255 / 0.14);
  --hair-2: rgb(76 154 255 / 0.45);
  --s-idle: #7f94c6;
  --s-listen: #3a6bff;
  --s-think: #8b2fff;
  --s-work: #16c8e6;
  --s-speak: #19c760;
  --state: var(--s-idle);
  /* the one type scale: six steps shared by both faces; every font size on the page is one of these */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --fs-h2: clamp(1.375rem, 0.875rem + 2.2vw, 2.5rem);
  --fs-h1: clamp(1.625rem, 1.1rem + 2.6vw, 3.25rem);
  /* the intro under a subpage title (diary, dashboard), smaller than body copy so the page's object stays in view */
  --fs-intro: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);  /* 14px on phones (the sm step), growing to 16px on wide screens */
  --display: "Michroma", "Eurostile", "Arial", sans-serif;
  --text: "HJMono", ui-monospace, "Cascadia Mono", "Roboto Mono", "Droid Sans Mono", monospace;
  --pad: clamp(20px, 5vw, 56px);
  --max: 1200px;
  --r: 18px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  transition: --state 0.6s ease;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--hair-2) var(--bg);
  /* without this, body hands its overflow to the viewport and the hero glow (inset -30vw) makes phones zoom out */
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;  /* Chrome's grey box on tap; every control has its own press state */ }
html.i18n-wait body { opacity: 0; animation: i18n-show 0s 1.2s forwards; }
@keyframes i18n-show { to { opacity: 1; } }

body {
  margin: 0;
  /* the night darkens evenly over the whole page, not just below the first screen */
  background: linear-gradient(var(--night-2), var(--night-3) 55%, var(--bg)) var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/1.62 var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* pages without the hero get its night from the top: a deep-blue glow that fades out evenly over the page height */
body:has(> main.legal, > main.dl, > main.dash, > main.gate) {
  background:
    radial-gradient(130% 70% at 50% 0, var(--night-1), transparent 70%),
    linear-gradient(var(--night-2), var(--night-3) 55%, var(--bg)) var(--bg);
}
::selection { background: rgb(76 154 255 / 0.38); color: #f2f7ff; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); max-width: 19em; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 14px; border-radius: 999px; background: var(--night-2); color: var(--ink);
}
.skip:focus { top: 12px; }

/* ---------- Glass ---------- */
.glass {
  position: relative;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgb(22 38 76 / 0.5), rgb(7 13 30 / 0.66));
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px 0 rgb(217 232 255 / 0.08), 0 30px 60px -30px rgb(0 0 0 / 0.75);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgb(9 17 36 / 0.94); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: #0a1428; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Bar ---------- */
.bar {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(8px, env(safe-area-inset-top)) var(--pad) 4px;
  height: 56px; box-sizing: content-box;
  position: relative; z-index: 2;
}
.brand {
  font-family: var(--display); font-size: var(--fs-sm); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.bar-left { display: flex; align-items: center; gap: 10px; }
/* the bar's round icon buttons (menu; the house on subpages): same glass and hairline as the language toggle */
.menu-btn, .home-btn {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; box-sizing: border-box;
  border: 1px solid var(--hair); border-radius: 50%; background: rgb(8 14 34 / 0.6); color: var(--ink-2); cursor: pointer;
  transition: color 0.2s, background-color 0.2s, scale 0.2s var(--ease-out);
}
.menu-btn:hover, .menu-btn:focus-visible, .home-btn:hover { color: var(--ink); background: rgb(76 154 255 / 0.12); outline: none; }
.menu-btn:active, .home-btn:active { scale: 0.92; }
.menu-btn svg, .home-btn svg { width: 22px; height: 22px; }
/* subpages: the house sits right before the language toggle and leads back to the landing page */
.home-btn { margin: 0 -8px 0 auto; }
/* below 380px the name and the house don't both fit; the house does the name's job there */
@media (max-width: 379px) { .bar:has(.home-btn) .brand { display: none; } }
.menu {
  position: absolute; inset: auto;  /* absolute in the top layer = anchored to the page, scrolls away with the bar */ top: calc(max(8px, env(safe-area-inset-top)) + 56px); left: max(8px, var(--pad));
  margin: 0; padding: 8px; min-width: 220px; color: var(--ink);
}
.menu::backdrop { background: rgb(4 6 11 / 0.35); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a, .menu .ph {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: var(--fs-md);
}
.menu a { color: var(--ink); text-decoration: none; }
.menu a:hover, .menu a:focus-visible { background: rgb(76 154 255 / 0.14); outline: none; }
.menu .ph { color: var(--ink-3); }
.menu .ph small { font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--ink-3); }
.lang, .mode {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--hair); border-radius: 999px; background: rgb(8 14 34 / 0.6);
}
.lang button, .mode button {
  min-width: 44px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-2);
  font-size: var(--fs-sm); letter-spacing: 0.04em; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.lang button:hover, .mode button:hover { color: var(--ink); }
.lang button[aria-pressed="true"], .mode button[aria-pressed="true"] {
  background: rgb(76 154 255 / 0.2); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hair-2);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-areas: "h1" "stage" "lede" "act";
  row-gap: 18px;
  padding: 4px var(--pad) clamp(56px, 10vw, 112px);
}
.hero::before {
  /* the app's night: deep blue base, tinted by whatever the orb is doing */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -80px -30vw 0;
  background:
    radial-gradient(closest-side, color-mix(in oklab, var(--state) 20%, transparent), transparent 70%) 50% 30% / min(110vw, 760px) min(110vw, 760px) no-repeat,
    radial-gradient(70% 50% at 50% 34%, var(--night-1), transparent 75%);
}
.hero h1 { grid-area: h1; font-size: var(--fs-h1); }
.lede { grid-area: lede; }
.actions { grid-area: act; }
h1 span { display: block; }
.h1-b { color: var(--ink-2); margin-top: 0.15em; }
.lede { color: var(--ink-2); max-width: 40ch; font-size: var(--fs-lg); }
.actions { margin-top: 4px; }
/* download, dashboard, diary after the hero; dashboard and diary in the download area; always one row */
.actions, .sec-dl { display: flex; align-items: stretch; gap: 8px; }
/* a toned-down take on the app's microphone key: glass, a soft light top left, a slim ring, the glass lift */
.soon-pill {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  padding: 6px clamp(9px, 3vw - 1px, 17px); border-radius: 999px; border: 2px solid rgb(76 154 255 / 0.2);
  background: radial-gradient(60% 60% at 35% 25%, rgb(255 255 255 / 0.11), transparent) rgb(10 20 44 / 0.7);
  -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
  box-shadow: inset 0 1px 0 rgb(217 232 255 / 0.08), 0 16px 32px -16px rgb(0 0 0 / 0.75);
  font-size: min(var(--fs-sm), 3.75vw); letter-spacing: 0.04em; line-height: 1.3; text-align: center;
  color: var(--ink-2); text-decoration: none;
  transition: transform 0.12s ease, color 0.2s ease;
}
.soon-pill:hover { background-color: rgb(76 154 255 / 0.18); color: var(--ink); }
.soon-pill[aria-disabled] { opacity: 0.5; pointer-events: none; }  /* the dashboard page does not exist yet */
/* the download is the one primary action */
.soon-pill.main { background-color: rgb(76 154 255 / 0.2); border-color: var(--hair-2); color: var(--ink); }
.soon-pill.main:hover { background-color: rgb(76 154 255 / 0.28); }
.soon-pill[href]:active { transform: scale(0.975); }

.stage { --orb: min(82vw, 42svh, 460px); grid-area: stage; position: relative; display: grid; justify-items: center; }
.orb {
  position: relative; display: block;
  width: var(--orb); aspect-ratio: 1;
  margin: -7% 0 0; padding: 0; border: 0; background: none; border-radius: 50%;
  cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.orb:focus-visible { outline: none; }
.orb:focus-visible::after {
  content: ""; position: absolute; inset: 22%; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent-ink);
}
/* points at the orb from the right, where there is more room; hidden while the demo runs, then it offers another round.
   The box covers the orb: the arrow is pinned to the orb (tip just outside the sphere at 68% / 34%, aimed at its centre),
   the text sits right above the arrow's tail and grows to the right, never past the screen edge (8px). */
.try {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  font-size: var(--fs-sm); line-height: 1.35; color: var(--ink);
  transition: opacity 0.5s var(--ease-out);
}
/* at least 8.5em wide so the text never breaks into single words on a small orb (phone in landscape) */
.try span {
  position: absolute; left: 69%; bottom: 79%; width: max(40%, 8.5em); max-width: calc((100vw - var(--orb)) / 2 + 31% - 8px);
  text-align: right; text-wrap: balance;
}
/* the arrow is drawn left to right; scale mirrors it, and the nudge (transform) then moves it towards the orb too */
.try svg { position: absolute; left: 65%; top: 21%; width: max(19%, 2.4em); scale: -1 1; color: var(--accent-ink); animation: try-nudge 1.6s ease-in-out infinite; }
@keyframes try-nudge { 50% { transform: translate(4px, 4px); } }
.running .try { opacity: 0; }
/* the idle orb breathes, before the first press and again after every round */
html:not(.running) .orb canvas { animation: orb-breathe 3.4s ease-in-out infinite; }
@keyframes orb-breathe { 50% { transform: scale(1.06); } }
.orb canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.orb.ready canvas { opacity: 1; }
.orb.no-gl::before {
  /* no WebGL: a still rendition of the idle orb */
  content: ""; position: absolute; inset: 26%; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgb(58 107 255 / 0.55), transparent 45%),
    radial-gradient(circle at 50% 50%, #10245e 30%, #2347d9 72%, rgb(35 71 217 / 0.2) 100%);
  box-shadow: 0 0 60px 10px rgb(35 71 217 / 0.35);
}

.demo {
  /* tucks into the orb's glow, measured on the orb itself: the outer tick ring ends at 84% of its height (86% while breathing) */
  width: min(100%, 460px); margin-top: calc(var(--orb) * -0.1);
  padding: 12px 14px 12px 16px; z-index: 1;
}
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-state { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); letter-spacing: 0.04em; }
.led {
  width: 8px; height: 8px; border-radius: 50%; background: var(--state);
  box-shadow: 0 0 10px 1px color-mix(in oklab, var(--state) 70%, transparent);
}
.demo-log { margin-top: 8px; min-height: 6.2em; font-size: var(--fs-sm); line-height: 1.5; display: grid; align-content: start; gap: 4px; }
.you { color: var(--ink); }
.you.is-hint { color: var(--ink-2); }
.tool { color: var(--s-work); min-height: 1.5em; }
.tool:empty { min-height: 0; }
.ans { color: color-mix(in oklab, var(--s-speak) 55%, var(--ink)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.demo-note { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }

/* Jogi's rotating glow edge, lit only while the orb is busy */
.demo::before, .demo::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 62%, var(--state) 82%, color-mix(in oklab, var(--state) 40%, white) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0; transition: opacity 0.5s ease;
}
.demo::after { filter: blur(7px); }
.demo.is-busy::before { opacity: 1; animation: spin 2.6s linear infinite; }
.demo.is-busy::after { opacity: 0.8; animation: spin 2.6s linear infinite; }
@keyframes spin { to { --angle: 360deg; } }

/* ---------- Areas: an engraved notch between them, a light running back and forth through it ---------- */
.notch {
  position: relative; width: calc(100% - 2 * var(--pad)); max-width: calc(var(--max) - 2 * var(--pad)); height: 2px;
  margin: clamp(64px, 11vw, 150px) auto 0; border: 0; overflow: hidden;
  background: linear-gradient(rgb(0 0 0 / 0.6) 50%, rgb(217 232 255 / 0.08) 50%);  /* the cut, and its lit lower lip */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hero + .notch { margin-top: 0; }
.notch::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 22%;
  background: linear-gradient(90deg, transparent, var(--accent) 40%, color-mix(in oklab, var(--accent) 40%, white) 50%, var(--accent) 60%, transparent);
  opacity: 0.85; animation: notch-run 12.84s linear infinite;
}
/* back and forth; it turns just where it fades out under the notch's end mask (centre at -3.7% / 103.7%),
   so it is out of sight for only the quarter-second hold at either end */
@keyframes notch-run {
  0%, 1.948% { transform: translateX(-67%); }
  50%, 51.948% { transform: translateX(421.5%); }
  100% { transform: translateX(-67%); }
}

/* one quiet way to the download at the end of each middle area; the hero and the end keep the pills */
.sec-link { grid-column: 1 / -1; margin: clamp(32px, 6vw, 56px) 0 0; font-size: var(--fs-sm); line-height: 1.5; }
.control > .sec-link { margin-top: 0; }
.sec-link a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- How ---------- */
section { position: relative; }
.how, .control, .vs, .facts, .close {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(64px, 11vw, 150px) var(--pad) 0;
}
.how-copy { display: grid; gap: 18px; max-width: 46rem; }
.how-copy p { color: var(--ink-2); max-width: 46ch; }
.how-copy .aside { color: var(--ink-3); font-size: var(--fs-sm); }

.routes {
  display: grid; gap: 40px; margin-top: clamp(40px, 7vw, 72px);
  align-items: start;
}
/* both ways get a small title, set like the fact titles */
.route figcaption { font-family: var(--display); font-size: var(--fs-lg); line-height: 1.3; color: var(--ink); margin-bottom: 14px; }

.ways { display: grid; gap: 32px; }
.hops { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; }
.hops li {
  display: inline-flex; align-items: center;
  font-size: var(--fs-sm); color: var(--ink-3);
  padding: 8px 12px; border: 1px dashed rgb(110 134 184 / 0.4); border-radius: 10px; white-space: nowrap;
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.hops li.on { color: var(--ink); border-color: rgb(76 154 255 / 0.45); background: rgb(76 154 255 / 0.1); }
.hops li + li { margin-left: 26px; position: relative; }
.hops li + li::before {
  content: ""; position: absolute; right: calc(100% + 4px); width: 18px; top: 50%;
  border-top: 1px dashed rgb(110 134 184 / 0.55);
}
/* the request travelling along the dashed line to the next pill, or back */
.hops li + li::after {
  --hop: translateX(13px);
  content: ""; position: absolute; right: calc(100% + 17px); top: 50%; width: 5px; height: 5px; margin-top: -2px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); opacity: 0;
}
.hops li.down::after { animation: hop 0.45s ease-in-out; }
.hops li.up::after { animation: hop 0.45s ease-in-out reverse; }
@keyframes hop {
  0% { transform: none; opacity: 0; }
  20%, 80% { opacity: 1; }
  100% { transform: var(--hop); opacity: 0; }
}
/* One stage per way: the request, the chain and the reply. Without the animation they stand one under the
   other; animated they share one place (the stage keeps the size of the largest), so nothing below moves. */
.run { display: grid; gap: 12px; justify-items: start; align-items: start; }
/* the app's live transcript bubble: the request in ink, the spoken reply in the demo's speaking tint */
.say {
  max-width: 22rem; margin: 0; padding: 10px 14px; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink);
  border: 1px solid var(--hair); border-radius: 14px; background: rgb(12 20 38 / 0.8);
}
.say .lbl { color: var(--ink-3); }
.say.rep .txt { color: color-mix(in oklab, var(--s-speak) 55%, var(--ink)); }
.anim .run > * {
  grid-area: 1 / 1; opacity: 0; transform: translateY(6px);
  transition: opacity 0.45s var(--ease-out), transform 0.6s var(--ease-out);
}
.anim .run > .show { opacity: 1; transform: none; }
.anim .say .txt span { opacity: 0; transition: opacity 0.25s; }
.anim .say .txt span.on { opacity: 1; }

.phone {
  position: relative; max-width: 440px;
  padding: 30px 14px 16px;
  border-radius: 40px;
  border: 1.5px solid var(--hair-2);
  background: linear-gradient(180deg, rgb(17 32 100 / 0.32), rgb(8 14 34 / 0.6));
  box-shadow: inset 0 0 0 5px rgb(4 6 11 / 0.8), inset 0 0 0 6px var(--hair);
}
.phone::before {
  content: ""; position: absolute; top: 12px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%; background: #0b1424; box-shadow: inset 0 0 0 1px var(--hair-2);
}
.phone-label { position: absolute; top: 9px; left: 26px; font-size: var(--fs-xs); color: var(--ink-3); }
.box { position: relative; border-radius: 14px; border: 1px solid var(--hair); padding: 12px; }
.box + .box, .box > .box { margin-top: 12px; }
.box-t { display: grid; gap: 2px; }
.box-t b { font-weight: 400; color: var(--ink); font-size: var(--fs-sm); }
.box-t b i { font-style: normal; color: var(--ink-3); }
.box-t span { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.45; }
.app { background: rgb(76 154 255 / 0.05); padding: 14px; }
.deb { background: rgb(127 148 198 / 0.07); border-color: rgb(127 148 198 / 0.22); }
.cli {
  background: linear-gradient(135deg, rgb(22 200 230 / 0.16), rgb(22 200 230 / 0.04));
  border-color: rgb(22 200 230 / 0.45);
}
.cli .box-t b { color: #c9f5ff; }
.bridge { background: rgb(25 199 96 / 0.07); border-color: rgb(25 199 96 / 0.35); }
.bridge .box-t b { color: #c6f7d9; }
.mcp {
  position: relative; display: flex; justify-content: center; height: 34px; margin: 0;
}
.mcp::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: linear-gradient(var(--s-work), var(--s-speak));
}
.mcp span {
  position: relative; align-self: center; padding: 1px 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--hair); font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--ink-2);
}
.mcp::after {
  /* a tool call travelling down the bridge */
  content: ""; position: absolute; left: 50%; top: 0; width: 5px; height: 5px; margin-left: -2px; border-radius: 50%;
  background: var(--s-work); box-shadow: 0 0 8px var(--s-work); opacity: 0;
}

.js .how .route.jogi .box, .js .how .mcp { opacity: 0; transform: translateY(10px) scale(0.985); }
.js .how.in .route.jogi .box, .js .how.in .mcp {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
}
.js .how.in .app { transition-delay: 0.05s; }
.js .how.in .deb { transition-delay: 0.25s; }
.js .how.in .cli { transition-delay: 0.45s; }
.js .how.in .mcp { transition-delay: 0.7s; }
.js .how.in .bridge { transition-delay: 0.85s; }
.how.in .mcp::after { animation: travel 2.4s 1.6s ease-in-out infinite; }
@keyframes travel {
  0% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: calc(100% - 5px); opacity: 0; }
}

/* ---------- Control ---------- */
.control { display: grid; gap: 36px; align-items: center; }
.control-copy { display: grid; gap: 18px; }
.control-copy p { color: var(--ink-2); max-width: 46ch; }
.zentrale { padding: 16px 18px 14px; }
.control::before {
  /* coloured field behind the glass so the blur has something to bend */
  content: ""; position: absolute; z-index: -1; right: 0; bottom: -40px;
  width: min(100vw, 680px); height: min(120vw, 560px);
  background: radial-gradient(closest-side, rgb(22 200 230 / 0.22), rgb(58 107 255 / 0.1) 62%, transparent);
  pointer-events: none;
}
.z-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.z-title { font-family: var(--display); font-size: var(--fs-sm); letter-spacing: 0.08em; text-transform: uppercase; }
.z-count { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.switches { display: grid; grid-template-columns: 1fr; column-gap: 22px; margin-top: 4px; }
.switches button {
  width: 100%; min-height: 48px; padding: 6px 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 0; background: none; cursor: pointer; text-align: left;
  font-size: var(--fs-sm); color: var(--ink-2); transition: color 0.2s;
}
.switches button:hover { color: var(--ink); }
.switches i {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px;
  background: rgb(127 148 198 / 0.16); box-shadow: inset 0 0 0 1px rgb(127 148 198 / 0.28);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.switches i::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: #7f94c6; transition: transform 0.3s var(--ease-out), background-color 0.25s, box-shadow 0.25s;
}
.switches button[aria-checked="true"] { color: var(--ink); }
.switches button[aria-checked="true"] i { background: rgb(22 200 230 / 0.25); box-shadow: inset 0 0 0 1px rgb(22 200 230 / 0.6); }
.switches button[aria-checked="true"] i::after { transform: translateX(16px); background: var(--s-work); box-shadow: 0 0 10px rgb(22 200 230 / 0.8); }
.switches button:active i::after { width: 19px; }
.z-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- Facts ---------- */
.fact-grid { display: grid; gap: 0 40px; margin-top: clamp(32px, 6vw, 56px); }
.fact { padding: 22px 0; border-top: 1px solid var(--hair); display: grid; gap: 8px; align-content: start; }
.fact dt { font-family: var(--display); font-size: var(--fs-lg); line-height: 1.3; }
.fact dd { color: var(--ink-2); font-size: var(--fs-md); max-width: 40ch; }
.close .avail { display: grid; gap: 10px; justify-items: center; }
.langs { font-family: var(--display); font-size: var(--fs-sm); color: var(--ink); }
.langs span { white-space: nowrap; }
.langs .sep { color: var(--ink-3); }
.flag { width: 1.2em; height: 0.8em; margin-right: 0.35em; vertical-align: -0.05em; border-radius: 2px; box-shadow: 0 0 0 1px var(--hair); }

/* ---------- Versus: same rows as Facts, each with the official apps and Hey, Jogi! ---------- */
.vs .fact dd b { display: block; font-weight: 400; font-size: var(--fs-xs); letter-spacing: 0.04em; color: var(--ink); }
.vs .fact dd.vs-them, .vs .fact dd.vs-them b { color: var(--ink-3); }
.vs-other { margin-top: 22px; color: var(--ink-2); max-width: 60ch; }
.vs-other b { font-weight: 400; color: var(--ink); }  /* the finding itself, lit like the key words elsewhere */

/* ---------- Close: the download at the end of the last area ---------- */
.facts { padding-bottom: clamp(72px, 12vw, 140px); }
.facts .close { max-width: none; margin-top: clamp(64px, 11vw, 150px); padding: 0; }
.close { text-align: center; display: grid; justify-items: center; gap: 18px; padding-bottom: clamp(72px, 12vw, 140px); }
.close h2 { font-size: var(--fs-h2); }
.close p { color: var(--ink-2); max-width: 42ch; }
.close p b { font-weight: 400; color: var(--ink); }
.lost { min-height: 100svh; align-content: center; padding-top: 0; padding-bottom: 0; }
.lost h1 { font-size: var(--fs-h2); }
/* the download page: nothing but the download, centred between bar and footer */
.dl { min-height: calc(100svh - 190px); align-content: center; padding-top: clamp(24px, 6vw, 56px); }
.dl h1 { font-size: var(--fs-h2); }
.close-orb {
  width: 84px; height: 84px; border-radius: 50%; margin-bottom: 10px;
  background:
    radial-gradient(circle at 50% 50%, rgb(120 160 255 / 0.5), transparent 42%),
    radial-gradient(circle at 50% 50%, #10245e 32%, #2347d9 74%, rgb(35 71 217 / 0) 100%);
  box-shadow: 0 0 50px 6px rgb(35 71 217 / 0.4), 0 0 0 14px rgb(76 154 255 / 0.04), 0 0 0 15px var(--hair);
  animation: breathe 5.5s ease-in-out infinite;
  display: grid; place-items: center; color: var(--ink);
  transition: scale 0.2s var(--ease-out), filter 0.2s var(--ease-out);
}
/* press: the orb sinks in and lights up, like the app's orb when you hold it */
a.close-orb:hover { filter: brightness(1.15); }
a.close-orb:active { scale: 0.9; filter: brightness(1.4); transition-duration: 0.08s; }
/* on the landing page it links to /download; on /download it becomes the APK link once the app is public */
.close-orb svg { width: 34px; height: 34px; fill: currentColor; filter: drop-shadow(0 0 8px rgb(76 154 255 / 0.6)); }
@keyframes breathe {
  50% { transform: scale(1.06); box-shadow: 0 0 70px 12px rgb(35 71 217 / 0.5), 0 0 0 18px rgb(76 154 255 / 0.04), 0 0 0 19px var(--hair); }
}

/* ---------- Legal notice and privacy: both languages in the page, the one matching <html lang> shows ---------- */
html[lang="de"] .legal [lang="en"], html:not([lang="de"]) .legal [lang="de"] { display: none; }
.legal { max-width: 46rem; margin: 0 auto; padding: clamp(24px, 6vw, 56px) var(--pad) clamp(72px, 12vw, 140px); }
.legal h1 { font-size: var(--fs-h2); margin-bottom: 16px; }
.legal h2 { font-size: var(--fs-lg); line-height: 1.3; margin: clamp(32px, 6vw, 48px) 0 10px; max-width: none; }
.legal p, .legal li { color: var(--ink-2); max-width: 65ch; }
.legal p + p, .legal p + ul, .legal ul + p, .legal address + p { margin-top: 12px; }
.legal ul { padding-left: 1.2em; list-style: disc; }
.legal li + li { margin-top: 6px; }
.legal b, .legal address { font-weight: 400; font-style: normal; color: var(--ink); }
.legal .asof { margin-top: 10px; font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- Stamp: pages still being built (diary, dashboard) ----------
   A rubber stamp fixed across the screen: it never scrolls, never takes a tap, and only says what is not real yet.
   Small and above the middle, between the intro and the page's object, so the diary drum stays usable. */
.stamp {
  position: fixed; left: 50%; top: 38%; z-index: 50; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-14deg);
  display: grid; justify-items: center; gap: 0.25rem; width: max-content; max-width: 72vw;
  margin: 0; padding: 0.5rem 1rem 0.625rem; text-align: center;
  /* in front of everything: strong ink and a faint dark fill, so the page reads as lying under it */
  color: rgb(143 192 255 / 0.62); background: rgb(4 6 11 / 0.32); border: 2px solid currentColor; border-radius: 10px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);  /* a fine blur behind the whole stamp keeps its text readable */
  outline: 1px solid currentColor; outline-offset: 4px;
}
.stamp b { font-family: var(--display); font-weight: 400; font-size: clamp(1.75rem, 9vw, 4rem); line-height: 1.05; letter-spacing: 0.08em; text-transform: uppercase; }
.stamp span { font-size: var(--fs-sm); line-height: 1.4; max-width: 24ch; color: rgb(217 232 255 / 0.8); }
html[lang="de"] .stamp [lang="en"], html:not([lang="de"]) .stamp [lang="de"] { display: none; }

/* ---------- Gate: the public front page while the site is being built (gate.html) ---------- */
.gate { min-height: calc(100svh - 190px); align-content: center; max-width: 34rem; margin: 0 auto; padding: clamp(12px, 3vw, 32px) var(--pad) clamp(40px, 7vw, 80px); display: grid; justify-items: center; gap: 18px; text-align: center; }
/* the name already stands in the bar, so the page heading is the note itself, set as body text */
.gate-note { font-family: var(--text); font-size: var(--fs-md); line-height: 1.62; letter-spacing: 0; color: var(--ink); max-width: 36ch; }
.gate-lede { color: var(--ink-2); max-width: 40ch; }
/* 9:16 film; never taller than about half the screen, so the text around it stays in view */
.gate-video { width: min(64vw, 280px, 26svh); aspect-ratio: 9 / 16; object-fit: cover; border: 1px solid var(--hair); border-radius: var(--r); background: #000; }
.gate-links { display: flex; justify-content: center; gap: 8px; }
.soon-pill small { margin-left: 0.6em; font-size: var(--fs-xs); color: var(--ink-3); }
.soon-pill.ico { width: 44px; padding: 0; justify-content: center; }
.soon-pill.ico svg { width: 20px; height: 20px; }
/* the owner's way in: quiet, at the bottom */
.gate-pw { display: flex; gap: 6px; margin-top: 14px; }
.gate-pw input, .gate-pw button { min-height: 40px; border: 1px solid var(--hair); background: rgb(8 14 34 / 0.6); color: var(--ink); font: inherit; }
.gate-pw input { width: 11rem; padding: 0 14px; border-radius: 999px; font-size: var(--fs-md); }  /* 16px keeps phones from zooming in */
.gate-pw input::placeholder { color: var(--ink-3); }
.gate-pw input[aria-invalid="true"] { border-color: rgb(255 120 120 / 0.7); }
.gate-pw button { width: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.gate-pw button svg { width: 18px; height: 18px; }
html[lang="de"] .gate [lang="en"], html:not([lang="de"]) .gate [lang="de"] { display: none; }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--max); margin: 0 auto;
  padding: 28px var(--pad) max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair);
  display: grid; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3);
}
.foot-brand { font-family: var(--display); font-size: var(--fs-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-sm); }

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .switches { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .routes { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 56px; }
  .hops { flex-direction: column; align-items: flex-start; gap: 22px; }
  .hops li + li { margin-left: 0; }
  .hops li + li::before { right: auto; left: 22px; top: auto; bottom: calc(100% + 3px); width: 0; height: 18px; border-top: 0; border-left: 1px dashed rgb(110 134 184 / 0.55); }
  .hops li + li::after { --hop: translateY(14px); right: auto; left: 20px; top: auto; bottom: calc(100% + 16px); margin-top: 0; }
}
@media (min-width: 960px) {
  :root { --fs-md: 1.0625rem; }
  .hero {
    grid-template-areas: ". stage" "h1 stage" "lede stage" "act stage" ". stage";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 40px;
    align-items: center;
    min-height: min(calc(100svh - 88px), 820px);
    padding-bottom: 72px;
  }
  .hero::before {
    background:
      radial-gradient(closest-side, color-mix(in oklab, var(--state) 20%, transparent), transparent 70%) 78% 45% / 820px 820px no-repeat,
      radial-gradient(60% 70% at 72% 42%, var(--night-1), transparent 75%);
  }
  .stage { --orb: min(44vw, 72svh, 600px); }
  .orb { margin-top: 0; }
  .control { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; }
  .fact-grid { grid-template-columns: 1.1fr 1fr; column-gap: 72px; }
  .routes { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); }
  .phone { margin-left: auto; margin-right: 8%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  html.i18n-wait body { animation: i18n-show 0s 1.2s forwards !important; }
}
