/* SaaS OS design system: tokens, type roles and the shared components.
   Every page loads this first; page files add layout only and take every
   colour, size, weight, space, radius, shadow and timing from here.
   The rules behind it are written down in site/DESIGN.md. */

@font-face { font-family: "Instrument Serif"; src: url("/fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Colour: Paper and Linen, Ink for type, Forest as the only colour */
  --paper: #fdfcf9;
  --white: #ffffff;
  --linen: #f4f1ea;
  --ink: #151515;
  --ink-2: #3d3d38;
  --muted: #76756e;
  --line: #e6e3da;
  --line-2: #d6d1c4;
  --forest: #18392a;
  --forest-hover: #294f39;
  --sage: #e1eadb;
  --sage-deep: #b5ceab;
  --sage-dark: #8fb79a;
  --on-forest: #f4f1e8;
  --on-forest-2: rgb(244 241 232 / 70%);
  /* Form errors only (2026-12-03): a refusal has to read as one, and Forest reads as fine. 6.6:1 on Paper */
  --alert: #a1371f;

  /* Type families: the serif for headings, Helvetica Neue for everything else.
     Tim asked for Tiempos (a paid Klim font); Instrument Serif is the free stand-in. */
  --serif: "Instrument Serif", "Tiempos Headline", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Type roles: 1 font shorthand and 1 tracking per role. Use a role, never a loose size. */
  --fs-display-1: clamp(48px, 6.2vw, 88px);
  --fs-display-2: clamp(40px, 4.6vw, 64px);
  --type-display-1: 400 var(--fs-display-1)/.98 var(--serif);          --track-display-1: -0.025em;
  --type-display-2: 400 var(--fs-display-2)/1.02 var(--serif);         --track-display-2: -0.02em;
  /* Helvetica Neue has no weight between Regular and Medium; Regular with a hairline stroke is the step between */
  --type-display-3: 400 clamp(32px, 3.4vw, 46px)/1.05 var(--serif);       --track-display-3: -0.02em;
  --type-display-sub: 400 calc(var(--fs-display-1) * .6)/1.1 var(--sans); --track-display-sub: -0.03em; --stroke-display-sub: .006em;
  --type-title: 500 clamp(22px, 2.2vw, 28px)/1.2 var(--sans);          --track-title: -0.03em;
  --type-body-l: 400 19px/1.5 var(--sans);
  --type-body: 400 17px/1.6 var(--sans);                                --track-body: -0.01em;
  --type-small: 400 14px/1.5 var(--sans);
  --type-button: 500 16px/1 var(--sans);
  --type-button-sm: 500 14.5px/1 var(--sans);
  --type-wordmark: 500 20px/1 var(--sans);                              --track-wordmark: -0.045em;

  /* Space: a 4 px base. Sections sit 152 px apart, a heading 56 px above its content. */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --section: 152px;
  --head-gap: 56px;
  --gutter: 24px;

  /* Radius: pills for controls, 20 for cards, 24 for panels, 10 for tiles */
  --r-pill: 999px; --r-card: 20px; --r-panel: 24px; --r-tile: 10px;

  /* Shadow: 1 warm neutral for every shadow on the page */
  --shade: 60 52 36;

  /* Glass, after Apple's material: a Paper-tinted fill, a strong blur with boosted saturation,
     a bright top edge, a hairline, a soft 2-step shadow. No refraction (Chromium only). */
  --glass-bg: linear-gradient(180deg, rgb(253 252 249 / 72%), rgb(250 248 243 / 52%));
  --glass-blur: blur(24px) saturate(170%);
  --glass-edge: inset 0 1px .5px rgb(255 255 255 / 90%), inset 0 -.5px .5px rgb(255 255 255 / 45%), 0 0 0 .5px rgb(var(--shade) / 10%);
  --glass-lift: 0 6px 16px -8px rgb(var(--shade) / 12%), 0 24px 48px -26px rgb(var(--shade) / 16%);

  /* Motion: 1 curve, 3 durations */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: .2s; --dur-base: .6s; --dur-slow: 1.2s;
}
@media (max-width: 560px) {
  :root { --section: 104px; --head-gap: 40px; --gutter: 16px; --type-body-l: 400 17px/1.5 var(--sans); }
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; color: var(--ink); font: var(--type-body); letter-spacing: var(--track-body); -webkit-font-smoothing: antialiased; background: var(--paper); }
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type roles as classes, and the defaults for headings */
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
.t-display-1 { font: var(--type-display-1); letter-spacing: var(--track-display-1); }
.t-display-2, h2.display { font: var(--type-display-2); letter-spacing: var(--track-display-2); }
.t-display-3 { font: var(--type-display-3); letter-spacing: var(--track-display-3); }
.t-title, h3 { font: var(--type-title); letter-spacing: var(--track-title); }
.t-body-l { font: var(--type-body-l); letter-spacing: var(--track-body); color: var(--ink-2); }
.t-small { font: var(--type-small); color: var(--muted); }
.display em { font-style: normal; }

/* Button: 1 style, 2 sizes. Forest with depth instead of a flat fill: a soft light falling from the top, a 1 px
   highlight along the top edge, a darker rim, and a low, tight shadow under it. It presses down 1 px when clicked. */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background-color: var(--forest); background-image: linear-gradient(180deg, rgb(255 255 255 / 6%), rgb(255 255 255 / 0) 50%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%), inset 0 -1px 0 rgb(0 0 0 / 16%), 0 0 0 1px rgb(14 36 25 / 82%), 0 1px 2px rgb(14 36 25 / 20%), 0 6px 14px -6px rgb(14 36 25 / 36%);
  color: var(--on-forest); font: var(--type-button); letter-spacing: -0.01em; text-decoration: none;
  transition: background-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); }
