/* Native Screen website. Editorial: paper and ink, serif headlines, hairline rules, one accent.
   No gradients, no glow, no stacked shadows. Color comes from the demos. */

:root {
  --paper: #f5f3ee;
  --paper-2: #ece9e1;
  --ink: #171614;
  --ink-2: #4a4741;
  --muted: #7a766d;
  --rule: #d8d3c8;
  --accent: #4d2ff5;       /* the app's timeline purple */
  --accent-ink: #ffffff;
  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141312;
    --paper-2: #1d1c1a;
    --ink: #ece8df;
    --ink-2: #bdb8ad;
    --muted: #8d887e;
    --rule: #34322e;
    --accent: #8f7bff;
    --accent-ink: #141312;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141312;
  --paper-2: #1d1c1a;
  --ink: #ece8df;
  --ink-2: #bdb8ad;
  --muted: #8d887e;
  --rule: #34322e;
  --accent: #8f7bff;
  --accent-ink: #141312;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
code { font: 0.88em var(--mono); background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

section[id] { scroll-margin-top: 72px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* Masthead */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.masthead-row { display: flex; align-items: center; gap: 24px; height: 60px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.wordmark img { border-radius: 7px; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }

.theme-switch { display: flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; }
.theme-switch button {
  font: 500 12px var(--sans); color: var(--muted); background: none; border: 0; border-radius: 999px;
  padding: 4px 10px; cursor: pointer;
}
.theme-switch button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(48px, 8.6vw, 112px); line-height: 0.98; letter-spacing: -0.03em; }
h1 em, h2 em { font-style: italic; color: var(--ink-2); }
h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.05; }
h3 { font-size: 24px; line-height: 1.2; }
.kicker { font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 28px; }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 36em; margin: 0; }
.fine { font-size: 13px; color: var(--muted); margin: 0; }
.note { color: var(--muted); font-size: 15px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 6px;
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  font: 500 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.small { height: 30px; padding: 0 12px; font-size: 13px; }

/* Hero */
.hero { padding-top: clamp(48px, 9vw, 120px); }
.hero-foot { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: end; margin-top: 40px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.cta .fine { flex-basis: 100%; text-align: right; }

/* Demo placeholders: plain, labelled, easy to spot and replace */
.demo { margin: 56px 0 0; }
.placeholder {
  position: relative;
  aspect-ratio: var(--ratio, 16 / 9);
  width: 100%;
  border: 1px dashed var(--muted);
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, color-mix(in srgb, var(--rule) 55%, transparent) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, color-mix(in srgb, var(--rule) 55%, transparent) 31px 32px),
    var(--paper-2);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(14px, 2.4vw, 28px);
  overflow: hidden;
}
.placeholder p { margin: 6px 0 0; max-width: 46em; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.ph-label { font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.dark-ph { --paper-2: #1d1c1a; --rule: #34322e; --ink-2: #bdb8ad; }
.demo.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.demo.pair figure { margin: 0; }
.demo.pair figcaption { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 10px; }

/* Real media */
[hidden] { display: none !important; } /* `.media` sets display, which would beat the attribute */
.media { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--paper-2); }
.shot { border: 1px solid var(--rule); }
video.media { aspect-ratio: 16 / 9; object-fit: cover; }
.demo figcaption, .col-figure figcaption { font-size: 12px; color: var(--muted); margin-top: 10px; }
.ratio-frame video.fill { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }

/* Facts strip */
.facts { margin-top: 96px; }
.facts dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.facts dl > div { padding: 22px 20px 24px 0; }
.facts dl > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dt { font: 400 52px/1 var(--serif); letter-spacing: -0.02em; }
.facts dd { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }

/* Chapters */
.chapter { padding-top: clamp(88px, 12vw, 152px); }
.chapter-head { display: grid; grid-template-columns: 80px 1fr; gap: 0 24px; border-top: 1px solid var(--ink); padding-top: 22px; margin-bottom: 48px; }
.chapter-head .num { font: 500 13px var(--mono); color: var(--accent); padding-top: 12px; }
.chapter-head h2 { max-width: 16em; }

.cols { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.col-text > p:first-child { margin-top: 0; font-size: 18px; color: var(--ink-2); }
.col-figure { margin: 0; }
.col-figure figcaption { font-size: 12px; color: var(--muted); margin-top: 10px; }

.ticks, .steps { padding: 0; margin: 24px 0 0; list-style: none; }
.ticks li, .steps li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; }
.ticks li::before { content: "+"; font-family: var(--mono); color: var(--accent); margin-right: 12px; }
.steps { counter-reset: s; }
.cols > .steps { margin-top: 0; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s, decimal-leading-zero); font: 500 12px var(--mono); color: var(--accent); margin-right: 14px; }

/* Polish features */
.features { display: grid; gap: clamp(56px, 8vw, 104px); }
.feature { display: grid; grid-template-columns: 3fr 9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.feature:nth-child(even) { grid-template-columns: 9fr 3fr; }
.feature:nth-child(even) .feature-text { order: 2; }
.feature h3 { margin: 0; }
.feature p { color: var(--ink-2); font-size: 16px; margin: 10px 0 0; }
.feature-media { margin: 0; }

/* Aspect ratio stage */
.segmented { display: inline-flex; margin-top: 20px; border: 1px solid var(--ink); border-radius: 7px; padding: 2px; position: relative; }
.segmented button {
  position: relative; z-index: 1;
  font: 500 14px var(--sans); color: var(--ink); background: none; border: 0; border-radius: 5px;
  height: 34px; padding: 0 16px; cursor: pointer; transition: color 0.2s;
}
.segmented button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.ratio-stage { display: flex; align-items: center; justify-content: center; height: clamp(320px, 42vw, 480px); }
.ratio-frame {
  width: 100%; aspect-ratio: 16 / 9;
  transition: width 0.45s cubic-bezier(.2, .8, .2, 1), height 0.45s cubic-bezier(.2, .8, .2, 1);
}
.ratio-frame .placeholder { height: 100%; aspect-ratio: auto; }
@media (prefers-reduced-motion: reduce) { .ratio-frame { transition: none; } }

/* Notes grid */
.native { margin-bottom: 48px; }
.native-lede { margin: 0; max-width: 40em; font-size: 20px; line-height: 1.5; color: var(--ink-2); }
.grid-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.grid-notes > div { padding: 24px 24px 28px 0; border-bottom: 1px solid var(--rule); }
.grid-notes > div:not(:nth-child(3n + 1)) { padding-left: 24px; border-left: 1px solid var(--rule); }
.grid-notes h3 { font-size: 22px; }
.grid-notes p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }
.langs { font-family: var(--serif); font-size: 18px !important; line-height: 1.5; }

/* Download */
.download { padding-top: clamp(96px, 13vw, 168px); padding-bottom: 72px; }
.download h2 { font-size: clamp(56px, 9vw, 120px); line-height: 1; letter-spacing: -0.03em; }
.download > .lede { margin: 20px 0 48px; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); margin-bottom: 28px; }
.dl { padding: 28px 32px 32px 0; }
.dl + .dl { padding-left: 32px; border-left: 1px solid var(--rule); }
.dl-shot { margin-bottom: 24px; }
.dl h3 { font-size: 32px; display: flex; align-items: center; gap: 12px; }
.dl .fine { margin: 6px 0 20px; }
.dl > p:last-child, .dl details { color: var(--ink-2); font-size: 14px; margin-top: 16px; }
details summary { cursor: pointer; color: var(--ink); }
details p { margin: 10px 0 0; }

.footer { border-top: 1px solid var(--rule); padding-top: 24px; padding-bottom: 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.footer p { margin: 0; }

/* Narrow screens */
@media (max-width: 900px) {
  .nav { display: none; }
  .theme-switch { margin-left: auto; }
  .hero-foot, .cols { grid-template-columns: 1fr; }
  .cta { justify-content: flex-start; }
  .cta .fine { text-align: left; }
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-text { order: 0; }
  .grid-notes { grid-template-columns: 1fr 1fr; }
  .grid-notes > div { padding: 22px 20px 24px 0; border-left: 0 !important; }
  .grid-notes > div:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--rule) !important; }
  .facts dl { grid-template-columns: 1fr 1fr; }
  .facts dl > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts dl > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .chapter-head { grid-template-columns: 1fr; }
  .chapter-head .num { padding-top: 0; margin-bottom: 8px; }
  .grid-notes, .dl-grid, .demo.pair { grid-template-columns: 1fr; }
  .grid-notes > div { padding-left: 0 !important; border-left: 0 !important; }
  .dl + .dl { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .ratio-stage { height: 360px; }
  .facts dt { font-size: 40px; }
}
