/* Treeyard site — direction prototype, round two.
   The page is a tree: Treeyard's own tree in 3D on the first screen, a real session replayed
   under the scroll, then the sections hang on one trunk like nodes. No frames, no gradients. */

@font-face { font-family: 'Iosevka Aile'; src: url('../fonts/aile-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Iosevka Aile'; src: url('../fonts/aile-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Iosevka Aile'; src: url('../fonts/aile-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Iosevka Aile'; src: url('../fonts/aile-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Iosevka Term Ext'; src: url('../fonts/IosevkaTermExtended-Regular.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Iosevka Term Ext'; src: url('../fonts/IosevkaTermExtended-Bold.woff2') format('woff2'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Treeyard Cell'; src: url('../fonts/TreeyardCellFallback.woff2') format('woff2'); font-display: block; }

:root {
  --bg: #16181c;          /* the TUI's own background: the terminal needs no frame */
  --line: #2c3037;
  --dim: #3a3f48;         /* branches not reached yet, like the TUI's grey connectors */
  --text: #e9eaec;
  --muted: #a5abb3;
  --accent: #7ee2a8;      /* the logo's mint: the path you are on, the main button */
  --accent-ink: #0d1a12;
  /* status colours of the TUI */
  --s-d: #5fd38d; --s-r: #5fd7e6; --s-a: #8ab4ff; --s-t: #c9ccd1; --s-w: #ffcf70; --s-i: #c4a7ff;
  --radius: 4px;
  --sans: 'Iosevka Aile', system-ui, sans-serif;
  --mono: 'Iosevka Term Ext', 'Treeyard Cell', ui-monospace, monospace;
  --pad: 64px;
  --top: 56px;
  --gut: max(var(--pad), calc((100vw - 1320px) / 2)); /* one left edge for everything */
  --lane: 72px;           /* the trunk's lane left of the sections */
  color-scheme: dark;
}
@media (max-width: 1023px) { :root { --pad: 28px; --lane: 48px; } }
@media (max-width: 639px)  { :root { --pad: 16px; --top: 52px; --lane: 30px; } }

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: var(--top); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 18px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0; }
code { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius); text-decoration: none; font-weight: 700; }
.skip:focus { top: 8px; }

/* ── header: the TUI's tab line, number keys jump ───────────────────── */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 24px; padding: 0 var(--gut); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 19px/1 var(--mono); color: var(--accent); padding: 8px 0; flex: none; }
.brand svg { width: 30px; height: 26px; }
.tabs-top { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; font: 400 15px/1 var(--mono); }
.tabs-top::-webkit-scrollbar { display: none; }
.tabs-top a { display: flex; align-items: baseline; gap: 6px; padding: 13px 10px; text-decoration: none; color: var(--muted); white-space: nowrap; border-radius: var(--radius); transition: color .15s ease-out; }
.tabs-top a b { font-weight: 400; color: var(--s-a); }
.tabs-top a:hover { color: var(--text); }
.tabs-top a[aria-current='true'] { color: var(--accent); }
.tabs-top a[aria-current='true'] span { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
/* the language switch: a knob you can drag, or just press */
.lang-sw { -webkit-user-drag: none; position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; width: 96px; height: 44px; font: 400 14px/1 var(--mono); text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.lang-o { position: relative; z-index: 1; pointer-events: none; display: grid; place-items: center; color: var(--muted); transition: color .15s ease-out; }
.lang-knob { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--line); border-radius: var(--radius); transition: transform .18s ease-out, background-color .15s ease-out; }
.lang-sw[data-on='ru'] .lang-knob { transform: translateX(100%); }
.lang-sw[data-on='en'] .lang-o:first-child, .lang-sw[data-on='ru'] .lang-o:nth-child(2) { color: var(--text); }
.lang-sw:hover .lang-knob, .lang-sw.drag .lang-knob { background: var(--dim); }
.lang-sw.drag { cursor: grabbing; }
/* the name's letters rise under the cursor: the one you point at highest, its neighbours less */
.brand-t { display: inline-flex; }
.brand-t i { font-style: normal; display: inline-block; transition: transform .12s ease-out; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress b { display: block; height: 100%; width: 0; background: var(--accent); }
@media (max-width: 1240px) { .tabs-top a span { display: none; } .tabs-top a[aria-current='true'] span { display: inline; } }
@media (max-width: 639px) { .brand .brand-t { display: none; } .top { gap: 10px; } .tabs-top { margin-left: 0; flex: 1; } }

/* ── buttons and links ────────────────────────────────────────────────── */
.cmd { display: inline-flex; align-items: center; gap: 14px; max-width: 100%; font: 400 17px/1.2 var(--mono); color: var(--accent-ink); background: var(--accent); border: 0; border-radius: var(--radius); padding: 15px 18px; cursor: pointer; transition: background-color .15s ease-out; }
.cmd:hover { background: #9ff0c1; }
.cmd:active { background: #6ad197; }
.cmd .cmd-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd .cmd-act { font: 700 15px var(--sans); padding-left: 14px; border-left: 1px solid rgb(13 26 18 / .3); }
.link { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 5px; text-decoration-thickness: 2px; padding: 12px 2px; transition: text-decoration-color .15s ease-out; }
.link:hover { text-decoration-color: var(--accent); }

/* ── hero: Treeyard's own tree in 3D ──────────────────────────────────── */
.hero { position: relative; min-height: calc(100svh - var(--top)); display: grid; align-content: center; justify-items: center; padding: 0 var(--gut) 6svh; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; }
.hero.drag { cursor: grabbing; }
.g3 { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.g3.back { z-index: 0; }
.g3.front { z-index: 3; }
/* the headline on top; the tree grows from below, around it */
.hero-text { position: relative; z-index: 2; text-align: center; }
.hero h1 { font-size: clamp(38px, min(6.2vw, 9.4svh), 104px); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.hero .act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 28px; margin-top: 28px; }
.hero .act > * { position: relative; z-index: 4; }
.hero-foot { grid-row: 3; position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 20px 0 28px; border-top: 1px solid var(--line); pointer-events: none; }
.hero-foot > * { pointer-events: auto; }
.tree-cap { font-size: 15px; color: var(--muted); max-width: 48ch; }
.legend { display: flex; flex-wrap: wrap; gap: 4px; }
.lg { display: inline-flex; align-items: center; gap: 8px; font: 400 14px/1 var(--mono); color: var(--muted); background: none; border: 1px solid transparent; border-radius: var(--radius); padding: 8px 10px; cursor: pointer; transition: color .15s ease-out, border-color .15s ease-out; }
.lg:hover { color: var(--text); }
.lg[aria-pressed='true'] { color: var(--text); border-color: var(--dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.s-d { background: var(--s-d); } .s-r { background: var(--s-r); } .s-a { background: var(--s-a); }
.s-t { background: var(--s-t); } .s-w { background: var(--s-w); } .s-i { background: var(--s-i); }
.c-g { background: var(--s-d); } .c-b { background: var(--s-a); } .c-y { background: var(--s-w); }
.card3d { position: absolute; z-index: 5; width: min(340px, calc(100% - 32px)); padding: 14px 16px; background: #1d2026; border: 1px solid var(--dim); border-radius: var(--radius); pointer-events: none; }
.card3d .st { display: flex; align-items: center; gap: 8px; font: 400 13px/1 var(--mono); color: var(--muted); }
.card3d .tt { margin-top: 8px; font-size: 17px; line-height: 1.35; font-weight: 500; }
.card3d .dw { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.card3d .dw b { font: 400 13px var(--mono); color: var(--accent); margin-right: 6px; }
@media (max-width: 639px) {
  .cmd { width: 100%; justify-content: space-between; font-size: 13.5px; padding: 14px 12px; gap: 8px; }
  .cmd .cmd-act { padding-left: 8px; font-size: 14px; }
  .step { flex-wrap: wrap; gap: 4px 12px; font-size: 13px; padding: 12px 12px 8px 14px; }
  .step code { white-space: nowrap; overflow-x: auto; flex: 1 1 100%; min-width: 0; }
  .step .cp { margin-left: auto; }
  .hero h1 br { display: none; }
}

/* ── the story: a sticky stage, the scroll is time ────────────────────── */
.story { position: relative; border-top: 1px solid var(--line); }
.stage { position: relative; }
.term { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.term-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.screen { margin: 0; font: 400 16px/1.25 var(--mono); color: #d7d7d7; white-space: pre; font-variant-ligatures: none; font-feature-settings: 'calt' 0; }
.screen .w2 { display: inline-block; width: 2ch; }
.beat { position: relative; z-index: 2; }
.beat h2 { font-size: clamp(30px, min(3.3vw, 6.2svh), 54px); line-height: 1.06; letter-spacing: -.025em; font-weight: 700; }
.beat p { margin-top: 18px; color: var(--muted); font-size: 19px; max-width: 34ch; }
.beat p strong { color: var(--text); font-weight: 500; }
.beat .k { font: 700 .9em var(--mono); color: var(--accent); }
.beat .try { display: flex; align-items: center; gap: 14px; margin-top: 28px; color: var(--text); font-size: 17px; }
.key { min-width: 48px; height: 48px; padding: 0 14px; font: 700 22px/1 var(--mono); color: var(--accent-ink); background: var(--accent); border: 0; border-radius: var(--radius); box-shadow: 0 4px 0 #3f8f63; cursor: pointer; transition: transform .12s ease-out, box-shadow .12s ease-out; }
.key:active, .key[aria-pressed='true'] { transform: translateY(4px); box-shadow: 0 0 0 #3f8f63; }
.key[aria-pressed='true'] { background: var(--dim); color: var(--text); }
.story:not(.live) .stage { padding: 96px var(--gut); display: grid; gap: 72px; }
.story:not(.live) .term, .story:not(.live) .cap-panel { display: none; }
.story.live { height: var(--story-h, 700svh); }
.story.live .stage { position: sticky; top: var(--top); height: calc(100svh - var(--top)); overflow: hidden; }
.story.live .beat { position: absolute; opacity: 0; visibility: hidden; }
.story.live .beat.on { visibility: visible; }
.story.live .cap-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; background: var(--bg); border-top: 1px solid var(--line); opacity: 0; }

/* ── the walk: one tree under the terminal, a node opens when you reach it ── */
.walk { position: relative; border-top: 1px solid var(--line); }
.walk:not(.live) .wstage { padding: 96px var(--gut); display: grid; gap: 64px; justify-items: start; }
.walk:not(.live) .wmap, .walk:not(.live) .whint { display: none; }
.walk.live { height: var(--walk-h, 1400svh); }
.walk.live .wstage { position: sticky; top: var(--top); height: calc(100svh - var(--top)); overflow: hidden; }
.wmap { position: absolute; inset: 0; width: 100%; height: 100%; }
.whint { position: absolute; z-index: 2; left: 0; right: 0; bottom: 28px; width: max-content; max-width: calc(100% - 32px); margin: 0 auto; text-align: center; font: 400 15px var(--mono); color: var(--muted); }
.wcard { width: min(680px, 100%); background: #1b1e23; border: 1px solid var(--dim); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 30px); }
.walk.live .wcard { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; z-index: 2; }
.walk.live .wcard.on { visibility: visible; }
.wcard h2 .md { font: 400 .8em var(--mono); color: var(--accent); }
/* the agent's session, in the look of the CLI agents people use: the prompt with ❯, ● replies,
   ⎿ results, the input between two rules — without any product's name or logo */
.wsession { position: absolute; left: 0; top: 0; z-index: 3; width: min(620px, calc(100% - 24px)); height: 290px; display: flex; flex-direction: column; padding: 14px 16px 10px; font: 400 15px/1.5 var(--mono); color: #d7d7d7; background: var(--bg); border: 1px solid var(--dim); border-radius: var(--radius); opacity: 0; visibility: hidden; white-space: pre-wrap; }
.wsession.on { visibility: visible; }
.ws-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* a fixed window: new lines come in at the bottom and push the older ones up */
.cc-log { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.cc-log > div, .cc-bottom > div { min-height: 1.5em; flex: none; }
.cc-user { background: #373737; color: #d7d7d7; margin: 0 -6px; padding: 0 6px; }
.cc-user b, .cc-in b { color: #999; font-weight: 400; }
.cc-dot { color: #d7d7d7; }
.cc-tool { color: #5fd38d; }
.cc-bold { font-weight: 700; color: #e9eaec; }
.cc-res { color: #999; }
.cc-spin { color: #d77757; }
.cc-spin span { color: #999; }
.cc-rule { color: #3b4048; overflow: hidden; white-space: nowrap; }
.cc-foot { color: #999; }
.cc-foot b { color: #ff6b80; font-weight: 400; }
.cc-caret { display: inline-block; width: .6em; background: #d7d7d7; color: transparent; }
.wsession.fold { height: auto; padding: 0; border-color: transparent; background: none; }
@media (max-width: 767px) { .wsession { font-size: 12.5px; padding: 10px 12px 8px; height: 230px; } }
.wcard h2 { font-size: clamp(25px, 2.7vw, 38px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; }
.wcard .wd { margin-top: 12px; color: var(--muted); font-size: 18px; max-width: 52ch; }
.wlist { list-style: none; margin: 16px 0 0; padding: 0; }
.wlist li { position: relative; padding: 9px 0 9px 26px; border-top: 1px solid var(--line); font-size: 17px; }
.wlist li::before { content: '○'; position: absolute; left: 0; top: 9px; font: 400 15px/1.55 var(--mono); color: var(--muted); }
.wmore { margin-top: 10px; }
.wfile { margin: 18px 0 0; padding: 16px; font: 400 15px/1.5 var(--mono); color: #d7d7d7; white-space: pre; overflow-x: auto; background: var(--bg); border-radius: var(--radius); }
.wfile b { color: var(--accent); font-weight: 400; }
.wfile i { color: var(--muted); font-style: normal; }
.wterm { position: relative; overflow: hidden; margin-top: 18px; height: var(--h, 220px); background: var(--bg); border-radius: var(--radius); }
.wterm .term { position: absolute; left: 0; top: 0; }
.wcard .field { margin-top: 20px; gap: 5px; }
.wcard .field-key { margin-top: 18px; gap: 6px; }
.wcard .field-key li { font-size: 16px; }
.wcard .fine { margin-top: 16px; }
.wcard .steps { margin-top: 18px; gap: 0; }
.wcard .step { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 0; }
.wcard .act { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.wcard .posts { margin-top: 14px; }
.wcard .posts a { grid-template-columns: 9em 1fr; padding: 16px 0; }
.wcard .posts h3 { font-size: 22px; }
@media (max-width: 767px) {
  .walk.live .wcard { left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: 12px; max-height: 58%; overflow-y: auto; }
  .wcard .wd { font-size: 16px; }
  .wfile { font-size: 12px; }
}

/* ── sections ───────────────────────────────────────────────────────── */
.wrap { padding: 0 var(--gut); }
.sec { padding-top: 160px; }
@media (max-width: 639px) { .sec { padding-top: 96px; } }
.sec-head { max-width: 920px; }
.sec h2 { font-size: clamp(30px, 4vw, 56px); line-height: 1.06; letter-spacing: -.03em; font-weight: 700; }
.sec-head p { margin-top: 14px; color: var(--muted); font-size: 18px; }

/* done: try to make the agent say "done" */
.life { margin-top: 48px; display: grid; gap: 28px; max-width: 1080px; }
.life-node { grid-column: 1 / -1; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ln-row { display: flex; align-items: baseline; gap: 18px; font: 400 clamp(22px, 3.4vw, 46px)/1.15 var(--mono); }
.ln-g { font-style: normal; color: var(--s-t); transition: color .15s ease-out; }
.ln-t { flex: 1; }
.ln-st { font-size: .42em; color: var(--muted); white-space: nowrap; }
.ln-when { margin-top: 14px; font: 400 16px/1.4 var(--mono); color: var(--muted); }
.ln-when span { color: var(--accent); margin-right: 8px; }
.ln-ideas { list-style: none; margin: 0; padding: 0; }
.ln-ideas li { margin-top: 12px; font: 400 clamp(17px, 2vw, 24px)/1.2 var(--mono); color: var(--s-i); }
.life-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.life-ctl h3 { font: 700 14px var(--mono); color: var(--muted); margin-bottom: 10px; }
.life-ctl button { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 13px 14px; font: 500 16px/1.2 var(--sans); color: var(--text); background: none; border: 1px solid var(--dim); border-radius: var(--radius); cursor: pointer; text-align: left; transition: border-color .15s ease-out, background-color .15s ease-out; }
.life-ctl button:hover { border-color: var(--muted); }
.life-ctl button:active { background: var(--line); }
.life-ctl kbd { font: 700 14px var(--mono); color: var(--accent-ink); background: var(--accent); border-radius: var(--radius); padding: 3px 7px; }
.life-log { list-style: none; margin: 0; padding: 0; font: 400 16px/1.45 var(--mono); color: var(--muted); min-height: 8.5em; }
.life-log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.life-log li:first-child { color: var(--text); }
.life-log li.bounce:first-child { color: var(--s-r); }
.life-log li.win:first-child { color: var(--s-d); }
.life .reset { grid-column: 1 / -1; justify-self: start; background: none; border: 0; cursor: pointer; font: 500 16px var(--sans); }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: translateX(10px); } 60% { transform: translateX(-6px); } }
.ln-row.bounce .ln-g { animation: nudge .35s ease-out; display: inline-block; }
@media (max-width: 899px) { .life { grid-template-columns: 1fr; } }

/* keys: one key, one thing */
.kb { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.kc { display: grid; justify-items: start; gap: 10px; min-width: 132px; padding: 14px 16px 16px; font: 400 15px/1.2 var(--sans); color: var(--muted); text-align: left; background: #1d2026; border: 1px solid var(--dim); border-bottom-width: 5px; border-radius: var(--radius); cursor: pointer; transition: transform .12s ease-out, border-color .15s ease-out, color .15s ease-out; }
.kc b { font: 700 30px/1 var(--mono); color: var(--text); }
.kc:hover { border-color: var(--muted); color: var(--text); }
.kc[aria-pressed='true'] { transform: translateY(3px); border-bottom-width: 2px; margin-bottom: 3px; border-color: var(--accent); color: var(--text); }
.kc[aria-pressed='true'] b { color: var(--accent); }
.kb-cap { margin-top: 24px; font: 400 clamp(18px, 2vw, 26px)/1.3 var(--mono); color: var(--text); min-height: 1.3em; }
.kscreen { margin-top: 20px; }
@media (max-width: 639px) { .kc { min-width: 0; flex: 1 1 calc(33% - 12px); } .kc span { display: none; } }

/* tokens: switch the tree size */
.seg { display: inline-flex; margin-top: 36px; border: 1px solid var(--dim); border-radius: var(--radius); }
.seg button { font: 500 16px var(--sans); color: var(--muted); background: none; border: 0; padding: 12px 16px; cursor: pointer; transition: color .15s ease-out; }
.seg button[aria-pressed='true'] { color: var(--accent-ink); background: var(--accent); }
.small-note { margin-top: 20px; font-size: 18px; color: var(--text); max-width: 60ch; }
.field .c { transition: background-color .25s ease-out, box-shadow .25s ease-out, opacity .25s ease-out; }
.field .c.off { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.field-key li.docs.off { opacity: .35; }

/* rules: a deck */
.deck { margin-top: 48px; max-width: 980px; }
.deck-stack { position: relative; min-height: clamp(260px, 30vw, 340px); border: 1px solid var(--dim); border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); background: #1b1e23; box-shadow: 10px 10px 0 -1px var(--bg), 10px 10px 0 0 var(--dim), 20px 20px 0 -1px var(--bg), 20px 20px 0 0 var(--line); touch-action: pan-y; cursor: grab; user-select: none; }
.rule .num { font: 700 clamp(48px, 7vw, 96px)/1 var(--mono); color: var(--accent); }
.rule h3 { margin-top: 20px; font-size: clamp(26px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; max-width: 20ch; }
.rule p:last-child { margin-top: 16px; font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); max-width: 52ch; }
.deck-nav { display: flex; align-items: center; gap: 12px; margin-top: 40px; }
.deck-nav button { width: 52px; height: 52px; font: 400 22px var(--mono); color: var(--text); background: none; border: 1px solid var(--dim); border-radius: var(--radius); cursor: pointer; transition: border-color .15s ease-out; }
.deck-nav button:hover { border-color: var(--muted); }
.deck-count { font: 400 16px var(--mono); color: var(--muted); min-width: 6em; text-align: center; }
.deck-nav .link { margin-left: auto; }

/* install: your goal in the TUI header */
.goal { margin-top: 40px; max-width: 1100px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.goal label { display: block; font: 700 15px var(--mono); color: var(--muted); }
.goal input { display: block; width: 100%; margin-top: 10px; padding: 14px 16px; font: 400 20px/1.3 var(--sans); color: var(--text); background: #1b1e23; border: 1px solid var(--dim); border-radius: var(--radius); }
.goal input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.goal input::placeholder { color: #8a9099; }
.tui-head { margin: 0; font: 400 clamp(11px, 1.45vw, 18px)/1.25 var(--mono); color: #d7d7d7; white-space: pre; overflow: hidden; }

/* numbers: one cell is a thousand tokens */
.field { display: grid; grid-template-columns: repeat(21, 1fr); gap: 6px; margin-top: 56px; max-width: 1080px; }
.field .c { aspect-ratio: 1; border-radius: var(--radius); }
.c.n { background: var(--accent); }
.c.p { background: var(--dim); }
.c.d { box-shadow: inset 0 0 0 1.5px var(--dim); }
.field-key { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; max-width: 1080px; }
.field-key li { display: grid; grid-template-columns: 18px 1fr auto; gap: 14px; align-items: center; font-size: 17px; }
.field-key .c { width: 18px; height: 18px; display: block; }
.field-key b { font: 700 17px var(--mono); }
.field-key li:first-child b { color: var(--accent); }
.fine { margin-top: 32px; font-size: 14px; color: var(--muted); max-width: 90ch; line-height: 1.5; }
@media (max-width: 639px) { .field { grid-template-columns: repeat(12, 1fr); gap: 5px; } }

/* agents */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 48px; border-bottom: 1px solid var(--line); }
.tabs button { font: 500 17px var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer; padding: 12px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease-out; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }
.mini { position: relative; margin-top: 32px; overflow: hidden; height: var(--mini-h, 560px); }
.mini .term { position: absolute; }
.mini-cap { margin-top: 16px; font-size: 15px; color: var(--muted); }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 72px; }
.cols3 h3 { font-size: 22px; font-weight: 700; }
.cols3 p { margin-top: 10px; color: var(--muted); font-size: 17px; }
@media (max-width: 899px) { .cols3 { grid-template-columns: 1fr; gap: 32px; } }

/* blog */
.posts { list-style: none; padding: 0; margin: 48px 0 0; }
.posts li { border-top: 1px solid var(--line); }
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 10em 1fr auto; gap: 8px 32px; align-items: baseline; padding: 28px 0; text-decoration: none; }
.posts time { font: 400 15px var(--mono); color: var(--muted); }
.posts h3 { font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.02em; font-weight: 700; transition: color .15s ease-out; }
.posts .ex { grid-column: 2; color: var(--muted); max-width: 64ch; }
.posts .go { font: 400 15px var(--mono); color: var(--muted); }
.posts a:hover h3 { color: var(--accent); }
@media (max-width: 767px) { .posts a { grid-template-columns: 1fr; } .posts .ex { grid-column: 1; } .posts .go { display: none; } }

/* install: the trunk ends in the root */
.done-sec { padding-bottom: 128px; }
.root-line { font: 400 17px var(--mono); color: var(--muted); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.root-line b { color: var(--accent); font-weight: 700; }
.done-sec h2 { margin-top: 20px; font-size: clamp(38px, 5.6vw, 88px); line-height: 1; letter-spacing: -.035em; font-weight: 800; max-width: 14ch; }
.steps { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 760px; }
.step { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); font: 400 17px/1.3 var(--mono); }
.step .p { color: var(--accent); margin-right: 12px; }
.step code { font-size: 1em; overflow-wrap: anywhere; }
.step .cp { font: 500 15px var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer; padding: 8px 10px; border-radius: var(--radius); flex: none; transition: color .15s ease-out; }
.step .cp:hover { color: var(--text); }
.done-sec .need { margin-top: 20px; color: var(--muted); max-width: 70ch; }
.done-sec .act { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; padding-top: 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 15px; }
footer a { text-decoration: none; padding: 12px 4px; }
footer a:hover { color: var(--text); }
footer .sp { margin-left: auto; }

@media (max-width: 380px) { .cmd { font-size: 12.5px; padding: 14px 10px; } .cmd .cmd-act { font-size: 13px; } }
.hero { grid-template-columns: minmax(0, 1fr); }
.cmd .cmd-text { min-width: 0; }
@media (hover: none) { .cmd:hover { background: var(--accent); } .top nav a:hover, .tabs button:hover, .lg:hover { color: inherit; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── pages: the blog, a post, errors ─────────────────────────────────── */
.page { padding: clamp(48px, 9svh, 112px) 0 128px; min-height: calc(100svh - var(--top) - 80px); }
.page h1 { font-size: clamp(36px, 5vw, 72px); line-height: 1.04; letter-spacing: -.03em; font-weight: 800; max-width: 20ch; }
.page-lead { margin-top: 20px; color: var(--muted); font-size: 19px; max-width: 60ch; }
.page .posts { margin-top: 48px; max-width: 980px; }
.page .posts a { grid-template-columns: 10em 1fr; }
.page .posts h2 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; transition: color .15s ease-out; }
.page .posts a:hover h2, .page .posts a:hover h3 { color: var(--accent); }
.pager { display: flex; gap: 8px; margin-top: 32px; font-family: var(--mono); }
.pager a { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--muted); }
.pager a[aria-current] { color: var(--text); border-color: var(--dim); }
.post.page { padding-top: clamp(24px, 6svh, 88px); }
.post .wrap { padding-top: 24px; }
.post-back { margin: 0 0 24px; }
.post-back .link { display: inline-block; }
.post-meta { margin-top: 16px; font: 400 15px var(--mono); color: var(--muted); }
.post-body { margin-top: 40px; max-width: 68ch; font-size: 18px; padding-bottom: 24px; }
.post-body .a-table-wrap { overflow-x: auto; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.post-body th, .post-body td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
.post-body th { font: 400 14px var(--mono); color: var(--muted); }
.post-body > * + * { margin-top: 1em; }
.post-body h2 { margin-top: 2em; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.02em; }
.post-body h3 { margin-top: 1.6em; font-size: 21px; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: .45em; }
.post-body code { background: #1d2026; padding: .1em .35em; border-radius: var(--radius); }
.post-body pre { background: #1b1e23; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; font: 400 15px/1.5 var(--mono); }
.post-body pre code { background: none; padding: 0; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
.post-body blockquote { margin-left: 0; padding-left: 20px; color: var(--muted); box-shadow: inset 2px 0 0 var(--dim); }
.post-body .a-quote blockquote { padding: 0; box-shadow: none; color: var(--text); }
.post-more { margin-top: 72px; font-size: 24px; font-weight: 700; }
.page-error .err-code { font: 700 clamp(64px, 12vw, 160px)/1 var(--mono); color: var(--dim); }
.page-error h1 { margin-top: 12px; }
.draft { background: var(--s-w); color: #16181c; text-align: center; padding: 8px; font-weight: 700; }
@media (max-width: 767px) { .page .posts a { grid-template-columns: 1fr; } }
.post-body .a-anchor { position: absolute; margin-left: -1em; padding-right: .25em; color: var(--dim); text-decoration: none; opacity: 0; transition: opacity .15s ease-out; }
.post-body h2:hover .a-anchor, .post-body h3:hover .a-anchor, .post-body .a-anchor:focus-visible { opacity: 1; }
@media (max-width: 767px), (hover: none) { .post-body .a-anchor { display: none; } }

/* copying (the button's state is a class: <html> carries data-copied for the script): the label rolls over to a drawn check, a copy of the command floats up and melts */
.cmd { position: relative; }
.cmd-act, .step .cp { display: grid; }
.ca { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .22s ease-out, opacity .22s ease-out; }
.ca-done { opacity: 0; transform: translateY(80%); }
.ca svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ca svg path { stroke-dasharray: 14; stroke-dashoffset: 14; transition: stroke-dashoffset .3s ease-out .12s; }
.is-copied .ca-idle { opacity: 0; transform: translateY(-80%); }
.is-copied .ca-done { opacity: 1; transform: none; }
.is-copied .ca svg path { stroke-dashoffset: 0; }
.step .cp.is-copied { color: var(--accent); }
.cmd-ghost { position: absolute; z-index: 5; pointer-events: none; white-space: nowrap; font: 400 17px/1.2 var(--mono); color: var(--accent); }

.wh-link { color: inherit; text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 6px; text-decoration-thickness: 2px; transition: text-decoration-color .15s ease-out; }
.wh-link:hover { text-decoration-color: var(--accent); }

/* the article's sidebar: a star on GitHub and the blocks from the settings */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px 72px; align-items: start; }
.post-main { min-width: 0; }
.post-aside { position: sticky; top: calc(var(--top) + 32px); display: grid; gap: 16px; margin-top: 60px; }
.aside-card { padding: 20px; background: #1b1e23; border: 1px solid var(--line); border-radius: var(--radius); }
.aside-h { font-size: 18px; line-height: 1.3; font-weight: 700; }
.aside-card p { margin-top: 10px; font-size: 16px; color: var(--muted); }
.aside-card .link { padding: 6px 0; }
.star-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 12px 14px; font: 700 15px var(--sans); color: var(--accent-ink); background: var(--accent); border-radius: var(--radius); text-decoration: none; transition: background-color .15s ease-out; }
.star-btn:hover { background: #9ff0c1; }
.star-n { margin-left: 4px; padding-left: 10px; border-left: 1px solid rgb(13 26 18 / .3); font: 400 14px var(--mono); }
.aside-code { overflow: hidden; }
@media (max-width: 1023px) { .post-grid { grid-template-columns: 1fr; } .post-aside { position: static; margin-top: 24px; max-width: 68ch; } }

.post-body figure { margin: 32px 0; }
.post-body img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.post-body figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }

/* article blocks (Siteyard renders them; the look is the site's) */
.post-body .a-lead { font-size: 21px; line-height: 1.5; color: var(--text); }
.a-takeaways, .a-callout, .a-cta { margin: 28px 0; padding: 20px 22px; background: #1b1e23; border: 1px solid var(--line); border-radius: var(--radius); }
.a-takeaways-title, .a-callout-title, .a-cta-title, .a-faq-title, .a-pc-title, .a-compare-title { font: 700 15px var(--mono); color: var(--accent); margin: 0 0 10px; }
.a-takeaways ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.a-takeaways li { padding-left: 24px; position: relative; }
.a-takeaways li::before { content: '✓'; position: absolute; left: 0; color: var(--s-d); font-family: var(--mono); }
.a-callout { display: grid; grid-template-columns: 24px 1fr; gap: 0 14px; }
.a-callout-ic { color: var(--s-a); } .a-callout-ic svg { width: 22px; height: 22px; }
.a-callout-tip .a-callout-ic, .a-callout-tip .a-callout-title { color: var(--s-d); }
.a-callout-warning .a-callout-ic, .a-callout-warning .a-callout-title { color: var(--s-w); }
.a-callout-info .a-callout-title { color: var(--s-a); }
.a-callout p:not(.a-callout-title) { margin: 0; color: var(--muted); }
.a-steps { counter-reset: s; display: grid; gap: 14px; margin: 28px 0; }
.a-step { display: grid; grid-template-columns: 40px 1fr; gap: 2px 14px; }
.a-step > i { grid-row: span 2; font: 700 20px/1.3 var(--mono); font-style: normal; color: var(--accent); }
.a-step h3 { margin: 0; font-size: 19px; }
.a-step p { margin: 4px 0 0; color: var(--muted); }
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 28px 0; }
.a-stat { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.a-stat strong { display: block; font: 800 34px/1 var(--sans); letter-spacing: -.02em; color: var(--accent); }
.a-stat span { display: block; margin-top: 8px; font-size: 15px; color: var(--muted); }
.a-compare, .a-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.a-compare-col, .a-pc-col { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.a-compare-col ul, .a-pc-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.a-compare-col li, .a-pc-col li { padding-left: 22px; position: relative; color: var(--muted); }
.a-compare-before li::before, .a-pc-cons li::before { content: '—'; position: absolute; left: 0; color: var(--muted); font-family: var(--mono); }
.a-compare-after li::before, .a-pc-pros li::before { content: '✓'; position: absolute; left: 0; color: var(--s-d); font-family: var(--mono); }
.a-compare-before .a-compare-title, .a-pc-cons .a-pc-title { color: var(--muted); }
.a-quote { margin: 32px 0; padding: 0 0 0 22px; box-shadow: inset 2px 0 0 var(--accent); }
.a-quote blockquote { margin: 0; font-size: 22px; line-height: 1.4; letter-spacing: -.01em; }
.a-quote figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }
.a-quote figcaption b { color: var(--text); font-weight: 500; }
.a-faq { margin: 32px 0; }
.a-faq-item { border-top: 1px solid var(--line); padding: 14px 0; }
.a-faq-item:last-child { border-bottom: 1px solid var(--line); }
.a-faq-item summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.a-faq-item summary::-webkit-details-marker { display: none; }
.a-faq-mark { font-family: var(--mono); color: var(--accent); }
.a-faq-answer { margin-top: 10px; color: var(--muted); }
.a-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.a-cta-title { margin: 0; color: var(--text); font: 700 20px var(--sans); }
.a-cta-text { margin: 6px 0 0; color: var(--muted); }
.a-cta .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: var(--radius); text-decoration: none; transition: background-color .15s ease-out; }
.a-cta .btn:hover { background: #9ff0c1; }
.a-cta .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.post-body hr, .post-body .a-divider { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
@media (max-width: 639px) { .a-compare, .a-proscons { grid-template-columns: 1fr; } }

.post h1 { font-size: clamp(34px, 4vw, 58px); max-width: 22ch; }
.a-quote figcaption span { display: flex; flex-wrap: wrap; gap: 0 8px; }
.a-quote figcaption i { font-style: normal; }
.a-quote figcaption i::before { content: '· '; color: var(--dim); }
.a-code { margin: 28px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #1b1e23; }
.a-code-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 16px; border-bottom: 1px solid var(--line); font: 400 14px var(--mono); color: var(--muted); }
.a-code-copy { min-height: 32px; padding: 4px 10px; font: 400 14px var(--mono); color: var(--accent); background: none; border: 0; border-radius: var(--radius); cursor: pointer; transition: background-color .15s ease-out; }
.a-code-copy:hover { background: #262a31; }
.post-body .a-code pre { margin: 0; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.post-body figure img { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgb(12 13 16 / .92); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: var(--radius); }

.post-main > .posts, .post-more { max-width: 68ch; }
.post-main > .posts a { grid-template-columns: 9em 1fr; padding: 20px 0; }
.post-main > .posts h3 { font-size: 20px; }
.a-faq-mark::before { content: '+'; }
.a-faq-item[open] .a-faq-mark::before { content: '−'; }
.a-faq-item summary { min-height: 24px; }
@media (max-width: 639px) { .post-main > .posts a { grid-template-columns: 1fr; gap: 6px; } }

.post .wrap { padding-bottom: 40px; }
/* the Blog node on a phone: date over title, smaller titles, so three posts fit the card */
@media (max-width: 639px) {
  .wcard .posts a { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .wcard .posts time { font-size: 13px; }
  .wcard .posts h3 { font-size: 17px; line-height: 1.3; }
  .wcard .wmore { margin-top: 12px; }
  .wcard .posts li:nth-child(n+3) { display: none; } /* the card is one screen tall: two posts and «All posts» */
}
