/* ============================================
   CSS CUSTOM PROPERTIES — DESIGN TOKENS
   ============================================ */
:root {
  /* Page is intentionally light-only; keep native widgets/scrollbars light
     too, even when the OS prefers dark. */
  color-scheme: light;
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f0fdfa;
  --bg-code: #f1f5f9;

  /* #167a71: 5.2:1 on white (the former #1a8a80 was 4.2:1, below AA) */
  --accent-cyan: #167a71;
  --accent-cyan-hover: #0f5f58;
  --accent-cyan-glow: rgba(26, 138, 128, 0.15);
  --accent-orange: #c44b16;
  --accent-orange-soft: rgba(196, 75, 22, 0.08);
  --accent-yellow: #a67c00;
  /* Green is reserved for the "try it live" entry points. #557500: 5.3:1 */
  --accent-green: #557500;
  --accent-violet: #5a5fad;
  --accent-red: #c0302d;

  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  /* #5f6b7a: 5.1:1 on the page background (the former #718096 was 3.8:1) */
  --text-muted: #5f6b7a;

  --border-card: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(26, 138, 128, 0.3);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', Consolas, monospace;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 30px rgba(26, 138, 128, 0.06);
  --shadow-code: inset 0 0 20px rgba(0, 0, 0, 0.03);

  --max-width: 1200px;
  --nav-height: 64px;
  /* Shared height of the header controls (Slides, Try it, menu button) */
  --nav-control: 34px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  font-size: clamp(14px, 1vw + 8px, 18px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first last;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
}

::selection {
  background: rgba(26, 138, 128, 0.2);
  color: var(--text-primary);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.25s ease, text-shadow 0.25s ease;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-cyan-hover);
  text-shadow: none;
}

main p a,
main li a,
main td a,
.note a,
.see-also a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(22, 122, 113, 0.4);
}

main p a:hover,
main li a:hover,
main td a:hover,
.note a:hover,
.see-also a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--accent-cyan);
  color: #ffffff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ============================================
   ANIMATED BACKGROUND GRID
   ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(26, 138, 128, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 138, 128, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 20% 50%, rgba(26, 138, 128, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(196, 75, 22, 0.03) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(90, 95, 173, 0.02) 0%, transparent 50%);
}

/* Reduced motion */
@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; }
}

/* ============================================
   NAVIGATION — Semantic <header> + <nav>
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

nav[aria-label="Main navigation"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-xl);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand .version {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent-cyan);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: var(--space-xs);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
  list-style: none;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 1;
  min-width: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: var(--nav-control);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent-cyan);
  background: rgba(26, 138, 128, 0.06);
}

.nav-links a[aria-current] {
  color: var(--accent-cyan);
  background: rgba(26, 138, 128, 0.08);
}

/* Base rules for the mobile dropdown live here, BEFORE the media
   queries below. Declared after them, `.nav-details { display: none }`
   won on equal specificity and the menu never opened under 950px. */
/* ============================================
   NAV DROPDOWN (CSS-only details/summary)
   ============================================ */
.nav-details {
  display: block;
  position: relative;
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.nav-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: var(--nav-control);
  height: var(--nav-control);
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(26, 138, 128, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.nav-summary::-webkit-details-marker {
  display: none;
}

.nav-summary::marker {
  content: '';
}

.nav-summary:hover,
.nav-summary:focus {
  color: var(--accent-cyan);
  border-color: var(--border-accent);
  background: rgba(26, 138, 128, 0.08);
}

.nav-summary svg {
  color: var(--accent-cyan);
  /* Declared here, not in the [open] rule below, so the rotation also
     animates when the menu closes. */
  transition: transform 0.2s ease;
}

.nav-details[open] .nav-summary {
  color: var(--accent-cyan);
  border-color: var(--border-accent);
  background: rgba(26, 138, 128, 0.08);
}

/* Click outside to close, with no JavaScript.
   While the menu is open, the summary grows a full-viewport pseudo-element
   that sits behind the dropdown (z-index 1000 against the dropdown's 1001).
   A click anywhere on the page therefore lands on the summary itself and
   toggles the details shut. Keep the summary free of any z-index of its
   own: it would create a stacking context and lift this backdrop above
   the dropdown, making the entries unclickable.

   NB: a value other than none for backdrop-filter makes the header the
   containing block for position:fixed descendants, which confined this
   backdrop to the 64px header strip and broke click-outside (verified with
   document.elementFromPoint). While the menu is open we drop the blur so
   the fixed backdrop really covers the viewport again; the near-opaque
   background compensates visually for the lost blur. */
header:has(.nav-details[open]) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.98);
}

