/* Veil Layer · base.css · tokens, type, layout, nav, footer, shared pieces.
   Section styles live in assets/css/sections/<id>.css, every selector scoped under #<id>. */

/* Local fallback for Google Fonts Archivo (same family, wdth 100 to 125, wght 400 to 700) */
@font-face { font-family: "Archivo V"; src: url("../fonts/archivo-latin.woff2") format("woff2"); font-weight: 400 700; font-stretch: 100% 125%; font-style: normal; font-display: swap; }

:root {
  /* brand */
  --g1: #e6e6e6; --g2: #d4d4d4; --g3: #adadad;
  --ink: #000; --v: #6600ff; --v-dk: #a26bff; --v-err: #4b00bd;
  --muted: #4a4a4a; --muted-dk: #a6a6a6;
  /* layout */
  --m: clamp(20px, 4.4vw, 64px);
  --gut: clamp(14px, 1.8vw, 24px);
  --maxw: 1360px;
  --nav: 72px;
  --sec: clamp(88px, 10vw, 150px);
  /* motion */
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  /* type */
  --font: "Archivo", "Archivo V", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* layers (see NOTES.md) */
  --z-shard: 5; --z-sheet: 49; --z-nav: 50; --z-toast: 80; --z-skip: 100;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav) + 8px); }
