/* =============================================================================
   Apphemeride — relaunch stylesheet (German pages, spec 20261030-001 Kap. 8).
   Night, precision, warmth: deep blue-black, warm gold accents (sun),
   precision cyan (data), eclipse red used sparingly. Dark only.
   No frameworks, self-hosted fonts only (CSP: style-src 'self' 'unsafe-inline',
   font-src 'self'). Logical properties throughout so `dir="rtl"` works later.
   ============================================================================= */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-latin-ext.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
/* Cyrillic (ru) and Vietnamese (vi) subsets of the same fonts, loaded only
   when a page uses those characters. Arabic, Devanagari and CJK fall back to
   the system fonts of the stack (Inter has no glyphs for them). */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable-vietnamese.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-cyrillic.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-vietnamese.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --bg: #050506;
  --bg-raised: #0B0D12;
  --bg-glass: rgba(8, 10, 14, .72);
  --line: rgba(246, 242, 234, .10);
  --text: #F6F2EA;
  --text-2: #B8B2A8;
  --text-3: #7D786F;
  --sun: #F6B34E;
  --data: #78D7E8;
  --eclipse: #E45B4A;
  --twilight-1: #0B1A3A;
  --twilight-2: #1E3A6E;
  --twilight-3: #C9705A;
  --twilight-4: #F2B66B;

  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1240px;
  --gutter: clamp(16px, 5vw, 48px);
  --section: clamp(96px, 14vw, 200px);
  --measure: 42rem;
  --radius: 12px;
  --header-h: 64px;
}
/* Scripts Inter does not cover: name each platform's regional font so Han
   characters get the right glyph forms (SC/JP/KR) instead of a random fallback. */
:lang(zh-Hans) { --font-text: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif; }
:lang(ja) { --font-text: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif; }
:lang(ko) { --font-text: "Inter", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif; }
:lang(hi) { --font-text: "Inter", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif; }
/* Korean breaks lines between words, not inside them; Japanese headings break at phrase boundaries where supported. */
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; }

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

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

body {
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
a { color: var(--sun); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--text); }
button { font: inherit; color: inherit; }
ul, ol { padding-inline-start: 1.25em; }

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

h1, h2, h3, h4 { font-weight: 650; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: clamp(2.75rem, 6.5vw, 6rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 4vw, 3.75rem); line-height: 1.08; }
h3 { font-size: 1.375rem; line-height: 1.25; }
p, li, dd { max-width: var(--measure); }
p + p { margin-block-start: 1em; }

.mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.kicker {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sun);
  margin-block-end: 1rem;
}
/* Connected scripts: tracking pulls joined letters (Arabic) and the headline (Devanagari) apart. */
:is(:lang(ar), :lang(hi)) :is(.kicker, .ftr h2, .lang-note) { letter-spacing: 0; }
.kicker--data { color: var(--data); }
.kicker--eclipse { color: var(--eclipse); }

.lead { font-size: 1.125rem; color: var(--text-2); }
.muted { color: var(--text-2); }
.fine { color: var(--text-3); font-size: 0.875rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: calc(var(--section) / 2); }
.section--tight { padding-block: calc(var(--section) / 3); }

.skip-link {
  position: absolute; inset-inline-start: .75rem; top: -4rem; z-index: 200;
  padding: .55rem 1rem; background: var(--bg-raised); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: .75rem; }

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

.hdr {
  position: sticky; top: 0; z-index: 100;
  min-height: var(--header-h);
  transition: background-color .25s ease, border-color .25s ease;
  border-block-end: 1px solid transparent;
}
.hdr.is-scrolled, .hdr.is-open { border-color: var(--line); }
/* The glass lives on a ::before layer, not on .hdr itself: a backdrop-filter
   on the header would make it the containing block for the fixed mobile
   sheet (.hdr.is-open .nav) and break its positioning. */
