/* ============================================================
   Silicon Verification Consultants — Design Tokens
   Editorial × Engineering. Three palettes, three type pairs,
   dark / light modes. Driven by data-attrs on <html>.
   ============================================================ */

:root {
  /* defaults — overridden by data-palette / data-type / data-mode */
  --ink: #14130F;
  --bone: #F5F1E8;
  --paper: #FBF8F1;
  --paper-2: #EFEAE0;
  --rule: rgba(20, 19, 15, 0.14);
  --rule-strong: rgba(20, 19, 15, 0.32);
  --muted: rgba(20, 19, 15, 0.62);
  --soft: rgba(20, 19, 15, 0.04);

  --accent: #E2530E;
  --accent-ink: #1A0A03;
  --accent-soft: rgba(226, 83, 14, 0.10);

  --signal: #1F6F7B;     /* secondary technical accent */
  --warn: #C2410C;

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;

  --tracking-mono: 0.08em;
  --tracking-eyebrow: 0.18em;

  --radius-card: 14px;
  --radius-pill: 999px;

  --max: 1320px;
  --gutter: clamp(20px, 4vw, 56px);

  /* spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
}

/* ---------- DARK MODE ---------- */
:root[data-mode="dark"] {
  --ink: #F2EFE7;
  --bone: #0C0B09;
  --paper: #0F0E0B;
  --paper-2: #16140F;
  --rule: rgba(242, 239, 231, 0.12);
  --rule-strong: rgba(242, 239, 231, 0.28);
  --muted: rgba(242, 239, 231, 0.62);
  --soft: rgba(242, 239, 231, 0.04);
  --accent-soft: rgba(226, 83, 14, 0.14);
  --accent-ink: #FFEDDE;
}

/* ---------- PALETTE: ember (default) ---------- */
:root[data-palette="ember"] { --accent: #E2530E; --signal: #1F6F7B; }
:root[data-palette="ember"][data-mode="dark"] { --accent: #FF6A22; }

/* ---------- PALETTE: cobalt ---------- */
:root[data-palette="cobalt"] {
  --accent: #1D4ED8;
  --accent-ink: #04102E;
  --signal: #B45309;
  --accent-soft: rgba(29, 78, 216, 0.10);
}
:root[data-palette="cobalt"][data-mode="dark"] {
  --accent: #5B8CFF;
  --accent-ink: #E6EEFF;
  --accent-soft: rgba(91, 140, 255, 0.16);
}

/* ---------- PALETTE: verdant ---------- */
:root[data-palette="verdant"] {
  --accent: #2F6B3B;
  --accent-ink: #0A1B0E;
  --signal: #8A5A1F;
  --accent-soft: rgba(47, 107, 59, 0.12);
  --bone: #F1EFE6;
  --paper: #F7F4EA;
  --paper-2: #E8E4D6;
}
:root[data-palette="verdant"][data-mode="dark"] {
  --accent: #6AB477;
  --accent-ink: #E4F2E7;
  --accent-soft: rgba(106, 180, 119, 0.18);
}

/* ---------- TYPE PAIRINGS ---------- */
:root[data-type="editorial"] {
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}
:root[data-type="technical"] {
  --serif: 'Space Grotesk', sans-serif;
  --sans: 'Space Grotesk', ui-sans-serif, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
:root[data-type="precision"] {
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'DM Sans', ui-sans-serif, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ============================================================
   Base
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
}

body { min-height: 100vh; }

/* the SPA root */
#root { display: block; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ============================================================
   Typography utilities
   ============================================================ */

.t-display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 152px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:root[data-type="technical"] .t-display,
:root[data-type="precision"] .t-display { font-weight: 500; letter-spacing: -0.035em; }

.t-h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 96px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:root[data-type="technical"] .t-h1,
:root[data-type="precision"] .t-h1 { font-weight: 500; letter-spacing: -0.03em; }

.t-h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
:root[data-type="technical"] .t-h2,
:root[data-type="precision"] .t-h2 { font-weight: 500; letter-spacing: -0.02em; }

.t-h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.t-body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
}
.t-body.muted { color: var(--muted); }

.t-lead {
  font-family: var(--sans);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.45;
  color: var(--muted);
  max-width: 56ch;
  text-wrap: pretty;
}

.t-mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--muted);
}

.t-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}

