/* ============================================================================
   base.css — design tokens, fonts, reset, typography, layout primitives
   ----------------------------------------------------------------------------
   Scribe marketing site. The visual system is deliberately quiet: one cool
   off-white ground, one near-black ink, a single cobalt blue shared with the
   mark and the app, and a serif reserved entirely for display type.
   ========================================================================== */

/* ── fonts ───────────────────────────────────────────────────────────────────
   Onest carries every piece of UI text. The display serif is Sentient when it
   is available (see the <link> in each page's <head>) and Source Serif 4
   otherwise; `size-adjust` brings the fallback's width within ~2% of Sentient
   so a swap never reflows a headline.                                        */
@font-face { font-family: 'Onest'; font-weight: 300; font-style: normal; font-display: swap;
  src: url('../fonts/onest-300.woff2') format('woff2'); }
@font-face { font-family: 'Onest'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/onest-400.woff2') format('woff2'); }
@font-face { font-family: 'Onest'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/onest-500.woff2') format('woff2'); }
@font-face { font-family: 'Onest'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/onest-600.woff2') format('woff2'); }

@font-face { font-family: 'Scribe Serif'; font-weight: 300; font-style: normal; font-display: swap;
  size-adjust: 98%; src: url('../fonts/source-serif-300.woff2') format('woff2'); }
@font-face { font-family: 'Scribe Serif'; font-weight: 400; font-style: normal; font-display: swap;
  size-adjust: 98%; src: url('../fonts/source-serif-400.woff2') format('woff2'); }
@font-face { font-family: 'Scribe Serif'; font-weight: 600; font-style: normal; font-display: swap;
  size-adjust: 98%; src: url('../fonts/source-serif-600.woff2') format('woff2'); }
@font-face { font-family: 'Scribe Serif'; font-weight: 300; font-style: italic; font-display: swap;
  size-adjust: 98%; src: url('../fonts/source-serif-300-italic.woff2') format('woff2'); }

/* ── tokens ───────────────────────────────────────────────────────────────── */
:root {
  /* surfaces */
  --bg:          #F7F8FA;   /* the page */
  --surface:     #EFF2F6;   /* cards, bands, anything raised off the page */
  --surface-2:   #E5E9F0;   /* the next step down — tabs, wells, dividers */
  --white:       #FFFFFF;

  /* ink */
  --ink:         #121620;   /* headlines, primary text */
  --ink-2:       #4B5363;   /* body copy, the muted half of a two-tone heading */
  --ink-3:       #858D9C;   /* labels, meta, placeholders */

  /* lines */
  --line:        rgba(18, 22, 32, .10);
  --line-2:      rgba(18, 22, 32, .16);

  /* accent — cobalt, the mark's colour (Sep 2026: was terracotta). Three
     steps, because one hue cannot do fills and small text at once and still
     be legible on the page:
       --brand      the mark's own colour. Decorative use only; at 3.2:1 on
                    the page it is not a text or UI colour.
       --accent     fills and 15px+ links — 5.3:1 on the page, 5.7:1 white on it
       --accent-ink hovers, and any accent text below 15px — 7.9:1
     The product UI in the screenshots uses the same three steps
     (assets/mockups/app.css). Watchout semantics stay red / amber / green,
     and "clarify" moved to violet so it never reads as the brand. */
  --brand:       #5A87F2;
  --accent:      #2D5BE3;
  --accent-ink:  #1F43B0;
  --accent-soft: #EBF0FD;
  --accent-line: #C9D6FA;

  /* radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* layout */
  --maxw:   1200px;
  --gutter: clamp(20px, 8.34vw, 120px);
  --nav-h:  72px;

  /* motion */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --dur:       .85s;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(18, 22, 32, .05);
  --shadow:    0 18px 48px -22px rgba(18, 22, 32, .30), 0 2px 6px rgba(18, 22, 32, .05);
  --shadow-lg: 0 44px 90px -30px rgba(18, 22, 32, .34), 0 4px 12px rgba(18, 22, 32, .06);
}

/* ── reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

/* `hidden` wins over any component display rule (.btn is inline-flex) */
[hidden] { display: none !important; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
}
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* ── typography ──────────────────────────────────────────────────────────── */
.display,
.h1, .h2, .h3, .h4 {
  font-family: 'Sentient', 'Scribe Serif', Georgia, 'Times New Roman', serif;
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}

.h1  { font-size: clamp(38px, 5.4vw, 56px); }
.h2  { font-size: clamp(32px, 4.4vw, 48px); }
.h3  { font-size: clamp(27px, 3.1vw, 40px); }
.h4  { font-size: clamp(26px, 3.1vw, 40px); line-height: 1.15; }

/* the muted half of a two-tone heading */
.h1 .soft, .h2 .soft, .h3 .soft, .h4 .soft, .display .soft { color: var(--ink-2); }

.lead {
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
  text-wrap: pretty;
}

.body-text { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.small     { font-size: 14px; line-height: 1.5;  color: var(--ink-2); }
.meta      { font-size: 13px; line-height: 1.45; color: var(--ink-3); }

.card-title {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.3;
  color: var(--ink);
}

/* the small dashed label above a section heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink-2);
}
.eyebrow::before {
  content: '';
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-3);
}
.eyebrow.is-centred { justify-content: center; }

/* ── layout primitives ───────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(60px, 7.6vw, 110px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.section--flush-top { padding-top: 0; }

.section-head { max-width: 720px; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head .lead { margin-top: 18px; }
.section-head.is-centred { margin-inline: auto; text-align: center; }
/* section headings carry an explicit line break, so leave the wrapping alone */
.section-head .h2 { text-wrap: pretty; }
.section-head.is-centred .lead { margin-inline: auto; }

.band { background: var(--surface); }

.grid { display: grid; gap: clamp(18px, 2vw, 24px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.row-gap { gap: 12px; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* screen-reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ── scroll reveal ───────────────────────────────────────────────────────────
   Elements start slightly low and out of focus, then settle. `reveal.js` adds
   `.is-in` when the element first crosses into view. Anything the script never
   reaches (JS disabled) is shown by the `no-js` rule at the foot of the file. */
.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(7px);
  transition:
    opacity   var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    filter    var(--dur) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* a gentler variant for large media, which looks wrong sliding far */
.reveal--soft { transform: translate3d(0, 14px, 0) scale(.985); }
.reveal--soft.is-in { transform: none; }

/* word-by-word display headings */
.split-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, .42em, 0);
  filter: blur(6px);
  transition:
    opacity   .7s var(--ease),
    transform .7s var(--ease),
    filter    .7s var(--ease);
  transition-delay: var(--word-delay, 0ms);
}
.is-in .split-word,
.split-word.is-in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .split-word {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* without JS nothing should stay hidden */
.no-js .reveal, .no-js .split-word {
  opacity: 1; transform: none; filter: none;
}
