/* =====================================================================
   PupMiles launch site — shared stylesheet
   Brand tokens locked to BrandGuide.md §3 (color) and §4 (typography).
   ===================================================================== */

/* --- Design tokens --------------------------------------------------- */
:root {
  /* Brand tokens (canonical) */
  --brand-teal: #008b8b;          /* color-primary */
  --brand-teal-deep: #018B8D;     /* icon tile */
  --brand-lime: #9fe870;          /* color-accent */
  --brand-sand: #f6e4c4;          /* color-bg-warm */
  --brand-charcoal: #2f2f2f;      /* color-text (light mode) */

  /* Dark premium surfaces (deep teal / near-black range) */
  --bg:          #07100f;
  --bg-surface:  #0b1716;
  --bg-surface-2:#10201f;
  --bg-surface-3:#13292a;
  --bg-surface-4:#18383a;
  --border:      rgba(255,255,255,.08);
  --border-2:    rgba(255,255,255,.14);
  --border-accent: rgba(159,232,112,.22);
  --divider:     rgba(255,255,255,.07);

  /* Text */
  --text:        #eef4f1;
  --text-muted:  #9fb3ae;
  --text-faint:  #6c8480;
  --text-invert: #0c1a19;

  /* Type scale (fluid) */
  --fs-xs:   clamp(0.78rem, 0.72rem + 0.2vw, 0.85rem);
  --fs-sm:   clamp(0.9rem,  0.85rem + 0.25vw, 1rem);
  --fs-base: clamp(1rem,    0.96rem + 0.2vw, 1.125rem);
  --fs-lg:   clamp(1.125rem,1rem + 0.6vw, 1.375rem);
  --fs-xl:   clamp(1.4rem,  1.15rem + 1vw, 1.9rem);
  --fs-2xl:  clamp(2rem,    1.4rem + 2.4vw, 3.25rem);
  --fs-3xl:  clamp(2.7rem,  1.6rem + 4.4vw, 5.2rem);

  /* Spacing (8pt) */
  --sp-1:.25rem; --sp-2:.5rem; --sp-3:.75rem; --sp-4:1rem;
  --sp-5:1.25rem; --sp-6:1.5rem; --sp-8:2rem; --sp-10:2.5rem;
  --sp-12:3rem; --sp-14:3.5rem; --sp-16:4rem; --sp-20:5rem;
  --sp-24:6rem; --sp-32:8rem;

  /* Radii */
  --r-sm:.5rem; --r-md:.875rem; --r-lg:1.25rem; --r-xl:1.75rem;
  --r-2xl:2.25rem; --r-pill:9999px; --r-tile: 22%;

  /* Type families */
  --font: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Motion */
  --ease: cubic-bezier(.2,.8,.2,1);
  --t-fast: 140ms var(--ease);
  --t: 220ms var(--ease);
  --t-slow: 360ms var(--ease);

  /* Layout */
  --container: 1240px;

  /* Shadows */
  --shadow-sm: 0 6px 20px rgba(0,0,0,.24);
  --shadow-md: 0 18px 50px rgba(0,0,0,.32);
  --shadow-lg: 0 40px 120px rgba(0,0,0,.42);
}

/* --- Reset ----------------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  min-height: 100dvh; font-family: var(--font); font-size: var(--fs-base);
  line-height: 1.6; color: var(--text); background: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 10% -10%, rgba(0,139,139,.14), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(159,232,112,.06), transparent 60%);
  background-attachment: fixed;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-lime); outline-offset: 3px; border-radius: 6px; }
ul, ol { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute; left: -9999px;
}
.skip-link:focus {
  left: var(--sp-4); top: var(--sp-4); z-index: 999;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--brand-lime); color: var(--text-invert);
  font-weight: 700;
}

/* --- Layout primitives ---------------------------------------------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.section { padding-block: clamp(var(--sp-16), 9vw, var(--sp-32)); }
.section-tight { padding-block: clamp(var(--sp-12), 6vw, var(--sp-20)); }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-lime);
}
.eyebrow--quiet { color: var(--text-faint); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }
.h-display { font-size: var(--fs-3xl); line-height: .98; letter-spacing: -.045em; }
.h-section { font-size: var(--fs-2xl); line-height: 1.05; letter-spacing: -.035em; }
.h-3       { font-size: var(--fs-xl);  line-height: 1.15; }
.h-4       { font-size: var(--fs-lg);  line-height: 1.2;  letter-spacing: -.02em; }
.lede { color: var(--text-muted); font-size: var(--fs-lg); max-width: 54ch; }
p { max-width: 68ch; }

/* All-caps UI label per BrandGuide §4 */
.label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
  color: var(--text-faint);
}

