/*
  Neaten design tokens for the marketing site (tryneaten.com) and the in-page editor. The dashboard's tokens are in
  app.css next to this file (the brand from design/neaten-handoff).
  Embedded tours never use these: they take the customer's theme through --nt-* (packages/sdk/src/renderer).
  Rules and reasons: docs/design.md. Contrast figures are WCAG ratios against white unless noted.

  The site loads this file as is. The editor (inside customers' pages) loads it with every name prefixed
  (--ne-*, selector :host), so a customer's own CSS variables can't collide with ours.
*/
:root,
:host {
  /* Surfaces: white canvas, quiet grey for wells, code and hover. */
  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-warm: #fafafa;

  /* Ink */
  --fg: #0d0d0d;
  --fg-2: #1a1a1a;
  --graphite: #3c3c3c;
  --muted: #6e6e6e;
  --meta: #9b9b9b;

  /* Lines. Hairlines separate; form controls get a border people can see (3.45:1, WCAG 1.4.11). */
  --border: #e5e5e5;
  --border-soft: #ededed;
  --border-strong: #d4d4d4;
  --border-input: #8a8a8a;

  /* Accent: spruce. Focus, progress and one emphasis per screen; primary actions stay ink. 6.29:1. */
  --accent: #2f6a5c;
  --accent-on: #ffffff;
  --accent-hover: #285b4f;
  --accent-active: #24514a;
  --accent-soft: #eaf0ef;

  /* States: text colours read at 4.5:1 or more on their soft fills. Success is the accent: one green. */
  --success: #2f6a5c;
  --ok: #2f6a5c;
  --ok-soft: #eaf0ef;
  --warn: #7a5200;
  --warn-soft: #f7efdc;
  --danger: #a3311f;
  --danger-soft: #f8e5e1;

  /* Type: Inter for everything that is product; the serif only for editorial display on the site. */
  --font-body: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Source Serif Pro", "Source Serif 4", Georgia, ui-serif, serif;
  --font-mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 28px;
  --text-3xl: 40px;
  --text-4xl: 56px;
  --leading-body: 1.6;
  --leading-tight: 1.08;
  --tracking-display: -0.02em;

  /* Space: 4px grid. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --section-y-desktop: 96px;
  --section-y-tablet: 64px;
  --section-y-phone: 48px;

  /* Shape: 12px controls, 16px cards, pills for chips. */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Elevation: almost none. */
  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 1px 2px rgb(13 13 13 / 0.05), 0 8px 24px rgb(13 13 13 / 0.08);

  /* Focus: a spruce ring (3.09:1 even against ink buttons). */
  --focus-ring: 0 0 0 3px rgb(47 106 92 / 0.18);

  /* Motion: one curve; feedback, entering, progress. Always off under prefers-reduced-motion. */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1200px;
  --container-gutter-desktop: 48px;
  --container-gutter-tablet: 24px;
  --container-gutter-phone: 24px;
}

/* The site's layer of tokens.css. The build puts Neaten's shared tokens (packages/tokens/tokens.css, the same ones the
 * dashboard and the editor use) in front of this file, so the site never defines a core token itself.
 * Block 2 adds a few named colours only the site uses, so no hex value appears outside a :root block.
 * Block 3 maps the landing, the live builder, the legal pages and the docs onto the shared tokens, with var(),
 * color-mix() and calc() only. The names are the ones the stylesheets already use.
 * Fonts: Inter and Source Serif 4 (registered under the stack's "Source Serif Pro" name), self-hosted by the build.
 */

@font-face{font-family:"Inter";src:url("/assets/fonts/inter/inter-latin-wght-normal.woff2") format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:"Source Serif Pro";src:url("/assets/fonts/source-serif/source-serif-4-latin-wght-normal.woff2") format("woff2");font-weight:200 900;font-style:normal;font-display:swap}
@font-face{font-family:"Source Serif Pro";src:url("/assets/fonts/source-serif/source-serif-4-latin-wght-italic.woff2") format("woff2");font-weight:200 900;font-style:italic;font-display:swap}

/* ---- Block 2: named colours from DESIGN.md that the contract leaves out ---- */
:root{
  --oa-graphite:      var(--graphite); /* body text, default reading colour */
  --oa-cloud:         #ececec;        /* disabled background, divider tint */
  --oa-stone:         #c4c4c4;        /* decorative dividers, faint icons */
  --oa-teal-soft:     var(--accent-soft); /* accent tint for success badges and highlight callouts (name kept) */
  --oa-border-strong: var(--border-strong); /* secondary button border on hover */
}

