/* KDT Apps — shared design system.
   Mirrors the KDTV app: deep blue gradients, Apple-style glass, blue focus. */

:root {
  --ink: #05080f;
  --ink-2: #070d18;
  --blue: #2b77ff;
  --blue-bright: #4c9dff;
  --blue-deep: #123a72;

  --text: #f3f7ff;
  --text-2: rgba(233, 241, 255, 0.72);
  --text-3: rgba(215, 228, 250, 0.5);

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-strong: rgba(255, 255, 255, 0.18);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --pill: 999px;

  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 40px 100px rgba(0, 0, 0, 0.6);

  --maxw: 1180px;
  --gutter: clamp(18px, 4vw, 40px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Fixed atmosphere behind everything — the app's background gradient. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 12% -8%, rgba(43, 119, 255, 0.30), transparent 62%),
    radial-gradient(1000px 620px at 92% 2%, rgba(18, 58, 114, 0.55), transparent 60%),
    radial-gradient(900px 900px at 50% 108%, rgba(43, 119, 255, 0.14), transparent 62%),
    linear-gradient(180deg, #061020 0%, #05080f 46%, #04070e 100%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(76, 157, 255, 0.35); }

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

/* ---------------------------------------------------------------- layout */

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 7vw, 104px) 0; }
.section--tight { padding: clamp(44px, 6vw, 80px) 0; }

.center { text-align: center; }
.stack { display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ type */

h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }

.h-hero { font-size: clamp(2.5rem, 6.4vw, 4.6rem); letter-spacing: -0.035em; font-weight: 800; }
.h-section { font-size: clamp(1.9rem, 4.2vw, 3rem); letter-spacing: -0.03em; }
.h-card { font-size: clamp(1.1rem, 1.6vw, 1.3rem); }

.lede { font-size: clamp(1.05rem, 1.55vw, 1.3rem); color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 0.9rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-bright));
}
.center .eyebrow::before { display: none; }

.grad {
  background: linear-gradient(120deg, #ffffff 12%, #9ec6ff 58%, #4c9dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----------------------------------------------------------------- glass */

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--shadow);
}

.glass-soft {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff;
  box-shadow: 0 12px 34px rgba(43, 119, 255, 0.42);
}
.btn-primary:hover { box-shadow: 0 18px 44px rgba(43, 119, 255, 0.55); }

.btn-glass {
  background: var(--glass-strong);
  border-color: var(--stroke-strong);
  color: var(--text);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); }

.btn-ghost { color: var(--text-2); padding: 10px 14px; }
.btn-ghost:hover { color: var(--text); }