/* Tagline treatment per BrandGuide §1.2 */
.tagline {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 500;
  color: var(--brand-lime);
}

/* --- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .6rem;
  padding: .9rem 1.3rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: -.005em;
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand-lime); color: var(--text-invert);
  box-shadow: 0 8px 26px rgba(159,232,112,.22);
}
.btn-primary:hover { box-shadow: 0 12px 34px rgba(159,232,112,.34); }
.btn-secondary {
  background: rgba(255,255,255,.04);
  border-color: var(--border-2);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(255,255,255,.08); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: 1.05rem 1.6rem; font-size: var(--fs-base); }

.btn .chev { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; }

/* --- Header ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: saturate(1.2) blur(14px);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--divider);
  transition: background var(--t);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: .75rem;
}
.brand__mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: block;
  background: #018B8D;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.brand__mark svg { width: 100%; height: 100%; }
.brand__name {
  font-weight: 700; font-size: 1.125rem; letter-spacing: -.025em;
}
.brand__name sup { font-size: .55em; color: var(--text-faint); font-weight: 500; margin-left: .15em; }

.nav {
  display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem);
}
.nav a {
  font-size: var(--fs-sm); color: var(--text-muted); transition: color var(--t);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: .6rem; }

@media (max-width: 780px) {
  .nav { display: none; }
  .site-header__inner { min-height: 64px; }
}

/* --- Footer ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--divider);
  padding-block: var(--sp-16) var(--sp-10);
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.2) 100%);
}
.footer-top {
  display: grid; grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: var(--sp-10);
}
.footer-brand { max-width: 36ch; }
.footer-brand .tagline { margin-top: .6rem; }
.footer-brand p { color: var(--text-muted); margin-top: .9rem; font-size: var(--fs-sm); }
.footer-col h4 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-faint); margin-bottom: var(--sp-4); font-weight: 500;
}
.footer-col ul { display: grid; gap: .65rem; }
.footer-col a {
  font-size: var(--fs-sm); color: var(--text-muted);
  transition: color var(--t);
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--text); }

@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* --- Surface / cards ------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
}
.card--flush { padding: 0; overflow: hidden; }

.surface-raised {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012));
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
}

/* --- Legal / long-form page styling --------------------------------- */
.legal {
  max-width: 760px; margin-inline: auto;
  padding-block: clamp(var(--sp-16), 8vw, var(--sp-24));
}
.legal h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-3); }
.legal .legal-meta { color: var(--text-faint); font-size: var(--fs-sm); margin-bottom: var(--sp-10); }
.legal h2 { font-size: var(--fs-xl); margin-top: var(--sp-12); margin-bottom: var(--sp-4); }
.legal h3 { font-size: var(--fs-lg); margin-top: var(--sp-8); margin-bottom: var(--sp-3); }
.legal p, .legal ul, .legal ol { color: var(--text-muted); margin-bottom: var(--sp-4); }
.legal p { max-width: none; }
.legal ul, .legal ol { padding-left: 1.25rem; }
.legal ul li, .legal ol li { list-style: disc; margin-bottom: .4rem; }
.legal ol li { list-style: decimal; }
.legal a { color: var(--brand-lime); border-bottom: 1px solid rgba(159,232,112,.35); }
.legal a:hover { border-bottom-color: var(--brand-lime); }
.legal strong { color: var(--text); font-weight: 600; }
.legal table {
  width: 100%; border-collapse: collapse; margin: var(--sp-4) 0 var(--sp-6);
  font-size: var(--fs-sm); color: var(--text-muted);
}
.legal table th, .legal table td {
  text-align: left; padding: .7rem .9rem;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
.legal table th { color: var(--text); font-weight: 600; background: rgba(255,255,255,.02); }

/* --- Utility --------------------------------------------------------- */
.accent { color: var(--brand-lime); }
.teal   { color: var(--brand-teal); }
.muted  { color: var(--text-muted); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.grid { display: grid; }
.flex { display: flex; }
.hidden-sm { display: inline-flex; }
@media (max-width: 640px) { .hidden-sm { display: none; } }

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

/* --- Page intro (interior pages) ----------------------------------- */
.page-intro {
  padding-block: clamp(var(--sp-16), 8vw, var(--sp-20)) var(--sp-8);
  border-bottom: 1px solid var(--divider);
  background:
    radial-gradient(700px 280px at 0% 0%, rgba(0,139,139,.14), transparent 60%);
}
.page-intro .eyebrow { margin-bottom: var(--sp-4); }
.page-intro h1 { font-size: var(--fs-2xl); max-width: 18ch; }
.page-intro p { color: var(--text-muted); max-width: 60ch; margin-top: var(--sp-4); font-size: var(--fs-lg); }