.nav-details[open] .nav-summary::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent;
  cursor: default;
}

.nav-details[open] .nav-summary svg {
  transform: rotate(90deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  /* Two columns: 20 entries stacked would run past the fold on a phone. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 4px;
  width: 480px;
  min-width: 0;
  /* Safety net for landscape phones and short viewports. */
  max-height: min(70vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-accent) transparent;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: var(--space-sm);
  z-index: 1001;
}

.nav-dropdown::-webkit-scrollbar {
  width: 6px;
}

.nav-dropdown::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 99px;
}

.nav-dropdown a {
  display: block;
  padding: 7px 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-dropdown a:hover,
.nav-dropdown a:focus {
  color: var(--accent-cyan);
  background: rgba(26, 138, 128, 0.06);
}

/* Single column on the narrowest phones: two would wrap every label. */
@media (max-width: 400px) {
  .nav-dropdown {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  /* No longer a full screen: the "Try" panel peeks above the fold. */
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + var(--space-2xl)) var(--space-xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.2) 0%, rgba(248, 249, 250, 0.7) 70%, var(--bg-primary) 100%);
}

.hero-puffy {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 4px 30px var(--accent-cyan-glow), inset 0 0 20px rgba(26, 138, 128, 0.05);
  margin-bottom: var(--space-xl);
  animation: floatPuffy 6s ease-in-out infinite;
  position: relative;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  /* overflow:hidden removed: it clipped the ::after ripple, which sits
     20px BELOW the circle (bottom: -20px) and was therefore never visible. */
}

.hero-puffy img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 50%;
}

/* Orbiting bubbles. Sized relative to the medallion, so they follow
   every breakpoint that resizes .hero-puffy (180px, 140px, 110px...). */
.hero-puffy__orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-puffy__orbit--inner {
  width: 144%;
  aspect-ratio: 1;
}

.hero-puffy__orbit--outer {
  width: 178%;
  aspect-ratio: 1;
}

.hero-puffy__orbit svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: orbitSpin 30s linear infinite;
}

.hero-puffy__orbit--outer svg {
  animation-duration: 45s;
  animation-direction: reverse;
}

/* The outer ring reaches the badge and the title: keep the text above it */
.hero-badge,
.hero h1 {
  position: relative;
  z-index: 1;
}

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes floatPuffy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* The h1 font-size drives the version number; the name has its own size. */
.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.hero__name {
  display: block;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.hero__version {
  display: block;
  background: linear-gradient(135deg, #0f5f58 0%, #167a71 50%, #c44b16 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 26px;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hero__cta--primary {
  background: var(--accent-green);
  color: #ffffff;
}

.hero__cta--primary:hover {
  background: #445e00;
  color: #ffffff;
}

.hero__cta--secondary {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  border-color: var(--border-accent);
}

.hero__cta--secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan-hover);
}

.hero__cta:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.hero .subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-meta a {
  color: var(--accent-cyan);
}

.hero-meta .artwork-credit {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent-cyan);
}

/* ============================================
   SECTIONS — COMMON with <main> + <article>
   ============================================ */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}

.section-header {
  margin-bottom: var(--space-2xl);
  position: relative;
}

/* Chapter number, set inside the h2 */
.section-number {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.5em;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0;
  margin-right: 0.6em;
  transform: translateY(-0.35em);
}

.section-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.section-header p {
  margin-top: var(--space-sm);
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 700px;
}