.t-num {
  font-family: var(--serif);
  font-feature-settings: "tnum", "lnum";
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Layout
   ============================================================ */

.shell { width: 100%; padding-inline: var(--gutter); }
.wrap { max-width: var(--max); margin: 0 auto; }
.row { display: flex; gap: var(--s-5); }
.col { display: flex; flex-direction: column; gap: var(--s-5); }

.section {
  padding-block: clamp(64px, 8vw, 128px);
  position: relative;
}

.rule { height: 1px; background: var(--rule); width: 100%; }
.rule.strong { background: var(--rule-strong); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn .arrow { display: inline-flex; transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-accent:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--soft); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: var(--tracking-mono);
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink);
  transition: color .2s ease, border-color .2s ease, gap .2s ease;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--bone);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--s-6);
  transition: border-color .25s ease, transform .25s ease, background-color .25s ease;
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: var(--rule-strong); }

.card.dark { background: var(--ink); color: var(--paper); border-color: transparent; }
.card.dark .t-body { color: var(--paper); }
.card.dark .t-body.muted { color: rgba(245, 241, 232, 0.62); }

/* ============================================================
   Schematic / engineering details
   ============================================================ */

/* corner crosshairs / fiducials */
.crosshair {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  opacity: 0.5;
}
.crosshair::before, .crosshair::after {
  content: ""; position: absolute; background: var(--ink);
}
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.crosshair::after  { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.crosshair.tl { top: var(--gutter); left: var(--gutter); }
.crosshair.tr { top: var(--gutter); right: var(--gutter); }
.crosshair.bl { bottom: var(--gutter); left: var(--gutter); }
.crosshair.br { bottom: var(--gutter); right: var(--gutter); }

/* label tag — used like a sticker */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* page-frame metadata strip at top of every page */
.meta-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--muted);
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}
.meta-strip .group { display: flex; gap: 24px; }
.meta-strip .group span { display: inline-flex; gap: 6px; }
.meta-strip .group b { color: var(--ink); font-weight: 500; }

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 18px;
  gap: 32px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 450;
  letter-spacing: -0.005em;
  color: var(--ink);
  position: relative;
  padding-block: 4px;
  cursor: pointer;
  transition: color .2s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); }
.nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; background: var(--accent);
}

.nav-svc {
  position: relative;
}
.nav-svc-menu {
  position: absolute;
  top: 100%;
  left: -16px;
  margin-top: 12px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 8px;
  min-width: 280px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  display: none;
}
.nav-svc:hover .nav-svc-menu { display: block; }
.nav-svc-menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-svc-menu a:hover { background: var(--soft); color: var(--accent); }
.nav-svc-menu .sec {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: var(--tracking-mono);
  text-transform: uppercase; color: var(--muted);
  padding: 12px 12px 6px;
}