/* ---- Block 3: the landing, the builder, the legal pages and the docs ---- */
:root{
  --font-sans:     var(--font-body);

  /* Canvas and planes: true white, mist for section breaks, pearl for panels. No gradients. */
  --nd-paper:      var(--bg);
  --nd-mist:       var(--surface-warm);
  --nd-stone:      var(--surface);
  --nd-stone-2:    var(--oa-cloud);
  --nd-light-wall: var(--surface);

  /* Ink */
  --nd-ink:        var(--fg);
  --nd-ink-2:      var(--oa-graphite);
  --nd-muted:      var(--muted);
  --nd-accent:     var(--accent);
  --nd-accent-text: var(--accent);   /* spruce reads as text at 6.29:1 on white */

  /* Lines: hairlines, used sparingly */
  --nd-line:       var(--border);
  --nd-line-soft:  var(--border-soft);
  --nd-mark:       var(--oa-stone);

  /* Elevation: a ring, and a whisper lift where something floats */
  --nd-shadow-frame:       var(--elev-ring), var(--elev-raised);
  --nd-shadow-card:        var(--elev-ring);
  --nd-shadow-card-hover:  var(--elev-ring), var(--elev-raised);
  --nd-shadow-soft:        0 0 0 1px var(--border-soft);
  --nd-shadow-soft-hover:  0 0 0 1px var(--border-soft), var(--elev-raised);

  /* Buttons: ink primary, white secondary with a hairline */
  --nd-btn:        var(--fg);
  --nd-btn-on:     var(--bg);
  --nd-btn-hover:  var(--fg-2);
  --nd-ghost-hover: var(--surface-warm);

  /* Type sizes for a landing page, on the system's scale: display 44 → 76, section heads 28 → 40 (the H1 size) */
  --nd-display:    clamp(2.75rem, 4.4vw + 0.75rem, 4.75rem);
  --nd-statement:  clamp(2rem, 2.6vw + 0.75rem, 3.25rem);
  --nd-h2:         clamp(1.75rem, 1.4vw + 1rem, 2.5rem);
  --nd-price:      clamp(2.5rem, 2.4vw + 1.25rem, 3.5rem);
  --text-caption:  var(--text-sm);

  /* Layout: the system's container and gutters, 64 → 128px between sections */
  --nd-shell:      var(--container-max);
  --nd-pad:        clamp(var(--container-gutter-phone), 4vw, var(--container-gutter-desktop));
  --nd-gap:        var(--space-6);
  --nd-section:    clamp(var(--space-16), 9vw, 8rem);
  --nd-narrow:     760px;
  --nd-overlap:    clamp(4rem, 8vw, 8rem);  /* how far the hero frame runs over the mist band below */

  /* Motion: 150–220ms for hover, 280–360ms for layout, the system's smooth-out curve */
  --nd-ease:       var(--ease-standard);
  --nd-settle:     360ms;
  --nd-rise:       12px;

  /* Names used by the tooltip object, the panel cards and the live builder frame */
  --font-outlier:     var(--font-display);
  --color-ink:        var(--fg);
  --color-muted:      var(--muted);
  --color-meta:       var(--meta);
  --color-paper-2:    var(--surface);
  --color-rule-hover: var(--oa-border-strong);
  --color-rule-soft:  var(--border-soft);
  --color-bone:       var(--bg);
  --glass-card:       var(--bg);
  --glass-card-line:  var(--border-soft);
  --glass-dark:       var(--surface);
  --on-dark-2:        color-mix(in oklab, var(--bg) 86%, var(--fg));
  --on-dark-muted:    color-mix(in oklab, var(--bg) 62%, var(--fg));
  --on-dark-border:   color-mix(in oklab, var(--bg) 22%, var(--fg));
  --ring-halo:        color-mix(in oklab, var(--fg) 8%, transparent);
  --shadow-float:     var(--elev-ring), var(--elev-raised);
  --shadow-raised:    var(--elev-ring), var(--elev-raised);
  --ui-light-bg:      var(--bg);
  --ui-light-fg:      var(--fg);
  --ui-light-surface: var(--surface-warm);
  --ui-light-border:  var(--border);
  --ui-light-muted:   var(--muted);
  --tracking-body:    0;
  --tracking-label:   0.04em;
  --space-2xs: var(--space-1);
  --space-xs:  var(--space-2);
  --space-sm:  var(--space-3);
  --space-md:  var(--space-4);
  --space-lg:  var(--space-6);
  --space-xl:  calc(var(--space-8) + var(--space-2));
  --space-2xl: var(--space-16);
  --dur-reveal: var(--nd-settle);
  --ease-out:   var(--nd-ease);

  /* Example customer app inside the visuals (Fernway Billing): neutral, so it reads as someone else's product */
  --color-demo-brand:   var(--fg);
  --color-demo-ink:     var(--fg);
  --color-demo-quiet:   var(--muted);
  --color-demo-late:    color-mix(in oklab, var(--danger), var(--fg) 25%);   /* the system red, deepened to read as small text */
}
