/* Web Daemon marketing site. Colours come from brand.css. */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-muted-on-dark: color-mix(in srgb, var(--sparkl-white) 78%, var(--sparkl-navy));
  --text-muted-on-light: color-mix(in srgb, var(--sparkl-navy) 75%, var(--sparkl-white));
  --rule-on-dark: color-mix(in srgb, var(--sparkl-white) 16%, var(--sparkl-navy));
  --rule-on-light: color-mix(in srgb, var(--sparkl-navy) 14%, var(--sparkl-white));
  --panel-on-dark: color-mix(in srgb, var(--sparkl-white) 6%, var(--sparkl-navy));
  --panel-on-light: color-mix(in srgb, var(--sparkl-cyan) 7%, var(--sparkl-white));

  --wrap: 1120px;
  --gutter: 20px;
  --radius: 10px;
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--panel-on-light);
}

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

/* Surfaces */

section { padding: clamp(64px, 9vw, 112px) 0; }

.surface-dark { background: var(--color-bg-dark); color: var(--color-text-on-dark); }
.surface-light { background: var(--color-bg-light); color: var(--color-text-on-light); }
.surface-accent { background: var(--color-bg-accent); color: var(--color-text-on-accent); }

.surface-dark .section-lede { color: var(--text-muted-on-dark); }
.surface-light .section-lede { color: var(--text-muted-on-light); }

.section-lede { font-size: 1.15rem; max-width: 46em; margin-bottom: 2.5rem; }
.section-lede:last-child { margin-bottom: 0; }
.section-lede.lede-first { margin-bottom: 1em; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-on-dark);
  margin-bottom: 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--sparkl-navy) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-on-dark);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand img { width: 150px; height: auto; }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a {
  color: var(--text-muted-on-dark);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-header nav a:hover { color: var(--color-text-on-dark); }
.site-header nav .nav-cta {
  color: var(--color-text-on-accent);
  background: var(--color-bg-accent);
  padding: 7px 16px;
  border-radius: 999px;
}
.site-header nav .nav-cta:hover { color: var(--color-text-on-accent); filter: brightness(1.08); }

@media (max-width: 760px) {
  .site-header nav a:not(.nav-cta) { display: none; }
  .brand img { width: 120px; }
}

/* Hero: the bubble cloud sweeps down from the top left, leaving clear space on the
   right. The banner fills the hero's height (both edges crop bubbles), and its right
   edge is pinned just past the content column so the copy always lands in that space. */

.hero {
  --hero-h: 720px;
  height: var(--hero-h);
  background:
    url("images/bubbles.png") right max(0px, calc(50vw - (var(--wrap) / 2) - 140px)) top 0 / auto 100% no-repeat,
    var(--color-bg-dark);
  display: flex;
  align-items: center;
}
.hero-inner { width: 100%; }
.hero-inner > * { max-width: 540px; margin-left: auto; }
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.1rem); }
.hero .lede { font-size: 1.15rem; color: var(--text-muted-on-dark); }
.hero em { font-style: normal; color: var(--color-accent-on-dark); }

@media (max-width: 1060px) {
  .hero {
    height: auto;
    background-position: left top;
    background-size: 200% auto;
    /* the banner at 200% width is 200vw * 680 / 2400 tall */
    padding-top: calc(56.7vw + 24px);
  }
  .hero-inner > * { max-width: 640px; margin-left: 0; }
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: filter 0.15s, background-color 0.15s;
}
.btn-accent { background: var(--color-bg-accent); color: var(--color-text-on-accent); }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--color-text-on-dark); border-color: var(--rule-on-dark); }
.btn-ghost:hover { border-color: var(--color-accent-on-dark); }

:focus-visible { outline: 3px solid var(--sparkl-cyan); outline-offset: 3px; }

/* Pillars */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.pillar {
  border-top: 4px solid var(--sparkl-cyan);
  padding-top: 24px;
}
.pillar-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--sparkl-navy);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pillar ul { margin: 0; padding: 0; list-style: none; }
.pillar li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.9em;
  color: var(--text-muted-on-light);
}
.pillar strong { color: var(--color-text-on-light); }
.pillar li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--sparkl-cyan);
}

/* Layers */

.layers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.layer {
  background: var(--panel-on-dark);
  border: 1px solid var(--rule-on-dark);
  border-radius: var(--radius);
  padding: 22px;
}
.layer p { margin: 0; color: var(--text-muted-on-dark); }
.layer-tag {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
.layer-new { border: 2px solid var(--sparkl-cyan); }
.layer-new .layer-tag { color: var(--color-accent-on-dark); }
.layer-new em { font-style: normal; color: var(--color-text-on-dark); }

/* Code */

.code-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 760px) { .code-pair { grid-template-columns: minmax(0, 1fr); } }

.code {
  margin: 0;
  background: color-mix(in srgb, black 25%, var(--sparkl-navy));
  border: 1px solid var(--rule-on-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.code figcaption {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted-on-dark);
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-on-dark);
}
.code pre { margin: 0; padding: 16px; overflow-x: auto; }
.code code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-on-dark);
}
.tok-tag, .tok-attr { color: var(--sparkl-cyan); }
.tok-str { color: var(--color-text-on-dark); font-weight: 600; }

/* Human and AI front ends */

.fronts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.front {
  border: 2px solid var(--sparkl-navy);
  border-radius: var(--radius);
  padding: 24px;
}
.front p { margin: 0; color: var(--text-muted-on-light); }
.front .front-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--color-text-on-light);
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--color-bg-accent);
  color: var(--color-text-on-accent);
}
@media (max-width: 760px) { .fronts { grid-template-columns: minmax(0, 1fr); } }
.fronts-note {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 600;
  color: var(--color-text-on-light);
}

/* Cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--panel-on-light);
  border: 1px solid var(--rule-on-light);
  border-radius: var(--radius);
  padding: 24px;
}
.card p { margin: 0; color: var(--text-muted-on-light); }

.callout {
  margin-top: 40px;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  border-left: 6px solid var(--sparkl-cyan);
}
.callout-title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.callout p:last-child { margin: 0; color: var(--text-muted-on-dark); }
.callout em { font-style: normal; color: var(--color-accent-on-dark); }

/* Two-column sections */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

.surface-accent h2 { margin: 0; }
.surface-accent p { font-size: 1.15rem; margin: 0; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  padding: 16px 0 16px 36px;
  border-bottom: 1px solid var(--rule-on-dark);
  position: relative;
  color: var(--text-muted-on-dark);
}
.checklist li:first-child { padding-top: 0; }
.checklist li:first-child::before { top: 3px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--sparkl-cyan);
}
.checklist strong { color: var(--color-text-on-dark); }

/* Contact */

.contact { text-align: center; }
.contact .section-lede { margin-left: auto; margin-right: auto; }
.contact strong { color: var(--color-text-on-dark); }
.actions-center { justify-content: center; margin-top: 0; }

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
  text-align: left;
}
.point {
  background: var(--panel-on-dark);
  border: 1px solid var(--rule-on-dark);
  border-top: 4px solid var(--sparkl-cyan);
  border-radius: var(--radius);
  padding: 24px;
}
.point p { margin: 0; color: var(--text-muted-on-dark); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule-on-dark);
  padding: 32px 0;
  font-size: 0.9rem;
  color: var(--text-muted-on-dark);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer-inner p { margin: 0; }
.footer-inner img { width: 104px; height: auto; }
