/* PFS Consulting — shared design system */

:root {
  /* Ember (default) */
  --ink: #0A0A0A;
  --ink-2: #1A1A1A;
  --ink-3: #2A2A2A;
  --paper: #F5F1EA;
  --paper-2: #EDE6D9;
  --paper-3: #E0D7C4;
  --accent: #FF5A1F;
  --accent-ink: #FFFFFF;
  --muted: #6B6358;
  --rule: #1A1A1A;
  --rule-soft: rgba(10,10,10,0.12);
  --grid: rgba(10,10,10,0.06);

  /* Typography presets */
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-display-style: normal;
  --font-display-weight: 400;
  --font-display-tracking: -0.02em;
  --font-body: "Geist", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", monospace;
  --display-italic-style: italic;
}

/* Editorial (default) — Instrument Serif + Geist */
[data-type="editorial"] {
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-display-weight: 400;
  --font-display-tracking: -0.02em;
  --font-body: "Geist", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", monospace;
  --display-italic-style: italic;
}

/* Modern Sans — Inter Display only, Swiss feel */
[data-type="sans"] {
  --font-display: "Inter Display", "Inter", -apple-system, system-ui, sans-serif;
  --font-display-weight: 500;
  --font-display-tracking: -0.04em;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Geist Mono", monospace;
  --display-italic-style: normal;
}

/* Magazine — high-contrast editorial: bold display + clean sans */
[data-type="magazine"] {
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-display-weight: 600;
  --font-display-tracking: -0.03em;
  --font-body: "Geist", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", monospace;
  --display-italic-style: italic;
}

[data-palette="electric"] {
  --accent: #3D5AFE;
  --accent-ink: #FFFFFF;
}

[data-palette="mono"] {
  --accent: #0A0A0A;
  --accent-ink: #F5F1EA;
}

[data-palette="saas"] {
  --accent: #3D5AFE;
  --accent-ink: #FFFFFF;
}

[data-theme="dark"] {
  --ink: #EDE6D9;
  --ink-2: #D4CCB8;
  --ink-3: #A9A192;
  --paper: #0A0A0A;
  --paper-2: #141414;
  --paper-3: #1F1F1F;
  --muted: #8A8578;
  --rule: #2A2A2A;
  --rule-soft: rgba(237,230,217,0.14);
  --grid: rgba(237,230,217,0.06);
}
[data-theme="dark"][data-palette="mono"] {
  --accent: #EDE6D9;
  --accent-ink: #0A0A0A;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv01";
}

body {
  overflow-x: hidden;
}

/* Type */
.display, h1.display {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  letter-spacing: var(--font-display-tracking);
  line-height: 0.95;
  font-style: normal;
}
.display em, h1.display em {
  font-style: var(--display-italic-style);
  color: var(--accent);
  font-weight: inherit;
}
[data-palette="mono"] .display em {
  color: var(--ink);
  background: linear-gradient(to bottom, transparent 62%, var(--paper-3) 62%, var(--paper-3) 92%, transparent 92%);
  padding: 0 0.08em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Layout */
.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 720px) {
  .wrap { padding: 0 22px; }
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .mark {
  font-family: "Instrument Serif", serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  font-style: italic;
}
.wordmark .mark b {
  font-style: normal;
  font-weight: 400;
}
.wordmark .tag {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--rule-soft);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.nav-links a[aria-current="page"]::after,
.nav-links a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 100px;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--accent); color: var(--accent-ink); }
.nav-cta::after { content: "→"; font-family: "Geist Mono", monospace; }

