:root {
  color-scheme: dark;
  --bg: #05070c;
  --surface: #0b101b;
  --surface-elevated: #101727;
  --border: rgba(148, 163, 184, 0.34);
  --border-strong: rgba(148, 163, 184, 0.56);
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --chalk-indigo: #a5b4fc;
  --chalk-cyan: #7dd3fc;
  --accent-bg: #4f46e5;
  --accent-bg-hover: #4338ca;
  --focus: #7dd3fc;
  --target-size: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

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

html {
  background-color: var(--bg);
  scroll-padding-top: 4.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

/* Skip Link */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus-visible {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface-elevated);
  color: var(--text);
  border: 2px solid var(--focus);
  font-weight: 600;
  text-decoration: none;
}

:where(a:any-link, button):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: rgba(5, 7, 12, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  min-block-size: var(--target-size);
  display: inline-flex;
  align-items: center;
  padding-inline: 0.25rem;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem 0.9rem;
  flex-wrap: wrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  min-block-size: var(--target-size);
  display: inline-flex;
  align-items: center;
  padding-inline: 0.35rem;
  border-radius: 0.35rem;
  transition: color 0.15s ease;
}

.nav-list a:hover {
  color: var(--chalk-cyan);
}

/* Main container */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Hero Banner + Drawn ZVP */
.hero-stage-section {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.hero-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding-top: 0.35rem;
}

.zvp-sketch-logo {
  width: clamp(180px, 34vw, 250px);
  height: auto;
  color: var(--text);
  overflow: visible;
}

.zvp-strokes .draw-stroke {
  stroke: currentColor;
  stroke-width: 4.5;
}

.zvp-strokes .draw-stroke.echo {
  stroke: var(--chalk-indigo);
  stroke-width: 1.8;
  opacity: 0.72;
}

.zvp-strokes .stroke-underline {
  stroke: var(--chalk-cyan);
  stroke-width: 2.5;
  opacity: 0.85;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 0.98rem);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Infographic Sketch Stage */
.sketch-stage {
  position: relative;
  min-height: clamp(470px, 68dvh, 640px);
  border-radius: 1rem;
  border: 1.5px dashed var(--border-strong);
  background-color: var(--surface);
  background-image: radial-gradient(rgba(148, 163, 184, 0.18) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.stage-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.stage-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-btn {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(16, 23, 39, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 0.45rem;
  padding: 0.35rem 0.75rem;
  min-block-size: var(--target-size);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.stage-btn:hover {
  border-color: var(--chalk-cyan);
  color: var(--text);
}

.stage-btn[hidden] {
  display: none;
}

/* Stage Grid */
.stage-canvas {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(300px, 1.15fr);
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.5rem;
}

/* Character + Speech Bubble */
.character-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 310px;
}

.speech-bubble {
  position: relative;
  align-self: flex-end;
  margin-right: 0.75rem;
  margin-bottom: 0.25rem;
  padding: 0.6rem 1rem;
  min-width: 144px;
  text-align: center;
  background: var(--surface-elevated);
  border: 2px solid var(--text);
  border-radius: 1rem 1.1rem 1rem 0.9rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(125, 211, 252, 0.28);
}

.bubble-tail {
  position: absolute;
  bottom: -17px;
  left: 24px;
  width: 26px;
  height: 18px;
  color: var(--text);
}

.sketch-walker {
  width: clamp(175px, 22vw, 228px);
}

.sketch-man {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.sketch-man .ink-main {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch-man .ink-soft {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch-man .ink-accent {
  fill: none;
  stroke: var(--chalk-cyan);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch-man .ink-dot {
  fill: var(--text);
}

.sketch-man .ground-line {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 2;
  stroke-linecap: round;
}

.sketch-man .ground-echo {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.2;
  stroke-linecap: round;
}

/* Default static pose (also fallback for reduced-motion & no-JS) */
.sketch-man .pose {
  opacity: 0;
}

.sketch-stage[data-step="done"] .pose-point-low,
.sketch-stage[data-step="point-2"] .pose-point-low {
  opacity: 1;
}

.sketch-stage[data-step="point-1"] .pose-point-top {
  opacity: 1;
}

.sketch-stage[data-step="greet"] .pose-greet {
  opacity: 1;
}

/* Callouts & Arrows */
.callout-zone {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.callout-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 0.65rem;
}

.sketch-arrow {
  width: 78px;
  height: auto;
  overflow: visible;
}

.arrow-mobile {
  display: none;
}

.sketch-arrow .arrow-shaft,
.sketch-arrow .arrow-head {
  fill: none;
  stroke: var(--chalk-cyan);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow-two .arrow-shaft,
.arrow-two .arrow-head {
  stroke: var(--chalk-indigo);
}

.sketch-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  background: rgba(16, 23, 39, 0.92);
  border: 2px solid var(--border-strong);
  text-decoration: none;
  color: var(--text);
  box-shadow: 4px 4px 0 rgba(148, 163, 184, 0.16);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.sketch-card:hover {
  border-color: var(--chalk-cyan);
  transform: translateY(-2px);
  box-shadow: 5px 6px 0 rgba(125, 211, 252, 0.22);
}

.sketch-card-nullpoint:hover {
  border-color: var(--chalk-indigo);
  box-shadow: 5px 6px 0 rgba(165, 180, 252, 0.24);
}

.sketch-card-kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--chalk-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sketch-card-nullpoint .sketch-card-kicker {
  color: var(--chalk-indigo);
}

.sketch-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sketch-card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sketch-card-cta {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

/* Playback Choreography (only when user allows motion) */
@media (prefers-reduced-motion: no-preference) {
  .hero-stage-section.is-logo-drawing .zvp-strokes .draw-stroke {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawInk 0.55s ease-out forwards;
  }

  .hero-stage-section.is-logo-drawing .zvp-strokes .stroke-v-1,
  .hero-stage-section.is-logo-drawing .zvp-strokes .stroke-v-2 {
    animation-delay: 0.18s;
  }

  .hero-stage-section.is-logo-drawing .zvp-strokes .stroke-p-1,
  .hero-stage-section.is-logo-drawing .zvp-strokes .stroke-p-2,
  .hero-stage-section.is-logo-drawing .zvp-strokes .stroke-p-3 {
    animation-delay: 0.34s;
  }

  .hero-stage-section.is-logo-drawing .zvp-strokes .stroke-underline {
    animation-delay: 0.5s;
  }

  /* Character entrance & walk cycle */
  .sketch-stage.is-playing .sketch-walker {
    transition: transform 0.9s linear, opacity 0.25s ease-out;
  }

  .sketch-stage.is-playing[data-step="init"] .sketch-walker {
    opacity: 0;
    transform: translateX(-115px);
  }

  .sketch-stage.is-playing[data-step="walk"] .sketch-walker {
    opacity: 1;
    transform: translateX(0);
  }

  .sketch-stage.is-playing[data-step="walk"] .pose-walk-a {
    animation: walkFrameA 0.48s steps(1, end) infinite;
  }

  .sketch-stage.is-playing[data-step="walk"] .pose-walk-b {
    animation: walkFrameB 0.48s steps(1, end) infinite;
  }

  .sketch-stage.is-playing[data-step="walk"] .pose-walk-c {
    animation: walkFrameC 0.48s steps(1, end) infinite;
  }

  /* Speech bubble reveal */
  .sketch-stage.is-playing .speech-bubble {
    transition: opacity 0.22s ease-out, transform 0.22s ease-out;
  }

  .sketch-stage.is-playing[data-step="init"] .speech-bubble,
  .sketch-stage.is-playing[data-step="walk"] .speech-bubble {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }

  /* Cards & arrows stepped reveal */
  .sketch-stage.is-playing .callout-row-top .sketch-card,
  .sketch-stage.is-playing .callout-row-bottom .sketch-card {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .sketch-stage.is-playing[data-step="init"] .callout-row-top .sketch-card,
  .sketch-stage.is-playing[data-step="walk"] .callout-row-top .sketch-card,
  .sketch-stage.is-playing[data-step="greet"] .callout-row-top .sketch-card {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }

  .sketch-stage.is-playing[data-step="init"] .callout-row-bottom .sketch-card,
  .sketch-stage.is-playing[data-step="walk"] .callout-row-bottom .sketch-card,
  .sketch-stage.is-playing[data-step="greet"] .callout-row-bottom .sketch-card,
  .sketch-stage.is-playing[data-step="point-1"] .callout-row-bottom .sketch-card {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }

  .sketch-stage.is-playing .sketch-arrow path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.35s ease-out;
  }

  .sketch-stage.is-playing[data-step="point-1"] .arrow-one path,
  .sketch-stage.is-playing[data-step="point-2"] .arrow-one path,
  .sketch-stage.is-playing[data-step="done"] .arrow-one path {
    stroke-dashoffset: 0;
  }

  .sketch-stage.is-playing[data-step="point-2"] .arrow-two path,
  .sketch-stage.is-playing[data-step="done"] .arrow-two path {
    stroke-dashoffset: 0;
  }
}

@keyframes drawInk {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes walkFrameA {
  0%, 24.9% { opacity: 1; }
  25%, 100% { opacity: 0; }
}

@keyframes walkFrameB {
  0%, 24.9% { opacity: 0; }
  25%, 49.9% { opacity: 1; }
  50%, 74.9% { opacity: 0; }
  75%, 100% { opacity: 1; }
}

@keyframes walkFrameC {
  0%, 49.9% { opacity: 0; }
  50%, 74.9% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

/* Hand-drawn Section Dividers */
.sketch-divider {
  margin: 2.75rem auto;
  max-width: 560px;
  color: var(--border);
}

.sketch-divider svg {
  width: 100%;
  height: 16px;
  display: block;
}

/* Lower Content Sections */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.narrow-section {
  max-width: 68ch;
}

.section-heading {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.detail-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--chalk-indigo);
  color: var(--chalk-indigo);
}

.badge-cyan {
  border-color: var(--chalk-cyan);
  color: var(--chalk-cyan);
}

.stack-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.detail-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.detail-card p,
.lead-copy {
  color: var(--text-muted);
  font-size: 1rem;
}

.detail-list {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* Contact Actions */
.contact-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: max(var(--target-size), 42px);
  padding: 0.55rem 1.1rem;
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent-bg);
  color: #ffffff;
  border: 1.5px solid var(--chalk-indigo);
}

.btn-primary:hover {
  background: var(--accent-bg-hover);
}

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

.btn-secondary:hover {
  border-color: var(--chalk-cyan);
}

.card-links {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.card-link-btn {
  display: inline-flex;
  align-items: center;
  min-block-size: max(var(--target-size), 38px);
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--chalk-indigo);
  background: rgba(16, 23, 39, 0.85);
  border: 1.5px solid var(--border-strong);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.card-link-btn:hover {
  border-color: var(--chalk-indigo);
  color: var(--text);
}

.card-link-cyan {
  color: var(--chalk-cyan);
}

.card-link-cyan:hover {
  border-color: var(--chalk-cyan);
}

.copy-feedback {
  min-height: 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--chalk-cyan);
}

.site-footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Mobile Responsive Layout */
@media (max-width: 767px) {
  .sketch-stage {
    min-height: auto;
    padding: 0.85rem 0.95rem 1.25rem;
  }

  .stage-canvas {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding-block: 0.25rem;
  }

  .character-zone {
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.5rem;
    min-height: 152px;
  }

  .sketch-walker {
    width: 124px;
    flex-shrink: 0;
  }

  .speech-bubble {
    align-self: flex-start;
    margin: 0.35rem 0 0 -0.25rem;
    min-width: 128px;
    font-size: 0.88rem;
  }

  .bubble-tail {
    bottom: 10px;
    left: -18px;
    transform: rotate(78deg);
  }

  /* Swap desktop right-pointing poses for mobile downward-pointing poses */
  .sketch-stage[data-step="point-1"] .pose-point-top,
  .sketch-stage[data-step="point-2"] .pose-point-low,
  .sketch-stage[data-step="done"] .pose-point-low {
    opacity: 0;
  }

  .sketch-stage[data-step="point-1"] .pose-point-down-1 {
    opacity: 1;
  }

  .sketch-stage[data-step="point-2"] .pose-point-down-2,
  .sketch-stage[data-step="done"] .pose-point-down-2 {
    opacity: 1;
  }

  .callout-zone {
    gap: 0.45rem;
  }

  .callout-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .arrow-desktop {
    display: none;
  }

  .arrow-mobile {
    display: block;
    width: 60px;
    margin-left: 74px;
    margin-top: -12px;
  }

  .arrow-two.arrow-mobile {
    width: 48px;
    margin-left: 48px;
    margin-top: 0;
  }

  .sketch-card {
    padding: 0.85rem 1rem;
  }

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

/* High Contrast / Forced Colors Fallback */
@media (forced-colors: active) {
  .sketch-stage,
  .sketch-card,
  .detail-card,
  .speech-bubble,
  .stage-btn,
  .btn-primary,
  .btn-secondary {
    border-color: CanvasText;
    box-shadow: none;
  }

  .sketch-man .ink-main,
  .sketch-man .ink-soft,
  .sketch-man .ink-accent,
  .sketch-arrow path,
  .zvp-strokes .draw-stroke {
    stroke: CanvasText;
  }

  .sketch-man .ink-dot {
    fill: CanvasText;
  }
}
