:root {
  --ink: #e8e8f5;
  --muted: #b8b8c9;
  --soil: #0b0b12;
  --gold: #c8c8f0;
}

* { box-sizing: border-box; }
body { overflow-x: hidden; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at 50% 20%, #1a1a2a, var(--soil) 60%); color: var(--ink); font-family: Georgia, serif; line-height: 1.6; }
.tree-page { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 28px 0 58px; }
a { color: var(--gold); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
.site-link { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.tree-header { max-width: 720px; margin: 76px auto 58px; text-align: center; }
.eyebrow, .branch span { color: var(--gold); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0 0 16px; font-size: clamp(2.8rem, 7vw, 5.8rem); font-weight: normal; line-height: 1; }
.intro { max-width: 600px; margin: 0 auto; color: var(--muted); font-size: 1.2rem; }
.game-callout { max-width: 720px; margin: 0 auto 40px; }
.play-portus { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border: 1px solid rgba(216, 168, 93, .55); border-radius: 14px; background: linear-gradient(135deg, rgba(44, 103, 119, .35), rgba(20, 32, 24, .68)); box-shadow: 0 0 35px rgba(150, 150, 255, .18); transition: transform .25s ease, box-shadow .25s ease; }
.play-portus:hover, .play-portus:focus-visible { transform: translateY(-3px); box-shadow: 0 0 45px rgba(180, 180, 255, .3); text-decoration: none; outline: none; }
.play-icon { font-size: 2rem; line-height: 1; }
.play-portus strong { display: block; font-size: 1.2rem; font-weight: normal; color: var(--ink); }
.play-portus small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.branches { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 30px 0 64px; }
.trunk { position: absolute; top: 0; bottom: 0; left: 50%; width: 5px; transform: translateX(-50%); border-radius: 5px; background: linear-gradient(var(--gold), #607e55); }
.branch { position: relative; min-width: 0; min-height: 142px; padding: 19px; border: 1px solid rgba(200, 200, 255, .25); border-radius: 14px; background: rgba(255, 255, 255, .06); backdrop-filter: blur(14px); color: #f0f0ff; box-shadow: 0 0 35px rgba(150, 150, 255, .3); transition: transform .25s ease, background .25s ease, box-shadow .25s ease; }
.branch::after { content: ""; position: absolute; top: 50%; width: 18px; border-top: 2px solid var(--gold); }
.branch:nth-of-type(odd)::after { right: -19px; }
.branch:nth-of-type(even)::after { left: -19px; }
.branch:hover, .branch:focus-visible { background: rgba(255, 255, 255, .12); outline: none; transform: translateY(-4px); box-shadow: 0 0 45px rgba(180, 180, 255, .4); text-decoration: none; }
.branch strong { display: block; margin: 14px 0 4px; font-size: 1.18rem; font-weight: normal; }
.branch small { display: block; color: var(--muted); line-height: 1.4; }
.branch-welcome { max-width: 760px; margin: 0 auto 42px; padding: 28px; border: 1px solid rgba(216, 168, 93, .42); background: rgba(20, 32, 24, .68); }
.branch-welcome h2 { margin: 0 0 10px; font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: normal; line-height: 1.15; }
.branch-welcome p:not(.eyebrow) { max-width: 620px; color: var(--muted); }
.idea-leaves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 auto 40px; }
.idea-leaves article { min-height: 190px; padding: 22px; border: 1px solid rgba(216, 168, 93, .4); background: rgba(20, 32, 24, .68); }
.leaf-number { margin: 0 0 20px; color: var(--gold); font-size: .78rem; letter-spacing: .16em; }
.idea-leaves h2 { margin: 0 0 8px; font-size: 1.22rem; font-weight: normal; }
.idea-leaves article p:last-child { margin-bottom: 0; color: var(--muted); }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 20px; font-size: .92rem; }
@media (max-width: 760px) {
  .tree-page { width: min(calc(100% - 28px), 560px); }
  .tree-header { margin: 58px auto 38px; }
  .branches { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .trunk, .branch::after { display: none; }
  .branch { min-height: 132px; padding: 15px; }
  .branch strong { font-size: 1.05rem; }
  .branch small { overflow-wrap: anywhere; }
  .branch-welcome { padding: 22px; }
  .idea-leaves { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}
@media (max-width: 430px) {
  .branches { grid-template-columns: 1fr; }
  .tree-header { margin-top: 42px; }
  .intro { font-size: 1rem; }
}
@media (max-width: 380px) {
  .tree-page { width: calc(100% - 20px); }
  .branch { min-height: 120px; padding: 12px; }
  .branch strong { font-size: .98rem; }
}

/* The Great Tree ecosystem */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ecosystem-header { margin-bottom: 36px; }
.ecosystem-map { position: relative; min-height: 720px; margin: 0 auto 80px; overflow: hidden; border: 1px solid rgba(200,200,255,.22); border-radius: 28px; background: linear-gradient(#18253a 0 42%, #18271d 42% 78%, #11150f 78%); box-shadow: inset 0 0 90px rgba(0,0,0,.45), 0 30px 80px rgba(0,0,0,.35); }
.ecosystem-map::before { content: ""; position: absolute; left: 50%; bottom: 92px; width: 94px; height: 370px; transform: translateX(-50%); border-radius: 50% 50% 16px 16px; background: linear-gradient(90deg,#493221,#795638 46%,#3b291c); box-shadow: inset 12px 0 18px rgba(255,255,255,.08), inset -16px 0 18px rgba(0,0,0,.3); }
.ecosystem-map::after { content: ""; position: absolute; left: 50%; bottom: 66px; width: 440px; height: 95px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at center,rgba(93,123,65,.7),rgba(24,39,29,0) 70%); }
.eco-canopy { position: absolute; left: 50%; top: 95px; width: 600px; height: 350px; transform: translateX(-50%); }
.eco-canopy i { position: absolute; display: block; border-radius: 50%; background: radial-gradient(circle at 35% 25%,#78945c,#314d35 63%,#1b3124); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.eco-canopy i:nth-child(1){width:290px;height:250px;left:15px;top:75px}.eco-canopy i:nth-child(2){width:300px;height:270px;right:10px;top:70px}.eco-canopy i:nth-child(3){width:310px;height:260px;left:145px;top:0}.eco-canopy i:nth-child(4){width:220px;height:190px;left:0;top:185px}.eco-canopy i:nth-child(5){width:225px;height:195px;right:0;top:180px}
.eco-zone,.eco-trunk { position: absolute; z-index: 3; display: block; max-width: 220px; padding: 14px 16px; border: 1px solid rgba(232,232,245,.28); border-radius: 14px; background: rgba(11,11,18,.76); color: var(--ink); backdrop-filter: blur(10px); box-shadow: 0 10px 35px rgba(0,0,0,.3); }
.eco-zone:hover,.eco-zone:focus-visible,.eco-trunk:hover,.eco-trunk:focus-visible { transform: translateY(-3px); text-decoration: none; background: rgba(38,49,39,.94); outline: 2px solid var(--gold); }
.eco-zone span,.eco-trunk span,.ecosystem-floor span { display: block; color: var(--gold); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; }
.eco-zone strong,.eco-trunk strong { display: block; margin: 3px 0; font-weight: normal; font-size: 1.12rem; }
.eco-zone small { display: block; color: var(--muted); line-height: 1.35; }
.eco-sky { top: 24px; left: 28px; }.eco-shoots { top: 260px; left: 24px; }.eco-nest { top: 205px; right: 24px; }.eco-fruit { top: 28px; right: 28px; }
.eco-trunk { left: 50%; bottom: 185px; width: 180px; transform: translateX(-50%); text-align: center; }
.eco-trunk:hover,.eco-trunk:focus-visible { transform: translate(-50%,-3px); }
.eco-fungi { bottom: 25px; left: 30px; }.eco-field { bottom: 25px; right: 30px; }
.ecosystem-branches > header { max-width: 680px; margin: 0 auto 25px; text-align: center; }
.ecosystem-branches h2 { margin: 0 0 10px; font-size: clamp(2rem,5vw,4rem); font-weight: normal; }
.ecosystem-floor { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 0 auto 70px; }
.ecosystem-floor a,.ecosystem-floor article { min-height: 160px; padding: 22px; border: 1px solid rgba(200,200,255,.25); border-radius: 16px; background: rgba(255,255,255,.05); color: var(--ink); }
.ecosystem-floor a:hover,.ecosystem-floor a:focus-visible { background: rgba(255,255,255,.1); text-decoration: none; transform: translateY(-3px); }
.ecosystem-floor strong { display: block; margin: 12px 0 5px; font-size: 1.2rem; font-weight: normal; }.ecosystem-floor small { color: var(--muted); }
.leaf-article { max-width: 760px; margin: auto; }.leaf-article .tree-header { margin-bottom: 40px; }.leaf-article .content { font-size: 1.12rem; }.leaf-article .content p { margin: 0 0 1.35em; }
@media (max-width:760px) {
  .ecosystem-map { min-height: 850px; }
  .eco-canopy { top: 140px; width: 480px; transform: translateX(-50%) scale(.78); }
  .ecosystem-map::before { bottom: 180px; height: 350px; }
  .eco-zone { max-width: 180px; padding: 11px 12px; }.eco-zone small { display:none; }
  .eco-sky{top:18px;left:14px}.eco-fruit{top:18px;right:14px}.eco-shoots{top:340px;left:12px}.eco-nest{top:340px;right:12px}.eco-trunk{bottom:255px}.eco-fungi{bottom:24px;left:14px}.eco-field{bottom:24px;right:14px}
  .ecosystem-floor { grid-template-columns: 1fr 1fr; }
}
@media (max-width:480px) {
  .ecosystem-map { min-height: 980px; }
  .eco-zone { position:absolute; width:calc(50% - 20px); max-width:none; }
  .eco-canopy { top:180px; transform:translateX(-50%) scale(.62); }
  .ecosystem-map::before { bottom:230px; height:390px; width:76px; }
  .eco-shoots,.eco-nest{top:390px}.eco-trunk{bottom:320px;width:150px}.eco-fungi,.eco-field{bottom:20px}
  .ecosystem-floor { grid-template-columns:1fr; }
}

/* Leaf discovery and cross-pollination */
.leaf-tools { display: grid; grid-template-columns: auto minmax(180px,1fr) auto minmax(110px,160px) auto; align-items: center; gap: 10px 14px; margin: 0 0 28px; padding: 18px; border: 1px solid rgba(200,200,255,.24); border-radius: 14px; background: rgba(255,255,255,.05); }
.leaf-tools label { color: var(--muted); font-size: .84rem; letter-spacing: .06em; }
.leaf-tools input,.leaf-tools select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid rgba(200,200,255,.32); border-radius: 8px; background: #12121d; color: var(--ink); font: inherit; }
.leaf-tools input:focus,.leaf-tools select:focus { border-color: var(--gold); outline: 2px solid rgba(200,200,240,.25); }
.leaf-tools output { justify-self: end; color: var(--gold); white-space: nowrap; }
.leaf-card[hidden],.leaf-empty[hidden] { display: none; }
.leaf-empty { margin: 30px 0; padding: 24px; text-align: center; color: var(--muted); border: 1px dashed rgba(200,200,255,.3); }
.leaf-context { width: min(760px,calc(100% - 32px)); margin: 55px auto 30px; padding: 24px; border: 1px solid rgba(200,200,255,.25); border-radius: 14px; background: rgba(255,255,255,.05); color: var(--ink); font-family: Georgia,serif; }
.leaf-context a { color: var(--gold); }
.also-grows { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); }
.also-grows span { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.leaf-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(200,200,255,.2); }
.leaf-pagination a:last-child { text-align: right; }
@media (max-width:760px) { .leaf-tools { grid-template-columns: 1fr; }.leaf-tools output { justify-self: start; }.leaf-pagination { grid-template-columns: 1fr; }.leaf-pagination a:last-child { text-align:left; } }

.branch-growing { opacity: .62; border-style: dashed; box-shadow: none; cursor: default; }
.branch-growing:hover { transform: none; background: rgba(255,255,255,.06); box-shadow: none; }
.branch-growing small { margin-top: 10px; color: var(--muted); font-size: .76rem; }

.ecosystem-floor article { scroll-margin-top: 24px; }
