/* ============================================================
   icetok — marketing site styles
   Dark basalt + aurora green + glacier cyan
   ============================================================ */

:root {
  color-scheme: dark;

  /* Palette */
  --bg: #06090d;
  --bg-elev: #0a1017;
  --bg-card: #0d141d;
  --bg-code: #0a1017;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e8eef4;
  --text-soft: #b8c4d1;
  --text-muted: #8b98a8;
  --accent: #34d399;
  --accent-deep: #10b981;
  --cyan: #38bdf8;
  --amber: #fbbf24;
  --danger: #f87171;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur: 200ms;

  /* Layout */
  --container: 1120px;
  --radius: 14px;
  --radius-sm: 9px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(52, 211, 153, 0.28);
  color: #fff;
}

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

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #04120c;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container-narrow {
  max-width: 760px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    background-color var(--dur) ease,
    border-color var(--dur) ease,
    color var(--dur) ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2dd4bf 100%);
  color: #04120c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 8px 24px -12px rgba(52, 211, 153, 0.55);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 14px;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 12px 32px -12px rgba(52, 211, 153, 0.7);
    transform: translateY(-1px);
  }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 240ms ease, border-color 240ms ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(6, 9, 13, 0.96);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-name {
  font-family: var(--font-display);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(52, 211, 153, 0.35));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color var(--dur) ease, background-color var(--dur) ease;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    color: var(--text);
    background: rgba(148, 163, 184, 0.08);
    text-decoration: none;
  }
}

.nav-cta {
  margin-left: 8px;
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 180px 0 96px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -30% -20% auto -20%;
  height: 120%;
  background:
    radial-gradient(52% 42% at 22% 30%, rgba(52, 211, 153, 0.16), transparent 70%),
    radial-gradient(46% 40% at 80% 24%, rgba(56, 189, 248, 0.13), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 860px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.4s var(--ease-out) infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 74px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.05;
  margin-bottom: 24px;
  text-wrap: balance;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent) 0%, #2dd4bf 45%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 40px;
}

/* ---------- Signup form ---------- */
.signup {
  max-width: 520px;
  margin-inline: auto;
  text-align: left;
}

.signup-row {
  display: flex;
  gap: 10px;
}

.signup-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 14px 20px;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease, background-color var(--dur) ease;
}

.signup-input::placeholder {
  color: var(--text-muted);
}

.signup-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  background: var(--bg-elev);
}

.signup-input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}

.signup-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.signup-note[data-state="error"] {
  color: var(--danger);
}

.signup-success {
  display: none;
  text-align: center;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--text);
  padding: 20px 24px;
  border-radius: var(--radius);
  font-size: 15.5px;
}

.signup-success strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  margin-top: 44px;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-proof li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}

/* ---------- Stats ---------- */
.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 20, 29, 0.5), rgba(13, 20, 29, 0.15));
  content-visibility: auto;
  contain-intrinsic-size: auto 170px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-block: 48px;
}

.stat {
  text-align: center;
  padding-inline: 12px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 20%, var(--text-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-value span {
  font-size: 0.55em;
  font-weight: 700;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  margin-left: 2px;
}

.stat-label {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 16px;
  }
}

/* ---------- Sections ---------- */
.section {
  padding: 104px 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 620px;
}

.section-alt {
  background: linear-gradient(180deg, rgba(13, 20, 29, 0.45), rgba(13, 20, 29, 0.15) 60%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin-bottom: 18px;
  max-width: 720px;
  text-wrap: balance;
}

.section-sub {
  font-size: 17.5px;
  color: var(--text-soft);
  max-width: 640px;
  margin-bottom: 56px;
}

.section-sub em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}

/* ---------- Dev / sovereign grids ---------- */
.dev-grid,
.sovereign-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .dev-grid,
  .sovereign-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* ---------- Code cards ---------- */
.code-card {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.7);
}

.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.04);
}

.code-dots {
  display: inline-flex;
  gap: 6px;
}

.code-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
}

