/* ============================================================================
 * Data Vision brand design system
 * Implements DESIGN.md sections 1-8 + 10. Single source of truth for the
 * apex (webauditfix.com) marketing surface.
 *
 * Loaded via base_design.html (the new shell). Old base.html still works
 * unchanged for portal templates that haven't been migrated yet.
 * ============================================================================ */


/* ============================================================================
 * 1. Reset
 * ============================================================================ */

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


/* ============================================================================
 * 2. Colour tokens
 * (DESIGN.md §1 — base palette, no overrides on webauditfix)
 * ============================================================================ */

:root {
  /* Core brand */
  --navy:        #1C2B3A;
  --navy-mid:    #2D4156;
  --steel:       #3B5B7A;

  /* Accent */
  --amber:       #E8A020;
  --amber-lt:    #FEF3DC;

  /* Trust / positive */
  --green:       #3D7A5F;
  --green-lt:    #EBF4EF;

  /* Data / technical */
  --indigo:      #4F46E5;
  --indigo-lt:   #EEF2FF;

  /* Neutrals */
  --parch:       #F5F3EF;
  --cream:       #F8F7F4;
  --stone:       #E8E5DF;
  --border:      #D4D0C8;
  --text:        #1E1E1E;
  --muted:       #6B7280;
  --white:       #FFFFFF;

  /* Semantic */
  --color-error:   #E55C5C;
  --color-warning: #E8A020;
  --color-success: #3D7A5F;

  /* Radius scale (DESIGN.md §4) */
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  10px;
  --radius-2xl: 12px;
  --radius-3xl: 14px;
  --radius-full: 9999px;

  /* Shadow scale (DESIGN.md §5) */
  --shadow-card:  0 2px 8px rgba(28,43,58,0.08);
  --shadow-lift:  0 8px 30px rgba(28,43,58,0.12);
  --shadow-modal: 0 20px 60px rgba(28,43,58,0.20);
  --shadow-amber: 0 0 0 3px rgba(232,160,32,0.15);
}


/* ============================================================================
 * 2.5 Self-hosted webfonts
 * Playfair Display 700 (display) / Inter variable 400-700 (UI) /
 * DM Mono 400 + 500 (data). Latin + Latin-extended subsets only.
 * Self-hosted so we don't self-fail our own no-third-party-trackers check.
 * Source: Google Fonts CSS API, woff2 files copied into /static/fonts/.
 * Total payload: ~232 KB across 8 files, font-display: swap on all.
 * ============================================================================ */

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/playfair-display-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/playfair-display-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Inter — variable font, one file covers weights 400 / 500 / 600 / 700 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/inter-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/dm-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/dm-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* ============================================================================
 * 3. Base typography + body
 * (DESIGN.md §2)
 * ============================================================================ */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--parch);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Display / headline family — Playfair Display, with serif fallback */
h1, h2, .display-xl, .display-lg, .display-md {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.15;
}

