/* Buffer Surge: landing page styles
   Tokens come from docs/design-system/tokens.json (ice palette). */

:root {
  --bg:           #04060c;
  --bg-deep:      #0a0c12;
  --grid:         rgba(120, 180, 255, 0.10);
  --swarm:        #7fd4ff;
  --swarm-hot:    #ffffff;
  --threat:       #ff3355;
  --threat-soft:  rgba(255, 51, 85, 0.35);
  --gate-pos:     #5effc0;
  --gate-text:    #eafaff;
  --projectile:   #aef0ff;
  --text-dim:     #6d829c;

  --display: 'Chakra Petch', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  --wrap-max: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--gate-text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; display: block; }

a {
  color: var(--swarm);
  text-decoration: none;
  transition: color 120ms linear;
}
a:hover { color: var(--swarm-hot); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 0.6em;
  color: var(--gate-text);
}
h1 { font-size: 52px; line-height: 0.98; }
h2 { font-size: 28px; }
h3 { font-size: 16px; letter-spacing: 0; text-transform: uppercase; }
@media (max-width: 720px) {
  h1 { font-size: 36px; line-height: 1.03; }
  h2 { font-size: 24px; }
}

p { margin: 0 0 1em; }

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--swarm);
  color: var(--bg);
  padding: 8px 12px;
  font-family: var(--mono);
  z-index: 100;
}
.skip-link:focus { left: 16px; }

/* ----- Background atmosphere ----- */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  background-position: -1px -1px;
  pointer-events: none;
  z-index: -2;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
.bg-scanline {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(127, 212, 255, 0.025) 0px,
    rgba(127, 212, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: -1;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(4, 6, 12, 0.92), rgba(4, 6, 12, 0.7));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(127, 212, 255, 0.12);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand img { height: 28px; }

.primary-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.primary-nav a {
  color: var(--text-dim);
}
.primary-nav a:hover { color: var(--gate-text); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--text-dim);
}
.lang-switch button {
  background: none;
  border: 1px solid rgba(127, 212, 255, 0.2);
  color: var(--text-dim);
  padding: 4px 8px;
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 120ms linear, border-color 120ms linear, background 120ms linear;
}
.lang-switch button:hover { color: var(--gate-text); border-color: rgba(127, 212, 255, 0.5); }
.lang-switch button[aria-pressed="true"] {
  color: var(--bg);
  background: var(--swarm);
  border-color: var(--swarm);
}

/* ----- Hero ----- */
.hero {
  min-height: 0;
  padding: 44px 0 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(127, 212, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(4, 6, 12, 0.94) 0%, rgba(4, 6, 12, 0.76) 42%, rgba(4, 6, 12, 0.10) 100%),
    radial-gradient(ellipse at 76% 48%, rgba(127, 212, 255, 0.18), transparent 48%),
    radial-gradient(ellipse at 88% 26%, rgba(255, 51, 85, 0.14), transparent 34%);
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}
.hero-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 28px;
  align-items: center;
}
.hero-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.62;
}
.field-line {
  position: absolute;
  right: -8%;
  width: 72%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 212, 255, 0.38), transparent);
  transform-origin: right center;
  animation: field-sweep 8s linear infinite;
}
.field-line-a { top: 24%; transform: rotate(-14deg); }
.field-line-b { top: 48%; transform: rotate(8deg); animation-delay: -2.4s; }
.field-line-c { top: 70%; transform: rotate(-4deg); animation-delay: -5s; }
@keyframes field-sweep {
  0%   { translate: 16% 0; opacity: 0; }
  18%  { opacity: 0.75; }
  100% { translate: -26% 0; opacity: 0; }
}
@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding: 48px 0 36px;
    background:
      linear-gradient(180deg, rgba(4, 6, 12, 0.94) 0%, rgba(4, 6, 12, 0.78) 55%, rgba(4, 6, 12, 0.38) 100%),
      radial-gradient(ellipse at 50% 64%, rgba(127, 212, 255, 0.20), transparent 50%);
  }
  .hero-stage {
    min-height: 0;
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--swarm);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.lead {
  font-size: 17px;
  color: var(--gate-text);
  max-width: 56ch;
}
.prose { color: var(--gate-text); max-width: 70ch; }

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms linear, background 120ms linear, color 120ms linear, border-color 120ms linear, box-shadow 220ms cubic-bezier(.2,.8,.2,1);
}
.btn-primary {
  background: var(--swarm);
  color: var(--bg);
  box-shadow: 0 0 24px rgba(127, 212, 255, 0.35);
}
.btn-primary:hover {
  background: var(--swarm-hot);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 0 32px rgba(127, 212, 255, 0.55);
}
.btn-ghost {
  background: transparent;
  color: var(--gate-text);
  border-color: rgba(127, 212, 255, 0.4);
}
.btn-ghost:hover {
  border-color: var(--swarm);
  color: var(--swarm);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.badges {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 24px 0 0;
}
.badges li {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid rgba(127, 212, 255, 0.25);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
}

.hero-readout {
  margin: 22px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 620px;
  border: 1px solid rgba(127, 212, 255, 0.16);
  background: rgba(127, 212, 255, 0.10);
}
.hero-readout div {
  padding: 12px 14px;
  background: rgba(4, 6, 12, 0.72);
}
.hero-readout dt {
  margin: 0 0 4px;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
}
.hero-readout dd {
  margin: 0;
  color: var(--gate-text);
  font-family: var(--display);
  font-size: 15px;
}
@media (max-width: 620px) {
  .hero-readout { grid-template-columns: 1fr; }
}

/* Alpha mascot scene */
.alpha-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 430px;
  isolation: isolate;
}
.alpha-orbit {
  position: relative;
  width: min(480px, 82vw);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}