.lead {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 46rem;
}

/* Sub-heading inside a section (same level everywhere: h3) */
.subsection-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
  margin: var(--space-2xl) 0 var(--space-md);
}

.section-header + .subsection-title,
.section__block > .subsection-title:first-child {
  margin-top: 0;
}

.section__block {
  margin-top: var(--space-2xl);
}

.section__illustration {
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.section__illustration img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  opacity: 0.85;
}

/* ============================================
   CARDS GRID
   ============================================ */
.card-grid {
  display: grid;
  gap: var(--space-lg);
}

.card-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.card-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card h3 .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(26, 138, 128, 0.06);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.card p, .card li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

.card ul {
  list-style: none;
  padding: 0;
}

.card ul li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-lg);
  position: relative;
}

.card--spaced,
.card-grid--spaced {
  margin-top: var(--space-lg);
}

.card--release { border-top: 3px solid var(--accent-cyan); }
.card--stable  { border-top: 3px solid var(--accent-violet); }
.card--current { border-top: 3px solid var(--accent-orange); }

.card__text--spaced {
  margin-top: var(--space-md);
}

.card .card__text--large {
  font-size: 1.05rem;
}

.card .card__file {
  margin-bottom: var(--space-md);
  font-weight: 600;
  color: var(--text-primary);
}

.card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

/* ============================================
   CODE BLOCKS
   ============================================ */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-code);
  position: relative;
}

/* File name / language label: its own line, never over the code.
   No uppercase: file paths are case-sensitive. */
.code-block::before {
  content: attr(data-lang);
  display: block;
  width: fit-content;
  margin: calc(var(--space-sm) * -1) 0 var(--space-sm) auto;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  background: rgba(22, 122, 113, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

.code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  /* Never below 14px: the commands are the content of this page. */
  font-size: max(14px, 0.85rem);
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre;
  tab-size: 4;
}

.code-block .comment { color: var(--text-muted); font-style: italic; }
.code-block .keyword { color: var(--accent-cyan); }
.code-block .string { color: var(--accent-orange); }
.code-block .number { color: var(--accent-violet); }
.code-block .builtin { color: var(--accent-green); font-weight: 600; }
.code-block .file-path { color: var(--accent-yellow); font-weight: 600; }

/* ============================================
   TABLES — Responsive wrapper
   ============================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-lg) 0;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: clamp(0.78rem, 1.5vw, 0.9rem);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
  min-width: 400px;
}

.data-table th {
  background: rgba(26, 138, 128, 0.05);
  color: var(--accent-cyan);
  font-weight: 600;
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-accent);
}

.data-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-card);
  color: var(--text-secondary);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(26, 138, 128, 0.04);
}

.data-table--flush {
  margin: 0;
}

.data-table td code,
.data-table td .path {
  font-family: var(--font-mono);
  font-size: 0.95em;
  background: rgba(26, 138, 128, 0.06);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ============================================
   NOTES / BLOCKQUOTES
   ============================================ */
.note {
  background: rgba(26, 138, 128, 0.04);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.note strong { color: var(--accent-cyan); }
.note a { color: var(--accent-cyan); }

.note code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(26, 138, 128, 0.07);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent-cyan);
}

.warning {
  background: var(--accent-orange-soft);
  border-left-color: var(--accent-orange);
  color: var(--text-primary);
}

.note.warning strong {
  color: var(--accent-orange);
}

