/* =========================================================================
   Marketing site
   Dark, data-forward theme. Signature motif: two sine-wave "braid" lines
   in a cyan→violet gradient — read as woven threads (a motif) carrying a
   current (streams). The same two-path pattern recurs at different scales:
   nav mark, section dividers, tier icons, hero/CTA backgrounds, and the
   infrastructure diagram's converging links.
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --bg: #0a0e14;
  --bg-raised: #0d1220;
  --surface: #10151f;
  --surface-hover: #141b28;
  --border: #1e2733;
  --border-strong: #2a3644;

  --text-primary: #e8edf4;
  --text-secondary: #8b97a8;
  --text-tertiary: #5b6779;

  --cyan: #22d3c7;
  --violet: #8b5cf6;
  --violet-soft: #a78bfa;

  --gradient: linear-gradient(90deg, var(--cyan), var(--violet));

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo,
    Consolas, monospace;

  --radius: 12px;
  --radius-sm: 7px;
  --container: 1180px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 7rem;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

/* ---- Focus & motion ------------------------------------------------------*/
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--violet);
  color: #0a0e14;
  padding: 0.75em 1.25em;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}

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

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

/* ---- Type scale -----------------------------------------------------------*/
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 var(--space-2);
}

h2 {
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 46em;
  margin-top: var(--space-2);
}

.section-head {
  max-width: 640px;
}

.gateway-eyebrow-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.gateway-eyebrow-row .eyebrow {
  margin-bottom: 0;
}