.alpha-orbit::before {
  content: '';
  position: absolute;
  inset: 19%;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(94, 255, 192, 0.34) 46% 47%, transparent 47% 100%),
    linear-gradient(0deg, transparent 0 46%, rgba(255, 51, 85, 0.28) 46% 47%, transparent 47% 100%);
  border-radius: 50%;
  filter: drop-shadow(0 0 16px rgba(127, 212, 255, 0.18));
  animation: rotate-slow 18s linear infinite;
}
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(127, 212, 255, 0.22);
  box-shadow: inset 0 0 24px rgba(127, 212, 255, 0.08);
  animation: ring-breathe 4.8s ease-in-out infinite;
}
.orbit-ring-a { inset: 12%; }
.orbit-ring-b { inset: 24%; animation-delay: -1.6s; border-color: rgba(94, 255, 192, 0.18); }
.orbit-ring-c { inset: 36%; animation-delay: -3.2s; border-color: rgba(255, 90, 138, 0.16); }
.node,
.threat-blip {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.node {
  background: var(--swarm);
  box-shadow: 0 0 14px rgba(127, 212, 255, 0.85);
  animation: node-pulse 2.2s ease-in-out infinite;
}
.node-a { top: 12%; left: 50%; animation-delay: -0.1s; }
.node-b { top: 28%; right: 15%; animation-delay: -0.5s; }
.node-c { bottom: 22%; right: 21%; animation-delay: -0.9s; }
.node-d { bottom: 14%; left: 44%; animation-delay: -1.3s; }
.node-e { bottom: 31%; left: 15%; animation-delay: -1.7s; }
.node-f { top: 25%; left: 20%; animation-delay: -2.1s; }
.threat-blip {
  background: var(--threat);
  box-shadow: 0 0 16px rgba(255, 51, 85, 0.9);
  animation: threat-drift 4.4s ease-in-out infinite;
}
.threat-a { top: 18%; right: 25%; }
.threat-b { bottom: 25%; left: 22%; animation-delay: -2.2s; }
.alpha-mascot {
  position: absolute;
  z-index: 3;
  width: min(300px, 54vw);
  filter:
    drop-shadow(0 0 20px rgba(127, 212, 255, 0.42))
    drop-shadow(0 26px 34px rgba(0, 0, 0, 0.52));
  animation: alpha-float 4.2s ease-in-out infinite;
}
.mascot-console {
  position: absolute;
  z-index: 4;
  left: 7%;
  bottom: 16%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-left: 2px solid var(--gate-pos);
  background: linear-gradient(90deg, rgba(4, 6, 12, 0.84), rgba(4, 6, 12, 0.18));
  box-shadow: 0 0 26px rgba(94, 255, 192, 0.13);
}
.mascot-console span {
  color: var(--gate-pos);
  font-size: 11px;
  text-transform: uppercase;
}
.mascot-console strong {
  color: var(--gate-text);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}
@keyframes rotate-slow {
  to { transform: rotate(360deg); }
}
@keyframes ring-breathe {
  0%, 100% { transform: scale(0.98); opacity: 0.46; }
  50%      { transform: scale(1.03); opacity: 0.9; }
}
@keyframes node-pulse {
  0%, 100% { transform: scale(0.84); opacity: 0.65; }
  50%      { transform: scale(1.26); opacity: 1; }
}
@keyframes threat-drift {
  0%, 100% { transform: translate(0, 0) scale(0.92); opacity: 0.78; }
  50%      { transform: translate(-22px, 10px) scale(1.18); opacity: 0.34; }
}
@keyframes alpha-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}
.hero-caption {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 3%;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--text-dim);
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .alpha-showcase {
    min-height: 380px;
    order: -1;
  }
  .alpha-mascot { width: min(280px, 70vw); }
  .mascot-console { left: 4%; bottom: 13%; }
  .hero-caption {
    left: 4%;
    right: 4%;
    bottom: 4%;
    text-align: center;
  }
}

