/* Entier — base: reset, tokens, type, shared components. Works from disk; relative paths only. */
@layer reset, tokens, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  ul[class], ol[class] { list-style: none; padding: 0; }
  h1, h2, h3, h4 { font-weight: inherit; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
  p { text-wrap: pretty; }
  a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); text-underline-offset: .18em; }
  address { font-style: normal; }
  dialog { max-width: none; max-height: none; border: 0; padding: 0; margin: 0; }
}

@layer tokens {
  /* Metric-compatible fallbacks so the page doesn't jump when the web fonts land. */
  @font-face { font-family: "Instrument Serif Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 92%; ascent-override: 86%; descent-override: 22%; line-gap-override: 0%; }
  @font-face { font-family: "Geist Fallback"; src: local("Helvetica Neue"), local("Arial"); size-adjust: 97%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }

  :root {
    color-scheme: dark;
    --bg: #0a0a0f;
    --bg-2: #111118;
    --bg-3: #181824;
    --ink: #eceaf2;
    --ink-2: #b4b1c0;
    --ink-3: #86838f;
    --line: rgb(236 234 242 / .12);
    --line-2: rgb(236 234 242 / .22);

    --lime: #9bff2e;
    --violet: #8b7cff;
    --blue: #3fa3ff;
    --neutral: #d9d5e6;
    --accent: var(--neutral);
    --accent-ink: #0a0a0f;   /* text on an accent-filled surface */

    --font-display: "Instrument Serif", "Instrument Serif Fallback", Georgia, "Times New Roman", serif;
    --font-body: Geist, "Geist Fallback", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --ease-out: cubic-bezier(.22, .61, .36, 1);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
    --dur-1: 160ms; --dur-2: 360ms; --dur-3: 640ms; --dur-4: 1200ms;

    --r-1: 6px; --r-2: 12px; --r-3: 20px; --r-4: 28px; --r-pill: 999px;
    --wrap: 76rem;
    --gutter: clamp(1rem, 4vw, 3rem);
    --measure: 60ch;

    /* fluid type (360 → 1440) */
    --step--2: clamp(.72rem, .70rem + .10vw, .79rem);
    --step--1: clamp(.84rem, .80rem + .19vw, .94rem);
    --step-0:  clamp(1rem, .94rem + .28vw, 1.17rem);
    --step-1:  clamp(1.2rem, 1.08rem + .52vw, 1.5rem);
    --step-2:  clamp(1.44rem, 1.25rem + .82vw, 1.95rem);
    --step-3:  clamp(1.73rem, 1.44rem + 1.24vw, 2.44rem);
    --step-4:  clamp(2.07rem, 1.65rem + 1.82vw, 3.05rem);
    --step-5:  clamp(2.6rem, 1.9rem + 3vw, 4.4rem);
    --step-6:  clamp(3rem, 1.9rem + 4.8vw, 5.8rem);
    --step-hero: clamp(2.7rem, 1.3rem + 6.6vw, 7rem);

    /* fluid space */
    --space-3xs: clamp(.25rem, .23rem + .1vw, .31rem);
    --space-2xs: clamp(.5rem, .46rem + .19vw, .63rem);
    --space-xs: clamp(.75rem, .69rem + .29vw, .94rem);
    --space-s: clamp(1rem, .93rem + .31vw, 1.19rem);
    --space-m: clamp(1.5rem, 1.39rem + .47vw, 1.78rem);
    --space-l: clamp(2rem, 1.86rem + .63vw, 2.38rem);
    --space-xl: clamp(3rem, 2.78rem + .94vw, 3.56rem);
    --space-2xl: clamp(4rem, 3.71rem + 1.25vw, 4.75rem);
    --space-3xl: clamp(6rem, 5.57rem + 1.88vw, 7.13rem);
    --section-pad: clamp(5rem, 3.5rem + 7vw, 10rem);
  }
}

@layer base {
  html { scroll-padding-top: 6rem; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 400;
    letter-spacing: -0.005em;
    font-size-adjust: ex-height from-font;
  }
  ::selection { background: color-mix(in oklab, var(--accent) 70%, white 10%); color: var(--accent-ink); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
  a:hover { text-decoration-color: currentColor; }
  em { font-style: italic; }
  strong { font-weight: 600; }
  svg.mark { width: 1em; height: 1em; }
}

@layer components {
  .wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

  .skip-link {
    position: fixed; top: .75rem; left: .75rem; z-index: 1000;
    padding: .6rem 1rem; border-radius: var(--r-pill);
    background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
    translate: 0 -200%; opacity: 0; transition: translate var(--dur-2) var(--ease-out), opacity var(--dur-2);
  }
  .skip-link:focus-visible { translate: 0 0; opacity: 1; outline-offset: 2px; }

  .eyebrow {
    font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
    display: inline-flex; align-items: center; gap: .6em;
  }
  .eyebrow::before { content: ""; width: 1.6em; height: 1px; background: currentColor; opacity: .7; }

  .display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; line-height: 1; }
  .display em { font-style: italic; color: var(--accent); }

  .lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }
  .prose { max-width: var(--measure); color: var(--ink-2); line-height: 1.6; }
  .prose p + p { margin-top: 1em; }
  .prose strong { color: var(--ink); }

  .btn {
    --btn-bg: var(--accent); --btn-fg: var(--accent-ink);
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    min-height: 3rem; padding: .8rem 1.35rem; border-radius: var(--r-pill);
    font-weight: 600; font-size: var(--step--1); letter-spacing: .005em; line-height: 1;
    text-decoration: none; white-space: nowrap;
    background: var(--btn-bg); color: var(--btn-fg);
    border: 1px solid transparent;
    transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2), border-color var(--dur-2), box-shadow var(--dur-2);
  }
  .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--accent) 60%, transparent); }
  .btn:active { transform: translateY(0); transition-duration: var(--dur-1); }
  .btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line-2); }
  .btn--ghost:hover { border-color: var(--ink-2); box-shadow: none; }
  .btn--small { min-height: 2.25rem; padding: .5rem .95rem; font-size: var(--step--2); }
  .btn svg { width: 1em; height: 1em; flex: none; }
  .btn .ext { opacity: .7; }

  .chips { display: flex; flex-wrap: wrap; gap: .5rem; }
  .chip {
    display: inline-flex; align-items: center; gap: .45em;
    padding: .42em .8em; border-radius: var(--r-pill);
    border: 1px solid var(--line); background: rgb(255 255 255 / .03);
    font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .02em; color: var(--ink-2);
  }
  .chip i { width: .5em; height: .5em; border-radius: 50%; background: var(--accent); flex: none; }

  .app-icon { width: 3rem; height: 3rem; border-radius: 26%; overflow: hidden; flex: none; box-shadow: 0 2px 10px -2px rgb(0 0 0 / .6), inset 0 0 0 1px rgb(255 255 255 / .08); }
  .app-icon img { width: 100%; height: 100%; object-fit: cover; }
}

@layer utilities {
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .tnum { font-variant-numeric: tabular-nums; }
}