/* ---- Layout helpers -------------------------------------------------------*/
.header-inner,
.hero-inner,
.section,
.final-cta-inner,
.footer-top,
.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.section {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.65em 1.3em;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn-lg {
  padding: 0.85em 1.7em;
  font-size: 1.02rem;
}

.btn-primary {
  background: var(--gradient);
  color: #06090d;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-secondary {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--surface);
}

.btn-secondary:hover {
  border-color: var(--violet-soft);
}

.cta-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ---- Braid / stream motif ------------------------------------------------*/
.braid-line {
  fill: none;
  stroke: url(#streamGradient);
  stroke-linecap: round;
}

.braid-a {
  stroke-width: 1.6;
}

.braid-b {
  stroke-width: 1.6;
  opacity: 0.55;
}

.braid-c {
  stroke-width: 1.4;
  opacity: 0.3;
}

.brand-mark .braid-a,
.brand-mark .braid-b {
  stroke-width: 2.2;
}

.tier-icon {
  width: 64px;
  height: 24px;
  margin-bottom: var(--space-2);
}

.braid-divider {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
  opacity: 0.7;
}

.braid-divider svg {
  width: 100%;
  height: 32px;
}

.stream-line {
  fill: none;
  stroke: url(#streamGradientSoft);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 6 14;
}

@media (prefers-reduced-motion: no-preference) {
  .stream-line {
    animation: stream-flow 26s linear infinite;
  }

  .stream-line:nth-child(2) {
    animation-duration: 32s;
    animation-direction: reverse;
  }

  .stream-line:nth-child(3) {
    animation-duration: 22s;
  }

  .stream-line:nth-child(4) {
    animation-duration: 30s;
    animation-direction: reverse;
  }

  .stream-line:nth-child(5) {
    animation-duration: 24s;
  }
}

@keyframes stream-flow {
  to {
    stroke-dashoffset: -400;
  }
}

/* ---- Announcement bar -----------------------------------------------------*/
.announcement-bar {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.announcement-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55em;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.6em var(--space-4);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.announcement-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.announcement-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #06090d;
  background: var(--gradient);
  padding: 0.2em 0.55em;
  border-radius: 999px;
  flex-shrink: 0;
}

.announcement-arrow {
  color: var(--violet-soft);
  flex-shrink: 0;
}

/* ---- Header -------------------------------------------------------------*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-right: auto;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.93rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-toggle-input,
.nav-toggle-label {
  display: none;
}

/* ---- Hero -----------------------------------------------------------------*/
.hero {
  position: relative;
  overflow: hidden;
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-bg svg {
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-headline {
  display: flex;
  flex-direction: column;
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 var(--space-3);
}

.hero-headline span:last-child {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 46em;
  margin-bottom: var(--space-4);
}

/* ---- Value band -----------------------------------------------------------*/
.value-band {
  text-align: center;
}

.value-statement {
  max-width: 760px;
  margin: 0 auto var(--space-5);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  text-align: left;
}

.value-item {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.value-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.value-item p {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* ---- Platform -------------------------------------------------------------*/
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: border-color 0.15s ease;
}

.platform-card:hover {
  border-color: var(--border-strong);
}

.platform-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
}

.platform-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---- Models -----------------------------------------------------------*/
.models-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dayzero-callout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  max-width: 320px;
}

.dayzero-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #06090d;
  background: var(--gradient);
  padding: 0.35em 0.6em;
  border-radius: 999px;
  flex-shrink: 0;
}

.dayzero-callout p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.model-card {
  grid-column: span 3;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.model-card h3 {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  margin-bottom: 0.5em;
}

.model-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-height: 2.7em;
}

.model-card--featured {
  grid-column: span 6;
  background: var(--surface);
  border-color: var(--border-strong);
  padding: var(--space-4);
}

.model-card--featured .tier-icon {
  margin-bottom: var(--space-3);
}

.model-card--featured h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.model-card--featured p {
  font-size: 1rem;
  min-height: 0;
  max-width: 46em;
}

.tag-row {
  display: flex;
  gap: 0.4em;
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--violet-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.25em 0.65em;
}

/* ---- Infrastructure --------------------------------------------------------*/
.infra-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
  margin-top: var(--space-5);
}

.infra-diagram svg {
  width: 100%;
  height: auto;
}

.infra-link {
  fill: none;
  stroke: url(#streamGradientSoft);
  stroke-width: 1.4;
  stroke-dasharray: 5 9;
}

@media (prefers-reduced-motion: no-preference) {
  .infra-link {
    animation: stream-flow 18s linear infinite;
  }
}

.infra-node {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.infra-hub {
  fill: var(--bg-raised);
  stroke: url(#streamGradient);
  stroke-width: 2;
}

.infra-hub-label {
  font-family: var(--font-mono);
  font-size: 15px;
  fill: var(--text-primary);
  font-weight: 600;
}

.infra-providers-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--text-tertiary);
}

.infra-points {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.infra-point h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.infra-point p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---- Developers -------------------------------------------------------*/
.developers {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-5);
  align-items: start;
}

.dev-bullets {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dev-bullets li {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.dev-bullets strong {
  font-size: 0.98rem;
}

.dev-bullets span {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.code-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.code-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.code-tab {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-tertiary);
  padding: 0.6em 0.9em;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
}

.code-tab:hover {
  color: var(--text-secondary);
}

#tab-curl:checked ~ .code-tabs label[for="tab-curl"],
#tab-python:checked ~ .code-tabs label[for="tab-python"] {
  color: var(--text-primary);
  background: var(--surface);
}

.code-block {
  margin: 0;
  padding: var(--space-3);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  display: none;
}

#tab-curl:checked ~ .code-block-curl,
#tab-python:checked ~ .code-block-python {
  display: block;
}

.tok-str {
  color: var(--cyan);
}

.tok-kw {
  color: var(--violet-soft);
}

.tok-fn {
  color: #f0b86e;
}

/* ---- Final CTA --------------------------------------------------------*/
.final-cta {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: var(--space-7) 0;
  text-align: center;
}

.final-cta-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.final-cta-bg svg {
  width: 100%;
  height: 100%;
}

.final-cta-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.final-cta h2 {
  margin-bottom: var(--space-2);
}

.final-cta p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: var(--space-4);
}

.final-cta .cta-row {
  justify-content: center;
}

/* ---- Footer -----------------------------------------------------------*/
.site-footer {
  border-top: 1px solid var(--border);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-5);
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
}

.footer-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.1em 0.6em;
  max-width: 280px;
}

.footer-brand .brand-mark {
  grid-row: 1;
}

.footer-brand .brand-name {
  grid-row: 1;
}

.footer-brand p {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-2);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
  padding-bottom: var(--space-4);
}

.footer-bottom p {
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

/* ---- Responsive ---------------------------------------------------------*/
@media (max-width: 900px) {
  .value-grid,
  .platform-grid,
  .model-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .model-card {
    grid-column: span 1;
  }

  .model-card--featured {
    grid-column: span 2;
  }

  .infra-layout,
  .developers {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
  }

  .nav-toggle-label span {
    display: block;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
  }

  .site-nav {
    flex-basis: 100%;
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }

  .nav-toggle-input:checked ~ .site-nav {
    max-height: 400px;
  }

  .nav-links,
  .nav-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .nav-cta {
    margin-top: var(--space-2);
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .value-grid,
  .platform-grid,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .model-card,
  .model-card--featured {
    grid-column: span 1;
  }

  .models-heading-row {
    align-items: flex-start;
  }

  .footer-columns {
    grid-template-columns: 1fr 1fr;
  }
}
