/* ── Brand tokens ─────────────────────────────────────────────────── */
:root {
  --brand:              #FF9500;
  --brand-soft:         rgba(255, 149, 0, 0.10);
  --brand-glow:         rgba(255, 149, 0, 0.05);
  --brand-border:       rgba(255, 149, 0, 0.20);
  --brand-border-hover: rgba(255, 149, 0, 0.45);
  --brand-soft-hover:   rgba(255, 149, 0, 0.16);
  --font-display:       'Instrument Serif', Georgia, serif;
  --font-body:          -apple-system, BlinkMacSystemFont, 'Geist', system-ui, sans-serif;
}

/* ── Dark mode ink tokens ─────────────────────────────────────────── */
[data-theme="dark"] {
  --ink-mute:  #999999;
  --ink-ghost: #8A8A8A;
}

/* ── Spray effect overlay (click) ─────────────────────────────────── */
.spray-effect {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
}

/* ── Hero overrides ────────────────────────────────────────────────── */

/* Hero background artwork ships as PNG (progressive blur trail lives in
   the alpha channel, not reproducible in SVG). Plain <img> rather than a
   CSS mask: Chrome won't load mask images on file:// pages. The artwork
   is pure white, so inverting in light mode matches --glyph-color, and
   its soft alpha needs a higher base opacity than the solid hero SVGs
   to reach the same presence. */
.hero-bg-png { opacity: 0.07; }
.hero-bg-png img { display: block; width: 100%; height: auto; }
[data-theme="light"] .hero-bg-png img { filter: invert(1); }

/* ── Process list ────────────────────────────────────────────────── */
.process-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2.5rem 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}
.process-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  transition: background 0.25s;
}
.process-step:last-child { border-bottom: none; }
.process-step:hover { background: var(--surface-2); }
.process-step-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--brand);
  letter-spacing: 0.06em;
  min-width: 2rem;
  padding-top: 0.2rem;
  transition: color 0.35s ease;
}

.process-step-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.375rem;
}
.process-step-desc {
  font-size: 0.875rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* ── Infra cards ─────────────────────────────────────────────────── */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
}
.infra-card {
  background: var(--surface-1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.25s;
}
.infra-card:hover { background: var(--surface-2); }
.infra-card-icon {
  color: var(--brand);
  margin-bottom: 0.25rem;
  transition: color 0.35s ease;
}
.infra-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}
.infra-card-desc {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* ── Db architecture ─────────────────────────────────────────────── */
.db-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
}
.db-panel {
  background: var(--surface-1);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background 0.25s;
}
.db-panel:hover { background: var(--surface-2); }
.db-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.db-panel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-panel-dot.swiftdata { background: #30D158; }
.db-panel-dot.grdb { background: var(--brand); transition: background 0.35s ease; }
.db-panel-name {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.db-panel-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}
.db-panel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.db-panel-list li {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  padding-left: 1rem;
  position: relative;
}
.db-panel-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-ghost);
}
.db-panel-stat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand);
  margin-top: 0.25rem;
  transition: color 0.35s ease;
}

/* ── Recommendation engine score mockup ──────────────────────────── */
.score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.score-row:last-child { border-bottom: none; }
.score-label {
  font-size: 0.875rem;
  color: var(--ink-soft);
  min-width: 130px;
}
.score-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.score-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: background 0.35s ease;
}
.score-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-mute);
  min-width: 3rem;
  text-align: right;
}

/* ── Timeline entry mockup ───────────────────────────────────────── */
.timeline-mock {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 2rem 0;
  background: var(--surface-1);
}
.timeline-mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.timeline-mock-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
}
.timeline-mock-meta {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-ghost);
  letter-spacing: 0.06em;
}
.timeline-entry-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.timeline-entry-row:last-child { border-bottom: none; }
.timeline-entry-row:hover { background: var(--surface-2); }
.entry-type-dot {
  width: 28px; height: 28px;
  border-radius: 0.5rem;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink-mute);
  font-size: 0.75rem;
  margin-top: 0.1rem;
}
.entry-type-dot.accent {
  background: var(--brand-soft);
  color: var(--brand);
  transition: background 0.35s ease, color 0.35s ease;
}
.entry-body { flex: 1; }
.entry-type-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 0.25rem;
}
.entry-content {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.entry-date {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-ghost);
  white-space: nowrap;
  padding-top: 0.15rem;
}

/* ── Tier comparison ─────────────────────────────────────────────── */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  margin: 2rem 0;
}
.tier-panel {
  background: var(--surface-1);
  padding: 2rem;
}
.tier-panel-head {
  margin-bottom: 1.5rem;
}
.tier-panel-name {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 0.375rem;
}
.tier-panel-title {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
}
.tier-items { display: flex; flex-direction: column; gap: 0.875rem; }
.tier-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.tier-item-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-top: 0.45em;
  flex-shrink: 0;
}
.tier-item-dot.free { background: var(--ink-ghost); }
.tier-item-dot.extract { background: var(--brand); transition: background 0.35s ease; }
.tier-item-text {
  font-size: 0.875rem;
  color: var(--ink-mute);
  line-height: 1.45;
}
.tier-item-text strong { color: var(--ink); font-weight: 500; }

/* ── Spray video (portrait, capped so it never towers past a screen) ── */
.figma-placeholder:has(> .cs-video) {
  width: fit-content;
  margin-inline: auto;
}
.cs-video { max-height: 80vh; width: auto; max-width: 100%; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.25rem; }
  .nav-links { display: none; }
  .wrap, .wrap-wide { padding: 0 1.25rem; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .infra-grid { grid-template-columns: 1fr; }
  .db-split { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
  .exec-summary { grid-template-columns: 1fr; }
}
