/* Virion Software — shared design system */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  /* Defaults — overridable via Tweaks */
  --accent: #FFB224;
  --accent-soft: rgba(255, 178, 36, 0.12);
  --accent-line: rgba(255, 178, 36, 0.35);

  /* Dark tokens */
  --bg: #0A0A0B;
  --bg-1: #0F1012;
  --bg-2: #141518;
  --bg-3: #1B1C20;
  --fg: #ECEDEF;
  --fg-dim: #9498A0;
  --fg-faint: #5A5E67;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --grid: rgba(255, 255, 255, 0.035);

  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 12px;

  --maxw: 1320px;
  --gutter: 24px;
  --density: 1;

  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  --easing: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #F6F5F1;
  --bg-1: #EEEDE7;
  --bg-2: #E6E4DC;
  --bg-3: #DCDAD0;
  --fg: #0A0A0B;
  --fg-dim: #555860;
  --fg-faint: #9A9DA4;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.18);
  --grid: rgba(0, 0, 0, 0.04);
  --accent-soft: rgba(255, 178, 36, 0.18);
  --accent-line: rgba(180, 120, 0, 0.4);
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

::selection { background: var(--accent); color: #000; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 20%, transparent 80%);
}

/* Side rails — dev-tool feel */
.rails {
  position: fixed;
  top: 0; bottom: 0;
  width: 100%;
  max-width: var(--maxw);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.rails::before, .rails::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.rails::before { left: var(--gutter); }
.rails::after { right: var(--gutter); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.nav-brand .mark {
  width: 22px; height: 22px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.nav-links a {
  position: relative;
  padding: 8px 14px;
  color: var(--fg-dim);
  transition: color 0.2s var(--easing);
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current="page"] {
  color: var(--fg);
}
.nav-links a[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: 14px; right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: all 0.2s var(--easing);
}
.nav-cta:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.nav-cta .arrow {
  transition: transform 0.2s var(--easing);
}
.nav-cta:hover .arrow { transform: translateX(2px); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  transition: all 0.2s var(--easing);
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-strong); }
.theme-toggle .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 8px; height: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  display: inline-block;
  transform: rotate(45deg);
}

.display {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(48px, 7.5vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.display em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent);
}

h2.section-title {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
h3 { font-weight: 500; letter-spacing: -0.015em; }

.lede {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  color: var(--fg-dim);
  max-width: 56ch;
}

.mono { font-family: var(--mono); }

/* ---------- Section scaffolding ---------- */
section { position: relative; z-index: 2; }

.section {
  padding: calc(120px * var(--density)) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 64px;
  align-items: end;
}
.section-head .tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head .tag .num {
  color: var(--accent);
  font-weight: 500;
}
@media (max-width: 780px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: all 0.2s var(--easing);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 500;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px var(--accent);
}
.btn-ghost {
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--fg);
  background: var(--bg-2);
}
.btn .arrow { transition: transform 0.25s var(--easing); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Card patterns ---------- */
.card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--easing), transform 0.35s var(--easing);
}
.card:hover { border-color: var(--line-strong); }

.corners::before,
.corners::after,
.corners > .c-tl,
.corners > .c-tr {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--easing);
}
.corners::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.corners::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.corners .c-tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.corners .c-tl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.corners:hover::before,
.corners:hover::after,
.corners:hover > .c-tl,
.corners:hover > .c-tr { opacity: 1; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
  background: var(--bg);
  position: relative;
  z-index: 2;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col a {
  display: block;
  color: var(--fg-dim);
  padding: 4px 0;
  font-size: 14px;
  transition: color 0.2s var(--easing);
}
.footer-col a:hover { color: var(--fg); }
.footer-brand .lede { font-size: 14px; max-width: 32ch; margin-top: 12px; }
.footer-bottom {
  max-width: var(--maxw);
  margin: 48px auto 0;
  padding: 20px var(--gutter) 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
@media (max-width: 780px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Tweaks panel ---------- */
.tweaks {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 200;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 260px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.8);
  display: none;
  font-family: var(--mono);
  font-size: 12px;
}
.tweaks.active { display: block; }
.tweaks h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tweaks h6::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.tweak-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.tweak-row:first-of-type { border-top: none; }
.tweak-row label { color: var(--fg-dim); }
.swatches { display: flex; gap: 6px; }
.swatch {
  width: 18px; height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.15s var(--easing);
}
.swatch:hover { transform: scale(1.12); }
.swatch[data-active="true"] { outline: 2px solid var(--fg); outline-offset: 1px; }
.seg {
  display: flex;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg button {
  padding: 4px 9px;
  color: var(--fg-dim);
  font-size: 11px;
  font-family: var(--mono);
}
.seg button[data-active="true"] { background: var(--accent); color: #000; }

/* ---------- Utility ---------- */
.cluster { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }

.hex-marker {
  width: 14px; height: 14px;
  display: inline-block;
  background: var(--accent);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  margin-right: 8px;
  vertical-align: middle;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--fg-dim);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.noise { display: none; }