.btn:hover { background-color: color-mix(in srgb, var(--forest) 55%, var(--forest-hover)); box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -1px 0 rgb(0 0 0 / 16%), 0 0 0 1px rgb(14 36 25 / 82%), 0 1px 2px rgb(14 36 25 / 20%), 0 10px 20px -8px rgb(14 36 25 / 42%); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%), inset 0 -1px 0 rgb(0 0 0 / 16%), 0 0 0 1px rgb(14 36 25 / 82%), 0 1px 1px rgb(14 36 25 / 20%); }
.btn-sm { min-height: 40px; padding: 0 18px; font: var(--type-button-sm); letter-spacing: -0.01em; }
/* On the Forest panel the button turns light: Paper with the same light from the top, a pale rim and a deeper shadow */
.btn-light { background-color: var(--paper); background-image: linear-gradient(180deg, rgb(255 255 255 / 100%), rgb(255 255 255 / 0) 70%); color: var(--forest);
  box-shadow: inset 0 -1px 0 rgb(var(--shade) / 14%), 0 0 0 1px rgb(255 255 255 / 24%), 0 1px 2px rgb(0 0 0 / 22%), 0 8px 18px -8px rgb(0 0 0 / 45%); }
.btn-light:hover { background-color: var(--white); box-shadow: inset 0 -1px 0 rgb(var(--shade) / 14%), 0 0 0 1px rgb(255 255 255 / 30%), 0 1px 2px rgb(0 0 0 / 22%), 0 12px 24px -10px rgb(0 0 0 / 50%); }
.btn-light:active { box-shadow: inset 0 -1px 0 rgb(var(--shade) / 14%), 0 0 0 1px rgb(255 255 255 / 24%), 0 1px 1px rgb(0 0 0 / 22%); }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }
.link { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-color: var(--forest); }

/* Input: a pill like the button and as tall, white on Paper with the stronger hairline; Forest and a Sage halo when focused.
   17 px type, so phones do not zoom in on focus. A label sits above it in small. */
.input { width: 100%; min-height: 50px; margin: 0; padding: 0 22px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--white); color: var(--ink); font: var(--type-body); letter-spacing: var(--track-body); -webkit-appearance: none; appearance: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--sage); }
.input:disabled { opacity: .6; }
.btn:disabled { opacity: .7; cursor: progress; }

/* Glass */
.glass { background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--glass-lift); }
.glass-rim { position: relative; }
.glass-rim::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(165deg, rgb(255 255 255 / 100%), rgb(255 255 255 / 25%) 30%, rgb(255 255 255 / 0%) 55%, rgb(255 255 255 / 55%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@media (prefers-reduced-transparency: reduce) { .glass { background: rgb(253 252 249 / 97%); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* Brand mark (Tim's pick, 2026-12-02, decision 16): a Sage dot inside 2 soft light green rings, no solid core.
   1 file, /img/mark.svg, for the nav, the eyebrow, the footer and the favicon. Bump ?v= when it changes. */
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark, .eyebrow .dot { --mark: 32px; flex: none; width: var(--mark); height: var(--mark); background: url("/img/mark.svg?v=4") center / contain no-repeat; }
/* Wordmark in the 2 voices: "SaaS" in Helvetica Neue Medium at 20 px, set tight; "OS" in the headline's serif at 1.16x with a hairline of weight */
.brand-name { font: var(--type-wordmark); letter-spacing: var(--track-wordmark); }
.brand-name span { font-family: var(--serif); font-weight: 400; font-size: 1.16em; letter-spacing: -0.005em; -webkit-text-stroke: .012em currentColor; }

/* Eyebrow: a glass pill with the Forest dot */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 5px 16px 5px 4px; border-radius: var(--r-pill); font: var(--type-small); color: var(--ink-2); }
.eyebrow .dot { --mark: 26px; margin: -2px 0; }

/* Panel: Linen, for the closing band and the video slot */
.field { position: relative; overflow: hidden; background: var(--linen); }