.hdr::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bg-glass); opacity: 0; transition: opacity .25s ease;
}
.hdr.is-scrolled::before, .hdr.is-open::before { opacity: 1; }
@supports (backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px)) {
  .hdr::before { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
.hdr-inner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  min-height: var(--header-h);
}
.lockup { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: .01em; }
.lockup img { width: 28px; height: 28px; border-radius: 7px; }
.lockup:hover { color: var(--sun); }

.nav { display: flex; justify-content: center; gap: .25rem; }
.nav > li { list-style: none; position: relative; }
.nav-link, .nav-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .85rem; border-radius: 999px; border: 1px solid transparent;
  color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 500;
  background: transparent; cursor: pointer;
}
.nav-link:hover, .nav-btn:hover, .nav-btn[aria-expanded="true"] { background: rgba(246, 242, 234, .07); color: var(--text); }
.nav-link[aria-current="page"], .nav-link[aria-current="true"] { color: var(--sun); }
.nav-btn::after {
  content: ""; width: .4em; height: .4em; margin-inline-start: .1em;
  border-inline-end: 1.5px solid currentColor; border-block-end: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-25%); transition: transform .15s ease;
}
.nav-btn[aria-expanded="true"]::after { transform: rotate(225deg) translateY(-10%); }

.mega {
  display: none; position: absolute; top: calc(100% + .6rem); inset-inline-start: 50%; transform: translateX(-50%);
  width: min(56rem, calc(100vw - 2rem)); padding: 1rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
[dir="rtl"] .mega { transform: translateX(50%); }
.nav > li.is-open > .mega { display: block; }
.mega-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; }
.mega-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mega-item {
  display: grid; grid-template-columns: 2rem 1fr; gap: .25rem .75rem; align-items: start;
  padding: .65rem .75rem; border-radius: 10px; color: var(--text); text-decoration: none;
}
.mega-item:hover { background: rgba(246, 242, 234, .06); color: var(--text); }
.mega-item svg { width: 1.6rem; height: 1.6rem; color: var(--sun); grid-row: span 2; margin-block-start: .15rem; }
.mega-item strong { font-weight: 600; font-size: .95rem; }
.mega-item span { grid-column: 2; font-size: .85rem; color: var(--text-2); line-height: 1.4; }
/* Entries without an icon (Ratgeber clusters): single column, title above
   description — otherwise the title would land in the 2rem icon column and
   wrap word by word into the description. */
.mega-item--text { display: block; }
.mega-item--text strong { display: block; }
.mega-item--text span { display: block; margin-block-start: .15rem; }
.mega-foot { margin-block-start: .75rem; padding-block-start: .75rem; border-block-start: 1px solid var(--line); font-size: .9rem; }