/* "Read: man(8)" references: a plain line, not a callout */
.see-also {
  margin: var(--space-sm) 0 var(--space-lg);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card .see-also {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.see-also code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ============================================
   DIVIDERS
   ============================================ */
.divider {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.divider hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.divider-svg {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  padding: var(--space-sm) 0;
  opacity: 0.3;
}

.divider-svg svg {
  width: 200px;
  height: 16px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.05em;
}

.badge-release {
  background: rgba(26, 138, 128, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(26, 138, 128, 0.2);
}

.badge-stable {
  background: rgba(90, 95, 173, 0.08);
  color: var(--accent-violet);
  border: 1px solid rgba(90, 95, 173, 0.2);
}

.badge-current {
  background: rgba(196, 75, 22, 0.08);
  color: var(--accent-orange);
  border: 1px solid rgba(196, 75, 22, 0.2);
}

/* ============================================
   LINK CARD
   ============================================ */
.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  transition: all 0.3s ease;
  color: var(--text-secondary);
  text-decoration: none;
}

.link-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateX(4px);
  color: var(--accent-cyan);
}

.link-card .arrow {
  color: var(--accent-cyan);
  margin-left: auto;
  transition: transform 0.2s ease;
}

.link-card:hover .arrow {
  transform: translateX(4px);
}

/* ============================================
   USE CASE CARDS
   ============================================ */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}

.usecase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.usecase-card .usecase-icon {
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(22, 122, 113, 0.06);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.usecase-card .usecase-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: block;
}

.usecase-card .usecase-tool {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: var(--space-xs);
  display: block;
}

/* ============================================
   FOOTER — Semantic <footer>
   ============================================ */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-card);
}

footer a { color: var(--accent-cyan); }

.footer__skyline {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 0 auto var(--space-xl);
  opacity: 0.28;
}

.footer__credit {
  margin-top: var(--space-md);
  font-size: 0.8rem;
}