.code-dots i:nth-child(1) { background: #f87171; }
.code-dots i:nth-child(2) { background: #fbbf24; }
.code-dots i:nth-child(3) { background: #34d399; }

.code-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.code-body {
  padding: 22px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-soft);
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.code-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

.code-body .c-comment { color: var(--text-muted); }
.code-body .c-prompt { color: var(--accent); font-weight: 700; }
.code-body .c-str { color: #93c5fd; }
.code-body .c-strong { color: var(--accent); font-weight: 700; }

.diagram-card .code-body.diagram {
  padding: 24px;
  line-height: 1.45;
  font-size: 12.5px;
}

/* ---------- Feature list ---------- */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) ease, background-color var(--dur) ease;
}

@media (hover: hover) and (pointer: fine) {
  .feature:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: #0f1823;
  }
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  flex-shrink: 0;
}

.feature p {
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- Benchmarks ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.bench-table th,
.bench-table td {
  text-align: left;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.bench-table thead th {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.04);
}

.bench-table tbody tr:last-child td {
  border-bottom: none;
}

.bench-table tbody tr {
  transition: background-color var(--dur) ease;
}

@media (hover: hover) and (pointer: fine) {
  .bench-table tbody tr:hover {
    background: rgba(52, 211, 153, 0.04);
  }
}

.bench-table tbody td:first-child {
  color: var(--text-soft);
  font-weight: 500;
}

.bench-table strong {
  color: var(--accent);
  font-size: 17px;
}

.table-note {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 14px 0 8px;
  letter-spacing: -0.01em;
}

.step p {
  font-size: 14.5px;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- FAQ ---------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--dur) ease;
}

.faq-item[open] {
  border-color: rgba(52, 211, 153, 0.35);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-soft);
  font-size: 17px;
  font-weight: 500;
  transition: transform 220ms var(--ease-in-out), background-color var(--dur) ease, color var(--dur) ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent);
}

.faq-item p {
  padding: 0 24px 22px;
  color: var(--text-muted);
  font-size: 15px;
  max-width: 640px;
}

@media (hover: hover) and (pointer: fine) {
  .faq-item summary:hover {
    color: var(--accent);
  }
}

/* ---------- Final CTA ---------- */
.cta {
  position: relative;
  text-align: center;
  overflow: hidden;
}

.cta-inner {
  position: relative;
  max-width: 720px;
}

.cta-glow {
  position: absolute;
  inset: -40% -30% auto -30%;
  height: 130%;
  background: radial-gradient(50% 44% at 50% 20%, rgba(52, 211, 153, 0.14), transparent 70%);
  pointer-events: none;
}

.cta-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 16px;
  text-wrap: balance;
}

.cta-sub {
  position: relative;
  color: var(--text-soft);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 36px;
}

.signup-center .signup-row {
  max-width: 520px;
  margin-inline: auto;
}

.cta-footnote {
  position: relative;
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-tagline {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 260px;
}

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-soft);
  font-size: 14.5px;
  transition: color var(--dur) ease;
}

@media (hover: hover) and (pointer: fine) {
  .footer-col a:hover {
    color: var(--accent);
    text-decoration: none;
  }
}

.footer-loc {
  color: var(--text-muted);
  font-size: 14.5px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Entrance animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(10px);
  }

  html.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity 400ms var(--ease-out),
      transform 400ms var(--ease-out);
  }

  html.js .feature-list .reveal:nth-child(2) { transition-delay: 40ms; }
  html.js .feature-list .reveal:nth-child(3) { transition-delay: 80ms; }
  html.js .feature-list .reveal:nth-child(4) { transition-delay: 120ms; }
  html.js .steps .reveal:nth-child(2) { transition-delay: 40ms; }
  html.js .steps .reveal:nth-child(3) { transition-delay: 80ms; }

  .hero-inner > *:not(.hero-title) {
    animation: hero-in 350ms var(--ease-out) both;
  }

  .hero-inner > .eyebrow { animation-delay: 0ms; }
  .hero-inner > .hero-sub { animation-delay: 40ms; }
  .hero-inner > .signup { animation-delay: 80ms; }
  .hero-inner > .hero-proof { animation-delay: 120ms; }

  @keyframes hero-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .eyebrow-dot {
    animation: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  .signup-row {
    flex-direction: column;
  }

  .signup-input,
  .btn {
    width: 100%;
  }

  .hero {
    padding-top: 140px;
  }

  .section {
    padding: 72px 0;
  }
}