.hdr-right { display: flex; align-items: center; gap: .5rem; justify-self: end; }
.dl-link {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px;
  background: var(--text); color: var(--bg); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.dl-link:hover { background: var(--sun); color: var(--bg); }
.dl-link svg { width: 1rem; height: 1.2rem; }

.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: .9rem;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { border-color: var(--data); }
.lang-btn svg { width: 1.1rem; height: 1.1rem; }
.lang-panel {
  display: none; position: absolute; inset-inline-end: 0; top: calc(100% + .6rem);
  width: min(40rem, calc(100vw - 2rem)); padding: .75rem;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); max-height: calc(100vh - 6rem); overflow-y: auto;
}
.lang.is-open .lang-panel { display: block; }
.lang-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem .5rem; }
.lang-grid a { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; border: 1px solid transparent; }
.lang-grid a:hover { background: rgba(246, 242, 234, .06); }
.lang-grid a[aria-current="true"] { border-color: var(--sun); color: var(--sun); }
.lang-flag { font-size: 1.1em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.lang-grid a[data-available="false"] { color: var(--text-2); }
.lang-note { margin-inline-start: auto; font-size: .62rem; font-weight: 600; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; color: var(--text-3); }

.burger { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.burger svg { width: 22px; height: 22px; }
.burger .ic-close { display: none; }
.hdr.is-open .burger .ic-close { display: block; }
.hdr.is-open .burger .ic-menu { display: none; }

/* Mobile sheet (links are in the DOM; the sheet is the same nav list) */
@media (max-width: 1023px) {
  .nav .mega { width: min(48rem, calc(100vw - 2rem)); }
}
@media (max-width: 767px) {
  .burger { display: inline-flex; }
  .hdr-inner { grid-template-columns: auto 1fr auto; }
  .nav { display: none; }
  .dl-link span { display: none; }
  .dl-link { padding: .45rem .7rem; }
  .hdr.is-open .nav {
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 90; overflow-y: auto;
    background: var(--bg); padding: 1rem var(--gutter) calc(2rem + env(safe-area-inset-bottom, 0px));
  }
  .hdr.is-open .nav > li { border-block-end: 1px solid var(--line); }
  .hdr.is-open .nav-link, .hdr.is-open .nav-btn { width: 100%; justify-content: space-between; padding: 1rem .25rem; border-radius: 0; font-size: 1.1rem; }
  .hdr.is-open .nav-btn::after { margin-inline-start: auto; }
  .mega { position: static; transform: none; width: auto; box-shadow: none; border: 0; background: transparent; padding: 0 0 1rem; }
  .mega-grid, .mega-grid--3 { grid-template-columns: 1fr; }
  /* Drops down below the header rather than up from the bottom edge, where
     Safari's floating toolbar can cover the last rows; above the nav sheet. */
  .lang-panel { position: fixed; inset: var(--header-h) .5rem auto .5rem; width: auto; z-index: 95; max-height: calc(100dvh - var(--header-h) - 1rem); overscroll-behavior: contain; }
  .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.is-locked { overflow: hidden; }
}
@media (max-width: 420px) {
  .lockup span { display: none; }
}

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

.hero { position: relative; overflow: clip; isolation: isolate; }
.sky {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  background: radial-gradient(120% 90% at 50% 100%, #0a1430 0%, var(--bg) 70%);
}
.sky canvas { width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding-block: clamp(3rem, 8vw, 7rem) clamp(2rem, 6vw, 5rem);
  min-height: calc(100svh - var(--header-h));
}
@media (min-width: 1024px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.hero-copy h1 { max-width: 14ch; }
.hero-copy .lead { margin-block-start: 1.5rem; font-size: clamp(1.125rem, 1.6vw, 1.3rem); }
.hero-cta { margin-block-start: 2rem; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.hero-cta .fine { max-width: 32ch; }
.hero-media .live-scene { margin: 0; }
.hero-media figcaption { margin-block-start: .75rem; }

/* App Store badge — official artwork, never modified, >= 40px tall, clear
   space of 1/4 badge height around it (margin). */
.badge { display: inline-block; line-height: 0; margin: 10px; }
.badge img { height: 48px; width: auto; }
.badge:focus-visible { outline-offset: 6px; }

/* --- Live scene ------------------------------------------------------------ */

.live-scene { position: relative; border-radius: var(--radius); overflow: clip; background: var(--bg-raised); }
.live-scene picture, .live-scene img.still { display: block; width: 100%; height: auto; }
.live-scene.has-mobile img.still { aspect-ratio: 3 / 2; object-fit: cover; }
@media (max-width: 767px) { .live-scene.has-mobile img.still { aspect-ratio: 4 / 5; } }
.live-scene video {
  /* max-width:none — the global max-width:100% would shrink the 600px box
     inside narrow scenes and letterbox the frame, shifting the picture. */
  position: absolute; top: 0; left: 0; transform-origin: 0 0; max-width: none;
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
  width: 600px; height: 1304px; /* intrinsic, replaced by JS */
  visibility: hidden;
}
.live-scene.is-playing video { opacity: 1; visibility: visible; }
.live-scene .occluder { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.live-scene figcaption, .scene-caption { font-size: .875rem; color: var(--text-3); margin-block-start: .75rem; max-width: none; }
.live-scene .mobile-only { display: none; }
@media (max-width: 767px) {
  .live-scene.has-mobile .desktop-only { display: none; }
  .live-scene.has-mobile .mobile-only { display: block; }
}
/* Environment-only motion: the whole scene (video + occluder inside) zooms
   1.00 -> 1.04 while it travels through the viewport. */
@supports (animation-timeline: view()) {
  .live-scene .zoom { animation: scene-zoom linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; transform-origin: 50% 50%; }
  @keyframes scene-zoom { from { transform: scale(1); } to { transform: scale(1.04); } }
}
.live-scene .zoom { position: relative; }

/* --- Proof bar (M6) -------------------------------------------------------- */

.proof { border-block: 1px solid var(--line); }
.proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem var(--gutter); padding-block: 2rem; }
@media (min-width: 768px) { .proof-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.proof-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 600; color: var(--data); line-height: 1.1; }
.proof-label { color: var(--text-2); font-size: .95rem; margin-block-start: .25rem; }

/* --- Chapters (text / media alternating) ---------------------------------- */

.chapter { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 1024px) {
  .chapter { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .chapter--media-left .chapter-media { order: -1; }
}
.chapter h2 { margin-block-end: 1rem; }
.chapter .lead { margin-block-end: 1.25rem; }
.examples { list-style: none; padding: 0; display: grid; gap: .5rem; margin-block: 1.25rem; }
.examples li { position: relative; padding-inline-start: 1.5rem; color: var(--text-2); }
.examples li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--sun); }
.arrow-link { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.arrow-link::after { content: "→"; transition: transform .15s ease; }
[dir="rtl"] .arrow-link::after { content: "←"; }
.arrow-link:hover::after { transform: translateX(3px); }
.chapter-extra { margin-block-start: clamp(2rem, 4vw, 3rem); }

/* --- Cards (Und außerdem) ---------------------------------------------------- */

.cards { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: block; color: var(--text); text-decoration: none; border-radius: var(--radius); overflow: clip; background: var(--bg-raised); border: 1px solid var(--line); transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: rgba(246, 178, 78, .5); color: var(--text); transform: translateY(-2px); }
.card picture, .card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.card-body { padding: 1.25rem 1.25rem 1.5rem; }
.card h3 { margin-block-end: .5rem; }
.card p { color: var(--text-2); font-size: .95rem; }

/* --- Tiles (features hub, cluster teaser) ------------------------------------ */

.tiles { list-style: none; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tiles--2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.tile {
  display: grid; grid-template-rows: auto 1fr; gap: .75rem; height: 100%;
  padding: 1.5rem; border-radius: var(--radius); background: var(--bg-raised); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: border-color .2s ease, transform .2s ease;
}
.tile:hover { border-color: rgba(246, 178, 78, .5); color: var(--text); transform: translateY(-2px); }
.tile svg { width: 2rem; height: 2rem; color: var(--sun); }
.tile h3 { font-size: 1.2rem; }
.tile p { color: var(--text-2); font-size: .95rem; }
.tile--cluster { display: block; }
.tile--cluster:hover { transform: none; }
.tile--cluster h3 { margin-block-end: .35rem; }
.tile--cluster h3 a { color: var(--text); text-decoration: none; }
.tile--cluster h3 a:hover { color: var(--sun); }
.tile--cluster .tile-links { list-style: none; padding: 0; margin-block-start: .9rem; display: grid; gap: .35rem; }
.tile--cluster .tile-links a { color: var(--text); text-decoration: none; font-size: .95rem; }
.tile--cluster .tile-links a:hover { color: var(--sun); }
.tile--cluster .tile-links li::before { content: "› "; color: var(--sun); }

/* --- Story teaser, FAQ, CTA ------------------------------------------------- */

.story-teaser { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 1024px) { .story-teaser { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.story-teaser img { border-radius: var(--radius); }

.faq { max-width: var(--measure); }
.faq h2 { margin-block-end: 1.5rem; }
.faq details { border-block-start: 1px solid var(--line); }
.faq details:last-of-type { border-block-end: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; font-weight: 600; font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: .25rem; top: .9rem; font-size: 1.5rem; color: var(--sun); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding-block: 0 1.25rem; color: var(--text-2); }

.cta-scene { position: relative; border-radius: var(--radius); overflow: clip; isolation: isolate; }
.cta-scene .live-scene { border-radius: 0; }
.cta-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
}
@media (min-width: 1024px) {
  /* Panel on the right: the device in L2 stands in the left third of the
     scene, and the copy must sit beside the device, never over it. */
  .cta-scene .cta-panel {
    position: absolute; inset: 0 0 0 auto; z-index: 2; width: min(44%, 36rem);
    display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(to left, rgba(5, 5, 6, .92) 55%, rgba(5, 5, 6, 0));
    padding-inline-start: clamp(3rem, 6vw, 6rem);
  }
}
.cta-panel h2 { margin-block-end: 1rem; }
.cta-panel .badge { margin-inline-start: -10px; margin-block-start: 1rem; }

.cta-block { text-align: center; padding-block: calc(var(--section) / 2); border-block-start: 1px solid var(--line); }
.cta-block h2 { margin-block-end: .75rem; }
.cta-block p { margin-inline: auto; color: var(--text-2); }
.cta-block .badge { margin-block-start: 1.25rem; }

/* --- Breadcrumbs, page heads ---------------------------------------------------- */

.crumbs { font-size: .875rem; color: var(--text-3); padding-block: 1rem; }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.crumbs li + li::before { content: "›"; margin-inline-end: .35rem; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--sun); }

.page-head { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem); }
.page-head h1 { max-width: 18ch; }
.page-head .lead { margin-block-start: 1.25rem; max-width: var(--measure); }
.page-head--split { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 1024px) { .page-head--split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.page-head--split h1 { font-size: clamp(2.25rem, 4.5vw, 4rem); }

/* --- Feature page --------------------------------------------------------------- */

.answers { list-style: none; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 768px) { .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.answers li { padding: 1rem 1.25rem; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); font-weight: 500; max-width: none; }
.answers li::before { content: "? "; color: var(--data); font-family: var(--font-mono); }

.steps { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.step { counter-increment: step; padding-block-start: 1rem; border-block-start: 1px solid var(--line); }
.step::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); color: var(--data); font-size: .85rem; display: block; margin-block-end: .5rem; }
.step h2, .step h3 { font-size: 1.375rem; line-height: 1.25; margin-block-end: .5rem; }
.step p { color: var(--text-2); }

.facts { width: 100%; border-collapse: collapse; font-size: .95rem; max-width: var(--measure); }
.facts th, .facts td { text-align: start; padding: .75rem 1rem; vertical-align: top; }
.facts th { font-weight: 500; color: var(--text-2); width: 40%; }
.facts td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .9rem; }
.facts tr:nth-child(odd) { background: var(--bg-raised); }
.facts tr { border-block-start: 1px solid var(--line); }
.facts tr:last-child { border-block-end: 1px solid var(--line); }

.note { padding: 1rem 1.25rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--text-2); max-width: var(--measure); }
.note strong { color: var(--text); }
.note--sun { border-inline-start: 3px solid var(--sun); }
.note--eclipse { border-inline-start: 3px solid var(--eclipse); }
.note--eclipse strong { color: var(--eclipse); }

.linkbox { padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-raised); }
.linkbox h2, .linkbox h3 { font-size: 1.1rem; margin-block-end: .75rem; }
.linkbox ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.linkbox a { text-decoration: none; }
.linkbox a:hover { text-decoration: underline; }
.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Device (Apple bezel, unmodified) -------------------------------------------- */

.device { margin-inline: auto; width: min(100%, 22rem); position: relative; }
.device img.frame, .device img.shot { width: 100%; height: auto; min-height: 200px; }
.device--live .screen {
  position: absolute; left: 5.102%; top: 2.2%; width: 89.796%; height: 95.6%;
  border-radius: 14.4% / 6.6%; overflow: clip; background: #000;
}
.device--live video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; }
.device--live.is-playing video { opacity: 1; }
.device--live img.frame { position: relative; z-index: 2; }
.device-wrap { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 768px) { .device-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.device-wrap figcaption, .device-caption { font-size: .875rem; color: var(--text-3); margin-block-start: .75rem; text-align: center; }

/* --- Guide article ----------------------------------------------------------------- */

.article { max-width: var(--measure); }
.article-head { padding-block: clamp(1rem, 3vw, 2rem) 2rem; }
.article-head h1 { font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.08; }
.byline { color: var(--text-3); font-size: .875rem; margin-block-start: 1rem; display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.summary {
  margin-block: 1.5rem 2.5rem; padding: 1.25rem 1.5rem;
  border: 1px solid var(--line); border-inline-start: 3px solid var(--sun); background: var(--bg-raised); border-radius: 0 10px 10px 0;
  font-size: 1.1rem;
}
.summary .kicker { margin-block-end: .5rem; }
.summary p { max-width: none; }
.summary--notice { border-inline-start-color: var(--eclipse); font-size: 1rem; color: var(--text-2); margin-block-start: -1.5rem; }
.summary--notice strong { color: var(--eclipse); }
.article h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; margin-block: 2.5rem 1rem; }
.article h3 { margin-block: 2rem .75rem; }
.article p, .article li { color: var(--text-2); }
.article p strong, .article li strong { color: var(--text); font-weight: 600; }
.article ul, .article ol { margin-block: 1rem; display: grid; gap: .5rem; }
.article table { width: 100%; border-collapse: collapse; margin-block: 1.25rem; font-size: .95rem; }
.article th, .article td { text-align: start; padding: .6rem .75rem; border-block-end: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.article th { color: var(--text); font-weight: 600; }
.article td:not(:first-child) { font-family: var(--font-mono); font-size: .88rem; font-variant-numeric: tabular-nums; }
.article blockquote { margin-block: 1.25rem; padding: 1rem 1.25rem; border-inline-start: 3px solid var(--eclipse); background: var(--bg-raised); border-radius: 0 10px 10px 0; color: var(--text-2); }
.article blockquote strong { color: var(--eclipse); }
.article .table-wrap { overflow-x: auto; }
.app-answer { margin-block: 3rem; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--radius); background: var(--bg-raised); border: 1px solid var(--line); }
.app-answer .kicker { color: var(--data); }
.app-answer h2 { margin-block-start: 0; }
.app-answer-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 768px) { .app-answer-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } .app-answer .device { position: sticky; top: calc(var(--header-h) + 1rem); } }
.app-answer .device { width: min(100%, 17rem); }
.article .faq { margin-block: 3rem; }
.article .faq h2 { margin-block-start: 0; }
.article-side { display: grid; gap: 1.5rem; margin-block: 3rem; }
@media (min-width: 768px) { .article-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Glossary ------------------------------------------------------------------- */

.glossary-letters { display: flex; flex-wrap: wrap; gap: .35rem; margin-block: 1.5rem 2.5rem; list-style: none; padding: 0; }
.glossary-letters a { display: inline-flex; min-width: 2.2rem; justify-content: center; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-family: var(--font-mono); font-size: .9rem; color: var(--text); }
.glossary-letters a:hover { border-color: var(--sun); color: var(--sun); }
.glossary-group { padding-block: 1.5rem; border-block-start: 1px solid var(--line); display: grid; gap: 1rem; }
@media (min-width: 768px) { .glossary-group { grid-template-columns: 4rem minmax(0, 1fr); } }
.glossary-group > h2 { font-family: var(--font-mono); font-size: 2rem; color: var(--sun); line-height: 1; }
.glossary-group dl { display: grid; gap: 1.5rem; max-width: var(--measure); }
.glossary-group dt { font-weight: 650; font-size: 1.1rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.glossary-group dt:target { color: var(--sun); }
.glossary-group dd { color: var(--text-2); margin-block-start: .35rem; }
.glossary-group dd .fine { display: block; margin-block-start: .35rem; }

/* --- Explanatory graphics ---------------------------------------------------------- */
/* Allowed (owner 2026-10-31): general explanations — M3 moon-phase band, M5
   twilight ladder — and the decorative star field M1 (.sky). Forbidden: anything
   resembling an app view (M2 world map, M4 sun arcs) — removed. */

.motion { position: relative; border-radius: var(--radius); overflow: clip; background: var(--bg-raised); border: 1px solid var(--line); }
.motion svg { width: 100%; height: auto; display: block; }
.motion-figure { margin-block: 2rem; }
.motion-figure figcaption { font-size: .875rem; color: var(--text-3); margin-block-start: .5rem; max-width: none; }

/* M5 twilight ladder: pure CSS gradient, scroll-driven reveal */
.twilight { position: relative; }
.twilight-bar { height: 2.25rem; border-radius: 8px; background: linear-gradient(to right, var(--twilight-4) 0%, var(--twilight-3) 22%, var(--twilight-2) 50%, var(--twilight-1) 78%, #03050c 100%); }
.twilight-ticks { position: relative; height: 3.25rem; font-family: var(--font-mono); font-size: .75rem; color: var(--text-2); }
.twilight-ticks span { position: absolute; top: .35rem; transform: translateX(-50%); white-space: nowrap; }
.twilight-ticks span::before { content: ""; position: absolute; left: 50%; top: -0.75rem; height: .55rem; border-inline-start: 1px solid var(--text-3); }
.twilight-bands { display: grid; gap: .4rem; margin-block-start: .75rem; font-size: .85rem; list-style: none; padding: 0; }
.twilight-bands li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .35rem 0; border-block-end: 1px solid var(--line); color: var(--text-2); max-width: none; }
.twilight-bands li span:last-child { font-family: var(--font-mono); color: var(--data); }
@supports (animation-timeline: view()) {
  .twilight-bar { clip-path: inset(0 100% 0 0 round 8px); animation: reveal linear both; animation-timeline: view(); animation-range: entry 20% cover 60%; }
  @keyframes reveal { to { clip-path: inset(0 0 0 0 round 8px); } }
}
@supports not (animation-timeline: view()) { .twilight-bar { clip-path: none; } }

/* --- About ------------------------------------------------------------------------- */

.about-story { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 1024px) { .about-story { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .about-story--flip .about-media { order: -1; } }
.about-story img { border-radius: var(--radius); }
.about-media { display: grid; gap: 1.5rem; }
.about-story p { color: var(--text-2); }
.about-story h2 { margin-block-end: 1rem; }

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

.ftr { margin-block-start: auto; border-block-start: 1px solid var(--line); padding-block: 3rem 2rem; font-size: .9rem; color: var(--text-2); }
.ftr-grid { display: grid; gap: 2rem; }
@media (min-width: 640px) { .ftr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ftr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ftr h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-block-end: .9rem; }
.ftr ul { list-style: none; padding: 0; display: grid; gap: .45rem; }
.ftr a { color: var(--text-2); text-decoration: none; }
.ftr a:hover { color: var(--sun); }
.ftr-lang { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ftr-bottom { margin-block-start: 2.5rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--line); display: grid; gap: .75rem; color: var(--text-3); font-size: .85rem; }
.ftr-brand { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ftr-brand img { height: 20px; width: auto; opacity: .85; }
.ftr-bottom p { max-width: none; }

/* --- Reduced motion ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .live-scene .zoom { transform: none !important; }
  .twilight-bar { clip-path: none !important; }
}

/* --- Utilities ------------------------------------------------------------------ */

.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt-1 { margin-block-start: 1rem; }
.mt-2 { margin-block-start: 2rem; }
.mt-3 { margin-block-start: 3rem; }
.center { text-align: center; }
.center p { margin-inline: auto; }
