/* ============================================================
   CUPLEX — core styles
   ============================================================ */

:root {
  --bg: #07070a;
  --surface-1: #0e0e12;
  --surface-2: #15151b;
  --surface-3: #1d1d25;
  --line: #26262f;
  --line-hi: #3a3a47;
  --bone: #e8e6e3;
  --bone-dim: #b8b6b3;
  --steel: #6b6b78;
  --steel-dim: #4a4a55;
  --accent: #ff2a6d;
  --accent-dim: #c41f54;
  --accent-glow: rgba(255, 42, 109, 0.35);
  --accent-glow-weak: rgba(255, 42, 109, 0.12);

  --sans: "Space Grotesk", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --density-pad: 32px;
  --density-gap: 24px;
  --grid-opacity: 1;
}

[data-density="compact"] {
  --density-pad: 20px;
  --density-gap: 14px;
}

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

html, body {
  background: var(--bg);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

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

/* ============================================================
   Background — animated grid + vignette
   ============================================================ */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  animation: grid-drift 32s linear infinite;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 85%);
}
.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,42,109,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,42,109,0.05) 1px, transparent 1px);
  background-size: 280px 280px;
}
@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 56px 56px, 56px 56px; }
}

.bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 80% 0%, var(--accent-glow-weak), transparent 45%),
    radial-gradient(circle at 10% 100%, rgba(80,80,200,0.06), transparent 55%);
}

main, nav, footer { position: relative; z-index: 1; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(7, 7, 10, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
}
.logo-glyph {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
}
.logo-glyph svg { width: 100%; height: 100%; display: block; }
.logo-text {
  position: relative;
  padding-right: 14px;
}
.logo-text::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--bone-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--bone); }
.nav-links a.active {
  color: var(--bone);
}
.nav-links a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-hi);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  transition: all 0.15s;
}
.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow-weak), inset 0 0 24px var(--accent-glow-weak);
}
.nav-cta .dot {
  width: 6px; height: 6px;
  background: #3be378;
  border-radius: 50%;
  box-shadow: 0 0 6px #3be378;
}

/* ============================================================
   Eyebrow / labels
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.eyebrow-steel {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
}

/* ============================================================
   Headings
   ============================================================ */
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.02em; }

.h-display {
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.h-display .accent { color: var(--accent); }

h2.section-title {
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

/* Scanline under key heading */
.scanline {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: 18px;
  position: relative;
}
.scanline::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  width: 60px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line-hi);
  background: transparent;
  color: var(--bone);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.btn::before, .btn::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border-color: var(--accent);
  border-style: solid;
  transition: all 0.15s;
}
.btn::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.btn::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow-weak);
}
.btn:hover::before, .btn:hover::after { width: 14px; height: 14px; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary::before, .btn-primary::after { border-color: var(--bone); }
.btn-primary:hover {
  background: var(--bg);
  color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: var(--density-pad);
  position: relative;
  transition: all 0.18s;
}
.card::before, .card::after,
.card > .bracket-tl, .card > .bracket-br {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-style: solid;
  border-color: var(--line-hi);
  transition: border-color 0.18s;
  pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.card::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.card:hover {
  border-color: var(--line-hi);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.card:hover::before, .card:hover::after {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   Tags / chips
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  border: 1px solid var(--line);
  background: var(--surface-1);
}
.chip.dev { color: var(--accent); border-color: var(--accent-dim); }
.chip.game { color: #8fd5ff; border-color: #2d4a60; }
.chip.note { color: #c8a6ff; border-color: #3f2d5f; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  margin-top: 120px;
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
  background: var(--surface-1);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 14px;
  font-weight: 400;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 8px; font-size: 13px; color: var(--bone-dim); }
.footer ul li a:hover { color: var(--accent); }
.footer-base {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
}

/* ============================================================
   Tweaks panel
   ============================================================ */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: var(--surface-2);
  border: 1px solid var(--line-hi);
  padding: 18px;
  width: 260px;
  font-family: var(--mono);
  font-size: 11px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h6 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tweaks-panel h6 .close { cursor: pointer; color: var(--steel); }
.tweak-row {
  margin-bottom: 14px;
}
.tweak-row label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 6px;
}
.tweak-row .options {
  display: flex;
  gap: 4px;
}
.tweak-row .opt {
  flex: 1;
  padding: 6px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--bone-dim);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.tweak-row .opt.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
  box-shadow: inset 0 0 12px var(--accent-glow-weak);
}
.tweak-swatches {
  display: flex;
  gap: 6px;
}
.tweak-swatch {
  width: 28px; height: 28px;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: all 0.15s;
}
.tweak-swatch.active {
  border-color: var(--bone);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px currentColor;
}
