/* ===== DESIGN TOKENS (from DESIGN.md) ===== */
:root {
  /* backgrounds — warm charcoal, not blue-tinted */
  --bg-deep:     #0a0a0c;
  --bg-base:     #111114;
  --bg-elevated: #1a1a1f;
  --bg-surface:  #222228;

  /* accent — soft teal-cyan */
  --accent:        #22d3ee;
  --accent-muted:  #15a3b8;
  --accent-glow:   rgba(34, 211, 238, 0.18);
  --accent-subtle: rgba(34, 211, 238, 0.08);

  /* text — slightly warm whites */
  --text-primary:   #ededf0;
  --text-secondary: #9494a0;
  --text-muted:     #55555f;

  /* semantic */
  --success: #3fb950;
  --warning: #d29922;
  --error:   #f85149;

  /* spacing (8px base) */
  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px;
  --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px; --s9: 128px;

  /* radii */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-full: 9999px;

  /* fonts */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.88em; }

/* ===== LAYOUT ===== */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s4);
}

/* ===== GLASS ===== */
.glass {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--accent-subtle);
  border-radius: var(--r-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  text-wrap: balance;
}
.section-heading {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--s6);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--s2) var(--s4);
  min-height: 44px;
  border-radius: var(--r-sm);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn__icon { flex-shrink: 0; }

.btn--primary {
  background: var(--accent);
  color: var(--bg-deep);
}
.btn--primary:hover {
  background: var(--accent-muted);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 60px rgba(0,212,255,0.06);
}
.btn--primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--disabled {
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
  opacity: 0.6;
}
.btn__soon {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.btn--ghost {
  border: 1px solid var(--accent-subtle);
  color: var(--text-primary);
}
.btn--ghost:hover {
  border-color: var(--accent-muted);
  color: var(--accent);
}
.btn--ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--s9) var(--s4) var(--s8);
  overflow: hidden;
  background: var(--bg-deep);
}
.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__atmosphere {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 50% at 50% 120%,
    rgba(34, 211, 238, 0.06) 0%,
    rgba(34, 211, 238, 0.02) 40%,
    transparent 70%
  );
  pointer-events: none;
}
.hero__content {
  position: relative;
  text-align: center;
  max-width: 720px;
  padding: var(--s5) var(--s6);
  background: rgba(10, 10, 12, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-subtle);
}
.hero__brand-canvas {
  display: block;
  margin: 0 auto var(--s2);
  max-width: 100%;
  height: auto;
}
.hero__title {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: var(--s4);
}
.hero__title-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #67e8f9 50%, #a5f3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 540px;
  margin: 0 auto var(--s5);
  color: var(--text-secondary);
}
.hero__actions {
  display: flex;
  gap: var(--s3);
  justify-content: center;
  flex-wrap: wrap;
}
.hero__kbd {
  display: inline-block;
  margin-top: var(--s5);
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--accent-subtle);
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.hero__kbd::before { content: 'Press '; }
.hero__kbd::after  { content: ' to download'; }
.hero:hover .hero__kbd { opacity: 0.8; }

/* ===== FEATURES ===== */
.features {
  padding: var(--s7) 0 var(--s6);
  background: var(--bg-base);
}

