:root {
  color-scheme: light;
  --bg: #f7faf8;
  --paper: #ffffff;
  --ink: #1f2622;
  --muted: #58665f;
  --line: #d7e2dc;
  --soft: #e8f1ec;
  --green: #18745f;
  --blue: #325e9d;
  --gold: #a96727;
  --code: #171b18;
  --code-ink: #eef7f1;
  --header-bg: rgba(247, 250, 248, .94);
  --hero-start: #fcfefd;
  --hero-glow: rgba(24, 116, 95, .1);
  --card-bg: rgba(255, 255, 255, .9);
  --card-soft: #f4f8f5;
  --section-warm: #f1f7f4;
  --success-bg: #f7fbf4;
  --footer-bg: #fcfefd;
  --primary-bg: #1f2622;
  --primary-ink: #ffffff;
  --final-bg: #1f2622;
  --final-ink: #ffffff;
  --final-muted: #aebcb4;
  --final-button-bg: rgba(255, 255, 255, .08);
  --final-button-border: rgba(255, 255, 255, .25);
  --final-primary-bg: #ffffff;
  --final-primary-ink: #1f2622;
  --shadow: rgba(32, 35, 31, .07);
  --max: 1120px;
  --radius: 8px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7faf8;
  --paper: #ffffff;
  --ink: #1f2622;
  --muted: #58665f;
  --line: #d7e2dc;
  --soft: #e8f1ec;
  --green: #18745f;
  --blue: #325e9d;
  --gold: #a96727;
  --code: #171b18;
  --code-ink: #eef7f1;
  --header-bg: rgba(247, 250, 248, .94);
  --hero-start: #fcfefd;
  --hero-glow: rgba(24, 116, 95, .1);
  --card-bg: rgba(255, 255, 255, .9);
  --card-soft: #f4f8f5;
  --section-warm: #f1f7f4;
  --success-bg: #f7fbf4;
  --footer-bg: #fcfefd;
  --primary-bg: #1f2622;
  --primary-ink: #ffffff;
  --final-bg: #1f2622;
  --final-ink: #ffffff;
  --final-muted: #aebcb4;
  --final-button-bg: rgba(255, 255, 255, .08);
  --final-button-border: rgba(255, 255, 255, .25);
  --final-primary-bg: #ffffff;
  --final-primary-ink: #1f2622;
  --shadow: rgba(32, 35, 31, .07);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101712;
  --paper: #16231c;
  --ink: #eef7f1;
  --muted: #a8b9af;
  --line: #365346;
  --soft: #203429;
  --green: #8ee6c8;
  --blue: #9dbaff;
  --gold: #e2ad65;
  --code: #080d0a;
  --code-ink: #edf9f2;
  --header-bg: rgba(16, 23, 18, .92);
  --hero-start: #101712;
  --hero-glow: rgba(142, 230, 200, .12);
  --card-bg: rgba(25, 43, 33, .95);
  --card-soft: #13241c;
  --section-warm: #111d17;
  --success-bg: #13241c;
  --footer-bg: #101712;
  --primary-bg: #eef7f1;
  --primary-ink: #101712;
  --final-bg: #08100c;
  --final-ink: #eef7f1;
  --final-muted: #91a69a;
  --final-button-bg: rgba(255, 255, 255, .06);
  --final-button-border: rgba(255, 255, 255, .2);
  --final-primary-bg: #eef7f1;
  --final-primary-ink: #101712;
  --shadow: rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

@view-transition { navigation: auto; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  transition: background-color .22s ease, color .22s ease;
}

::view-transition-old(root),
::view-transition-new(root) { animation-duration: .18s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(50, 94, 157, .35);
  outline-offset: 3px;
}

.term {
  display: inline;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  padding: 0 .03em;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

.term:hover,
.term[aria-expanded="true"] {
  color: var(--blue);
}

.term-popover {
  position: fixed;
  z-index: 30;
  max-width: min(20rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 .9rem 2.5rem var(--shadow);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 620;
  line-height: 1.45;
  padding: .75rem .85rem;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 20;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  padding: .65rem .9rem;
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: .9rem max(1rem, calc((100% - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 850;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  gap: .35rem 1rem;
}

nav a,
.site-footer a {
  color: var(--muted);
  font-size: .93rem;
  font-weight: 720;
  text-decoration: none;
}

nav a:hover,
.site-footer a:hover {
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  width: 3.45rem;
  height: 1.9rem;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: .18rem;
  cursor: pointer;
}

.theme-toggle-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(135deg, #b7d8ff, #f8d58b);
  transition: background .24s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: .18rem;
  left: .2rem;
  width: 1.16rem;
  height: 1.16rem;
  border-radius: 50%;
  background: #fff8c7;
  box-shadow: 0 0 0 .22rem rgba(255, 248, 199, .25), 0 .15rem .4rem rgba(31, 38, 34, .2);
  transition: transform .24s ease, background .24s ease, box-shadow .24s ease;
}

.theme-toggle-sun,
.theme-toggle-moon {
  position: absolute;
  inset: 0;
  transition: opacity .24s ease, transform .24s ease;
}

.theme-toggle-sun::before,
.theme-toggle-moon::before {
  position: absolute;
  content: "";
}

.theme-toggle-sun::before {
  top: .38rem;
  right: .55rem;
  width: .28rem;
  height: .28rem;
  border-radius: 50%;
  background: #fff6ad;
  box-shadow:
    -.5rem .18rem 0 -.08rem rgba(255, 246, 173, .75),
    -.18rem .58rem 0 -.1rem rgba(255, 246, 173, .65);
}

.theme-toggle-moon {
  opacity: 0;
  transform: translateX(.35rem);
}

.theme-toggle-moon::before {
  top: .38rem;
  left: .52rem;
  width: .54rem;
  height: .54rem;
  border-radius: 50%;
  background: #dce9ff;
  box-shadow: .22rem -.05rem 0 0 #23344b;
}

:root[data-theme="dark"] .theme-toggle-track {
  background: linear-gradient(135deg, #12233d, #213a31);
}

:root[data-theme="dark"] .theme-toggle-thumb {
  background: #dce9ff;
  box-shadow: 0 0 0 .2rem rgba(157, 186, 255, .16), 0 .15rem .4rem rgba(0, 0, 0, .35);
  transform: translateX(1.54rem);
}

:root[data-theme="dark"] .theme-toggle-sun {
  opacity: 0;
  transform: translateX(-.35rem);
}

:root[data-theme="dark"] .theme-toggle-moon {
  opacity: 1;
  transform: translateX(0);
}

.hero {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 20%, var(--hero-glow), transparent 32rem),
    linear-gradient(180deg, var(--hero-start) 0%, var(--bg) 100%);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 72svh;
  padding: 5rem 0;
}

.hero-copy {
  max-width: 680px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--green);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  max-width: 620px;
  margin-bottom: 1rem;
  font-size: clamp(2.2rem, 4vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h2 {
  max-width: 620px;
  margin-bottom: 1rem;
  font-size: clamp(1.55rem, 2.6vw, 2.3rem);
  line-height: 1.14;
  letter-spacing: 0;
}

h3 {
  margin-bottom: .45rem;
  font-size: 1.12rem;
  line-height: 1.22;
}

.lede {
  max-width: 610px;
  color: var(--muted);
  font-size: 1.13rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin: 1.35rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 0 1rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

button.button {
  cursor: pointer;
}

.button.primary {
  border-color: var(--primary-bg);
  background: var(--primary-bg);
  color: var(--primary-ink);
}

.button:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 28px var(--shadow);
  transform: translateY(-1px);
}

.text-link {
  color: var(--muted);
  font-size: .94rem;
  font-weight: 780;
  text-decoration: none;
}

.text-link:hover {
  color: var(--ink);
}

.flow-card,
.proof-box,
.steps li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: 0 18px 50px var(--shadow);
}

.flow-card {
  padding: 1rem;
  min-width: 0;
}

.flow-label {
  margin: 0 0 .8rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.flow {
  display: grid;
  gap: .7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.flow li {
  position: relative;
  padding: .9rem;
  border-radius: 7px;
  background: var(--card-soft);
}

.flow-step {
  display: inline-flex;
  margin-bottom: .35rem;
  color: var(--green);
  font-size: .74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.flow strong,
.flow p {
  display: block;
  margin-bottom: 0;
}

.flow p {
  color: var(--muted);
  font-size: .94rem;
}

.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--line);
}

.section.warm {
  background: var(--section-warm);
}

.two-col,
.example-grid,
.final-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, .85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.copy {
  display: grid;
  gap: .9rem;
}

.copy p,
.section-head p,
.example-grid p,
.final-layout p,
.site-footer p {
  color: var(--muted);
}

.section-head {
  max-width: 720px;
  margin-bottom: 2rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.steps li {
  min-height: 13rem;
  padding: 1rem;
}

.steps span {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
  font-weight: 850;
}

.steps strong {
  display: block;
  margin-bottom: .45rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.proof-box {
  overflow: hidden;
}

.proof-row {
  display: grid;
  gap: .5rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.proof-row span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92rem;
}

.proof-row code {
  display: block;
  overflow-x: auto;
  border-radius: 7px;
  background: var(--code);
  color: var(--code-ink);
  padding: .8rem;
}

.proof-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .65rem;
  align-items: center;
  padding: 1rem;
  background: var(--success-bg);
}

.proof-result p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
}

.status-dot {
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(24, 116, 95, .14);
}

.final-cta {
  background: var(--final-bg);
  color: var(--final-ink);
}

.final-cta .eyebrow {
  color: #9fe1d1;
}

.final-cta h2 {
  max-width: 680px;
}

.final-cta .final-layout p {
  color: var(--final-muted);
}

.final-cta .button {
  border-color: var(--final-button-border);
  background: var(--final-button-bg);
  color: var(--final-ink);
}

.final-cta .button.primary {
  border-color: var(--final-primary-bg);
  background: var(--final-primary-bg);
  color: var(--final-primary-ink);
}

.site-footer {
  padding: 2rem 0;
  background: var(--footer-bg);
}

.footer-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.footer-layout p {
  margin: 0;
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero-layout,
  .two-col,
  .example-grid,
  .final-layout,
  .footer-layout {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    min-height: auto;
    padding: 3.25rem 0;
  }

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

@media (max-width: 560px) {
  .wrap {
    width: min(calc(100% - 1.25rem), 22.75rem);
    margin-right: auto;
    margin-left: .625rem;
  }

  .site-header {
    position: relative;
    padding: .85rem .75rem;
    gap: .75rem;
  }

  .header-actions {
    display: contents;
  }

  nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
    gap: .55rem 1rem;
  }

  h1 {
    max-width: 17ch;
    font-size: 1.9rem;
  }

  h2 {
    max-width: 18ch;
    font-size: 1.65rem;
  }

  .lede {
    max-width: 31ch;
    font-size: 1.02rem;
  }

  .actions,
  .flow-card,
  .proof-box {
    max-width: 22.75rem;
  }

  .button {
    width: 100%;
  }

  .text-link {
    width: 100%;
    text-align: center;
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero-layout {
    padding: 2rem 0 1.8rem;
  }

  .flow-card {
    padding: .8rem;
  }

  .flow {
    gap: .45rem;
  }

  .flow li {
    padding: .65rem;
  }

  .flow p {
    font-size: .9rem;
  }

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

  .steps li {
    min-height: auto;
  }

  .proof-row code {
    font-size: .82rem;
  }

  .footer-layout {
    gap: .9rem;
  }
}

nav a[aria-current="page"] {
  color: var(--ink);
}

.explorer-page {
  padding: 3.25rem 0 4rem;
}

.explorer-page h1 {
  font-size: clamp(1.85rem, 3vw, 2.6rem);
}

.task-cards {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin: 1.5rem 0 0;
}

.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: 0 .4rem 1.2rem var(--shadow);
  padding: 1rem 1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.task-card h3 {
  margin: 0;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.task-tag {
  font-size: .74rem;
  font-weight: 750;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green);
  border: 1px solid var(--line);
}

.task-tag.open {
  color: var(--gold);
}

.task-tag.solved {
  color: var(--green);
}

.task-meta {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.task-meta b {
  color: var(--ink);
  font-weight: 700;
}

.task-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .86rem;
  font-weight: 720;
}

.task-links a {
  color: var(--blue);
  text-decoration: none;
}

.task-links a:hover {
  text-decoration: underline;
}

pre.task-cmd {
  margin: .25rem 0 0;
  overflow-x: auto;
  border-radius: 7px;
  background: var(--code);
  color: var(--code-ink);
  padding: .65rem .8rem;
  font-size: .82rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.task-apply {
  margin: 0;
  border-radius: 7px;
  background: var(--soft);
  padding: .65rem .8rem;
  font-size: .9rem;
}

.explorer-empty {
  margin: 1.5rem 0 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--muted);
  text-align: center;
  max-width: 42rem;
}

.explorer-empty a {
  color: var(--blue);
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: .14em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
