/* Ridgeline — base: font, reset, type, stage/device layout */
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 1000; font-style: italic; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
/* Scrolling works everywhere; scrollbars are never drawn. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; background: transparent; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--stage);
  color: var(--ink);
  font: 400 16px/1.5 var(--f-ui);
  font-feature-settings: "tnum" 0, "ss01" 0;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1[tabindex="-1"]:focus-visible, main[tabindex="-1"]:focus-visible { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ---------- Type (one family, confident weights) ---------- */
.display { font-weight: 650; letter-spacing: -.04em; line-height: 1; font-size: 38px; text-wrap: balance; }
.display em { font-style: normal; color: var(--accent-text); }
.h1 { font-weight: 650; font-size: 26px; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.h2 { font-weight: 620; font-size: 19px; line-height: 1.14; letter-spacing: -.028em; }
.h3 { font-weight: 600; font-size: 16px; line-height: 1.25; letter-spacing: -.015em; }
.lede { font-size: 15.5px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; letter-spacing: -.005em; }
.body { font-size: 15px; }
.small { font-size: 13.5px; line-height: 1.45; }
.fine { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.eyebrow { font-weight: 560; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow--accent { color: var(--accent-text); }
.num {
  font-weight: 650; letter-spacing: -.045em; line-height: .95;
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1;
}
.num--s { font-size: 18px; letter-spacing: -.03em; }
.num--m { font-size: 27px; }
.num--l { font-size: 40px; }
.num--xl { font-size: 54px; letter-spacing: -.055em; }
.unit { font-weight: 520; font-size: .36em; letter-spacing: 0; margin-left: .3em; color: var(--ink-3); }

/* ---------- Stage / device ---------- */
.stage { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 72px; }
.side { display: none; }

.device { position: relative; width: 100%; height: 100vh; height: 100dvh; background: var(--bg); overflow: hidden; isolation: isolate; }
.app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
}
.screen > .page { padding: 0 var(--pad) var(--s8); }
.screen.enter > .page { animation: rise .42s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 600px) {
  .stage { padding: 24px; }
  .device {
    width: 390px; height: min(844px, calc(100dvh - 48px)); min-height: 620px;
    border-radius: 46px;
    box-shadow: 0 0 0 9px var(--bezel), 0 0 0 10.5px var(--line-2), var(--shadow-2);
  }
}

/* Desktop: navigator beside the phone */
@media (min-width: 1040px) {
  .side {
    display: flex; flex-direction: column; gap: var(--s6); width: 300px; align-self: center;
    max-height: calc(100dvh - 48px); overflow-y: auto; padding: 4px;
  }
  .side__title { font-weight: 650; font-size: 30px; letter-spacing: -.04em; line-height: 1.02; text-wrap: balance; }
  .side__nav { display: grid; gap: 2px; }
  .side__nav a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: 12px; font-weight: 520; font-size: 15px; color: var(--ink-2);
  }
  .side__nav a:hover { background: var(--bg-2); color: var(--ink); }
  .side__nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
  .side__group { display: grid; gap: var(--s2); }
  .side__note { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
  .side__note strong { color: var(--ink-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