html[data-motion="off"] { scroll-behavior: auto; }
body { margin: 0; background: var(--g2); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.5; font-stretch: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg, canvas, video { display: block; max-width: 100%; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--v); color: #fff; }
main:focus, [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: var(--z-skip); padding: 12px 18px; background: #000; color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--v); outline-offset: 3px; }
.dark :focus-visible, .foot :focus-visible { outline-color: var(--v-dk); }

/* layout primitives */
.wrap { width: min(100% - 2 * var(--m), var(--maxw)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); }
.grid > * { grid-column: 1 / -1; min-width: 0; }
.sec { position: relative; padding: var(--sec) 0; }
.dark { background: #000; color: var(--g1); }

/* type */
h1, h2, .display { font-stretch: 125%; font-weight: 600; letter-spacing: -0.035em; line-height: 0.95; }
h2 { font-size: clamp(40px, 5.9vw, 96px); text-wrap: balance; }
h3 { font-stretch: 118%; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.lede { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.5; max-width: 25em; }
.dark .lede { color: #c4c4c4; }
.fine { font-size: 14px; line-height: 1.5; color: var(--muted); }
.dark .fine { color: var(--muted-dk); }
.mono { font-family: var(--mono); font-size: .92em; }
.tabular { font-variant-numeric: tabular-nums; }

/* buttons: the mark's 45 degree cut on two corners */
.btn { --bg: #000; --fg: #fff; --cut: 11px; position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; height: 54px; padding: 0 30px; border: 0; background: none; color: var(--fg); font-weight: 600; font-size: 16px; font-stretch: 112%; letter-spacing: 0.005em; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bg); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: background-color .25s var(--ease); }
.btn:hover::before { background: var(--v); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; --cut: 8px; }
.btn--light { --bg: var(--g1); --fg: #000; }
.btn--light:hover { --fg: #fff; }
.link-arrow { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; font-size: 16px; font-stretch: 112%; text-decoration: none; }
.link-arrow::after { content: ""; width: 9px; height: 9px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px) rotate(45deg); }

/* nav: sticky; hides while scrolling down past the hero, returns on scroll up (core.js) */
.nav { position: sticky; top: 0; z-index: var(--z-nav); height: var(--nav); background: var(--g1); transition: box-shadow .3s, transform .5s var(--ease-out); }
.nav[data-solid] { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.14); }
.nav[data-hide]:not([data-open]):not(:focus-within) { transform: translateY(-101%); box-shadow: none; }
.nav__in { height: var(--nav); width: min(100% - 2 * var(--m), var(--maxw)); margin-inline: auto; display: flex; align-items: center; gap: 36px; }
.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.lockup__mark { width: 30px; height: 30px; }
.lockup__word { font-stretch: 125%; font-weight: 600; font-size: 25px; letter-spacing: -0.02em; line-height: 1; transform: translateY(-1px); }
.nav__links { display: flex; gap: 30px; margin-left: auto; }
.nav__links a { font-size: 15px; font-weight: 500; text-decoration: none; padding: 8px 0; background: linear-gradient(var(--v), var(--v)) 0 100% / 0 2px no-repeat; transition: background-size .3s var(--ease); }
.nav__links a:hover, .nav__links a[aria-current] { background-size: 100% 2px; }
.nav__menu { display: none; position: relative; width: 44px; height: 44px; margin-left: 4px; border: 0; background: none; cursor: pointer; }
.nav__menu i { position: absolute; left: 11px; width: 22px; height: 2px; background: #000; transition: transform .3s var(--ease); }
.nav__menu i:first-of-type { top: 17px; } .nav__menu i:last-of-type { top: 25px; }
.nav[data-open] .nav__menu i:first-of-type { transform: translateY(4px) rotate(45deg); }
.nav[data-open] .nav__menu i:last-of-type { transform: translateY(-4px) rotate(-45deg); }
.sheet { display: none; }
@media (max-width: 1199px) {
  .nav__links { display: none; }
  .nav__buy { margin-left: auto; }
  .nav__menu { display: block; }
  .nav[data-open] .sheet { display: flex; }
  .sheet { position: fixed; inset: var(--nav) 0 0 0; z-index: var(--z-sheet); flex-direction: column; justify-content: space-between; gap: 32px; padding: 24px var(--m) calc(32px + env(safe-area-inset-bottom)); background: var(--g1); overflow-y: auto; overscroll-behavior: contain; }
  .sheet nav { display: flex; flex-direction: column; }
  .sheet nav a { font-stretch: 125%; font-weight: 600; font-size: clamp(28px, 8vw, 40px); letter-spacing: -0.03em; line-height: 1.15; padding: 8px 0; text-decoration: none; border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
  .sheet .btn { align-self: flex-start; }
}
@media (max-width: 420px) { .nav__buy { display: none; } .nav__menu { margin-left: auto; } }

/* spec sheet (shared definition list) */
.spec > div { display: grid; grid-template-columns: minmax(7.5em, 34%) 1fr; column-gap: var(--gut); padding: 17px 0 18px; border-top: 1px solid rgba(0, 0, 0, 0.2); }
.spec > div:last-child { border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
.spec dt { font-size: 14px; color: var(--muted); padding-top: 4px; }
.spec dd { font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; font-stretch: 108%; line-height: 1.3; }

/* shard edge: the banner's violet band + black wedge on a section boundary.
   Static without JS; core.js (Veil.shard) sweeps it in on scroll when the svg has data-shard. */
.cut { position: absolute; left: 0; width: 100%; height: clamp(44px, 7.6vw, 110px); pointer-events: none; z-index: var(--z-shard); }
.cut--top { bottom: calc(100% - 1px); }
.cut--bottom { top: calc(100% - 1px); }

/* footer */
.foot { background: #000; color: var(--muted-dk); padding: 72px 0 calc(40px + env(safe-area-inset-bottom)); font-size: 14px; }
.foot .lockup__word { color: var(--g1); }
.foot__brand p { margin-top: 14px; }
/* links get thumb-sized rows (44 px on touch layouts); the padding is pulled back so the text keeps its place */
.foot__nav { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 21px; }
.foot__nav a { color: var(--g1); text-decoration: none; padding: 11px 4px; margin-inline: -4px; }
.foot__nav a[data-link="x"] { padding-inline: 10px; margin-inline: -10px; }
.foot__nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.foot__legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid #2a2a2a; display: grid; gap: 8px; max-width: 62em; }
@media (min-width: 900px) {
  .foot__brand { grid-column: 1 / span 4; }
  .foot__nav { grid-column: span 4; flex-direction: column; align-items: flex-start; margin-top: -2px; }
  .foot__nav a { padding-block: 6px; }
  .foot__nav + .foot__nav { grid-column: span 4; }
}

/* toast ("Link opens at launch"): violet, so it reads as a message on the grey and on the black chapters alike
   (the cut corners are a clip-path, which would clip any outline or shadow) */
.toast { position: fixed; left: 50%; bottom: calc(32px + env(safe-area-inset-bottom)); z-index: var(--z-toast); max-width: calc(100% - 32px); padding: 14px 20px; background: var(--v); color: #fff; font-size: 14px; font-weight: 500; transform: translate(-50%, 140%); opacity: 0; transition: transform .45s var(--ease-out), opacity .3s; pointer-events: none; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.toast[data-on] { transform: translate(-50%, 0); opacity: 1; }

/* reveals (core.js). Content is visible without JS. html.vr is set by the head gate and removed by core.js
   (or by its 2.5 s failsafe), so nothing stays hidden if GSAP never loads. */
html.vr [data-reveal] { opacity: 0; }
.vw { display: inline-block; vertical-align: top; overflow: hidden; padding: 0 .06em .16em; margin: 0 -.06em -.16em; }
.vw > .vw__i { display: inline-block; }

/* reduced motion: everything static and readable */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* app link in the nav */
.nav__links .nav__app { display: inline-flex; align-items: center; gap: 8px; }
.nav__links .nav__app::before { content: ""; width: 8px; height: 8px; background: var(--v); transform: rotate(45deg); }
@media (min-width: 1024px) and (max-width: 1180px) { .nav__links { gap: 20px; } }

/* dashboard buttons */
.btn--violet { --bg: var(--v); --fg: #fff; }
.btn--violet:hover::before { background: #000; }
.nav__dash { margin-left: 22px; margin-right: 10px; }
@media (max-width: 1199px) { .nav__dash { margin-left: auto; } .nav__buy { margin-left: 0; } }
@media (max-width: 560px) { .nav__dash { display: none; } .nav__buy { margin-left: auto; } }
.sheet .btn--violet { margin-top: auto; }
.sheet .btn--violet + .btn { margin-top: -20px; }
