/* ---------- tokens ---------- */
:root {
  --chassis: #17121a;
  --panel: #221a27;
  --line: #3a2d40;
  --crt: #ff1f3d;
  --crt-deep: #c80f28;
  --rim: #52e5f2;
  --tile: #f8d5ee;
  --ink: #f3eef5;
  --muted: #a597ad;
  --clip: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--chassis);
  color: var(--ink);
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 2px solid var(--rim);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  clip-path: var(--clip);
  white-space: nowrap;
}
.btn-primary {
  background: var(--crt);
  color: #fff;
}
.btn-primary:hover { background: var(--crt-deep); }
.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--rim); }
.btn-text {
  background: none;
  border: none;
  color: var(--rim);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--clip);
  text-decoration: none;
}
.icon-btn:hover { box-shadow: inset 0 0 0 1px var(--rim); color: var(--rim); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn-sm {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.icon-btn-sm svg { width: 15px; height: 15px; }

/* ---------- boot screen ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05040a;
  color: var(--rim);
  font-family: 'Chakra Petch', monospace;
  font-size: clamp(.85rem, 2.4vw, 1.1rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 32px;
  cursor: pointer;
  transition: opacity .5s ease;
}
#boot[hidden] { display: none; }
#boot.fading { opacity: 0; pointer-events: none; }
#boot .boot-line { min-height: 1.6em; white-space: pre; }
#boot .boot-hint {
  margin-top: 24px;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .04em;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(23, 18, 26, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  flex-shrink: 0;
}
.nav-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-brand span {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 1;
  min-width: 0;
}
.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav .btn { flex-shrink: 0; padding: 10px 18px; font-size: .85rem; }

@media (max-width: 640px) {
  .nav-brand span,
  .nav-links a[data-nav="home"] { display: none; }
}

/* ---------- wordmark glitch ---------- */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}
.glitch::before { color: var(--rim); }
.glitch::after { color: var(--crt); }
.glitch.glitching::before {
  opacity: .8;
  animation: glitchSlice .45s steps(2, jump-none);
}
.glitch.glitching::after {
  opacity: .8;
  animation: glitchSlice2 .45s steps(2, jump-none);
}
@keyframes glitchSlice {
  0% { clip-path: inset(0 0 85% 0); transform: translate(-4px, 0); opacity: .8; }
  30% { clip-path: inset(20% 0 60% 0); transform: translate(4px, 0); opacity: .8; }
  60% { clip-path: inset(70% 0 5% 0); transform: translate(-3px, 0); opacity: .6; }
  100% { clip-path: inset(100% 0 0 0); transform: translate(0, 0); opacity: 0; }
}
@keyframes glitchSlice2 {
  0% { clip-path: inset(85% 0 0 0); transform: translate(4px, 0); opacity: .8; }
  30% { clip-path: inset(45% 0 30% 0); transform: translate(-4px, 0); opacity: .8; }
  60% { clip-path: inset(5% 0 75% 0); transform: translate(3px, 0); opacity: .6; }
  100% { clip-path: inset(0 100% 0 0); transform: translate(0, 0); opacity: 0; }
}

/* ---------- hero ---------- */
.hero {
  background: var(--bg, var(--chassis));
  transition: background .5s ease;
  padding: 56px 0 72px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.hero-copy .eyebrow {
  color: var(--rim);
  font-weight: 700;
  letter-spacing: .05em;
  font-size: .95rem;
}
.hero-copy .eyebrow .caret {
  display: inline-block;
  width: .5em;
  height: 1em;
  background: var(--rim);
  vertical-align: -.15em;
  margin-left: 2px;
  animation: caretBlink 1s step-end infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.wordmark {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 10px 0 18px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--clip);
  padding: 8px 14px;
  margin-bottom: 22px;
  font-size: .85rem;
}
.hero-badge .badge-strong { color: var(--ink); font-weight: 700; }
.hero-badge .badge-sep { color: var(--line); }
.hero-badge .badge-soft { color: var(--rim); }

.hero-intro {
  color: var(--muted);
  max-width: 46ch;
  font-size: 1.02rem;
  margin-bottom: 28px;
}

.ca-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--clip);
  padding: 12px 16px;
  margin-bottom: 24px;
  max-width: 100%;
}
.ca-bar .ca-label {
  color: var(--rim);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.ca-bar .ca-value {
  font-family: 'Chakra Petch', monospace;
  font-size: .88rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.ca-bar .ca-value.is-empty { color: var(--muted); }
.ca-bar button {
  flex-shrink: 0;
  background: var(--chassis);
  color: var(--rim);
  border: none;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: inherit;
  font-weight: 700;
  font-size: .78rem;
  padding: 8px 12px;
  cursor: pointer;
  clip-path: var(--clip);
}
.ca-bar button:hover { box-shadow: inset 0 0 0 1px var(--rim); }
.ca-bar button:disabled { cursor: not-allowed; opacity: .5; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.hero-social {
  display: flex;
  gap: 10px;
}

/* ---------- face console ---------- */
.face-console {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.face {
  width: min(460px, 100%);
  aspect-ratio: 1;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 0 48px var(--glow, rgba(255,31,61,.4)));
}
.face svg { width: 100%; height: 100%; display: block; }

.face .mood { display: none; }
.face[data-mood="focused"] .m-focused,
.face[data-mood="happy"] .m-happy,
.face[data-mood="idle"] .m-idle,
.face[data-mood="smug"] .m-smug,
.face[data-mood="shocked"] .m-shocked,
.face[data-mood="crying"] .m-crying,
.face[data-mood="love"] .m-love,
.face[data-mood="overheated"] .m-overheated,
.face[data-mood="pumping"] .m-pumping,
.face[data-mood="bsod"] .m-bsod,
.face[data-mood="overclocked"] .m-overclocked,
.face[data-mood="sus"] .m-sus {
  display: inline;
}

.face .scr-blue { display: none; }
.face[data-mood="bsod"] .scr-red { display: none; }
.face[data-mood="bsod"] .scr-blue { display: inline; }

.face .eyes > * {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .08s;
  transform: translate(var(--eye-x, 0px), var(--eye-y, 0px)) scaleY(var(--eye-scale-y, 1));
}
.face.blinking { --eye-scale-y: .08; }

.face .scan { animation: scanScroll 6s linear infinite; }
@keyframes scanScroll { to { transform: translateY(24px); } }

.face .zz { animation: zzFloat 2.4s ease-in-out infinite; }
@keyframes zzFloat { 50% { transform: translateY(-8px); opacity: .5; } }

.face.glitching {
  animation: faceGlitch .3s linear;
  filter: drop-shadow(0 0 48px var(--glow, rgba(255,31,61,.4))) drop-shadow(-7px 0 0 var(--rim)) drop-shadow(7px 0 0 var(--crt));
}
@keyframes faceGlitch {
  0% { transform: translate(0, 0) skewX(0deg); }
  20% { transform: translate(-4px, 2px) skewX(-6deg); }
  40% { transform: translate(4px, -2px) skewX(6deg); }
  60% { transform: translate(-3px, 1px) skewX(-3deg); }
  80% { transform: translate(3px, -1px) skewX(3deg); }
  100% { transform: translate(0, 0) skewX(0deg); }
}

.face-readout { text-align: center; }
.face-readout .count {
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .1em;
  font-weight: 700;
}
.face-readout .mood-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0;
}
.face-readout .mood-status {
  color: var(--rim);
  font-size: .95rem;
  min-height: 1.3em;
}

/* ---------- gallery ---------- */
.gallery {
  background-color: var(--tile);
  background-image:
    repeating-linear-gradient(45deg, rgba(200, 15, 40, .12) 0, rgba(200, 15, 40, .12) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(-45deg, rgba(200, 15, 40, .12) 0, rgba(200, 15, 40, .12) 1px, transparent 1px, transparent 42px);
  color: #1c0f18;
  padding: 64px 0;
}
.gallery h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; }
.gallery .section-note {
  color: #5a3f52;
  max-width: 50ch;
  margin-top: 8px;
  margin-bottom: 32px;
}
.gallery-strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.gallery-frame {
  background: var(--chassis);
  border: 2px solid #1c0f18;
  box-shadow: 8px 8px 0 var(--crt);
  padding: 8px;
  height: 260px;
  display: flex;
}
.gallery-frame img {
  height: 100%;
  width: auto;
  object-fit: cover;
}
.gallery-item[data-shape="square"] .gallery-frame { width: 260px; }
.gallery-item[data-shape="wide"] .gallery-frame { width: 460px; }
.gallery-caption {
  display: inline-block;
  margin-top: 10px;
  background: var(--chassis);
  color: var(--rim);
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 10px;
  clip-path: var(--clip);
}

dialog#lightbox {
  border: none;
  background: none;
  padding: 0;
  max-width: 92vw;
  max-height: 92vh;
}
dialog#lightbox::backdrop { background: rgba(5, 4, 10, .88); }
dialog#lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border: 2px solid var(--line);
  cursor: pointer;
}