/* hero feature — full width */
.feature-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
  padding: var(--s5);
  margin-bottom: var(--s5);
}
.feature-hero__text { display: flex; flex-direction: column; justify-content: center; }
.feature-hero__text h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--s3);
}
.feature-hero__text p {
  max-width: 50ch;
  line-height: 1.65;
}
.feature-hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-hero__img {
  width: 100%;
  max-width: 340px;
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* orchestration diagram */
.orchestration-diagram {
  --orch-working: #6B9FD6;
  --orch-complete: #DA7756;
  position: relative;
  width: 300px;
  height: 300px;
}

/* SVG connection lines */
.orch-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.orch-line {
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: 0.35;
}
.orch-line--1 { stroke: var(--orch-working); animation: orch-dash 2.5s linear infinite; }
.orch-line--2 { stroke: var(--orch-working); animation: orch-dash 2.5s linear infinite 0.4s; }
.orch-line--3 { stroke: var(--orch-complete); animation: orch-dash 2.5s linear infinite 0.8s; }

@keyframes orch-dash {
  0%   { stroke-dashoffset: 0; opacity: 0.2; }
  50%  { opacity: 0.5; }
  100% { stroke-dashoffset: -20; opacity: 0.2; }
}

/* nodes — shared */
.orch-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.orch-label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* center hub — static accent */
.orch-node--hub {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.orch-hub-icon {
  width: 26px;
  height: 28px;
  color: var(--accent);
  margin-bottom: -2px;
}
.orch-node--hub .orch-label {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

/* agent nodes — pulse between working blue and complete orange */
.orch-node--agent {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-surface);
  justify-content: center;
  gap: 0;
  border: 2px solid var(--bg-surface);
  box-shadow: none;
  transition: border-color 1.2s ease, box-shadow 1.2s ease;
}
.orch-node--agent .orch-icon {
  transition: color 1.2s ease, opacity 1.2s ease;
}
.orch-node--agent.is-working {
  border-color: var(--orch-working);
  box-shadow: 0 0 12px rgba(107, 159, 214, 0.25);
}
.orch-node--agent.is-working .orch-icon {
  color: var(--orch-working);
  opacity: 1;
}
.orch-node--agent.is-complete {
  border-color: var(--orch-complete);
  box-shadow: 0 0 12px rgba(218, 119, 86, 0.25);
}
.orch-node--agent.is-complete .orch-icon {
  color: var(--orch-complete);
  opacity: 1;
}
.orch-icon {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
  opacity: 0.8;
}

/* agent positions — triangle layout, combined float + pulse animations */
.orch-pos--tl {
  top: 6%; left: 12%;
  animation: orch-float 4s ease-in-out infinite;
}
.orch-pos--tr {
  top: 6%; right: 12%;
  animation: orch-float 4s ease-in-out infinite 1.3s;
}
.orch-pos--bc {
  bottom: 4%; left: 50%; transform: translateX(-50%);
  animation: orch-float-bc 4s ease-in-out infinite 2.6s;
}

@keyframes orch-float {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(3px, -5px); }
}
@keyframes orch-float-bc {
  0%, 100% { transform: translateX(-50%) translate(0, 0); }
  50%      { transform: translateX(-50%) translate(3px, -5px); }
}

/* pulse ring */
.orch-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  z-index: 1;
  animation: orch-ping 3s ease-out infinite;
}
@keyframes orch-ping {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

/* secondary features — asymmetric grid */
.feature-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--s4);
}
.feature-card {
  padding: var(--s4);
}
.feature-card:first-child {
  border-left: 2px solid var(--accent-subtle);
}
.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--s2);
}
.feature-card p {
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ===== TERMINAL SECTION ===== */
.terminal-section {
  padding: var(--s6) 0 var(--s7);
  background: var(--bg-deep);
}
/* demo embed — real app UI from herd repo */
.demo-frame-wrapper {
  max-width: 920px;
  margin: 0 auto;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.2);
}
.demo-frame-wrapper iframe {
  width: 100%;
  aspect-ratio: 900 / 550;
  border: none;
  display: block;
}

/* ===== CHANGELOG ===== */
.changelog {
  padding: var(--s6) 0 var(--s6);
  background: var(--bg-base);
}

.changelog__timeline {
  position: relative;
  padding-left: 36px;
  max-width: 640px;
  margin: 0 auto;
}

/* vertical line */
.changelog__line {
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent-subtle);
}

/* each version entry */
.changelog__entry {
  position: relative;
  margin-bottom: var(--s5);
}
.changelog__entry:last-of-type {
  margin-bottom: 0;
}

/* timeline dot */
.changelog__dot {
  position: absolute;
  left: -32px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--bg-base);
  z-index: 1;
}
.changelog__dot--latest {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* glass card for each version */
.changelog__card {
  padding: 20px 24px;
}

.changelog__header {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.changelog__version {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.changelog__date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.changelog__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--s2);
}

.changelog__changes {
  list-style: none;
  padding: 0;
  margin: 0;
}
.changelog__changes li {
  position: relative;
  padding-left: 16px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.changelog__changes li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--text-muted);
  font-weight: 700;
}

.changelog__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s5);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
}
.changelog__all:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .changelog__timeline {
    padding-left: 28px;
  }
  .changelog__dot {
    left: -24px;
  }
  .changelog__card {
    padding: 16px 18px;
  }
}

