/* ============================================================ */
/* 3PL COMPARE — DESIGN SYSTEM v2                                 */
/* Editorial · advisory · restrained                              */
/* ============================================================ */

:root {
  /* Surfaces */
  --cream:        #f5f1ea;   /* primary background */
  --cream-50:     #faf7f1;
  --cream-100:    #ece6d5;
  --cream-200:    #e0d8c2;
  --cream-300:    #c8bca0;
  --paper:        #ffffff;

  /* Ink */
  --ink:          #0a1942;   /* deep navy — primary text & dark surfaces */
  --ink-2:        #050d28;
  --ink-soft:     #1a2854;
  --ink-line:     rgba(245, 241, 234, 0.10);
  --ink-line-2:   rgba(245, 241, 234, 0.18);

  /* Text */
  --text:         #0a1942;
  --text-2:       #4a567a;
  --text-3:       #8090aa;

  /* Accent — used sparingly */
  --gold:         #fde031;   /* the brand yellow */
  --gold-hover:   #ffe84a;
  --gold-deep:    #f5d300;
  --gold-soft:    #fff5a8;

  /* Lines */
  --line:         rgba(10, 25, 66, 0.10);
  --line-2:       rgba(10, 25, 66, 0.18);

  /* Status */
  --rust:         #c25a30;
  --sage:         #137a52;

  /* Spacing scale (8px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;
  --s-20: 80px; --s-24: 96px; --s-32: 128px;

  /* Radii */
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px; --r-xl: 22px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.55;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--gold); color: var(--ink); }

/* CONTAINER */
.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-10); }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--s-10); }
@media (max-width: 700px) {
  .container, .container-narrow { padding: 0 var(--s-5); }
}

/* TYPE SYSTEM */
.serif { font-family: 'Fraunces', Georgia, serif; }
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

h1, h2, h3, h4, h5 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

/* Display headlines — editorial serif */
.display-1, .display-2, .display-3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.96;
  color: var(--text);
  font-variation-settings: "opsz" 144;
}
.display-1 { font-size: clamp(3.2rem, 7.5vw, 5.6rem); }
.display-2 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.display-3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -0.025em; line-height: 1.15; }

em.accent { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 400; }

/* Body */
.lede { font-size: 1.18rem; color: var(--text-2); line-height: 1.55; max-width: 56ch; }
@media (max-width: 700px) { .lede { font-size: 1.05rem; } }

/* Eyebrow — small caps label */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow-gold { color: var(--gold-deep); }
.eyebrow-cream { color: rgba(245, 241, 234, 0.7); }

/* Editorial pull quote */
.pullquote {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--text);
  border-left: 2px solid var(--ink);
  padding-left: var(--s-6);
  max-width: 56ch;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 14px 22px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 0.94rem;
  cursor: pointer; border: 1.5px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none; line-height: 1;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--cream-300); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); padding-left: 4px; padding-right: 4px; border-bottom: 1.5px solid var(--ink); border-radius: 0; }
.btn-ghost:hover { color: var(--gold-deep); border-color: var(--gold-deep); }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-cream:hover { background: var(--cream-100); }

.btn-sm { padding: 9px 16px; font-size: 0.84rem; }
.btn-lg { padding: 18px 28px; font-size: 1rem; }
.btn .arrow { transition: transform 0.18s; }
.btn:hover .arrow { transform: translateX(3px); }

/* Legacy — alias yellow → gold */
.btn-yellow { background: var(--gold); color: var(--ink); border-color: transparent; }
.btn-yellow:hover { background: var(--gold-hover); transform: translateY(-1px); }
.btn-navy { background: var(--ink); color: var(--cream); border-color: transparent; }
.btn-navy:hover { background: var(--ink-2); }

/* SECTIONS */
section { padding: var(--s-24) 0; }
section.tight { padding: var(--s-16) 0; }
section.cream { background: var(--cream); }
section.paper { background: var(--paper); }
section.ink { background: var(--ink); color: var(--cream); }
section.ink h1, section.ink h2, section.ink h3, section.ink h4 { color: var(--cream); }
section.ink .lede { color: rgba(245, 241, 234, 0.75); }
section.ink .eyebrow { color: var(--gold-deep); }