@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(0.92); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { font-family: "Geist Mono", monospace; transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* Section scaffold */
section {
  position: relative;
  padding: 120px 0;
  border-top: 1px solid var(--rule-soft);
}
@media (max-width: 720px) {
  section { padding: 72px 0; }
}

.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label .num {
  color: var(--ink);
  font-weight: 500;
}
.section-label .line {
  flex: 1;
  height: 1px;
  background: var(--rule-soft);
  max-width: 80px;
}

/* Cards */
.card {
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  padding: 32px;
  position: relative;
}

/* Blueprint grid bg */
.blueprint {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Coordinate ticks at corners of section */
.tick {
  position: absolute;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.tick.tl { top: 16px; left: 40px; }
.tick.tr { top: 16px; right: 40px; }
.tick.bl { bottom: 16px; left: 40px; }
.tick.br { bottom: 16px; right: 40px; }

/* Footer */
footer {
  background: var(--ink);
  color: var(--paper-2);
  padding: 80px 0 40px;
}
[data-theme="dark"] footer { background: #000; border-top: 1px solid var(--rule); }
footer .wrap { color: var(--paper-2); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(245,241,234,0.12);
}
.footer-grid h4 {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.55);
  margin-bottom: 20px;
}
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 12px; }
.footer-grid a {
  color: var(--paper-2);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
}
.footer-grid a:hover { opacity: 1; color: var(--accent); }
.footer-display {
  font-family: "Instrument Serif", serif;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.footer-display em { color: var(--accent); font-style: italic; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,241,234,0.55);
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 16px;
  width: 260px;
  font-size: 13px;
  display: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.tweaks.open { display: block; }
.tweaks h5 {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.tweaks .row { display: flex; gap: 6px; margin-bottom: 14px; }
.tweaks .row:last-child { margin-bottom: 0; }
.tweak-swatch {
  flex: 1;
  height: 32px;
  border: 1px solid var(--rule-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-2);
  transition: all 0.15s;
}
.tweak-swatch.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tweak-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* Utilities */
.accent-text { color: var(--accent); }
.muted { color: var(--muted); }
hr.rule { border: none; border-top: 1px solid var(--rule-soft); margin: 0; }

/* Tables / lists shared */
.kv-list {
  list-style: none;
  border-top: 1px solid var(--rule-soft);
}
.kv-list li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.kv-list li .idx {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.kv-list li .label {
  font-size: 17px;
  color: var(--ink);
}
.kv-list li .meta {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Ink block (reused) */
.ink-block {
  background: var(--ink);
  color: var(--paper);
}
.ink-block .eyebrow { color: rgba(245,241,234,0.55); }
.ink-block .eyebrow .dot { background: var(--accent); }
[data-theme="dark"] .ink-block {
  background: var(--paper-2);
  color: var(--ink);
}
[data-theme="dark"] .ink-block .eyebrow { color: var(--muted); }

/* Diagram helpers */
.diagram-node {
  fill: var(--paper-2);
  stroke: var(--ink);
  stroke-width: 1;
}
.diagram-edge {
  stroke: var(--ink);
  stroke-width: 1;
  fill: none;
}
.diagram-accent {
  fill: var(--accent);
  stroke: var(--accent);
}
.diagram-text {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  fill: var(--ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.diagram-text-muted {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  fill: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Scroll reveal subtle */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* === Type preset overrides — uses higher specificity to defeat per-page font-family declarations === */
/* These match anywhere "Instrument Serif" or "Geist Mono" was hardcoded.
   The :where() trick keeps specificity low while the [data-type] attribute selector
   on html boosts it just enough to override per-page rules. */

html[data-type] .display,
html[data-type] h1.display,
html[data-type] h2.display,
html[data-type] h3.display { font-family: var(--font-display) !important; font-weight: var(--font-display-weight) !important; letter-spacing: var(--font-display-tracking) !important; }
html[data-type] .display em,
html[data-type] h1.display em,
html[data-type] h2 em,
html[data-type] h3 em,
html[data-type] .audience-title em,
html[data-type] .case-title em,
html[data-type] .svc-title em,
html[data-type] .case-heading em { font-style: var(--display-italic-style) !important; color: var(--accent) !important; }

/* Force every font-family declaration to flow through our variables */
html[data-type] [style*="Instrument Serif"],
html[data-type] *[class] { /* will be more specific via cascade below */ }

/* Universal overrides — beat any inline-style-block selectors */
html[data-type="editorial"] body, html[data-type="editorial"] body * { font-family: inherit; }
html[data-type="sans"] body, html[data-type="sans"] body * { font-family: inherit; }
html[data-type="magazine"] body, html[data-type="magazine"] body * { font-family: inherit; }

/* Reapply role-specific fonts at top of each html[data-type] tree */
html[data-type] body {
  font-family: var(--font-body) !important;
}
html[data-type] .display, html[data-type] h1.display, html[data-type] h2.display,
html[data-type] .case-title, html[data-type] .svc-title, html[data-type] .audience-title,
html[data-type] .price-card h2, html[data-type] .ladder h2, html[data-type] .price-range .val, html[data-type] .price-range .dash,
html[data-type] .footer-display,
html[data-type] .wordmark .mark,
html[data-type] .belief h3, html[data-type] .beliefs h2,
html[data-type] .diff h3,
html[data-type] .mission h2,
html[data-type] .case-heading, html[data-type] .case-num, html[data-type] .case-metrics .big,
html[data-type] .why h2, html[data-type] .why-item h3,
html[data-type] .svc-num, html[data-type] .svc-outcome .v,
html[data-type] .step h4, html[data-type] .step .n,
html[data-type] .case-result-bar .big, html[data-type] .results .big, html[data-type] .result-row .big,
html[data-type] .testimonials-head h2, html[data-type] .t-card blockquote, html[data-type] .t-card .mark,
html[data-type] .offer-head h2, html[data-type] .offer-card h3, html[data-type] .offer-card .b .outcome, html[data-type] .offer-card .b .specs .v,
html[data-type] .hero-stat .num,
html[data-type] .lead-drop, html[data-type] .story-text p,
html[data-type] .aside-item .v, html[data-type] .details-list li .v,
html[data-type] .faq-grid h2, html[data-type] .faq-q .q,
html[data-type] .diag-grid .info h2, html[data-type] .form h3,
html[data-type] .path h2,
html[data-type] .trust-grid .v,
html[data-type] .ladder-row .scope,
html[data-type] .final-cta h2, html[data-type] .cs-cta h2, html[data-type] .svc-cta h2,
html[data-type] .problem-quote, html[data-type] .problem-headline,
html[data-type] .whatwedo h2, html[data-type] .whatwedo-result .text {
  font-family: var(--font-display) !important;
  font-weight: var(--font-display-weight) !important;
  letter-spacing: var(--font-display-tracking) !important;
}

html[data-type] .eyebrow, html[data-type] .mono,
html[data-type] .nav-cta::after, html[data-type] .btn .arrow,
html[data-type] .wordmark .tag,
html[data-type] .section-label, html[data-type] .section-label .num,
html[data-type] .hero-meta, html[data-type] .hero-stat .cap,
html[data-type] .marquee-track,
html[data-type] .problem-item .idx, html[data-type] .problem-item .status,
html[data-type] .whatwedo-points li::before, html[data-type] .whatwedo-result .label,
html[data-type] .step .arrow-next, html[data-type] .step .n .arrow-next,
html[data-type] .case-tag, html[data-type] .case-meta .case-chip, html[data-type] .case-chip,
html[data-type] .case-col h5, html[data-type] .case-result-bar .cap, html[data-type] .case-metrics .cap,
html[data-type] .t-card .author,
html[data-type] .offer-card .b h4, html[data-type] .offer-card .b .specs .k,
html[data-type] .footer-grid h4, html[data-type] .footer-bottom,
html[data-type] .belief .num, html[data-type] .case-num, html[data-type] .svc-num,
html[data-type] .diff .num, html[data-type] .why-item .mark,
html[data-type] .audience-cols h4, html[data-type] .story-cracks li .t,
html[data-type] .aside-item .k, html[data-type] .details-list li .k,
html[data-type] .faq-q .n, html[data-type] .faq-q .toggle,
html[data-type] .diag-steps li .idx, html[data-type] .form-row label, html[data-type] .form-note, html[data-type] .form .submit,
html[data-type] .path .time,
html[data-type] .price-range .from, html[data-type] .price-note, html[data-type] .price-card .b h3,
html[data-type] .included li .idx, html[data-type] .ladder-row .tier, html[data-type] .ladder-row .price,
html[data-type] .trust-grid .k, html[data-type] .svc-tag, html[data-type] .svc-toc .idx, html[data-type] .svc-toc .meta,
html[data-type] .svc-body .col h4, html[data-type] .svc-list li .idx, html[data-type] .svc-outcome .k,
html[data-type] .why-item .mark, html[data-type] .case-result-bar .cell,
html[data-type] .tweaks h5, html[data-type] .tweak-swatch,
html[data-type] .diagram-text, html[data-type] .diagram-text-muted,
html[data-type] .nav-cta {
  font-family: var(--font-mono) !important;
}

/* Italics for display "em" should be NORMAL when sans preset */
html[data-type="sans"] .display em,
html[data-type="sans"] h1.display em,
html[data-type="sans"] h2 em,
html[data-type="sans"] h3 em,
html[data-type="sans"] .case-title em,
html[data-type="sans"] .audience-title em,
html[data-type="sans"] .svc-title em,
html[data-type="sans"] .case-heading em,
html[data-type="sans"] .lead-drop,
html[data-type="sans"] .belief .num,
html[data-type="sans"] .case-num,
html[data-type="sans"] .svc-num,
html[data-type="sans"] em,
html[data-type="sans"] .outcome,
html[data-type="sans"] .svc-outcome .v,
html[data-type="sans"] .t-card .mark,
html[data-type="sans"] .whatwedo-result .text,
html[data-type="sans"] .footer-display em,
html[data-type="sans"] .wordmark .mark { font-style: normal !important; }

/* Magazine preset — heavier display weight */
html[data-type="magazine"] .display,
html[data-type="magazine"] h1.display,
html[data-type="magazine"] .case-heading,
html[data-type="magazine"] .audience-title,
html[data-type="magazine"] .svc-title { font-weight: 600 !important; }

/* SaaS palette dark mode tweaks */
[data-theme="dark"][data-palette="saas"] {
  --accent: #6B83FF;
}