/* ---------- spec sheet ---------- */
.spec {
  padding: 64px 0;
}
.spec h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; }
.spec .section-note {
  color: var(--muted);
  max-width: 55ch;
  margin-top: 8px;
  margin-bottom: 28px;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 14px 20px;
  font-weight: 400;
  font-size: .95rem;
}
.spec-table th {
  color: var(--muted);
  font-weight: 700;
  width: 40%;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.site-footer p {
  color: var(--muted);
  font-size: .82rem;
  max-width: 62ch;
}
.site-footer .tagline {
  color: var(--rim);
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
}

/* ---------- how it works: intro ---------- */
.page-intro {
  padding: 56px 0 48px;
}
.page-intro .container {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 48px;
  align-items: center;
}
.page-intro h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 18px;
}
.page-intro .lede {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.02rem;
}
.face-small-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.face-small-wrap .face {
  width: min(300px, 100%);
}
.face-caption {
  text-align: center;
  color: var(--rim);
  font-size: .88rem;
  max-width: 30ch;
  min-height: 2.6em;
}

/* ---------- how it works: the cycle ---------- */
.cycle { padding: 40px 0 56px; }
.cycle h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: 32px; }
.cycle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step {
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 22px 20px;
  cursor: default;
  transition: box-shadow .2s;
}
.step:hover, .step:focus-visible {
  box-shadow: inset 0 0 0 1px var(--rim);
}
.step .step-num {
  color: var(--crt);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
}
.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.step p {
  color: var(--muted);
  font-size: .9rem;
}

