/* Sondhi Studios: shared foundation (tokens, type, buttons, forms, utilities). */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-wght.woff2") format("woff2");
  font-weight: 300 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-wght-italic.woff2") format("woff2");
  font-weight: 300 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-wght.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}
/* Metric-matched fallbacks so the swap doesn't shift layout. */
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 92%; ascent-override: 98%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Newsreader Fallback"; font-style: italic; src: local("Georgia Italic"), local("Georgia"); size-adjust: 90%; ascent-override: 100%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial"), local("Helvetica Neue"); size-adjust: 97%; ascent-override: 95%; descent-override: 25%; line-gap-override: 0%; }

@property --sweep { syntax: "<percentage>"; inherits: false; initial-value: -30%; }

:root {
  --ink-0: #0e0d0b;
  --ink-1: #14130f;
  --ink-2: #1b1915;
  --ink-3: #2a2722;
  --ink-4: #3a362f;
  --ivory: #f3ede2;
  --ivory-2: #d8d1c4;
  --ash: #9a9284;
  --brass: #c8a15a;
  --brass-hi: #e3c58c;
  --brass-lo: #8f7038;
  --paper: #faf6ee;
  --paper-2: #f1ebdf;
  --sand: #e4dccd;
  --umber: #2b2620;
  --muted: #6b6457;
  --ok: #4e8a63;
  --warn: #b5762a;
  --danger: #a3413a;

  --serif: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --sans: "Instrument Sans", "Instrument Sans Fallback", Arial, system-ui, sans-serif;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .7s;
  --gutter: clamp(18px, 4.5vw, 64px);
  --maxw: 1320px;
  --radius: 14px;
  --radius-lg: 22px;

  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.09rem);
  --step-1: clamp(1.18rem, 1.08rem + .45vw, 1.42rem);
  --step-2: clamp(1.42rem, 1.22rem + .9vw, 1.96rem);
  --step-3: clamp(1.8rem, 1.4rem + 1.8vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.2vw, 4.4rem);
  --step-5: clamp(2.9rem, 1.7rem + 5.6vw, 7.2rem);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100dvh;
  background: var(--ink-0); color: var(--ivory);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-kerning: normal; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg, video, picture { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -.012em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
::selection { background: var(--brass); color: var(--ink-0); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 6px; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--brass); color: var(--ink-0); border-radius: 999px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.eyebrow { font: 600 var(--step--1)/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ivory-2); max-width: 36em; }
.muted { color: var(--ash); }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }

/* Buttons */
.btn {
  --btn-bg: transparent; --btn-fg: var(--ivory); --btn-bd: rgba(243, 237, 226, .28);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: .9em 1.5em; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font: 600 1rem/1 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .45s var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn .icon { transition: transform .45s var(--ease-out); }
.btn:hover .icon-arrow, .btn:focus-visible .icon-arrow { transform: translateX(4px); }
.btn-primary { --btn-bg: var(--brass); --btn-fg: #17130c; --btn-bd: var(--brass); box-shadow: 0 10px 30px -12px rgba(200, 161, 90, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { --btn-bg: var(--brass-hi); --btn-bd: var(--brass-hi); }
.btn-ghost:hover { --btn-bd: var(--ivory); }
.btn-quiet { --btn-bd: transparent; padding-inline: .4em; min-height: 44px; }
.btn-quiet:hover { color: var(--brass-hi); }
.btn-sm { min-height: 40px; padding: .6em 1.1em; font-size: .92rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.light .btn { --btn-fg: var(--umber); --btn-bd: rgba(43, 38, 32, .25); }
.light .btn-primary { --btn-bg: var(--umber); --btn-fg: var(--paper); --btn-bd: var(--umber); box-shadow: 0 10px 26px -14px rgba(43, 38, 32, .6); }
.light .btn-primary:hover { --btn-bg: #3d362d; --btn-bd: #3d362d; }
.light .btn-ghost:hover { --btn-bd: var(--umber); }
.light .btn-quiet:hover { color: var(--brass-lo); }

/* Reveal-on-scroll primitives (landing.js / app.js add .is-in) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity .4s linear; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* Plain pages (errors, notices) */
.plain { background: var(--ink-0); }
.plain-main { min-height: 100dvh; display: grid; place-items: center; padding: 40px var(--gutter); }
.err { max-width: 34rem; text-align: left; }
.err-num { font: italic 300 clamp(6rem, 22vw, 11rem)/.8 var(--serif); color: transparent; -webkit-text-stroke: 1px var(--brass); margin: 0 0 .25em; letter-spacing: -.04em; }
.err-title { font-size: var(--step-3); margin-bottom: .5em; }
.err-body { color: var(--ivory-2); margin-bottom: 2em; }

/* Light surfaces (intake, portal, legal pages) */
.light { color-scheme: light; background: var(--paper); color: var(--umber); }
.light ::selection { background: var(--umber); color: var(--paper); }
.light :focus-visible { outline-color: var(--brass-lo); }
.light .eyebrow { color: var(--brass-lo); }
.light .lede { color: #4d463c; }
.light .muted { color: var(--muted); }

/* Prose (privacy, terms) */
.prose { max-width: 42rem; }
.prose h2 { font-size: var(--step-2); margin: 2em 0 .6em; }
.prose h3 { font-size: var(--step-1); margin: 1.6em 0 .4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose a { color: inherit; }

/* Grain overlay used by layered heroes */
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: overlay; background-image: url("/assets/img/grain.svg"); background-size: 220px; }
