/* SPDX-License-Identifier: MIT
   ket website — dark, near-black canvas with a single quantum-gold accent.
   Plain CSS; a tiny main.js adds the cursor spotlight, copy, and scroll reveal. */

/* ---- Self-hosted fonts (match the GUI: Inter + JetBrains Mono) ---- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/Inter-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/Inter-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
}

/* ---- Design tokens ---- */
:root {
  --bg: #0a0a0a;
  --panel: #0f0f0f;
  --surface: #151515;
  --surface-2: #1d1d1d;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(251, 191, 36, 0.35);
  --text: #e6e6e6;
  --muted: #8c8c8c;
  --faint: #6b6b6b;
  --line: #2a2a2a; /* faint line-art strokes in illustrations */
  --accent: #fbbf24; /* quantum gold — CTAs / emphasis only */
  --accent-hi: #ffd24d;
  --accent-dim: rgba(251, 191, 36, 0.12);

  --max: 1120px;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---- Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.accent {
  color: var(--accent);
}
.em {
  color: var(--text);
} /* white emphasis inside muted copy */
.muted {
  color: var(--muted);
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand svg,
.brand img {
  width: auto;
  height: 28px;
}
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: 8px;
}
.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-right a:not(.btn) {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s;
}
.nav-right a:not(.btn):hover {
  color: var(--text);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.15s,
    border-color 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--accent);
  color: #1a1400;
}
.btn-accent:hover {
  background: var(--accent-hi);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
}
.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

/* ---- Pill / badge ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding: 120px 0 80px;
  overflow: hidden;
}
.aurora {
  position: absolute;
  top: -260px;
  left: 50%;
  width: 900px;
  height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(
    closest-side,
    rgba(251, 191, 36, 0.16),
    rgba(251, 191, 36, 0) 70%
  );
  filter: blur(20px);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.85;
  }
  to {
    transform: translateX(-50%) translateY(30px) scale(1.08);
    opacity: 1;
  }
}
.hero h1 {
  margin: 26px auto 18px;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 14ch;
}
.grad {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 19px);
}
.hero .cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Section ---- */
section {
  padding: 64px 0;
}
.section-head {
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 700;
}
.section-head p {
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

/* ---- Bento grid ---- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.card {
  position: relative;
  grid-column: span 2;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.card.wide {
  grid-column: span 3;
}
.card.tall {
  grid-row: span 2;
}
/* cursor spotlight (main.js sets --mx/--my) */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 0%),
    var(--accent-dim),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.card:hover::before {
  opacity: 1;
}
.card .icon {
  color: var(--accent);
  margin-bottom: 12px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 500;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.card .art {
  margin-top: 18px;
  width: 100%;
  color: var(--line); /* currentColor drives the faint strokes */
}

/* ---- Code showcase ---- */
.code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code .chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.code .dots {
  display: flex;
  gap: 7px;
}
.code .dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface-2);
}
.tabs {
  display: flex;
  gap: 4px;
}
.tabs label {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}
.tabs label:hover {
  color: var(--text);
}
.code input[type="radio"] {
  display: none;
}
.copy {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
}
.copy:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}
.code pre {
  margin: 0;
  padding: 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
}
.code .panel {
  display: none;
}
/* :has() ties the checked radio to its panel — no JS needed for tabs */
#tab-cpp:checked ~ .body #panel-cpp,
#tab-py:checked ~ .body #panel-py,
#tab-qasm:checked ~ .body #panel-qasm {
  display: block;
}
#tab-cpp:checked ~ .chrome label[for="tab-cpp"],
#tab-py:checked ~ .chrome label[for="tab-py"],
#tab-qasm:checked ~ .chrome label[for="tab-qasm"] {
  color: var(--text);
  background: var(--surface);
}
/* syntax tints */
.tok-kw {
  color: #d8a0ff;
}
.tok-fn {
  color: #79b8ff;
}
.tok-str {
  color: #a6e22e;
}
.tok-num {
  color: #f6c177;
}
.tok-com {
  color: var(--faint);
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  color: var(--muted);
  font-size: 14px;
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  justify-content: space-between;
}
.foot-col h4 {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 12px;
}
.foot-col a {
  display: block;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.15s;
}
.foot-col a:hover {
  color: var(--text);
}

/* ---- Hero install command ---- */
.install {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 10px 16px;
  font-family: var(--mono);
  font-size: 14px;
  max-width: 100%;
}
.install .prompt {
  color: var(--accent);
}
.install .cmd {
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}
.install .copy2 {
  font-family: var(--font);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.install .copy2:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}
.tags {
  margin-top: 22px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* ---- Hero illustration (the quantum computer) — floats on the page bg ---- */
.hero-photo {
  max-width: 760px;
  margin: 28px auto -24px;
}
.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Stats ---- */
section.tight {
  padding: 26px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  padding: 30px 26px;
  border-left: 1px solid var(--border);
}
.stat:first-child {
  border-left: none;
}
.stat .num {
  font-family: var(--mono);
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat .num.accent {
  color: var(--accent);
}
.stat .lbl {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.45;
}

/* ---- Product screenshot showcase ---- */
.section-head.center {
  text-align: center;
}
.section-head.center p {
  margin-left: auto;
  margin-right: auto;
}
.shot {
  position: relative;
  max-width: 1080px;
  margin: 6px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 40px 110px -45px rgba(0, 0, 0, 0.85);
}
.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
}
/* window chrome — same style as the code block (.code .chrome) */
.winbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.winbar .lights {
  display: flex;
  gap: 7px;
}
.winbar .lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface-2);
}
.winbar .wintitle {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

/* ---- Bento card internals ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}
.split .k {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.split .v {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.route {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
code.inline {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}
.textlink {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.textlink:hover {
  color: var(--accent-hi);
}

/* ---- Quickstart: code + result ---- */
.code-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.result {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.result-head {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}
.amp {
  display: grid;
  grid-template-columns: 46px 1fr 42px;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 5px 0;
}
.amp .ket {
  color: var(--muted);
}
.amp .bar {
  height: 6px;
  border-radius: 3px;
  width: var(--p);
  min-width: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
}
.amp.dim .bar {
  background: var(--surface-2);
}
.amp.dim .ket,
.amp.dim .val {
  color: var(--faint);
}
.amp .val {
  color: var(--text);
  text-align: right;
}
.result-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Closing CTA band ---- */
.cta-band {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 60px 24px;
  background: radial-gradient(
    120% 140% at 50% 0%,
    rgba(251, 191, 36, 0.07),
    transparent 55%
  );
}
.cta-band h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 700;
}
.cta-band p {
  color: var(--muted);
  margin: 0 0 26px;
}
.cta-band .cta {
  justify-content: center;
}

/* ---- Scroll reveal (main.js adds .in) ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .code-row {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(3) {
    border-left: none;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .card,
  .card.wide {
    grid-column: span 6;
  }
  .card.tall {
    grid-row: auto;
  }
  .split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .stat:first-child {
    border-top: none;
  }
  .install {
    width: 100%;
  }
}
