:root {
  --ink: #17233b;
  --muted: #536771;
  --paper: #fffaf2;
  --surface: #ffffff;
  --sky: #eaf7ff;
  --mint: #dff4e8;
  --sun: #fff1be;
  --pink: #f7e3ee;
  --blue: #165a78;
  --green: #216b55;
  --berry: #7b3154;
  --violet: #6245a8;
  --line: #a9c0cc;
  --focus: #005fcc;
  --shadow: 0 16px 40px rgba(24, 64, 78, 0.13);
  --scale: 1;
  --content: 1180px;
  --reading: 72ch;
}

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, #dff5ff 0 12rem, transparent 12.2rem),
    radial-gradient(circle at 92% 5%, #fff0b8 0 11rem, transparent 11.2rem),
    var(--paper);
  font-family: ui-rounded, "Avenir Next", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
img, svg, video, canvas { max-width: 100%; height: auto; }
a { color: #075d91; text-underline-offset: 0.18em; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 4px; border-radius: 7px; }

.wrap { width: min(100% - 2rem, var(--content)); margin-inline: auto; }
.skip { position: fixed; top: -8rem; left: 1rem; z-index: 999; background: #000; color: #fff; padding: 0.8rem 1rem; }
.skip:focus { top: 0; }
.dev-banner { background: #5a2d82; color: #fff; text-align: center; padding: 0.55rem 1rem; }
.ribbon { background: #17343f; color: #fff; text-align: center; padding: 0.55rem 1rem; font-weight: 800; }

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 250, 242, 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav-inner, .nav > .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-block: 0.65rem;
}
.nav a, .button, .access-bar button, .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.58rem 0.88rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.nav .brand { margin-right: auto; background: var(--pink); color: var(--berry); }
.nav a[aria-current="page"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.nav-toggle { display: none; }

.access-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.access-bar button { min-height: 44px; border-width: 1px; }
.access-bar button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

.button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.actions, .seeds, .root-status { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.actions > *, .seeds > *, .root-status > * { max-width: 100%; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 7rem) 4rem;
}
.hero > .wrap { width: min(100% - 2rem, var(--content)); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 900; color: var(--berry); }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 8vw, 7rem); letter-spacing: -0.055em; margin: 0.3rem 0 1rem; }
h1 span { color: var(--blue); }
h2 { font-size: clamp(2rem, 5vw, 3.7rem); letter-spacing: -0.035em; }
.lede, .intro { font-size: 1.18rem; max-width: 52rem; }

.seeds span, .root-status span, .tag {
  padding: 0.45rem 0.8rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: #fff;
  font-weight: 900;
}

.garden { position: relative; min-height: 470px; isolation: isolate; }
.garden::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: -2;
  border-radius: 48% 52% 55% 45% / 55% 42% 58% 45%;
  background: linear-gradient(145deg, #bfe8f8, #dff4e8, #fff1be);
  box-shadow: var(--shadow);
  transform: rotate(-4deg);
}
.orbit { position: absolute; inset: 14% 8%; border: 3px dashed rgba(22, 90, 120, 0.3); border-radius: 50%; transform: rotate(18deg); }
.orbit2 { inset: 23% 18%; transform: rotate(-15deg); }
.person {
  position: absolute;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 150px; height: 150px;
  border-radius: 50%; background: #fff; border: 4px solid var(--berry);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow); text-align: center;
}
.person span { font-size: 2rem; color: var(--berry); }
.person small { color: var(--muted); }
.petal {
  position: absolute; display: grid; place-items: center;
  width: 118px; min-height: 70px; padding: 0.5rem;
  border: 3px solid currentColor; background: #fff;
  border-radius: 50% 45% 52% 48%; font-weight: 900; text-align: center;
  box-shadow: 0 8px 20px rgba(24, 64, 78, 0.1);
}
.p1 { left: 5%; top: 12%; color: var(--green); transform: rotate(-8deg); }
.p2 { right: 4%; top: 17%; color: var(--blue); transform: rotate(8deg); }
.p3 { left: 5%; bottom: 12%; color: #755300; transform: rotate(7deg); }
.p4 { right: 9%; bottom: 8%; color: var(--berry); transform: rotate(-7deg); }
.spark { position: absolute; font-style: normal; font-size: 2rem; color: #e2a819; }
.s1 { left: 45%; top: 6%; } .s2 { right: 17%; top: 46%; color: var(--berry); } .s3 { left: 25%; bottom: 14%; color: var(--blue); }

.section {
  width: min(100% - 2rem, var(--content));
  margin: 2rem auto;
  padding: clamp(1.3rem, 4vw, 3.2rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
.section > .wrap { width: 100%; }
.joyful { background: linear-gradient(145deg, #fff, #eefaff, #fff6d8); }
.history-callout { background: linear-gradient(145deg, #fff8da, #ecf8ff, #f8eafb); }
.question-grid, .grid, .worlds, .root-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.card, .root-matrix article {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}
.card b, .root-matrix b {
  display: grid; place-items: center;
  width: 2.7rem; height: 2.7rem;
  border-radius: 50%; background: var(--sun); font-size: 1.2rem;
}
.q1 { border-top: 7px solid #e3ad22; }
.q2 { border-top: 7px solid #e86673; }
.q3 { border-top: 7px solid #745bc1; }
.q4 { border-top: 7px solid #2d87b2; }
.promise, .warning, .boundary {
  padding: 1rem 1.2rem;
  border: 3px solid var(--berry);
  border-radius: 18px;
  background: var(--pink);
}
.worlds a {
  min-height: 165px;
  padding: 1.2rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; text-decoration: none;
  border: 2px solid currentColor; border-radius: 28px;
  background: #fff; box-shadow: var(--shadow);
}
.worlds span { font-size: 2.2rem; }
.worlds small { color: var(--muted); }

.roots-hero, .roots-callout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.roots-tree, .mini-roots { position: relative; min-height: 390px; }
.roots-canopy, .mini-roots span {
  position: absolute; left: 50%; top: 4%; transform: translateX(-50%);
  display: grid; place-items: center; text-align: center;
  width: min(80%, 310px); min-height: 150px;
  border-radius: 48% 52% 55% 45%;
  background: linear-gradient(145deg, var(--pink), var(--sun), var(--mint));
  border: 3px solid var(--berry); font-size: 1.8rem; font-weight: 950; box-shadow: var(--shadow);
}
.roots-trunk, .mini-roots i { position: absolute; left: calc(50% - 16px); top: 40%; width: 32px; height: 130px; background: #805b3d; border-radius: 20px; }
.roots-seed, .root-node, .mini-roots b {
  position: absolute; display: grid; place-items: center; text-align: center;
  border: 3px solid var(--berry); background: #fff; border-radius: 50%; font-weight: 950; box-shadow: var(--shadow);
}
.center-seed { left: 50%; bottom: 5%; transform: translateX(-50%); width: 100px; height: 78px; background: var(--sun); }
.root-node, .mini-roots b { bottom: 0; width: 86px; height: 66px; font-size: 0.72rem; }
.node-left, .mini-roots b:nth-of-type(1) { left: 2%; }
.node-mid, .mini-roots b:nth-of-type(2) { left: calc(50% - 43px); }
.node-right, .mini-roots b:nth-of-type(3) { right: 2%; }
.root-line { position: absolute; bottom: 19%; height: 10px; background: #805b3d; border-radius: 999px; }
.root-left { left: 9%; width: 42%; transform: rotate(16deg); }
.root-mid { left: 24%; width: 52%; }
.root-right { right: 9%; width: 42%; transform: rotate(-16deg); }

.footer { margin-top: 4rem; padding: 3rem 1rem; background: #17233b; color: #fff; }
.footer a { color: #dff4ff; }

.large-text { --scale: 1.22; }
.readable-type body { font-family: Verdana, Atkinson Hyperlegible, system-ui, sans-serif; letter-spacing: 0.02em; word-spacing: 0.08em; }
.reading-mode body { background: var(--paper); }
.reading-mode main { width: min(100% - 2rem, var(--reading)); margin-inline: auto; }
.reading-mode .hero, .reading-mode .roots-hero, .reading-mode .roots-callout, .reading-mode .question-grid, .reading-mode .grid, .reading-mode .worlds, .reading-mode .root-matrix {
  grid-template-columns: 1fr !important;
}
.reading-mode .section { width: 100%; box-shadow: none; border-radius: 16px; }
.reading-mode .garden, .reading-mode .roots-tree, .reading-mode .mini-roots, .reading-mode .spark { display: none !important; }
.reading-mode .worlds a { min-height: auto; align-items: flex-start; text-align: left; }
.calm-motion *, .calm-motion *::before, .calm-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.high-contrast { --paper: #000; --ink: #fff; --line: #fff; --focus: #ffff00; color-scheme: dark; }
.high-contrast body, .high-contrast .section, .high-contrast .card, .high-contrast .nav, .high-contrast .access-bar, .high-contrast .worlds a, .high-contrast .person, .high-contrast .petal, .high-contrast .seeds span, .high-contrast .button, .high-contrast button, .high-contrast .root-matrix article, .high-contrast .roots-canopy, .high-contrast .root-node, .high-contrast .roots-seed {
  background: #000 !important; color: #fff !important; box-shadow: none;
}
.high-contrast a { color: #7fdcff; }

@media (max-width: 900px) {
  .hero, .roots-hero, .roots-callout { grid-template-columns: 1fr; }
  .garden { min-height: 390px; }
}

@media (max-width: 720px) {
  .wrap, .section, .hero > .wrap { width: min(100% - 1rem, var(--content)); }
  .section { margin-block: 0.75rem; padding: 1rem; border-radius: 18px; }
  .nav { position: sticky; top: 0; }
  .nav-inner, .nav > .wrap { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
  .nav .brand { margin: 0; justify-self: start; }
  .nav-toggle { display: inline-flex; justify-self: end; }
  .nav-inner > a:not(.brand), .nav > .wrap > a:not(:first-child) { display: none; grid-column: 1 / -1; width: 100%; justify-content: flex-start; border-radius: 14px; }
  .nav.nav-open .nav-inner > a:not(.brand), .nav.nav-open > .wrap > a:not(:first-child) { display: inline-flex; }
  .access-bar { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-inline: 0.5rem; scrollbar-width: thin; }
  .access-bar button { flex: 0 0 auto; white-space: nowrap; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .actions .button { width: 100%; }
  .question-grid, .grid, .worlds, .root-matrix { grid-template-columns: 1fr; }
  .garden { min-height: 330px; }
  .petal { width: 92px; min-height: 58px; font-size: 0.78rem; }
  .person { width: 122px; height: 122px; }
  h1 { font-size: clamp(2.45rem, 14vw, 4.4rem); }
  h2 { font-size: clamp(1.8rem, 9vw, 3rem); }
}

@media (max-width: 420px) {
  .ribbon, .dev-banner { font-size: 0.82rem; }
  .roots-tree, .mini-roots { min-height: 340px; }
  .root-node, .mini-roots b { width: 74px; height: 58px; font-size: 0.64rem; }
  .node-mid, .mini-roots b:nth-of-type(2) { left: calc(50% - 37px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  * { box-shadow: none !important; }
  .section, .card, .worlds a, .button, button { forced-color-adjust: auto; border: 2px solid CanvasText; }
}
@media print {
  .nav, .access-bar, .ribbon, .garden, .actions, .roots-tree, .mini-roots { display: none !important; }
  .section { width: 100%; box-shadow: none; border: 1px solid #777; }
  .footer { background: #fff; color: #000; }
  .footer a { color: #000; }
}