@media (max-width: 700px) { section { padding: var(--s-16) 0; } }

/* Editorial section header */
.section-head { max-width: 720px; margin-bottom: var(--s-16); }
.section-head .eyebrow { display: block; margin-bottom: var(--s-4); }
.section-head h2 { margin-bottom: var(--s-5); }
.section-head .lede { margin-top: var(--s-4); }

/* Hairline rule */
.rule { height: 1px; background: var(--line); border: none; margin: 0; width: 100%; }
.rule-ink { background: var(--ink-line); }

/* Editorial grid — 2-up, 3-up, 4-up */
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--s-12); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: var(--s-8); }
}

/* ============================================================ */
/* NAV                                                            */
/* ============================================================ */
nav.main {
  background: var(--ink);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
nav.main.scrolled { border-bottom-color: var(--ink-line); background: rgba(10, 25, 66, 0.96); backdrop-filter: blur(12px); }
nav.main .container { display: flex; justify-content: space-between; align-items: center; gap: var(--s-8); }

.wordmark { display: flex; align-items: center; }
.wordmark img { height: 38px; width: auto; }
@media (max-width: 600px) { .wordmark img { height: 32px; } }

.nav-links { display: flex; gap: var(--s-10); align-items: center; flex: 1; justify-content: center; }
.nav-links > a {
  color: var(--cream); font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.005em;
  transition: color 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-links > a:hover { color: var(--gold); }
.nav-links > a .caret { font-size: 0.7em; opacity: 0.6; }

.nav-actions { display: flex; gap: var(--s-3); align-items: center; }
.nav-actions a.login { color: var(--cream); font-size: 0.9rem; font-weight: 500; padding: 8px 4px; }
.nav-actions a.login:hover { color: var(--gold); }

/* Hamburger */
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--ink-line-2);
  color: var(--cream);
  border-radius: var(--r-md);
  padding: 9px 11px;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-burger:hover { border-color: var(--gold); color: var(--gold); }
.nav-burger svg { display: block; }

@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-actions a.login { display: none; }
  .nav-burger { display: inline-flex; }
}

/* Mobile drawer */
.nav-drawer {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--ink); z-index: 200;
  display: none; flex-direction: column;
  padding: var(--s-6) var(--s-6) var(--s-8);
  overflow-y: auto;
}
.nav-drawer.open { display: flex; }
.nav-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-8); }
.nav-drawer-close {
  background: transparent; border: 1px solid var(--ink-line-2);
  color: var(--cream); border-radius: var(--r-md);
  padding: 9px 13px; cursor: pointer;
  font-size: 1.2rem; line-height: 1;
}
.nav-drawer-close:hover { border-color: var(--gold); color: var(--gold); }
.nav-drawer-links { list-style: none; margin: 0 0 var(--s-8); padding: 0; }
.nav-drawer-links li { border-top: 1px solid var(--ink-line); }
.nav-drawer-links li:last-child { border-bottom: 1px solid var(--ink-line); }
.nav-drawer-links a {
  display: block; padding: 18px 0;
  color: var(--cream); font-size: 1.05rem; font-weight: 500;
  min-height: 44px;
}
.nav-drawer-links a:hover, .nav-drawer-links a:focus { color: var(--gold); }
.nav-drawer-cta { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.nav-drawer-cta .btn { justify-content: center; padding: 16px 22px; }
.nav-drawer-foot {
  display: flex; gap: var(--s-5); padding-top: var(--s-6);
  border-top: 1px solid var(--ink-line);
  font-size: 0.86rem; color: var(--text-3);
}
.nav-drawer-foot a { color: var(--text-3); }
.nav-drawer-foot a:hover { color: var(--gold); }

body.nav-locked { overflow: hidden; }

/* ============================================================ */
/* FOOTER                                                         */
/* ============================================================ */
footer {
  background: var(--ink); color: var(--text-3);
  padding: var(--s-20) 0 var(--s-8);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--s-10);
  padding-bottom: var(--s-10);
  border-bottom: 1px solid var(--ink-line);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

footer .wordmark { margin-bottom: var(--s-4); }
footer .tagline { font-size: 0.92rem; line-height: 1.6; max-width: 280px; margin-bottom: var(--s-6); }
footer h5 {
  font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cream); font-weight: 600; margin-bottom: var(--s-4);
}
footer ul { list-style: none; }
footer li { margin-bottom: 10px; }
footer li a { color: var(--text-3); font-size: 0.92rem; transition: color 0.15s; }
footer li a:hover { color: var(--gold); }

