/* tree.gg :: the living tree — chrome, panel, list view */

:root {
  --bg: #0b1a12; --bg-deep: #06110b; --ink: #efe6d2; --ink-strong: #f7efdd;
  --amber: #f2b25a; --glow: #7be3d0; --dim: #7fa88f; --dim2: #9cc7ad;
  --leaf0: #9fd6a8; --leaf1: #5fbf6a; --leaf2: #2f8f4a;
  --serif: Georgia, 'Times New Roman', serif; --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --panel-w: 440px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html.lock { overflow: hidden; overscroll-behavior: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); overflow-x: hidden; }
a { color: var(--amber); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#scroll { height: 560vh; }
#gl { position: fixed; inset: 0; z-index: 0; touch-action: pan-y; }
#gl canvas { display: block; width: 100%; height: 100%; }

/* ---- chrome ---------------------------------------------------------- */
#ui { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#brand { position: absolute; left: 32px; top: 28px; pointer-events: auto; display: flex; gap: 14px; align-items: baseline; font-family: var(--sans); letter-spacing: .32em; text-transform: uppercase; font-size: 12px; color: var(--dim2); text-decoration: none; }
#brand span { letter-spacing: 0; text-transform: none; font-size: 12px; color: #6f9a80; }
#chrome { position: absolute; right: 24px; top: 24px; pointer-events: auto; display: flex; gap: 8px; align-items: center; font-family: var(--sans); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }
#chrome button { appearance: none; background: rgba(11,26,18,.55); border: 1px solid rgba(123,227,208,.22); color: var(--dim2); padding: 8px 12px; border-radius: 999px; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; backdrop-filter: blur(8px); }
#chrome button[aria-pressed="true"] { color: var(--ink-strong); border-color: rgba(123,227,208,.5); }
#chrome button:hover { color: var(--ink-strong); }
#chrome a { color: var(--dim2); text-decoration: none; margin-left: 8px; letter-spacing: .06em; text-transform: none; }
#chrome a:hover { color: var(--ink-strong); }

.motto { position: absolute; left: 50%; top: 40vh; transform: translateX(-50%); width: min(90vw, 760px); text-align: center; font-style: italic; font-size: clamp(30px, 5.2vw, 58px); line-height: 1.05; color: var(--ink-strong); opacity: 0; transition: opacity .9s ease; text-shadow: 0 2px 40px rgba(0,0,0,.65); }
.motto.on { opacity: 1; }
.motto b { font-weight: 400; color: var(--amber); }

#labels { position: absolute; inset: 0; }
.lbl { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; appearance: none; background: rgba(7,4,15,.42); border: 1px solid rgba(123,227,208,.14); border-radius: 999px; backdrop-filter: blur(6px); padding: 10px 16px; font-family: var(--sans); letter-spacing: .28em; text-transform: uppercase; font-size: 13px; color: #f3f7ee; opacity: 0; transition: opacity .6s ease, color .3s ease; white-space: nowrap; text-shadow: 0 0 18px rgba(0,0,0,.95), 0 0 4px rgba(0,0,0,.9); }
.lbl small { display: block; letter-spacing: .1em; text-transform: none; font-size: 11px; color: var(--dim2); text-align: center; margin-top: 3px; }
.lbl:hover, .lbl:focus-visible { color: #fff3dc; outline: none; }
.lbl::before { content: ""; position: absolute; left: 50%; top: -4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #d8fff5; box-shadow: 0 0 14px 5px rgba(123,227,208,.55); }

#top { position: absolute; left: 50%; bottom: 10vh; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 1s ease; pointer-events: none; }
#top.on { opacity: 1; pointer-events: auto; }
#top .n { font-family: var(--sans); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #dfe9d9; margin-bottom: 18px; text-shadow: 0 0 16px rgba(0,0,0,.9), 0 0 4px rgba(0,0,0,.9); }
#enter { display: inline-block; font-family: var(--sans); letter-spacing: .28em; text-transform: uppercase; font-size: 13px; color: var(--bg); background: var(--amber); padding: 14px 26px; border-radius: 999px; text-decoration: none; box-shadow: 0 0 40px rgba(242,178,90,.35); }
#hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); font-family: var(--sans); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); transition: opacity .6s; }
#hint.off { opacity: 0; }

#tooltip { position: fixed; z-index: 3; pointer-events: none; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-strong); background: rgba(11,26,18,.72); border: 1px solid rgba(123,227,208,.22); padding: 6px 10px; border-radius: 6px; backdrop-filter: blur(6px); max-width: 260px; text-shadow: none; }
#tooltip small { display: block; font-family: var(--sans); font-style: normal; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim2); margin-top: 2px; }

/* ---- panel ------------------------------------------------------------ */
#panel { position: fixed; z-index: 4; top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 100vw); transform: translateX(104%); transition: transform .45s cubic-bezier(.2,.7,.2,1); background: rgba(11,26,18,.62); backdrop-filter: blur(14px) saturate(1.1); border-left: 1px solid rgba(123,227,208,.18); color: var(--ink); display: flex; flex-direction: column; }
#panel[hidden] { display: none; }
#panel.open { transform: translateX(0); }
#panel .handle { display: none; }
#panel .close { position: absolute; top: 14px; right: 14px; z-index: 1; appearance: none; background: rgba(11,26,18,.5); border: 1px solid rgba(123,227,208,.22); color: var(--dim2); width: 36px; height: 36px; border-radius: 50%; font: 20px/1 var(--sans); cursor: pointer; }
#panel .close:hover { color: var(--ink-strong); }
#panel .inner { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 40px 32px 48px; -webkit-overflow-scrolling: touch; }
#panel .crumb { display: flex; gap: 10px; align-items: center; font-family: var(--sans); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--dim2); margin-bottom: 18px; }
#panel .crumb a, #panel .crumb button { color: var(--dim2); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
#panel .crumb a:hover, #panel .crumb button:hover { color: var(--ink-strong); }
#panel h2 { margin: 0 0 8px; font-weight: 400; font-style: italic; font-size: 30px; line-height: 1.1; color: var(--ink-strong); outline: none; }
#panel .meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim2); margin-bottom: 26px; }
#panel .meta .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 10px 3px rgba(123,227,208,.25); }
#panel .body { font-size: 18px; line-height: 1.6; color: #e6dfcd; }
#panel .body p { margin: 0 0 1em; }
#panel .body a { color: var(--amber); text-decoration: none; border-bottom: 1px solid rgba(242,178,90,.35); }
#panel .body a:hover { color: #ffd58a; }
#panel .body pre, #panel .body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
#panel .body pre { overflow-x: auto; padding: 12px; background: rgba(0,0,0,.28); border-left: 2px solid rgba(123,227,208,.3); }
#panel .body blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 2px solid rgba(123,227,208,.35); color: #cfd9c6; }
#panel .body img { max-width: 100%; height: auto; }
#panel .body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
#panel .body th, #panel .body td { border: 1px solid rgba(123,227,208,.2); padding: 4px 8px; }
#panel .body.loading { color: var(--dim); font-style: italic; }
#panel h3 { margin: 30px 0 10px; font-family: var(--sans); font-weight: 500; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--dim2); }
#panel .chips { display: flex; flex-wrap: wrap; gap: 8px; }
#panel .chip { appearance: none; background: rgba(123,227,208,.08); border: 1px solid rgba(123,227,208,.22); color: #dfe9d9; padding: 6px 10px; border-radius: 999px; font: 13px var(--serif); cursor: pointer; text-decoration: none; }
#panel .chip:hover, #panel .chip:focus-visible { border-color: rgba(123,227,208,.6); color: var(--ink-strong); outline: none; }
#panel .rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#panel .row { display: block; text-decoration: none; color: inherit; padding: 10px 12px; margin: 0 -12px; border-radius: 8px; }
#panel .row:hover, #panel .row:focus-visible { background: rgba(123,227,208,.08); outline: none; }
#panel .row .t { font-size: 17px; color: var(--ink-strong); }
#panel .row .s { display: block; font-size: 14px; color: #b9c6b3; margin-top: 2px; }
#panel .row .m { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim2); margin-top: 6px; }
#panel .row .mark { color: var(--amber); }
#panel .pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
#panel .pager a, #panel .pager button { color: var(--dim2); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
#panel .pager a:hover, #panel .pager button:hover { color: var(--ink-strong); }
#panel .pager .off { opacity: .35; pointer-events: none; }
#panel .lead { font-size: 16px; line-height: 1.55; color: #cfd9c6; margin: 0 0 22px; }
#panel .garden-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
#panel .garden-nav .chip[aria-current="true"] { background: rgba(242,178,90,.16); border-color: rgba(242,178,90,.6); }
.leafdot0 { background: var(--leaf0); } .leafdot1 { background: var(--leaf1); } .leafdot2 { background: var(--leaf2); }

/* ---- list view -------------------------------------------------------- */
#listview { position: fixed; z-index: 5; inset: 0; overflow-y: auto; background: rgba(6,17,11,.92); backdrop-filter: blur(10px); padding: 88px 32px 60px; font-family: var(--serif); }
#listview[hidden] { display: none; }
#listview .wrap { max-width: 720px; margin: 0 auto; }
#listview .notice { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; color: var(--amber); margin-bottom: 20px; }
#listview h1 { font-weight: 400; font-style: italic; font-size: 34px; margin: 0 0 6px; color: var(--ink-strong); }
#listview .sub { color: var(--dim2); margin: 0 0 30px; font-style: italic; }
#listview h2 { font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--dim2); margin: 28px 0 8px; }
#listview ul { list-style: none; margin: 0; padding: 0; }
#listview li a { display: block; padding: 8px 0; color: var(--ink-strong); text-decoration: none; font-size: 18px; border-bottom: 1px solid rgba(123,227,208,.1); }
#listview li a:hover, #listview li a:focus-visible { color: var(--amber); outline: none; }
#listview li a small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim2); margin-top: 3px; }
#listview .files h2 { color: var(--dim); }

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 720px) {
  #brand span, #chrome a { display: none; }
  #chrome { right: 16px; top: 16px; }
  #brand { left: 18px; top: 22px; }
  .lbl { padding: 14px 12px; }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: 100vw; height: 72vh; transform: translateY(104%); border-left: 0; border-top: 1px solid rgba(123,227,208,.18); border-radius: 18px 18px 0 0; }
  #panel.open { transform: translateY(0); }
  #panel .handle { display: block; width: 44px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: rgba(239,230,210,.35); touch-action: none; }
  #panel .inner { padding: 22px 20px 40px; }
  #panel h2 { font-size: 26px; }
  #listview { padding: 76px 18px 40px; }
}

/* ---- motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .motto, .lbl, #top, #hint, #panel, #chrome button { transition: none !important; }
}
body.reduced .motto, body.reduced .lbl, body.reduced #top, body.reduced #hint, body.reduced #panel { transition: none !important; }