/* ----- Bands ----- */
.band {
  padding: 56px 0;
  border-top: 1px solid rgba(127, 212, 255, 0.08);
}
.band-soft {
  background:
    linear-gradient(180deg, rgba(127, 212, 255, 0.025), transparent 60%),
    var(--bg);
}

/* ----- Alpha intro ----- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 40px;
  align-items: center;
}
.alpha-notes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.alpha-notes li {
  padding: 16px 0 16px 18px;
  border-left: 2px solid rgba(127, 212, 255, 0.42);
  background: linear-gradient(90deg, rgba(127, 212, 255, 0.08), transparent);
}
.alpha-notes span {
  display: block;
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.alpha-notes strong {
  display: block;
  color: var(--gate-text);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ----- Cards ----- */
.cards {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-deep);
  border: 1px solid rgba(127, 212, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 220ms cubic-bezier(.2,.8,.2,1), transform 220ms cubic-bezier(.2,.8,.2,1);
}
.card:hover {
  border-color: rgba(127, 212, 255, 0.35);
  transform: translateY(-2px);
}
.card h3 {
  color: var(--swarm);
  margin-bottom: 8px;
}
.card p { margin: 0; color: var(--gate-text); font-size: 13px; }

/* ----- Screenshots ----- */
.shots {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.shot {
  margin: 0;
  background: var(--bg-deep);
  border: 1px solid rgba(127, 212, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}
.shot-portrait  { aspect-ratio: 9 / 16; }
.shot-landscape { aspect-ratio: 16 / 10; grid-column: span 2; }
@media (max-width: 600px) {
  .shot-landscape { grid-column: auto; }
}
.shot-ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--text-dim);
  text-transform: uppercase;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0px,
      transparent 12px,
      rgba(127, 212, 255, 0.05) 12px,
      rgba(127, 212, 255, 0.05) 13px
    );
}

/* ----- Demo ----- */
.demo-frame {
  margin-top: 24px;
  position: relative;
  background: var(--bg-deep);
  border: 1px solid rgba(127, 212, 255, 0.18);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  max-height: 70vh;
}
.demo-frame iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
.demo-placeholder {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 40%, rgba(127, 212, 255, 0.08), transparent 60%),
    var(--bg-deep);
}
.demo-placeholder p { margin: 0; color: var(--gate-text); }
.demo-placeholder .mono {
  color: var(--swarm);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* ----- FAQ ----- */
.faq-list { margin-top: 24px; display: grid; gap: 8px; }
.faq-item {
  background: var(--bg-deep);
  border: 1px solid rgba(127, 212, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-family: var(--display);
  font-weight: 500;
  color: var(--gate-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--swarm);
  font-family: var(--mono);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-body {
  padding: 0 20px 18px;
  color: var(--gate-text);
}

/* ----- Doc routes (privacy / imprint) ----- */
.route-doc {
  padding: 48px 0 80px;
}
.doc h2 {
  margin-top: 28px;
  font-size: 18px;
  color: var(--swarm);
  text-transform: uppercase;
  letter-spacing: 0;
}
.doc p, .doc li { color: var(--gate-text); }
.doc ul { padding-left: 1.2em; }
.back-link { margin-top: 32px; }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid rgba(127, 212, 255, 0.12);
  padding: 24px 0;
  margin-top: 48px;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-mark { height: 24px; opacity: 0.85; }
.site-footer nav {
  display: flex; gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.site-footer nav a { color: var(--text-dim); }
.site-footer nav a:hover { color: var(--gate-text); }
.small { font-size: 11px; color: var(--text-dim); }
.mono  { font-family: var(--mono); }

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .field-line,
  .alpha-orbit::before,
  .orbit-ring,
  .node,
  .threat-blip,
  .alpha-mascot {
    animation: none;
  }
}
