/* =====================================================================
   The one stylesheet for the apps site.
   Dark and native: the system face, a soft palette instead of pure white
   on black, glass cards, and an ambient glow of the app's accent behind a
   blurred header. Every page shares it; an app changes only its accent,
   which tools/build.py writes on <html> (and on each hub icon) as four
   contrast-checked roles. Nothing here names an app.
   ===================================================================== */

:root {
  color-scheme: dark;

  --bg: #0E0E10;
  --ink: #EDEDF0;
  --ink-2: #A2A2A9;
  --ink-3: #85858D;
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.075);
  --chassis: #2A2A2E;

  /* The hub's neutral accent; app pages override all four inline. */
  --accent: #8E8E96;
  --accent-fill: #EDEDF0;
  --on-accent: #111113;
  --accent-ink: #EDEDF0;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 24px;
  --maxw: 1080px;
  --wide: 1480px;   /* header, footer and the app page share one width on every page */
  --readw: 880px;
  --radius: 18px;
}
@media (max-width: 640px) { :root { --gutter: 20px; } }

/* Moving between pages is a short cross-fade over the shared header instead of
   a blank frame (same-origin navigations; browsers without it just navigate). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scrollbar-gutter: stable; }
body {
  position: relative; isolation: isolate; margin: 0; min-width: 320px; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 0.92em; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100%, var(--maxw)); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: fixed; z-index: 100; top: 8px; left: 8px; padding: 8px 12px; border-radius: 8px;
  background: var(--ink); color: var(--bg); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Ambient glow: the app's colour behind the header, fading into the page.
   The hub mixes every app's colour (--glow-1..3 on <html>). */
body::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: min(760px, 100%); pointer-events: none;
  /* Sized in pixels, not percentages: the glow keeps its shape on any width
     instead of stretching into vertical bands on a narrow phone. Never taller
     than the page, or a short window could scroll to empty glow. */
  background: radial-gradient(760px 520px at 50% -80px, color-mix(in srgb, var(--accent) 24%, transparent), transparent 72%);
}
:root:not([data-app]) body::before {
  background:
    radial-gradient(520px 440px at 22% -80px, color-mix(in srgb, var(--glow-1, transparent) 20%, transparent), transparent 72%),
    radial-gradient(520px 440px at 50% -80px, color-mix(in srgb, var(--glow-2, transparent) 16%, transparent), transparent 72%),
    radial-gradient(520px 440px at 78% -80px, color-mix(in srgb, var(--glow-3, transparent) 18%, transparent), transparent 72%);
}

/* App icons: a hairline keeps a dark icon from dissolving into the page. */
.hero-icon, .app-icon, .app-tab img, .doc-back img {
  border-radius: 22.37%; outline: 1px solid rgba(255, 255, 255, 0.1); outline-offset: -1px;
}

/* ---------- header: a quiet glass bar with the app switcher, on app pages only ---------- */
.site-header {
  position: relative; z-index: 30;
  background: rgba(255, 255, 255, 0.025);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { --maxw: var(--wide); display: flex; justify-content: center; height: 56px; }

/* Switcher between apps, centred in the header: plain icons and names, the
   current one bright with a dot of its colour. */
.app-switch { display: flex; }
/* Each tab is a full-height hit area; the padding fills the gaps between tabs. */
.app-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 11px;
  color: var(--ink-3); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color .15s ease;
}
.app-tab img { width: 22px; height: 22px; flex: none; opacity: 0.5; transition: opacity .15s ease; }
.app-tab:hover { color: var(--ink); }
.app-tab:hover img, .app-tab[aria-current] img { opacity: 1; }
.app-tab[aria-current] { color: var(--ink); }
/* With names shown, the current app is underlined just below its label,
   clear of the header's edge. */
.app-tab[aria-current]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 9px; height: 2px;
  border-radius: 2px; background: var(--accent);
}