.footer-socials { display: flex; gap: 12px; margin-top: var(--s-3); }
.footer-socials a { color: var(--cream); }

.footer-bottom { padding-top: var(--s-6); font-size: 0.82rem; color: var(--text-3); }

/* ============================================================ */
/* GLOBAL UTILITIES                                               */
/* ============================================================ */

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Hairline divider with optional centred label */
.divider-label {
  display: flex; align-items: center; gap: var(--s-6);
  margin: var(--s-12) 0;
}
.divider-label::before, .divider-label::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.divider-label .eyebrow { white-space: nowrap; }

/* Editorial serial numbers (1-of-3, 01-of-04 etc.) */
.serial {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--text-3);
}

/* ============================================================ */
/* MOBILE GLOBAL POLISH                                           */
/* ============================================================ */
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px !important; }
  .btn { min-height: 44px; }
  .scroll-x-mobile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s-5)); padding: 0 var(--s-5); }
  .scroll-x-mobile table { min-width: 640px; }
  .display, h1, h2, h3 { word-wrap: break-word; overflow-wrap: break-word; }
  .btn-block-mobile { width: 100%; justify-content: center; }
}

@supports (padding: max(0px)) {
  nav.main { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  footer { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .nav-drawer {
    padding-left: max(var(--s-6), env(safe-area-inset-left));
    padding-right: max(var(--s-6), env(safe-area-inset-right));
    padding-bottom: max(var(--s-8), env(safe-area-inset-bottom));
  }
}

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

/* ============================================================ */
/* PAGE-SPECIFIC MOBILE OVERRIDES (kept from prior pass)          */
/* ============================================================ */

@media (max-width: 1000px) {
  .compare-grid { grid-template-columns: 100% !important; overflow: hidden; }
  .compare-grid .header-cell-empty,
  .compare-grid .row-label,
  .compare-grid .section-head-row { display: block !important; grid-column: 1 / -1 !important; }
  .compare-grid .header-cell, .compare-grid .data-cell {
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .controls { grid-template-columns: 1fr 1fr !important; gap: 16px !important; padding: 18px !important; }
  .weights .weight-grid, .summary-row, .flag-grid { grid-template-columns: 1fr !important; }
  .flag-col { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .flag-col:last-child { border-bottom: none; padding-bottom: 0; }
}

@media (max-width: 700px) {
  .component-table {
    display: block; overflow-x: auto;
    -webkit-overflow-scrolling: touch; white-space: nowrap;
  }
  .receipt { padding: 24px 18px !important; font-size: 0.78rem !important; }
  .doc-body { padding: 28px 22px !important; }
}

@media (max-width: 800px) {
  .calc-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .calc-card { padding: 22px !important; }
  .calc-row .row-2 { grid-template-columns: 1fr !important; gap: 12px !important; }
  .index-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 500px) { .index-grid { grid-template-columns: 1fr !important; } }

@media (max-width: 800px) {
  .task { grid-template-columns: 1fr !important; padding: 18px 0 !important; }
  .summary-header, .inputs { grid-template-columns: 1fr !important; gap: 14px !important; }
  .phases { grid-template-columns: 1fr 1fr !important; }
  .phase-block { padding: 22px 18px !important; }
}

@media (max-width: 700px) {
  .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr !important; }
  .form-section { padding: 22px !important; }
  .layout { grid-template-columns: 1fr !important; gap: 18px !important; }
  .rfp-col { position: static !important; }
}

@media (max-width: 700px) {
  .providers { grid-template-columns: 1fr !important; }
  .provider-data { grid-template-columns: 1fr 1fr !important; }
  .quick-stats { grid-template-columns: 1fr 1fr !important; }
  .related-grid { grid-template-columns: 1fr !important; }
}

body { overflow-x: hidden; }
section, .container, footer { max-width: 100vw; }