/* Store buttons: icon + two-line label, App Store style. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 16px;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.store:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}
.store svg { width: 26px; height: 26px; flex-shrink: 0; }
.store span { display: block; font-size: 0.68rem; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3; }
.store strong { display: block; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ chip */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--pill);
  background: var(--glass);
  border: 1px solid var(--stroke);
  font-size: 0.88rem;
  color: var(--text-2);
}
.chip svg { width: 16px; height: 16px; opacity: 0.85; }
.chip strong { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-link { transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.chip-link:hover { color: var(--text); background: var(--glass-strong); border-color: var(--stroke-strong); transform: translateY(-2px); }

.stars { color: #ffc960; letter-spacing: 2px; font-size: 0.95rem; }

/* --------------------------------------------------------------- devices */

/* Bezel frames. The screen cutouts in the PNGs are transparent and pixel-exact
   for these screenshots, so the shot is positioned at the measured percentages
   and the bezel is layered over it (notch and camera stay on top). */
.device { position: relative; width: 100%; }
.device img.bezel { position: relative; z-index: 2; width: 100%; height: auto; pointer-events: none; }
.device .shot {
  position: absolute;
  z-index: 1;
  object-fit: cover;
  background: #000;
}

.device--tv .shot { left: 2.3953%; top: 4.2806%; width: 89.3023%; height: 77.6978%; }
/* The same Apple TV frame cropped to the display alone — no box or remote, so
   smaller devices can sit against its bottom edge without colliding with them. */
.device--tv-screen .shot { left: 0.6934%; top: 1.4388%; width: 98.6133%; height: 97.1223%; }
.device--phone .shot { left: 5.3333%; top: 2.5%; width: 89.3333%; height: 95%; border-radius: 15.4%/7.1%; }
.device--phone-land .shot { left: 2.5%; top: 5.3333%; width: 95%; height: 89.3333%; border-radius: 9.5%/20.6%; }
/* iPad Pro 13" — the cutouts are pixel-exact for the 2064x2752 screenshots. */
.device--ipad .shot { left: 5.1304%; top: 4.1333%; width: 89.7391%; height: 91.7333%; border-radius: 1.95%/1.5%; }
.device--ipad-land .shot { left: 4.1333%; top: 5.1304%; width: 91.7333%; height: 89.7391%; border-radius: 1.45%/1.95%; }
/* Pixel 9 Pro — a much thinner frame than the iPhone's, hence its own numbers. */
.device--android .shot { left: 1.983%; top: 1.0738%; width: 95.184%; height: 97.987%; border-radius: 14.3%/6.6%; }

/* Reserve each frame's box before its image loads. Without this the page is far
   shorter during load, so a cross-page anchor (/kdtivi#get) lands short and the
   artwork then pushes the target away underneath it. */
.device--tv img.bezel { aspect-ratio: 4300 / 2780; }
.device--tv-screen img.bezel { aspect-ratio: 3894 / 2224; }
.device--phone img.bezel { aspect-ratio: 1350 / 2760; }
.device--phone-land img.bezel { aspect-ratio: 2760 / 1350; }
.device--android img.bezel { aspect-ratio: 1412 / 2980; }
.device--ipad img.bezel { aspect-ratio: 2300 / 3000; }
.device--ipad-land img.bezel { aspect-ratio: 3000 / 2300; }

/* Every radius above is measured from the bezel PNG's own screen hole (flood-filled,
   then rounded UP by a few percent). Under-rounding lets a screenshot's square corner
   show outside the frame; over-rounding only shaves an invisible sliver of dark UI. */

.device--glow::after {
  content: "";
  position: absolute;
  inset: 8% 6% -14%;
  z-index: 0;
  background: radial-gradient(60% 60% at 50% 50%, rgba(43, 119, 255, 0.55), transparent 70%);
  filter: blur(60px);
}

/* ------------------------------------------------------------------ rail */

.rail {
  display: flex;
  gap: clamp(16px, 2.4vw, 28px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px var(--gutter) 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.rail > * { scroll-snap-align: center; flex: 0 0 auto; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; }
.rail::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 12, 24, 0.62);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -0.02em; font-size: 1.06rem; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 13px;
  border-radius: var(--pill);
  font-size: 0.93rem;
  color: var(--text-2);
  transition: color 0.16s ease, background 0.16s ease;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.nav-cta { margin-left: 8px; padding: 10px 18px; font-size: 0.93rem; }

@media (max-width: 860px) {
  .nav a:not(.nav-keep) { display: none; }
  .site-header .wrap { height: 62px; }
}

/* ---------------------------------------------------------- announcement */

.announce {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px auto 0;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(43, 119, 255, 0.16), rgba(43, 119, 255, 0.05));
  border: 1px solid rgba(76, 157, 255, 0.35);
}
.announce .badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(76, 157, 255, 0.2);
  color: var(--blue-bright);
  flex-shrink: 0;
}
.announce .badge svg { width: 18px; height: 18px; }
.announce p { font-size: 0.94rem; color: var(--text-2); }
.announce strong { color: var(--text); }
.announce .close {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px;
}
.announce .close:hover { color: var(--text); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 56px 0 44px;
  color: var(--text-3);
  font-size: 0.9rem;
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px 64px; justify-content: space-between; }
.site-footer h4 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); margin-bottom: 14px; }
.site-footer ul { list-style: none; display: grid; gap: 9px; }
.site-footer a:hover { color: var(--text); }
.social-row { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.site-footer .legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.06); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* --------------------------------------------------------------- reveals */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .store:hover { transform: none; }
}

/* ------------------------------------------------------- document pages */

/* Legal and support copy: one readable column on the same dark ground. */
.doc { max-width: 74ch; margin: 0 auto; padding: clamp(40px, 6vw, 76px) 0 clamp(56px, 8vw, 96px); }
.doc h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.03em; margin-bottom: 10px; }
.doc h2 { font-size: clamp(1.25rem, 2vw, 1.55rem); margin: 42px 0 12px; }
.doc h3 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--text); }
.doc p, .doc li { color: var(--text-2); }
.doc p { margin-bottom: 14px; }
.doc ul, .doc ol { margin: 0 0 18px 22px; display: grid; gap: 8px; }
.doc a { color: var(--blue-bright); }
.doc a:hover { text-decoration: underline; }
.doc strong { color: var(--text); }
.doc hr { border: 0; border-top: 1px solid var(--stroke); margin: 34px 0; }
.doc table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--stroke); color: var(--text-2); }
.doc th { color: var(--text); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.doc .updated { color: var(--text-3); font-size: .92rem; margin-bottom: 30px; }
