:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #152030;
  --text-muted: #516274;
  --accent: #147a96;
  --accent-hover: #0f637a;
  --code-ink: #0c5466;
  --on-accent: #ffffff;
  --accent-soft: rgba(20, 122, 150, 0.1);
  --accent-line: rgba(20, 122, 150, 0.35);
  --accent-muted: rgba(20, 122, 150, 0.22);
  --accent-scan: rgba(20, 122, 150, 0.08);
  --code-bg: rgba(20, 122, 150, 0.08);
  --border: rgba(21, 32, 48, 0.1);
  --radius: 8px;
  --radius-code: 4px;
  --radius-icon: 22px;
  --page: 42rem;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-mid: 240ms;
  --dur-enter: 520ms;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --z-skip: 50;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-code);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.12em 0.35em;
  border-radius: var(--radius-code);
}

.page {
  width: min(calc(100% - 2.5rem), var(--page));
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-md);
  z-index: var(--z-skip);
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  left: var(--space-md);
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: border-color var(--dur-mid) var(--ease-out-quint);
}

.header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: 1.15rem 0;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-code);
}

.site-title:hover {
  color: var(--accent);
}

.site-title:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.94rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-code);
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-nav .nav-cta {
  color: var(--accent);
  font-weight: 650;
}

.site-nav .nav-cta:hover {
  color: var(--accent-hover);
}

main {
  padding: clamp(3rem, 8vw, 4.5rem) 0 clamp(3.5rem, 8vw, 5rem);
}

main > section + section {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
}

h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.specimen h2 {
  font-size: 1.25rem;
}

.download-panel h2 {
  margin-bottom: 0.65rem;
  color: var(--accent-hover);
}

.license-block h2 {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-muted);
}

.path-panel {
  position: relative;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.path-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--accent-scan) 48%,
    transparent 92%
  );
  transform: translateY(-100%);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal.in-view .path-panel::after {
    animation: scan-line 720ms var(--ease-out-expo) both;
    animation-delay: 180ms;
  }
}

@keyframes scan-line {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}

.intro-icon {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-icon);
  margin-bottom: 1.75rem;
  outline: 3px solid var(--accent-soft);
  outline-offset: 6px;
  transition:
    transform var(--dur-mid) var(--ease-out-quint),
    outline-color var(--dur-mid) var(--ease-out-quint);
}

@media (prefers-reduced-motion: no-preference) {
  .intro-icon:hover {
    transform: translateY(-3px);
    outline-color: var(--accent-muted);
  }
}

.intro-meta {
  margin: 0 0 var(--space-md);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.intro h1 {
  margin: 0 0 1.35rem;
  font-size: clamp(2.25rem, 6vw, 3.35rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 14ch;
}

.headline-accent {
  color: var(--accent);
}

.intro-lede {
  margin: 0 0 var(--space-xl);
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 1.08rem;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-item {
    animation: hero-settle var(--dur-enter) var(--ease-out-quint) both;
    animation-delay: calc(var(--i, 0) * 70ms);
  }

  .reveal .stagger-item {
    transform: translateY(10px);
    transition: transform 460ms var(--ease-out-quint);
    transition-delay: calc(var(--i, 0) * 50ms);
  }

  .reveal.in-view .stagger-item {
    transform: translateY(0);
  }
}

@keyframes hero-settle {
  from {
    transform: translateY(14px);
    filter: blur(5px);
  }
  to {
    transform: translateY(0);
    filter: blur(0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background var(--dur-mid) var(--ease-out-quint),
    color var(--dur-mid) var(--ease-out-quint),
    transform var(--dur-fast) var(--ease-out-quint);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.is-downloading {
  pointer-events: none;
  background: var(--accent-hover);
}

@media (prefers-reduced-motion: no-preference) {
  .btn-primary.is-downloading {
    animation: download-pulse 680ms var(--ease-out-quint);
  }
}

@keyframes download-pulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 0 4px var(--accent-muted);
  }
}

.btn-large {
  min-height: 48px;
  padding: 0.75rem var(--space-lg);
  font-size: 1rem;
}

.path-caption {
  padding: 0.7rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
}

.path-list {
  margin: 0;
  padding: 1.15rem 1.2rem;
  overflow-x: auto;
  background: var(--surface);
}

.path-list code {
  display: block;
  padding: 0;
  background: none;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre;
}

.path-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.1rem 0.45rem;
  margin: 0 -0.45rem;
  border-radius: var(--radius-code);
  cursor: default;
  transition: background var(--dur-fast) var(--ease-out-quint);
}

.path-line-path {
  min-width: 0;
  overflow-x: auto;
}

.path-line-size {
  flex-shrink: 0;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(4px);
  transition:
    opacity var(--dur-mid) var(--ease-out-quint),
    transform var(--dur-mid) var(--ease-out-quint);
}

.path-line:hover,
.path-line:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.path-line:hover .path-line-size,
.path-line:focus-visible .path-line-size {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .reveal.in-view .path-line {
    animation: path-found 380ms var(--ease-out-quint) both;
    animation-delay: calc(320ms + var(--line, 0) * 85ms);
  }
}

@keyframes path-found {
  from {
    transform: translateX(-7px);
  }
  to {
    transform: translateX(0);
  }
}

.flow-list {
  margin: 0;
  padding-left: var(--space-lg);
  color: var(--text);
  max-width: 36rem;
  font-size: 1.02rem;
}

.flow-list li {
  margin-bottom: 0.85rem;
  padding-left: 0.35rem;
}

.flow-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

.flow-list li:last-child {
  margin-bottom: 0;
}

.trash-word {
  font-weight: 700;
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 520ms var(--ease-out-quint);
}

.reveal.in-view .trash-word {
  text-decoration-color: var(--accent-line);
}

.download-panel {
  padding: 1.75rem var(--space-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
}

.download-lede {
  margin: 0 0 1.25rem;
  color: var(--text);
  max-width: 34rem;
  font-size: 1.02rem;
  text-wrap: pretty;
}

.fine-print {
  margin: var(--space-md) 0 0;
  min-height: 1.5em;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.license-block p:last-child {
  margin: 0;
  color: var(--text-muted);
  max-width: 36rem;
  text-wrap: pretty;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0 2.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer code {
  font-size: 0.92em;
}

@media (max-width: 540px) {
  .intro h1 {
    max-width: none;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-panel {
    padding: 1.35rem 1.1rem;
  }

  .path-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .path-line-size {
    align-self: flex-end;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .btn,
  .btn-primary:hover,
  .btn-primary:active {
    transform: none;
  }

  .reveal .stagger-item {
    transform: none;
  }

  .path-line-size {
    opacity: 1;
    transform: none;
  }

  .intro-icon:hover {
    transform: none;
  }
}