/* ============================================================
   Logo lockup
   ============================================================ */

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.logo-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  position: relative;
  background: var(--paper);
}
.logo-mark::before, .logo-mark::after {
  content: ""; position: absolute; background: var(--accent);
}
.logo-mark::before { width: 10px; height: 2px; left: -3px; top: 50%; transform: translateY(-50%); box-shadow: 0 0 0 #0000, 35px 0 0 var(--accent); }
.logo-mark::after  { width: 2px; height: 10px; left: 50%; top: -3px; transform: translateX(-50%); box-shadow: 0 35px 0 var(--accent); }
.logo-mark .inner {
  width: 14px; height: 14px; background: var(--ink); border-radius: 2px;
}
.logo-word { display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.logo-word b { font-family: var(--serif); font-size: 19px; font-weight: 400; letter-spacing: -0.01em; }
.logo-word small { font-family: var(--mono); font-size: 9px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--muted); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 112px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-tag-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }

.hero-headline em {
  font-style: italic;
  color: var(--accent);
  font-family: var(--serif);
}
:root[data-type="technical"] .hero-headline em,
:root[data-type="precision"] .hero-headline em { font-style: normal; font-weight: 600; }

.hero-meta {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.hero-meta .item small { display: block; }

/* ============================================================
   Stats strip
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-block: 1px solid var(--rule-strong);
}
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat {
  padding: 40px 28px;
  display: flex; flex-direction: column; gap: 8px;
  border-right: 1px solid var(--rule);
  position: relative;
}
.stat:last-child { border-right: 0; }
@media (max-width: 800px) {
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
.stat .num {
  font-family: var(--serif);
  font-size: clamp(48px, 5vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum", "lnum";
}
:root[data-type="technical"] .stat .num,
:root[data-type="precision"] .stat .num { font-weight: 500; letter-spacing: -0.03em; }

.stat .num sup {
  font-family: var(--mono);
  font-size: 13px;
  vertical-align: top;
  position: relative;
  top: 14px;
  color: var(--accent);
  margin-left: 4px;
}

/* ============================================================
   Service grid
   ============================================================ */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule-strong);
}
@media (max-width: 900px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .svc-grid { grid-template-columns: 1fr; } }

.svc-cell {
  padding: 36px 32px;
  border-right: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
  position: relative;
  cursor: pointer;
  transition: background .3s ease, color .3s ease;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 320px;
}
.svc-cell:hover { background: var(--ink); color: var(--paper); }
.svc-cell:hover .t-mono { color: rgba(245,241,232,0.62); }
.svc-cell:hover .svc-cell-arrow { transform: translate(4px, -4px); color: var(--accent); }

.svc-cell-head {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.svc-cell-arrow {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  transition: transform .25s ease, color .25s ease;
}
.svc-cell-title {
  font-family: var(--serif);
  font-size: clamp(28px, 2.4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-top: auto;
}
:root[data-type="technical"] .svc-cell-title,
:root[data-type="precision"] .svc-cell-title { font-weight: 500; letter-spacing: -0.025em; }

.svc-cell-desc {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 30ch;
}
.svc-cell:hover .svc-cell-desc { color: rgba(245,241,232, 0.7); }

.svc-cell-icon { color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: 80px 40px;
  position: relative;
  overflow: hidden;
}
.footer .rule { background: rgba(245,241,232,0.16); }
.footer .t-mono { color: rgba(245,241,232,0.62); }
.footer-mega {
  font-family: var(--serif);
  font-size: clamp(64px, 11.5vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 56px 0 40px;
  white-space: nowrap;
  color: var(--paper);
}
:root[data-type="technical"] .footer-mega,
:root[data-type="precision"] .footer-mega { font-weight: 500; letter-spacing: -0.045em; }
.footer-mega em { font-style: italic; color: var(--accent); }
:root[data-type="technical"] .footer-mega em,
:root[data-type="precision"] .footer-mega em { font-style: normal; font-weight: 600; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.footer-col h6 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: rgba(245,241,232,0.5);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 15px;
  line-height: 1.6;
  color: var(--paper);
  margin: 0;
  padding: 2px 0;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--accent); }

/* ============================================================
   Forms
   ============================================================ */

.field {
  display: flex; flex-direction: column; gap: 8px;
}
.field label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  font-family: var(--sans);
  font-size: 16px;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--ink);
  outline: none;
  transition: border-color .2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--accent); }
.field textarea { resize: vertical; min-height: 100px; }

/* ============================================================
   Misc
   ============================================================ */

.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  opacity: 0.5;
}

.pulse {
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* clip when needed */
.clip { overflow: hidden; }

/* utility */
.hidden { display: none !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }
.mb-6 { margin-bottom: 64px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mt-6 { margin-top: 64px; }

/* page transition removed — explicit instant render so screenshots capture cleanly */
.page-enter { opacity: 1; }

/* selection */
::selection { background: var(--accent); color: var(--accent-ink); }

/* scrollbar (subtle) */
* { scrollbar-color: var(--rule-strong) transparent; scrollbar-width: thin; }
