/* ============================================================================
   Vineport — foundation stylesheet
   Design system: Vinport System v3. Paper-only, light-scheme.
   Shared by index.html, terms.html, privacy.html.
   ========================================================================== */

/* --- Self-hosted fonts (Latin woff2 subsets — drop files into /fonts/) -------
   Four faces only. Falls back gracefully to a serif / system-sans / mono stack
   until the woff2 subsets are added, so the page is fully usable without them. */

@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/spectral-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/spectral-500-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
}

/* --- Tokens (§1) ---------------------------------------------------------- */

:root {
  color-scheme: light; /* paper-only — never let the browser invent dark mode */

  /* Paper ladder — always used in this order: sunk < base < band < card */
  --sunk: #E4D9C0;   /* wells, inputs, empty slots */
  --base: #EDE3CE;   /* page background */
  --band: #F7F1E3;   /* section bands */
  --card: #FCF8EF;   /* raised cards */

  /* Ink & accent */
  --ink:    #1A1410; /* all primary text */
  --onsite: #7A1B2E; /* burgundy — "you were there" */
  --remote: #1C4A63; /* blue — "you weren't" */
  --gold:   #A6832E; /* passport apparatus only: tiers, seals, authority */
  --gold-bright: #C29B3E;
  --rule:      #DDCFAE; /* 1px section rules */
  --card-edge: #E3D6B8; /* card borders */
  --deep:      #4A1220; /* document/authority surface */
  --deep-2:    #3B0E1A; /* deepest authority surface */

  /* Web-adapted ink steps (§1 contrast audit — mono captions floor here) */
  --ink-2: #4A4137; /* AAA on all paper — strong secondary text */
  --ink-3: #5C5148; /* AA on all paper — muted body / captions */
  --hairline-ink: #8B7E6D; /* decorative / hairline stamp text ONLY */

  /* Reversed-out gold (on deep burgundy) — AAA per audit (6.37 on #3B0E1A) */
  --gold-on-deep: #C29B3E;
  --paper-on-deep: #F0E6CE; /* cream text on deep burgundy surfaces */
  --paper-on-deep-muted: #C9BCA0;

  /* Type stack — all OFL, self-hostable */
  --font-display: 'Spectral', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;

  /* Card spec (§1): #FCF8EF, 1px #E3D6B8, radius 16, layered shadow */
  --card-radius: 16px;
  --card-shadow: 0 1px 2px rgba(26, 20, 16, 0.05), 0 6px 14px rgba(26, 20, 16, 0.06);

  /* Focus — visible burgundy ring */
  --focus: var(--onsite);

  /* Layout */
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
}

/* --- Reset / base --------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* Accessible focus — burgundy ring, generous offset */
:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper-on-deep);
  padding: 12px 18px;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skip-link:focus { left: 12px; top: 12px; }

/* --- Type scale ----------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }

h1 {
  font-size: clamp(2.1rem, 6.2vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.12;
}
h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); }

p { max-width: 62ch; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-2); }

/* Pull-quote — the user's own words, Spectral italic */
.pullquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  line-height: 1.35;
  color: var(--ink);
}

/* --- Layout primitives ---------------------------------------------------- */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

section { padding-block: clamp(28px, 4.5vw, 54px); }

/* Surfaces down the paper ladder */
.s-base { background: var(--base); }
.s-band { background: var(--band); }
.s-sunk { background: var(--sunk); }
.s-deep { background: var(--deep-2); color: var(--paper-on-deep); }

/* Section band carries a 1px rule + light shadow so seams read without borders */
.s-band, .s-sunk {
  border-block: 1px solid var(--rule);
}

/* Card — never sits on the same tone as its background */
.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

/* Well — recessed input surface, one step below page */
.well {
  background: var(--sunk);
  border: 1px solid var(--card-edge);
  border-radius: var(--card-radius);
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: translateY(1px); }
}

.btn-primary {
  background: var(--onsite);
  color: #FBF3E7;
  border-color: var(--onsite);
}
.btn-primary:hover { background: #63121f; border-color: #63121f; }

/* Ghost CTA — for the sticky header, sits on band */
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--card-edge);
  min-height: 40px;
  font-size: 0.9rem;
}
.btn-ghost:hover { border-color: var(--onsite); color: var(--onsite); }

/* Reversed button on deep surface */
.btn-on-deep {
  background: var(--gold-on-deep);
  color: #2A0A12;
  border-color: var(--gold-on-deep);
}
.btn-on-deep:hover { background: #d4ac4c; border-color: #d4ac4c; }

/* --- The mark (passport cover with the bottle cut clean out; evenodd) ------
   Recovered from the system bundle. currentColor drives it; the bottle is a
   hole — whatever is behind shows through. That hole *is* the idea. */
.mark { width: 1em; height: 1.4em; color: var(--onsite); }
.mark path { fill: currentColor; }

/* --- Utility -------------------------------------------------------------- */
.mono { font-family: var(--font-mono); letter-spacing: 0.12em; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Footer (shared across pages) ----------------------------------------- */

.site-footer {
  background: var(--sunk);
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
  padding-block: clamp(20px, 3vw, 32px) 0;
}
.site-footer a { color: var(--ink-2); text-decoration-color: var(--card-edge); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--onsite); }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.footer-brand-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand-line .mark { width: 22px; height: 30px; color: var(--onsite); }
.footer-brand-line b { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; letter-spacing: 0.02em; }

.footer-note { max-width: 42ch; line-height: 1.55; }

.footer-pledge {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-3);
}

/* MRZ-style bottom strip */
.mrz {
  margin-top: clamp(32px, 5vw, 52px);
  border-top: 1px solid var(--rule);
  padding-block: 18px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--hairline-ink);
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mrz span { color: var(--ink-3); }

.legal-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 8px;
}

/* --- Reduced motion global ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