.footer__heart {
  color: #dc2626;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

/* ============================================
   RESPONSIVE — 5 BREAKPOINTS
   ============================================ */

@media (max-width: 600px) {
  .nav-links__slides {
    display: none;
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  nav[aria-label="Main navigation"] {
    padding: 0 var(--space-md);
  }

  /* Use the fixed header as the dropdown containing block. */
  .nav-details {
    position: static;
  }

  .nav-dropdown {
    top: calc(100% + 8px);
    left: var(--space-sm);
    right: var(--space-sm);
    width: auto;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  .section {
    padding: var(--space-2xl) var(--space-md);
  }

  .card-grid-2,
  .card-grid-3 {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table td,
  .data-table th {
    padding: var(--space-sm) var(--space-md);
  }

  .hero-puffy {
    width: 140px;
    height: 140px;
  }

  .hero-puffy img {
    width: 110px;
    height: 110px;
  }

  .usecase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vps-card {
    max-width: 220px;
    padding: var(--space-md);
  }

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

/* Mobile landscape / large phone */
@media (max-width: 480px) {
  .hero-puffy {
    width: 110px;
    height: 110px;
  }

  .hero-puffy img {
    width: 85px;
    height: 85px;
  }

  .section {
    padding: var(--space-xl) var(--space-md);
  }

  .card {
    padding: var(--space-lg);
  }

  .code-block {
    padding: var(--space-md);
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .vps-section {
    padding: var(--space-lg);
  }

}

/* Tiny phones (iPhone SE, etc) */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 0.9rem;
  }

  .hero-meta {
    flex-direction: column;
    align-items: center;
  }

  .usecase-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-table {
    min-width: 280px;
  }

  nav[aria-label="Main navigation"] {
    padding: 0 var(--space-sm);
  }

  .nav-brand {
    font-size: 0.95rem;
  }
}

/* Ultra-wide / 4K */
@media (min-width: 1800px) {
  :root {
    --max-width: 1400px;
  }

  .hero h1 {
    font-size: 7rem;
  }

  .section {
    padding: var(--space-4xl) var(--space-3xl);
  }

  .card {
    padding: var(--space-2xl);
  }

  .card h3 {
    font-size: 1.3rem;
  }

  .code-block pre {
    font-size: 1rem;
  }

  .section-header h2 {
    font-size: 3rem;
  }
}

/* 5K+ */
@media (min-width: 2560px) {
  :root {
    --max-width: 1800px;
    --space-xs: 0.375rem;
    --space-sm: 0.75rem;
    --space-md: 1.5rem;
    --space-lg: 2.25rem;
    --space-xl: 3rem;
    --space-2xl: 4.5rem;
    --space-3xl: 6rem;
    --space-4xl: 9rem;
  }

  html {
    font-size: 22px;
  }

  .hero h1 {
    font-size: 9rem;
  }

  .hero-puffy {
    width: 240px;
    height: 240px;
  }

  .hero-puffy img {
    width: 190px;
    height: 190px;
  }
}

/* Landscape on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--space-2xl) var(--space-xl);
  }

  .hero-puffy {
    width: 90px;
    height: 90px;
  }

  .hero-puffy img {
    width: 70px;
    height: 70px;
  }

}

/* Print styles */
@media print {
  body::before, body::after { display: none; }
  header { position: static; }
  .hero { min-height: auto; padding: var(--space-xl); }
  .hero-bg { display: none; }
  .hero-puffy { border: 2px solid #333; box-shadow: none; animation: none; }
  .nav-details, .hero-puffy__orbit { display: none; }
  .hero-badge { border: 1px solid #999; color: #333; background: #f5f5f5; }
  .section { padding: var(--space-lg) 0; page-break-inside: avoid; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  .code-block { box-shadow: none; border: 1px solid #ccc; }
  .data-table { min-width: 0; }
  body { background: white; color: #222; }
  a { color: #0055aa; text-shadow: none; }
  .note { border-left-color: #0055aa; background: #f5f5f5; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
/* ============================================
   HERO BADGE
   ============================================ */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: linear-gradient(135deg, rgba(196, 75, 22, 0.08), rgba(26, 138, 128, 0.08));
  border: 1px solid rgba(196, 75, 22, 0.15);
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-lg);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hero-badge:hover {
  color: #a33c0f;
  border-color: rgba(196, 75, 22, 0.4);
  background: rgba(196, 75, 22, 0.1);
}

/* ============================================
   VPS HOSTING
   ============================================ */
.vps-section {
  background: linear-gradient(135deg, rgba(26, 138, 128, 0.03), rgba(196, 75, 22, 0.03));
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  border: 1px solid var(--border-card);
}

.vps-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.vps-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  max-width: 280px;
  min-height: 150px;
  flex: 1;
  overflow: hidden;
}

.vps-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* Two logos with very different shapes: give them the same visual weight */
.vps-card .vps-logo {
  max-width: 100%;
  object-fit: contain;
}

.vps-card .vps-logo--wide {
  width: 200px;
  height: auto;
}

.vps-card .vps-logo--square {
  width: 72px;
  height: 72px;
}

.vps-section__intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-md);
}

.vps-card__caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ============================================
   TRY IN BROWSER — panel, nav pill, inline callouts
   ============================================ */
.try {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-lg);
}

.try__panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-2xl);
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-2xl);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(26, 138, 128, 0.05), rgba(85, 117, 0, 0.05) 55%, rgba(196, 75, 22, 0.04));
  box-shadow: var(--shadow-card);
}

.try__panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-green), var(--accent-cyan), transparent);
  opacity: 0.75;
}

.try__kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-green);
  background: rgba(85, 117, 0, 0.08);
  border: 1px solid rgba(85, 117, 0, 0.22);
  border-radius: 99px;
  padding: 4px 14px;
  margin-bottom: var(--space-md);
}

.try__title {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.try__lead {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

.try__points {
  list-style: none;
  display: grid;
  gap: var(--space-sm);
  margin: 0 0 var(--space-xl);
}

.try__points li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.try__points li::before {
  content: '\25B8';
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: 700;
}

.try__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--accent-green);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 26px;
  border-radius: 99px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 18px rgba(85, 117, 0, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.try__button:hover,
.try__button:focus-visible {
  background: #4e6c00;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(85, 117, 0, 0.26);
}

.try__button svg {
  transition: transform 0.25s ease;
}

.try__button:hover svg {
  transform: translateX(3px);
}

.try__meta {
  margin-top: var(--space-md);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.try__meta code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(26, 138, 128, 0.07);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent-cyan);
}

/* Decorative terminal preview */
.try__terminal {
  min-width: 0;
  background: #14142a;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(26, 26, 46, 0.2);
}

.try__terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.try__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.try__dot--live {
  background: #9fc93c;
}

.try__terminal-name {
  min-width: 0;
  overflow-wrap: anywhere;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.42);
}

