/* CardHouse — shared system */
:root {
  --bg: #0A0A0A;
  --bg-2: #141311;
  --bg-3: #1C1A17;
  --fg: #EDEAE4;
  --fg-2: #C6C1B8;
  --fg-3: #7A756E;
  --fg-4: #3A3833;
  --hair: rgba(237, 234, 228, 0.08);
  --hair-strong: rgba(237, 234, 228, 0.18);
  --accent: oklch(0.45 0.16 25);      /* oxblood */
  --accent-ink: oklch(0.92 0.04 25);
  --accent-deep: oklch(0.32 0.14 25);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;

  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
}

[data-accent="gold"]  { --accent: oklch(0.72 0.13 75);  --accent-ink: oklch(0.96 0.04 85);  --accent-deep: oklch(0.55 0.12 70); }
[data-accent="blue"]  { --accent: oklch(0.58 0.18 255); --accent-ink: oklch(0.94 0.04 250); --accent-deep: oklch(0.42 0.16 258); }
[data-accent="red"]   { --accent: oklch(0.45 0.16 25);  --accent-ink: oklch(0.92 0.04 25);  --accent-deep: oklch(0.32 0.14 25); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  overflow-x: hidden;
}

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

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

/* Grain overlay via SVG noise */
.grain {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 1000;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.88  0 0 0 0 0.84  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Typography system */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: middle;
  transform: translateY(-1px);
}

.display {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 0.92;
  text-wrap: balance;
}

.h1 { font-size: clamp(56px, 10vw, 168px); }
.h2 { font-size: clamp(40px, 6vw, 96px); }
.h3 { font-size: clamp(28px, 3.2vw, 48px); }
.h4 { font-size: clamp(20px, 1.6vw, 28px); }

.lede {
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.45;
  color: var(--fg-2);
  font-weight: 300;
  letter-spacing: -0.01em;
  max-width: 64ch;
  text-wrap: pretty;
}

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--fg-3); }

/* Containers */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1680px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(80px, 10vw, 160px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--hair); }

.hr { height: 1px; background: var(--hair); border: 0; margin: 0; }

/* Top nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: rgba(10,10,10,0.55);
  border-bottom: 1px solid var(--hair);
}
.nav-logo {
  font-family: var(--display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 10px;
}
.nav-logo .mark {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  position: relative;
}
.nav-logo .mark svg { width: 100%; height: 100%; }
.nav-links {
  display: flex; gap: 28px;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.nav-links a {
  position: relative;
  padding: 6px 2px;
  transition: color 0.2s;
}
.nav-links a::after {
  content: ''; position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--accent);
  transition: right 0.35s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { right: 0; }
.nav-links a[aria-current="page"] { color: var(--fg); }
.nav-links a[aria-current="page"]::after { right: 0; background: var(--accent); }

.nav-meta {
  display: flex; justify-content: flex-end; gap: 18px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-3);
}
.nav-meta .live {
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-meta .live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent);
  animation: livepulse 2s infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--hair-strong);
  color: var(--fg);
  transition: all 0.25s ease;
  cursor: pointer;
  background: transparent;
}
.btn .arr { transition: transform 0.25s ease; display: inline-block; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); background: color-mix(in oklch, var(--accent) 15%, transparent); }
.btn:hover .arr { transform: translateX(4px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-deep); }

/* Placeholders (striped) */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(237,234,228,0.04) 0 1px,
      transparent 1px 10px),
    linear-gradient(180deg, #141311, #0f0e0c);
  border: 1px solid var(--hair);
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  left: 14px; bottom: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  background: rgba(10,10,10,0.7);
  padding: 5px 9px;
  border: 1px solid var(--hair);
}
.ph--corner::before {
  content: attr(data-corner);
  position: absolute;
  right: 14px; top: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--fg-3);
}

/* Footer */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--hair);
  padding: 100px var(--gutter) 36px;
  position: relative;
}
.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer-wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 4vw, 72px);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--fg);
  mix-blend-mode: normal;
  min-width: 0;
  white-space: nowrap;
}
.footer-col { min-width: 0; }
.footer-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  margin: 0 0 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col li a { color: var(--fg-2); font-size: 14px; transition: color 0.2s; }
.footer-col li a:hover { color: var(--accent-ink); }
.footer-bar {
  max-width: var(--maxw); margin: 80px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-3);
}
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-legal a { color: var(--fg-3); transition: color 0.2s; }
.footer-legal a:hover { color: var(--accent-ink); }

/* Legal / text pages */
.legal-hero { padding: 160px var(--gutter) 0; max-width: var(--maxw); margin: 0 auto; }
.legal-hero .ch { font-family: var(--mono); font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 22px; display: flex; align-items: center; gap: 12px; }
.legal-hero .ch::before { content: ''; width: 40px; height: 1px; background: var(--accent); }
.legal-hero h1 { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(44px, 7vw, 96px); letter-spacing: -0.04em; line-height: 0.9; font-stretch: 125%; }
.legal-body { max-width: 760px; margin: 0 auto; padding: clamp(48px, 6vw, 80px) var(--gutter) clamp(80px, 10vw, 140px); }
.legal-body .updated { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); padding-bottom: 28px; margin-bottom: 40px; border-bottom: 1px solid var(--hair); }
.legal-body .lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--fg); margin: 0 0 8px; }
.legal-body h2 { font-family: var(--display); font-weight: 900; font-size: clamp(20px, 2vw, 26px); letter-spacing: -0.02em; color: var(--fg); margin: 44px 0 12px; }
.legal-body p { font-size: 16px; line-height: 1.7; color: var(--fg-2); margin: 0 0 16px; }
.legal-body p strong { color: var(--fg); font-weight: 500; }
.legal-body a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal-body a:hover { color: var(--fg); }
@media (max-width: 700px) {
  .legal-hero { padding-top: 130px; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.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; }

/* Tweaks panel */
.tweaks {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  background: rgba(20,19,17,0.95);
  border: 1px solid var(--hair-strong);
  backdrop-filter: blur(10px);
  padding: 16px 18px;
  display: none;
  min-width: 240px;
}
.tweaks.on { display: block; }
.tweaks h5 {
  margin: 0 0 12px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-3); font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks h5::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.swatches { display: flex; gap: 10px; }
.swatch {
  flex: 1; height: 36px;
  border: 1px solid var(--hair-strong);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
}
.swatch[aria-selected="true"] { border-color: var(--fg); }
.swatch[data-c="red"]   { background: oklch(0.45 0.16 25); }
.swatch[data-c="gold"]  { background: oklch(0.72 0.13 75); }
.swatch[data-c="blue"]  { background: oklch(0.58 0.18 255); }
.swatch span {
  position: absolute; bottom: -18px; left: 0;
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-3);
}
.tweaks .labels { height: 14px; margin-top: 8px; }

/* Mobile */
@media (max-width: 900px) {
  .nav {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px var(--gutter);
  }
  .nav-meta { display: none; }
  .nav-logo { justify-self: center; }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    font-size: 10.5px;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-wordmark { grid-column: 1 / -1; }
}
