/* Cachet — base reset + shared primitives */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* clears the sticky header on anchor jumps */
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--t-0);
  line-height: 1.6;
  letter-spacing: -0.006em;
  min-height: 100vh;
}

/* Paper needs no ambient layer. The only motion on this page is the hero
 * verification "labor" beat (the scan passing, the verdict landing): watching
 * the work is what earns belief. Everything else stays still, like ink. */

h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }

.serif { font-family: var(--font-display); font-weight: 400; font-optical-sizing: auto; }
.mono { font-family: var(--font-mono); font-feature-settings: "kern" 1; letter-spacing: -0.01em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Scroll reveal ----
 * Only hide content when JS is present, so a no-JS load shows everything.
 * Stagger via --reveal-i. transform+opacity only. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-4) var(--ease-out),
              transform var(--dur-4) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-sans);
  font-size: var(--t-0);
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.8em 1.3em;
  border-radius: var(--r-1);
  border: 1px solid transparent;
  min-height: 44px; /* guaranteed touch target */
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
/* Primary is ink on paper: the page's one filled element. */
.btn-primary { background: var(--n-10); color: var(--n-0); }
.btn-primary:hover { background: var(--n-9); box-shadow: 0 6px 20px hsl(30 25% 28% / 0.16); }
.btn-ghost { color: var(--text-primary); border-color: var(--border-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--n-6); background: var(--surface-raised); }

/* Real focus ring, never removed. Ink, so oxblood stays reserved for verdicts. */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--n-9);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

/* ---- Sticky header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-3) var(--ease-out),
              border-color var(--dur-3) var(--ease-out);
}
.site-header.scrolled {
  background: hsl(43 40% 94% / 0.82);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  border-bottom-color: var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--s-4);
}
.brand {
  font-family: var(--font-display);
  font-size: var(--t-5);
  font-weight: 500;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.nav-links { display: flex; gap: var(--s-6); align-items: center; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: var(--t-0); position: relative; transition: color var(--dur-2) var(--ease-out); }
/* text links get a >=44px hit area without changing the nav's height
 * (the 44px button already sets the row height) */
.nav-links a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 9px; height: 1px;
  background: var(--text-primary);
  transition: right var(--dur-2) var(--ease-out);
}
.nav-links a:not(.btn):hover { color: var(--text-primary); }
.nav-links a:not(.btn):hover::after { right: 0; }

@media (max-width: 720px) {
  /* a.hide-sm matches the specificity of the 44px-hit-area rule above and wins
   * on source order, so the text links actually collapse on small screens. */
  .nav-links a.hide-sm { display: none; }
}

/* ---- Reduced motion: keep feedback, drop movement ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
