/* ============================================================
   Q MINING — design tokens
   Void #0D0616 · Substrate #171026 · Plasma #FF2E7E
   Flare #FF7A18 · Ion #8F6BFF · Ghost #F1EBFF
   Display: Unbounded · Body: Space Grotesk · Data: JetBrains Mono
   ============================================================ */

:root {
  --void: #0D0616;
  --substrate: #171026;
  --substrate-2: #1F1633;
  --plasma: #FF2E7E;
  --flare: #FF7A18;
  --ion: #8F6BFF;
  --ghost: #F1EBFF;
  --dim: #9B8FB8;
  --line: rgba(143, 107, 255, 0.18);
  --grad: linear-gradient(100deg, var(--plasma), var(--flare));
  --font-display: "Unbounded", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --r: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--ghost);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: var(--plasma); color: var(--void); }

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: 1.08; text-transform: uppercase; }
h3 { font-size: 1.12rem; font-weight: 600; margin-bottom: 0.6rem; }
p  { color: var(--dim); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- ambient layers ---------- */
#strata {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.grain {
  position: fixed; inset: -50%;
  z-index: 1; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,1%); }
  50% { transform: translate(1%,-2%); } 75% { transform: translate(-1%,2%); }
  100% { transform: translate(0,0); }
}

main, .nav, .foot { position: relative; z-index: 2; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0;
  display: flex; align-items: center; gap: 2.4rem;
  padding: 1rem clamp(1.2rem, 4vw, 3.2rem);
  background: color-mix(in srgb, var(--void) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 34px; height: 34px; transition: transform 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.brand:hover .brand-mark { transform: rotate(180deg); }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.14em; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav-links a {
  font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim);
  position: relative; padding: 0.2rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-links a:hover { color: var(--ghost); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--flare); outline-offset: 3px;
}
.btn-plasma {
  background: var(--grad); color: var(--void);
  box-shadow: 0 0 0 rgba(255, 46, 126, 0);
}
.btn-plasma:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 34px rgba(255, 46, 126, 0.45);
}
.btn-ghost { border-color: var(--line); color: var(--ghost); background: transparent; }
.btn-ghost:hover { border-color: var(--ion); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(3.4rem, 8vh, 6.5rem) clamp(1.2rem, 4vw, 3.2rem) 4rem;
  max-width: 1400px; margin: 0 auto;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.22em;
  color: var(--ion); margin-bottom: 1.4rem;
  display: flex; align-items: center; gap: 0.55rem;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--plasma);
  box-shadow: 0 0 0 0 rgba(255, 46, 126, 0.7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 12px rgba(255, 46, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 46, 126, 0); }
}
.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 0.98; text-transform: uppercase;
}
.hero-title .line {
  display: block;
  opacity: 0; transform: translateY(0.6em);
  animation: rise 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero-title .line:nth-child(2) { animation-delay: 0.14s; }
.hero-title .line:nth-child(3) { animation-delay: 0.28s; }
.line-accent {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.hero-sub { margin: 1.5rem 0 2.1rem; max-width: 34rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* ---------- synthesis console (signature) ---------- */
.console {
  background: var(--substrate);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(143, 107, 255, 0.08);
  scroll-margin-top: 6rem;
}
.console-chrome {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--substrate-2);
  border-bottom: 1px solid var(--line);
}
.chrome-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.chrome-dot:first-child { background: var(--plasma); }
.chrome-title {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--dim);
  margin-left: 0.6rem;
}
.chrome-latency {
  margin-left: auto; font-family: var(--font-mono);
  font-size: 0.72rem; color: var(--flare);
}
.query-bar {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 1rem 1.2rem;
  font-family: var(--font-mono); font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
  min-height: 3.4rem;
}
.query-prompt { color: var(--plasma); font-weight: 600; }
.query-text { color: var(--ghost); word-break: break-word; }
.caret {
  width: 9px; height: 1.15em; background: var(--flare);
  display: inline-block; transform: translateY(0.2em);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.dash { padding: 1.1rem 1.2rem 1.3rem; }
.dash-status {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ion);
  margin-bottom: 0.9rem; min-height: 1em;
}
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-bottom: 0.9rem; }
.kpi {
  background: var(--substrate-2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.7rem 0.8rem;
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.kpi b { display: block; font-family: var(--font-mono); font-size: 1.15rem; color: var(--ghost); }
.kpi span { font-size: 0.7rem; color: var(--dim); letter-spacing: 0.04em; text-transform: uppercase; }
.kpi em { font-style: normal; font-family: var(--font-mono); font-size: 0.72rem; margin-left: 0.4rem; }
.kpi em.up { color: #4ADE80; } .kpi em.down { color: var(--plasma); }
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(8px); } }

.charts {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 0.7rem;
}
.chart-card {
  background: var(--substrate-2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.75rem;
  animation: pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.chart-card h4 {
  font-family: var(--font-mono); font-weight: 400; font-size: 0.68rem;
  color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-donut svg { max-width: 110px; margin: 0 auto; }
.legend { list-style: none; margin-top: 0.5rem; }
.legend li {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--dim);
}
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.bar-rect { transform-origin: bottom; animation: grow-y 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
@keyframes grow-y { from { transform: scaleY(0); } }
.line-path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.1s ease forwards 0.15s; }
.area-path { opacity: 0; animation: fade 0.6s ease forwards 0.7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.donut-seg { stroke-dasharray: 0 999; transition: stroke-dasharray 0.9s cubic-bezier(0.2, 0.9, 0.2, 1); }

/* ---------- legacy marquee ---------- */
.legacy { border-block: 1px solid var(--line); overflow: hidden; }
.marquee { padding: 1.1rem 0; white-space: nowrap; }
.marquee-track {
  display: inline-flex; align-items: center; gap: 2.6rem;
  animation: scroll-x 26s linear infinite;
  font-family: var(--font-display); font-weight: 400; font-size: 0.85rem;
  letter-spacing: 0.12em; color: var(--dim);
}
.marquee-track s {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em;
  color: var(--plasma); text-decoration-color: var(--plasma);
}
@keyframes scroll-x { to { transform: translateX(-50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- sections ---------- */
section { padding: clamp(4rem, 9vh, 7rem) clamp(1.2rem, 4vw, 3.2rem); }
.section-head { max-width: 1400px; margin: 0 auto 3rem; }
.section-head .eyebrow { margin-bottom: 1rem; }

/* ---------- capabilities ---------- */
.cap-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem; max-width: 1400px; margin: 0 auto;
}
.cap-card {
  background: var(--substrate);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.8rem 1.6rem;
  position: relative; overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease;
}
.cap-card::before {
  content: ""; position: absolute; inset: -1px;
  border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.35s ease;
}
.cap-card:hover { transform: translateY(-6px); }
.cap-card:hover::before { opacity: 1; }
.cap-card h3 { text-transform: uppercase; font-size: 0.98rem; letter-spacing: 0.04em; }
.cap-card p { font-size: 0.95rem; }
.cap-tag { margin-top: 1.1rem; font-size: 0.72rem; color: var(--flare); letter-spacing: 0.08em; }

.cap-glyph { height: 64px; margin-bottom: 1.3rem; display: flex; align-items: flex-end; gap: 6px; }
.glyph-dash span {
  width: 12px; border-radius: 3px 3px 0 0; background: var(--grad);
  animation: equalize 2.6s ease-in-out infinite;
}
.glyph-dash span:nth-child(1) { height: 55%; animation-delay: 0s; }
.glyph-dash span:nth-child(2) { height: 85%; animation-delay: 0.3s; }
.glyph-dash span:nth-child(3) { height: 40%; animation-delay: 0.6s; }
.glyph-dash span:nth-child(4) { height: 70%; animation-delay: 0.9s; }
@keyframes equalize { 50% { transform: scaleY(0.55); } }
.glyph-ui { align-items: stretch; flex-direction: column; justify-content: flex-end; gap: 5px; }
.glyph-ui i {
  height: 12px; border-radius: 4px;
  background: var(--substrate-2); border: 1px solid var(--ion);
  animation: slide-in 3s ease-in-out infinite;
}
.glyph-ui i:nth-child(1) { width: 70%; animation-delay: 0s; }
.glyph-ui i:nth-child(2) { width: 45%; animation-delay: 0.4s; border-color: var(--plasma); }
.glyph-ui i:nth-child(3) { width: 88%; animation-delay: 0.8s; }
@keyframes slide-in { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
.glyph-api {
  font-family: var(--font-mono); font-size: 2.4rem; font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  align-items: center;
}
.codeblock {
  margin-top: 1.1rem; padding: 0.9rem 1rem;
  background: var(--void); border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.72rem; line-height: 1.7; color: var(--ghost);
  white-space: pre-wrap; word-break: break-word;
  min-height: 7.5em;
}
.codeblock .tok-k { color: var(--ion); }
.codeblock .tok-s { color: var(--flare); }
.codeblock .tok-c { color: var(--dim); }

/* ---------- pipeline ---------- */
.pipe {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem; align-items: stretch;
  max-width: 1400px; margin: 0 auto;
}
.pipe-stage {
  background: var(--substrate);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.7rem 1.5rem;
}
.pipe-stage p { font-size: 0.94rem; }
.stage-k {
  display: inline-block; font-size: 0.68rem; letter-spacing: 0.24em;
  color: var(--void); background: var(--grad);
  padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: 1rem;
  font-weight: 600;
}
.pipe-flow { display: flex; align-items: center; }
.pipe-flow svg { width: 46px; }
.pipe-flow path {
  stroke: var(--ion); stroke-width: 2; fill: none; stroke-linecap: round;
  stroke-dasharray: 6 8;
  animation: flow 1.2s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -14; } }

/* ---------- proof ---------- */
.proof { border-block: 1px solid var(--line); background: color-mix(in srgb, var(--substrate) 45%, transparent); }
.proof-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; max-width: 1400px; margin: 0 auto 3rem;
}
.stat { text-align: center; padding: 1rem 0.4rem; }
.stat-n {
  display: block; font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-l { font-size: 0.8rem; color: var(--dim); letter-spacing: 0.04em; }
.quote { max-width: 760px; margin: 0 auto; text-align: center; }
.quote p {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem); color: var(--ghost); line-height: 1.4;
}
.quote cite { display: block; margin-top: 1rem; font-style: normal; font-size: 0.82rem; color: var(--dim); }

/* ---------- deploy ---------- */
.deploy-inner { max-width: 720px; margin: 0 auto; text-align: center; scroll-margin-top: 5rem; }
.deploy-mark { width: 74px; margin-bottom: 1.6rem; animation: spin-slow 24s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.deploy-inner p { margin: 1.2rem auto 2rem; max-width: 34rem; }
.access-form { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.access-form input {
  background: var(--substrate); color: var(--ghost);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.85rem 1.3rem; font-size: 0.88rem; min-width: 280px;
}
.access-form input::placeholder { color: var(--dim); }
.form-note { margin-top: 1rem; font-size: 0.75rem; color: var(--flare); min-height: 1.2em; }

/* ---------- footer ---------- */
.foot {
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1.2rem, 4vw, 3.2rem);
  border-top: 1px solid var(--line);
}
.foot-left { display: flex; align-items: center; gap: 0.8rem; }
.foot-mark { width: 24px; }
.foot-left .mono { font-size: 0.68rem; color: var(--dim); letter-spacing: 0.1em; }
.foot-links { margin-left: auto; display: flex; gap: 1.4rem; }
.foot-links a { font-size: 0.78rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.foot-links a:hover { color: var(--ghost); }

/* ---------- reveals ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.on { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; max-width: 640px; }
  .pipe { grid-template-columns: 1fr; max-width: 640px; }
  .pipe-flow { justify-content: center; }
  .pipe-flow svg { transform: rotate(90deg); width: 34px; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .charts { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .access-form input { min-width: 0; width: 100%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}