/* Language: one button at the end of the footer; a tap switches to the other language. */
.lang {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 10px 0 9px;
  margin-block: -6px;   /* never makes the footer taller than its text */
  border: 0; border-radius: 9px; cursor: pointer; user-select: none;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2); font: 600 13px/1 var(--font); letter-spacing: 0.02em;
  transition: background .15s ease, color .15s ease;
}
.lang[hidden] { display: none; }
.lang:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang svg { width: 15px; height: 15px; flex: none; }

/* ---------- app page: one screen, details left, phones right ---------- */
.app-grid {
  --maxw: var(--wide);
  /* Pinned to the top, never centred: every app's icon and phones land on the
     same lines whatever the length of its text. */
  display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; align-content: start; gap: 56px;
  min-height: calc(100svh - 56px - 84px); padding-block: 40px 36px;   /* header and footer share the screen */
}
.app-info { display: flex; flex-direction: column; }
.app-id { display: flex; align-items: flex-start; gap: 18px; }
.hero-icon {
  width: 88px; height: 88px; flex: none;
  box-shadow: 0 22px 48px -20px color-mix(in srgb, var(--accent) 75%, transparent);
}
.hero-kind { color: var(--accent-ink); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.hero-name { margin-top: 2px; font-size: clamp(32px, 3.2vw, 42px); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; }
/* Fixed text slots: the subtitle always takes two lines and the description
   four, so badges and facts sit at the same height on every app's page. */
.hero-tagline { min-height: calc(2 * 1.4em); margin-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.hero-lead { min-height: calc(4 * 1.6em); margin-top: 18px; color: #CFCFD4; font-size: 15px; line-height: 1.6; }

/* Store badges, drawn like the official ones. */
.get { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 16px 0 13px;
  border-radius: 11px; background: #000000; color: #FFFFFF; text-decoration: none;
  box-shadow: inset 0 0 0 1px #A6A6A6; transition: transform .15s ease, box-shadow .15s ease;
}
a.badge:hover { box-shadow: inset 0 0 0 1px #FFFFFF; transform: translateY(-1px); }
a.badge:active { transform: translateY(0) scale(0.98); }
.badge svg { width: 24px; height: 24px; flex: none; }
.badge > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; text-align: left; }
.badge small { font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em; }
.badge b { margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.badge--appstore svg { margin-top: -3px; }
.badge--googleplay small { font-size: 9px; letter-spacing: 0.06em; }
.badge--googleplay b { font-weight: 500; letter-spacing: -0.01em; }
.badge[aria-disabled] { opacity: 0.42; cursor: default; }
.badge-soon { position: relative; display: inline-flex; }
.soon { color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.badge-soon .soon {
  position: absolute; top: -9px; right: -8px; padding: 3px 8px; border-radius: 999px;
  background: #2C2C30; box-shadow: inset 0 0 0 1px var(--line);
}

.fact-list, .doc { background: var(--card); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.fact-list { margin-top: 22px; padding: 2px 16px; }
.fact-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fact-list > div:first-child { border-top: 0; }
.fact-list dt { flex: none; color: var(--ink-2); }
.fact-list dd { text-align: right; }

/* Phones: real iPhone 16 Pro Max bezels (fastlane/frameit-frames); the
   screenshot sits in the frame's screen window, the frame on top. The
   height cap keeps all three on the first screen of a laptop. */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 18px; }
.phone {
  position: relative; width: 100%; max-width: min(340px, calc((100svh - 220px) * 0.49)); margin-inline: auto; aspect-ratio: 1470 / 3000;
  filter: drop-shadow(0 30px 34px rgba(0, 0, 0, 0.55));
}
.phone img {
  position: absolute; left: 5.102%; top: 2.2%; width: 89.796%; height: 95.6%;
  object-fit: cover; object-position: top; background: #000000;
  border-radius: 14.4% / 6.62%;   /* the bezel's screen corner: ~190 px on the 1320 px screen */
}
/* A localized pair shows the page language; the hidden one is lazy and never loads. */
:root:lang(uk) .phone .shot-en, :root:not(:lang(uk)) .phone .shot-uk { display: none; }
.phone::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/assets/iphone-frame.webp") center / 100% 100% no-repeat;
}

.pager { display: none; }

/* ---------- hub: a home screen of icons on frosted glass ---------- */
.hub-intro { padding: 76px 0 0; text-align: center; }
.hub-title { font-size: clamp(32px, 4.4vw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -0.032em; }
.hub-lead { max-width: 31em; margin: 14px auto 0; color: var(--ink-2); font-size: 17px; }
.hub-apps { padding: 72px 0 104px; }
@media (min-width: 761px) {
  .hub:not(.not-found) { display: grid; align-content: center; }   /* the apps sit mid-screen */
  .hub-apps { padding-block: 40px; }
}
.app-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 200px)); justify-content: center;
  gap: 36px 20px; max-width: 760px; margin-inline: auto; padding: 44px 24px 40px;
  border-radius: 36px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
}
.app-link { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; }
.app-icon {
  width: 96px; height: 96px; transition: transform .2s ease;
  box-shadow: 0 18px 38px -18px color-mix(in srgb, var(--accent) 80%, transparent);
}
.app-link:hover .app-icon { transform: translateY(-4px); }
.app-name { margin-top: 14px; font-size: 15px; font-weight: 600; }
.app-kind { margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.app-platforms { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; margin-top: 10px; color: var(--ink-2); }
.mark { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; }
.mark svg { width: 14px; height: 14px; flex: none; }
.mark .soon {
  margin-left: 2px; padding: 1px 6px; border-radius: 999px; color: var(--ink-2);
  font-size: 10.5px; font-weight: 600; background: rgba(255, 255, 255, 0.08);
}
.not-found-home { margin-top: 28px; }
.not-found-home a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
}

/* ---------- legal ---------- */
.legal-page { padding: 40px 0 72px; }
.legal-page .wrap { --maxw: 820px; }
.doc { padding: 36px clamp(20px, 5vw, 48px) 40px; }
.doc h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 700; line-height: 1.1; letter-spacing: -0.028em; }
.doc .updated { margin-top: 8px; color: var(--ink-3); font-size: 13.5px; }
.doc .tldr {
  margin: 22px 0 6px; padding: 15px 18px; border-radius: 14px; color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}
.doc .tldr strong { color: var(--accent-ink); }
.doc h2 { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 8px; font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; }
.doc h2 .num { flex: none; color: var(--accent-ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.doc p, .doc li { color: #C6C6CC; font-size: 15.5px; line-height: 1.66; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 10px 0; padding-left: 20px; list-style: disc; }
.doc li + li { margin-top: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--accent-ink); text-underline-offset: 3px; }
.doc-back { margin-top: 24px; text-align: center; }
.doc-back a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.doc-back a:hover { color: var(--ink); }
.doc-back img { width: 22px; height: 22px; }

/* ---------- footer ---------- */
.site-footer { padding: 26px 0 32px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
.site-footer .wrap { --maxw: var(--wide); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.site-footer a { color: var(--ink-2); text-decoration: none; transition: color .15s ease; }
.site-footer a:hover { color: var(--ink); }
.footer-copy { margin: 0 auto 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* Short laptop windows (browser bars and the Dock take ~150 px of a 900 px
   screen): tighter spacing keeps the footer on the first screen down to ~640 px. */
@media (min-width: 1001px) and (max-height: 760px) {
  .app-grid { min-height: calc(100svh - 114px); padding-block: 20px; }
  .phone { max-width: min(340px, calc((100svh - 160px) * 0.49)); }
  .hero-lead { margin-top: 12px; }
  .fact-list { margin-top: 14px; }
  .fact-list > div { padding: 7px 0; }
  .get { margin-top: 14px; }
  .site-footer { padding: 17px 0 18px; }
}

/* ---------- tablet: details above, phones below ---------- */
@media (min-width: 761px) and (max-width: 1000px) {
  .app-grid { grid-template-columns: 1fr; gap: 40px; min-height: 0; padding-block: 40px 56px; }
  .app-info { max-width: 560px; }
  .shots { max-width: 760px; }
  .phone { max-width: 240px; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .site-header .wrap { height: 52px; }
  /* Phone: identity, badges, screenshots to swipe, then facts and links. */
  .app-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding-block: 24px 40px; }
  .app-info { display: contents; }
  .app-id { order: 1; gap: 14px; }
  .hero-lead { order: 2; }
  .gallery { order: 3; margin-top: 24px; }
  .get { order: 4; justify-content: center; gap: 10px; margin-top: 18px; }
  .fact-list { order: 5; margin-top: 20px; }
  .hero-icon { width: 72px; height: 72px; }
  .hero-name { font-size: 30px; }
  .badge { height: 46px; padding: 0 13px 0 11px; gap: 8px; }
  .badge b { font-size: 19px; }
  .badge small { font-size: 9.5px; }
  .badge--googleplay small { font-size: 8.5px; }
  /* One phone per page: swipe snaps to the next screenshot, dots follow. */
  .gallery .shots {
    display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1); padding: 6px 0 14px;
    scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .gallery .shots::-webkit-scrollbar { display: none; }
  .gallery .shots > li { flex: 0 0 100%; display: flex; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; }
  .phone { width: min(64vw, 260px); max-width: none; margin-inline: 0; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.5)); }
  .pager { display: flex; justify-content: center; gap: 4px; }
  .pager button { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
  .pager button::before {
    content: ""; display: block; width: 7px; height: 7px; margin: auto; border-radius: 50%;
    background: rgba(255, 255, 255, 0.28); transition: background .2s ease, transform .2s ease;
  }
  .pager button[aria-current]::before { background: var(--ink); transform: scale(1.1); }
  .hub-intro { padding-top: 44px; }
  .hub-lead { font-size: 16px; }
  .hub-apps { padding: 28px 0 64px; }
  .app-platforms { justify-content: flex-start; }
  /* On a phone the hub is a list: icon, name, kind and platforms, chevron. */
  .app-list { display: block; padding: 4px 16px; border-radius: 22px; }
  .app-list li { position: relative; }
  .app-list li + li::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; border-top: 1px solid var(--line); }
  .app-link {
    display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; column-gap: 14px; align-items: center;
    grid-template-areas: "icon name chev" "icon kind chev" "icon plat chev";
    padding: 14px 0; text-align: left;
  }
  .app-link::after {
    content: ""; grid-area: chev; width: 7px; height: 7px; margin-right: 4px; transform: rotate(45deg);
    border-top: 1.75px solid var(--ink-3); border-right: 1.75px solid var(--ink-3);
  }
  .app-icon { grid-area: icon; width: 62px; height: 62px; }
  .app-link:hover .app-icon { transform: none; }
  .app-name { grid-area: name; align-self: end; margin-top: 0; font-size: 16px; }
  .app-kind { grid-area: kind; font-size: 13px; }
  .app-platforms { grid-area: plat; align-self: start; margin-top: 5px; }
  .legal-page { padding: 20px 0 48px; }
  .site-footer .wrap { justify-content: center; text-align: center; }
  .footer-copy { margin-right: 0; }
  .footer-links { justify-content: center; }
}
/* Narrower headers: the switcher keeps only the icons. */
@media (max-width: 860px) {
  .app-tab { padding: 0 9px; }
  .app-tab img { width: 26px; height: 26px; }
  .app-tab span { display: none; }
  .app-tab[aria-current]::after {   /* icons only: a dot instead of the underline */
    left: 50%; right: auto; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  }
}
@media (max-width: 560px) {
  .hero-lead { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