.try__terminal-body {
  margin: 0;
  /* Extra bottom padding: breathing room under the last prompt. */
  padding: var(--space-lg) var(--space-lg) var(--space-4xl);
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.1vw, 0.8rem);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  /* Preserve terminal spacing while wrapping long lines. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.try__prompt { color: #9fc93c; font-weight: 600; }
.try__out    { color: rgba(255, 255, 255, 0.5); }
.try__hi     { color: #4fd1c5; }

.try__cursor {
  display: inline-block;
  width: 7px;
  height: 0.95em;
  margin-left: 3px;
  vertical-align: -2px;
  background: #9fc93c;
  animation: tryBlink 1.1s steps(1) infinite;
}

@keyframes tryBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Inline callout, dropped inside a section next to the matching commands */
.try-note {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(85, 117, 0, 0.05);
  border-left: 3px solid var(--accent-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.try-note:hover,
.try-note:focus-visible {
  background: rgba(85, 117, 0, 0.1);
  color: var(--text-primary);
  transform: translateX(3px);
}

.try-note__icon {
  color: var(--accent-green);
  flex-shrink: 0;
}

.try-note__text strong {
  color: var(--accent-green);
  font-weight: 600;
}

.try-note__arrow {
  margin-left: auto;
  color: var(--accent-green);
  flex-shrink: 0;
}

/* Nav pill */
.nav-links .nav-try {
  color: var(--accent-green);
  background: rgba(85, 117, 0, 0.07);
  border: 1px solid rgba(85, 117, 0, 0.24);
  font-weight: 600;
}

.nav-links .nav-try:hover {
  color: #445e00;
  background: rgba(85, 117, 0, 0.14);
  border-color: rgba(85, 117, 0, 0.42);
}

.nav-dropdown a.nav-dropdown-try {
  grid-column: 1 / -1;
  /* Stays visible while the rest of the list scrolls under it. */
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--accent-green);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border-card);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: var(--space-xs);
}

.nav-dropdown a.nav-dropdown-try:hover,
.nav-dropdown a.nav-dropdown-try:focus {
  color: #445e00;
  background: rgba(85, 117, 0, 0.1);
}

@media (max-width: 900px) {
  .try__panel {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-xl);
  }
}

@media (max-width: 480px) {
  .try {
    padding: var(--space-xl) var(--space-md) var(--space-md);
  }

  .try__panel {
    padding: var(--space-lg);
  }

  .try__button {
    width: 100%;
    justify-content: center;
  }

  .try-note {
    padding: var(--space-md);
    font-size: 0.85rem;
  }
}

@media print {
  .try__terminal { display: none; }
  .try__panel { border: 1px solid #ccc; background: none; box-shadow: none; }
  .try-note { background: none; border-left-color: #666; }
}

/* ============================================
   SMARTWATCH / ULTRA-TINY
   ============================================ */
@media (max-width: 300px) {
  html {
    font-size: 12px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .subtitle {
    font-size: 0.8rem;
  }

  .hero-puffy {
    width: 70px;
    height: 70px;
  }

  .hero-puffy img {
    width: 55px;
    height: 55px;
  }

  .section {
    padding: var(--space-lg) var(--space-sm);
  }

  .card {
    padding: var(--space-md);
  }

  .vps-card {
    padding: var(--space-md);
  }

  .vps-card {
    max-width: 160px;
  }

  .hero-badge {
    font-size: 0.6rem;
    padding: 4px 10px;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }

  .nav-brand .version {
    display: none;
  }

  .badge {
    font-size: 0.6rem;
  }

}

/* ============================================
   INLINE CODE
   ============================================ */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(26, 138, 128, 0.06);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 3px;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ============================================
   LINKS GRID
   ============================================ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-md);
}

.nav-dropdown a.nav-dropdown-slides {
  grid-column: 1 / -1;
}