/* ---------- how it works: fees ---------- */
.fees { padding: 40px 0 56px; background: var(--panel); }
.fees h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: 8px; }
.fees .section-note { color: var(--muted); max-width: 60ch; margin-bottom: 32px; }
.fee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.fee-panel {
  background: var(--chassis);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 24px;
  transition: box-shadow .2s;
}
.fee-panel:hover { box-shadow: inset 0 0 0 1px var(--rim); }
.fee-panel h3 {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.fee-panel .fee-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.fee-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 16px;
}
.fee-bar span { display: block; height: 100%; }
.fee-bar .seg-burn, .fee-bar .seg-holders { background: var(--rim); }
.fee-bar .seg-vault { background: #5a4663; }
.fee-bar .seg-burn { background: var(--crt); }
.fee-legend { display: flex; flex-direction: column; gap: 10px; }
.fee-legend .legend-row { display: flex; align-items: baseline; gap: 8px; font-size: .88rem; }
.fee-legend .legend-dot { width: 10px; height: 10px; flex-shrink: 0; margin-top: 3px; }
.fee-legend .dot-burn { background: var(--crt); }
.fee-legend .dot-holders { background: var(--rim); }
.fee-legend .dot-vault { background: #5a4663; }
.fee-legend strong { color: var(--ink); }
.fee-legend span.desc { color: var(--muted); }

.net-effect {
  background: var(--crt);
  color: #fff;
  padding: 22px 24px;
  clip-path: var(--clip);
}
.net-effect p:first-child { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.net-effect p.net-note { font-size: .85rem; opacity: .85; }

/* ---------- how it works: contracts ---------- */
.contracts { padding: 56px 0; }
.contracts h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: 8px; }
.contracts .section-note { color: var(--muted); margin-bottom: 24px; }
.contract-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--clip);
  padding: 12px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.contract-row .contract-label {
  color: var(--rim);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .05em;
  flex-shrink: 0;
  width: 130px;
}
.contract-row .contract-value {
  font-family: 'Chakra Petch', monospace;
  font-size: .88rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contract-row .contract-value.is-empty { color: var(--muted); }
.contract-row button {
  flex-shrink: 0;
  background: var(--chassis);
  color: var(--rim);
  border: none;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: inherit;
  font-weight: 700;
  font-size: .78rem;
  padding: 8px 12px;
  cursor: pointer;
  clip-path: var(--clip);
}
.contract-row button:hover { box-shadow: inset 0 0 0 1px var(--rim); }
.contract-row button:disabled { cursor: not-allowed; opacity: .5; }

/* ---------- how it works: closing ---------- */
.closing {
  background: var(--panel);
  padding: 64px 0;
  text-align: center;
}
.closing h2 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; margin-bottom: 10px; }
.closing .tagline { color: var(--rim); font-weight: 700; margin-bottom: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-copy { order: 2; }
  .face-console { order: 1; }
  .face { width: min(340px, 78vw); }

  .page-intro .container { grid-template-columns: 1fr; }
  .face-small-wrap { order: -1; }
  .cycle-grid { grid-template-columns: 1fr 1fr; }
  .fee-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 36px 0 48px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .gallery-item[data-shape="square"] .gallery-frame { width: 200px; }
  .gallery-item[data-shape="wide"] .gallery-frame { width: 320px; }
  .gallery-frame { height: 200px; }
  .spec-table th, .spec-table td { padding: 10px 12px; font-size: .85rem; }

  .cycle-grid { grid-template-columns: 1fr; }
  .contract-row { align-items: stretch; }
  .contract-row .contract-label { width: auto; }

  .nav-links { gap: 12px; }
  .nav-links a:not(.btn) { font-size: .82rem; }
  .nav .btn { padding: 8px 12px; font-size: .78rem; }
  .icon-btn-sm { width: 30px; height: 30px; }
  .icon-btn-sm svg { width: 13px; height: 13px; }
}