/* ===== DOWNLOAD ===== */
.download {
  padding: var(--s7) 0 var(--s6);
  background: var(--bg-base);
  text-align: center;
}
.download__sub {
  margin-bottom: var(--s5);
  color: var(--text-secondary);
}
.download__platforms {
  display: flex;
  gap: var(--s3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--s6);
}

/* cli copy */
.download__cli {
  max-width: 520px;
  margin: 0 auto var(--s5);
  text-align: left;
}
.download__cli-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--s2);
}
.download__cli-box {
  display: flex;
  align-items: center;
  padding: var(--s2) var(--s3);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.download__cli-box code { flex: 1; }
.download__copy {
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding: var(--s2) var(--s3);
  min-height: 44px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  transition: color 0.2s;
}
.download__copy:hover { color: var(--accent); }
.download__copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.download__copy.copied { color: var(--success); }

/* checksums */
.download__checksums {
  max-width: 520px;
  margin: 0 auto var(--s4);
  text-align: left;
}
.download__checksums summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--s2) 0;
}
.download__checksums summary:hover { color: var(--text-secondary); }
.checksums {
  padding: var(--s3) 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.checksums p { margin-bottom: var(--s1); }
.checksums code { color: var(--text-secondary); word-break: break-all; }

.download__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== FOOTER ===== */
.footer {
  padding: var(--s6) 0 var(--s5);
  background: var(--bg-deep);
  border-top: 1px solid rgba(255,255,255,0.04);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--s5);
}
.footer__logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}
.footer__tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--s1);
}
.footer__links {
  display: flex;
  gap: var(--s2);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer__links a {
  padding: var(--s2) var(--s3);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer__links a:hover { color: var(--text-secondary); }
.footer__links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.footer__copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== SCROLL FADE-IN ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ===== RESPONSIVE ===== */

/* tablet */
@media (max-width: 768px) {
  .hero { min-height: auto; padding: var(--s8) var(--s4) var(--s7); }
  .feature-hero {
    grid-template-columns: 1fr;
  }
  .feature-row {
    grid-template-columns: 1fr;
    gap: var(--s3);
  }
  .footer__inner {
    flex-direction: column;
    gap: var(--s4);
  }
  .footer__links { flex-wrap: wrap; }
}

/* mobile */
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding: var(--s7) var(--s3) var(--s6); min-height: auto; }
  .features { padding: var(--s6) 0 var(--s5); }
  .terminal-section { padding: var(--s5) 0 var(--s6); }
  .changelog { padding: var(--s5) 0 var(--s5); }
  .download { padding: var(--s6) 0 var(--s7); }
  .hero__title { font-size: 2rem; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
  .hero__kbd { display: none; }
  .section-heading { font-size: 1.5rem; }
  .download__platforms { flex-direction: column; align-items: stretch; }
  .download__platforms .btn { justify-content: center; }
  .terminal__body { padding: var(--s2) var(--s3); font-size: 0.8rem; }
}

/* ─── Cookie consent banner ─────────────────────────────────────────────── */
.consent-banner {
  position: fixed;
  bottom: var(--s4);
  left: var(--s4);
  right: var(--s4);
  max-width: 720px;
  margin: 0 auto;
  padding: var(--s4) var(--s5);
  background: rgba(15, 18, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--accent-subtle);
  border-radius: var(--r-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  z-index: 9999;
  font-size: 0.9rem;
  animation: consent-slide-up 0.4s ease-out;
}
.consent-banner--hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.consent-banner__text { flex: 1 1 280px; }
.consent-banner__text p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-secondary);
}
.consent-banner__text a {
  color: var(--accent);
  text-decoration: underline;
}
.consent-banner__buttons {
  display: flex;
  gap: var(--s2);
  flex-shrink: 0;
}
.consent-btn {
  padding: var(--s2) var(--s4);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}
.consent-btn:hover { transform: translateY(-1px); }
.consent-btn--accept {
  background: var(--accent);
  color: var(--bg-base);
}
.consent-btn--reject {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--accent-subtle);
}
.consent-btn--reject:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
@keyframes consent-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
  .consent-banner {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--r-md) var(--r-md) 0 0;
    border-bottom: none;
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .consent-banner { animation: none; }
  .consent-banner--hidden { transition: none; }
}
