:root {
  /* Grey Pulse palette */
  --gp-mist: #CFDBD5;
  --gp-limestone: #E8EDDF;
  --gp-signal: #F5CB5C;
  --gp-asphalt: #242423;
  --gp-graphite: #333533;

  /* Mapping */
  --bg: var(--gp-limestone);
  --bg-dark: var(--gp-asphalt);
  --bg-card: var(--gp-mist);
  --surface: var(--gp-limestone);
  --surface-dark: var(--gp-graphite);
  --accent: var(--gp-signal);
  --text: #1F1F1F;
  --text-light: #F5F5F5;
  --text-dim: #5A5A5A;
  --text-dim-light: #A8A8A8;
  --line: #C8C8C8;
  --line-dark: #555;

  --radius: 6px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --space-80: 80px;
  --space-88: 88px;
  --space-120: 120px;

  --max-w: 1200px;
  --container-pad: 32px;
}

@media (max-width: 768px) {
  :root {
    --container-pad: 20px;
    --space-80: 56px;
    --space-88: 56px;
    --space-120: 72px;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

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

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(232, 237, 223, 0.96); /* limestone */
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo {
  font-weight: 700; font-size: 19px; letter-spacing: -0.4px;
  color: var(--gp-asphalt); text-decoration: none;
}
.nav-links {
  display: flex; gap: 28px;
}
.nav-links a {
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--gp-asphalt); }
.nav-cta {
  font-size: 14px; padding: 10px 22px; border-radius: 999px;
  background: var(--gp-asphalt); color: #fff; font-weight: 600;
  transition: all 0.2s ease;
}
.nav-cta:hover { background: var(--gp-graphite); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-cta { padding: 8px 16px; font-size: 13px; }
}

/* HERO */
.hero {
  background: var(--gp-asphalt);
  color: #fff;
  padding: 96px 0 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.hero-copy h1 {
  font-size: clamp(38px, 4.8vw, 58px);
  line-height: 1.05;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: -1.1px;
  max-width: 18ch;
}
.hero .lead {
  font-size: 18px;
  opacity: 0.92;
  max-width: 44ch;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.23,1,0.32,1);
  min-height: 44px;
}
.btn.primary {
  background: var(--gp-signal); color: var(--gp-asphalt);
}
.btn.primary:hover { background: #e6b84a; transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.btn.ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
}
.btn.large { padding: 16px 34px; font-size: 16px; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* HERO GRAPHIC - NEW THREE STAGE */
.hero-graphic {
  position: relative;
  height: auto;
  min-height: 340px;
  width: 100%;
}
#hero-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Source cards - consistent, aligned grid */
.source-card {
  fill: rgba(255,255,255,0.06);
  stroke: rgba(255,255,255,0.5);
  stroke-width: 1;
  rx: 4;
}
.source-label {
  fill: rgba(255,255,255,0.92);
  font-size: 11px;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Reconstruction layer */
.recon-layer {
  fill: none;
  stroke: var(--gp-signal);
  stroke-width: 1.5;
  stroke-opacity: 0.6;
}
.recon-box {
  fill: rgba(245, 203, 92, 0.08);
  stroke: var(--gp-signal);
  stroke-width: 1.5;
  rx: 5;
}
.recon-label {
  fill: var(--gp-signal);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Structured output */
.output-card {
  fill: #1f252b;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 1;
  rx: 4;
}
.output-label {
  fill: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
}
.output-accent {
  fill: var(--gp-signal);
}

/* Animation helpers */
.hero-graphic .animating .source-card {
  transition: transform 700ms cubic-bezier(0.23,1,0.32,1), opacity 500ms ease;
}
.hero-graphic .animating .recon-line {
  transition: stroke-dashoffset 800ms ease;
}

/* SECTIONS */
.section {
  padding: var(--space-88) 0;
}
.section-dark {
  background: var(--gp-asphalt);
  color: #fff;
}
.section-tinted {
  background: var(--gp-mist);
}
.section-label {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-dim-light);
  margin-bottom: 6px;
  font-weight: 600;
}
h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.15;
  margin: 0 0 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
h3 { font-size: 19px; font-weight: 600; margin: 0 0 6px; }

/* RECOGNITION PANELS */
.panels {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.panel {
  background: var(--gp-graphite);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: transform 0.45s cubic-bezier(0.23,1,0.32,1), opacity 0.4s ease;
}
.panel-inner { max-width: 42ch; }
.panel-num {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--gp-signal);
  margin-bottom: 10px;
  font-weight: 600;
}
.panel p { margin: 0; opacity: 0.88; font-size: 15px; }

/* CAPABILITIES */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}
.cap {
  padding: 22px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.cap h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.cap p { margin: 0; font-size: 14.5px; color: var(--text-dim); }

/* DELIVERABLE PREVIEW */
.preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  max-width: 620px;
}
.preview-header {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 600;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.preview-item {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 5px;
  font-size: 14px;
}
.preview-item .label { display: block; color: var(--text-dim); font-size: 12px; }
.mini-line {
  height: 1px;
  background: linear-gradient(to right, var(--gp-graphite), transparent);
  margin-top: 6px;
}
.preview-foot {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
}

/* AUDIENCE */
.audience {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.audience span {
  background: var(--gp-mist);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid var(--line);
  color: var(--gp-asphalt);
}

/* HOW IT STARTS */
.how-start {
  background: var(--gp-asphalt);
  color: #fff;
}

/* FORM - START PAGE */
.start-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 20px 100px;
}
.start-container h1 {
  font-size: 38px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.start-container .intro {
  color: var(--text-dim);
  max-width: 58ch;
  margin-bottom: 32px;
}

.form-section {
  margin-bottom: 32px;
}
.form-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 5px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
  color: var(--text);
  transition: border 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gp-asphalt);
  box-shadow: 0 0 0 3px rgba(36, 36, 35, 0.08);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.checkbox-item input { width: auto; margin: 0; }

.info-panel {
  background: var(--gp-mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 14px;
  margin: 24px 0;
  color: var(--gp-asphalt);
}
.info-panel strong { font-weight: 600; }

.note {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 12px;
}

.error {
  color: #c0392b;
  font-size: 14px;
  margin-top: 8px;
}

.success {
  padding: 24px;
  background: var(--gp-mist);
  border: 1px solid var(--gp-asphalt);
  border-radius: var(--radius);
  text-align: center;
}

/* FOOTER */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-dim);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Accessibility & reduced motion */
@media (prefers-reduced-motion: reduce) {
  .panel, .hero-graphic * {
    transition: none !important;
    animation: none !important;
  }
}

/* 404 */
.not-found {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.not-found h1 { font-size: 72px; margin: 0; opacity: 0.15; }
.not-found .content { max-width: 420px; }

/* Misc */
.small { font-size: 12px; }
/* Hero relationship graphic improvements */
.hero-svg-wrap { position: relative; width: 100%; height: 320px; }
#hero-svg { display: block; }
.source-node, .output-node { cursor: pointer; }
.source-node rect, .output-node rect { transition: stroke 0.15s ease, fill 0.15s ease; }
#paths path { transition: stroke 0.15s ease, stroke-width 0.15s ease, opacity 0.15s ease; }
.highlight path, .highlight .source-node rect, .highlight .output-node rect { stroke: #F5CB5C !important; stroke-width: 2.5 !important; opacity: 1 !important; }
.dim { opacity: 0.25 !important; }

#hero-tooltip {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.3;
}

/* Responsive graphic - intentional mobile layout */
@media (max-width: 768px) {
  .hero-svg-wrap { height: auto; min-height: 280px; }
  #hero-svg { max-height: 260px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-copy { order: 1; }
  .hero-graphic { order: 2; }
}

/* Tooltip on mobile touch friendly */
@media (max-width: 600px) {
  #hero-tooltip { max-width: 220px; font-size: 11px; padding: 6px 8px; }
}