.display-xl { font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1.1; }
.display-lg { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.display-md { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; }

/* Body / UI scale */
.text-lg   { font-size: 1.05rem;  line-height: 1.7; }
.text-base { font-size: 0.95rem;  line-height: 1.7; }
.text-sm   { font-size: 0.875rem; line-height: 1.6; }
.text-xs   { font-size: 0.82rem;  line-height: 1.5; }
.text-2xs  { font-size: 0.72rem;  line-height: 1.5; }

/* Data / mono scale */
.mono-xl, .mono-lg, .mono-md, .mono-sm, .mono-xs {
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mono-xl { font-size: 2.5rem;  font-weight: 500; line-height: 1; }
.mono-lg { font-size: 1.4rem;  font-weight: 500; line-height: 1; }
.mono-md { font-size: 1rem;    font-weight: 500; }
.mono-sm { font-size: 0.78rem; }
.mono-xs { font-size: 0.65rem; }

/* Eyebrow label */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
  margin-bottom: 0.6rem;
}
.eyebrow.green { color: var(--green); }

/* Display <em> emphasis: amber, normal weight, never italic */
h1 em, h2 em, .display-xl em, .display-lg em, .display-md em {
  font-style: normal;
  color: var(--amber);
}


/* ============================================================================
 * 4. Layout primitives
 * (DESIGN.md §3, §7)
 * ============================================================================ */

.section         { padding: 4.5rem 2rem; }
.section-compact { padding: 3.5rem 2rem; }
.section-hero    { padding: 5rem 2rem; }
.section-inner   { max-width: 1080px; margin: 0 auto; }

/* Dark section helper — when a section background is --navy, text shifts */
.section-dark {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark .display-xl,
.section-dark .display-lg, .section-dark .display-md { color: #fff; }
.section-dark .muted { color: rgba(255,255,255,0.40); }


/* ============================================================================
 * 5. Navigation
 * (DESIGN.md §6 → nav)
 * ============================================================================ */

.site-nav {
  background: var(--navy);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
}
.site-nav .logo .dot { color: var(--amber); }

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav-links a:hover { color: #fff; text-decoration: none; }

.site-nav-cta {
  background: var(--amber);
  color: var(--navy) !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.site-nav-cta:hover { background: #d4911a; text-decoration: none; }


/* ============================================================================
 * 6. Buttons
 * (DESIGN.md §6 → buttons)
 * ============================================================================ */

.btn-primary,
.btn-ghost,
.btn-outline {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  border: none;
}

.btn-primary {
  background: var(--amber);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}
.btn-primary:hover { background: #d4911a; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.2);
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  transition: border-color 0.2s;
}
.btn-outline:hover { border-color: var(--navy); text-decoration: none; }

.btn-sm { font-size: 0.8rem; padding: 0.5rem 1rem; }


/* ============================================================================
 * 7. Badges + tags
 * (DESIGN.md §6 → badges)
 * ============================================================================ */

.badge-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(232,160,32,0.15);
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--green-lt);
  color: var(--green);
  border: 1px solid rgba(61,122,95,0.2);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
}

.badge-featured {
  background: var(--amber-lt);
  color: var(--amber);
  border: 1px solid rgba(232,160,32,0.3);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.tag {
  background: var(--stone);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}


/* ============================================================================
 * 8. Cards
 * (DESIGN.md §6 → cards)
 * ============================================================================ */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.card-featured {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--amber);
}
.card-featured:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.card-dark {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
}
.card-dark:hover { background: rgba(255,255,255,0.08); }


/* ============================================================================
 * 9. Forms
 * (DESIGN.md §6 → forms)
 * ============================================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
}
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.875rem;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--amber); }

.form-note { font-size: 0.72rem; color: var(--muted); }

.form-submit {
  width: 100%;
  background: var(--amber);
  color: var(--navy);
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.2s;
}
.form-submit:hover { background: #d4911a; }


/* ============================================================================
 * 10. Feature icons + lists
 * (DESIGN.md §6 → feature-icon, feature-item, check-list)
 * ============================================================================ */

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.feature-icon.green  { background: var(--green-lt); }
.feature-icon.amber  { background: var(--amber-lt); }
.feature-icon.indigo { background: var(--indigo-lt); }
.feature-icon.navy   { background: var(--navy); color: #fff; }

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.feature-item p { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
.feature-item strong {
  display: block;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}
.check-list li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}
.check-list.light li { color: rgba(255,255,255,0.75); }
.check-list.light li::before { color: var(--green); }


/* ============================================================================
 * 11. Proof bar
 * (DESIGN.md §6 → stats / proof bar)
 * ============================================================================ */

.proof-bar {
  background: var(--navy-mid);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem 2rem;
}
.proof-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.proof-stat { display: flex; align-items: baseline; gap: 0.5rem; }
.proof-num {
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--amber);
}
.proof-lbl { font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.proof-div {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}


/* ============================================================================
 * 12. Grids
 * (DESIGN.md §6 → grids)
 * ============================================================================ */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-3-flush {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stone);
  border-radius: var(--radius-2xl);
  overflow: hidden;
}
.grid-3-flush > * { background: var(--white); }
.grid-copy-card {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3.5rem;
  align-items: center;
}
.grid-copy-card.flip { grid-template-columns: 1.15fr 1fr; }


/* ============================================================================
 * 13. Timeline
 * (DESIGN.md §6 → timeline)
 * ============================================================================ */

.timeline { position: relative; display: flex; flex-direction: column; }
.timeline::before {
  content: '';
  position: absolute;
  left: 23px; top: 12px; bottom: 12px;
  width: 2px;
  background: var(--border);
}
.tl-item {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  padding-bottom: 2.5rem;
  position: relative;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border: 3px solid var(--parch);
}
.tl-content { padding-top: 0.6rem; }
.tl-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.tl-content p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 480px;
}


/* ============================================================================
 * 14. Footer
 * (DESIGN.md §6 → footer)
 * ============================================================================ */

.site-footer {
  background: var(--navy);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.site-footer p { color: rgba(255,255,255,0.35); font-size: 0.78rem; line-height: 1.8; }
.site-footer a { color: rgba(255,255,255,0.5); text-decoration: none; }
.site-footer a:hover { color: rgba(255,255,255,0.8); text-decoration: none; }


/* ============================================================================
 * 15. Accessibility baseline
 * (DESIGN.md §8)
 * ============================================================================ */

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

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


/* ============================================================================
 * 16. Responsive breakpoints
 * (DESIGN.md §7)
 * ============================================================================ */

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-copy-card { grid-template-columns: 1fr; gap: 1.25rem; }
  .grid-3-flush { grid-template-columns: 1fr; }
  .grid-copy-card { gap: 2rem; }
  .section, .section-compact, .section-hero { padding-left: 1.25rem; padding-right: 1.25rem; }
  .site-nav { padding: 0 1.25rem; }
}

@media (max-width: 600px) {
  .site-nav-links a:not(.site-nav-cta) { display: none; }
  .proof-div { display: none; }
  .proof-inner { gap: 1.25rem; }
}
