:root {
  --bg: oklch(0.2 0 0);
  --bg-deep: oklch(0.115 0 0);
  --surface: oklch(0.155 0 0);
  --raise: oklch(0.235 0 0);
  --ink: oklch(0.95 0.008 90);
  --dim: oklch(0.95 0.008 90 / 0.58);
  --line: oklch(0.95 0.008 90 / 0.14);
  --accent: oklch(0.56 0.21 27);
  --accent-soft: oklch(0.56 0.21 27 / 0.18);
  --cut: oklch(0.14 0 0);
  --sans: "Roboto", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  height: 100dvh;
}

/* ---------- tree ---------- */
.stage {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 46%, oklch(0.245 0 0), oklch(0.1 0 0) 92%);
}
#tree { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
#tree.dragging { cursor: grabbing; }

.ring { fill: none; stroke: oklch(1 0 0 / 0.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.edge { stroke: oklch(1 0 0 / 0.14); stroke-width: 2; transition: stroke 300ms ease-out; }
.edge.lit { stroke: var(--accent); stroke-width: 3; }
/* from a branch's outermost skill out to the branch name */
.spoke { stroke: oklch(1 0 0 / 0.36); stroke-width: 1.5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.branch-name {
  font: 300 30px var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--ink);
  paint-order: stroke; stroke: oklch(0.12 0 0); stroke-width: 8px; stroke-linejoin: round;
}

.node { cursor: pointer; outline: none; }
.node .hit { fill: transparent; }
.node .sel { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; opacity: 0; transition: opacity 150ms ease-out; }
.node.selected .sel { opacity: 1; }
.node:focus-visible .sel { opacity: 1; stroke-dasharray: 5 5; }
.node .shape { transform-box: fill-box; transform-origin: center; transition: transform 160ms ease-out; }
@media (hover: hover) { .node:hover .shape { transform: scale(1.08); } }
.node:active .shape { transform: scale(0.97); }

.node text {
  font: 400 19px var(--sans);
  fill: var(--dim);
  paint-order: stroke; stroke: oklch(0.13 0 0); stroke-width: 6px; stroke-linejoin: round;
}
.node.core text { font-weight: 500; font-size: 21px; }
.node.ready text, .node.done text, .node.selected text { fill: var(--ink); }
#tree.far .node:not(.core):not(.selected) text { display: none; }
#tree.very-far .node:not(.selected) text { display: none; }

/* ---------- tokens ----------
   A token is a black hand-cut frame, a coloured field with scratches, and a white glyph.
   Diamonds are school skills, hexagons are skills school does not teach.
   Every unlocked skill has the same purple field. The grade is the chain around it: bronze 6-7,
   silver 8-9, diamond 10, no chain for a skill with no grade.
   The stars above it are the tutor's verdict: none for minus, one for regular, two for plus. */
.s-locked-in { stop-color: oklch(0.215 0 0); }
.s-locked-out { stop-color: oklch(0.13 0 0); }
.s-ready-in { stop-color: oklch(0.47 0.012 255); }
.s-ready-out { stop-color: oklch(0.2 0.008 255); }
.s-start-in { stop-color: oklch(0.6 0.21 28); }
.s-start-out { stop-color: oklch(0.24 0.1 25); }
.s-done-in { stop-color: oklch(0.53 0.18 305); }
.s-done-out { stop-color: oklch(0.19 0.09 300); }

.tk-frame { fill: oklch(0.07 0 0); stroke: oklch(1 0 0 / 0.1); stroke-width: 1; stroke-linejoin: round; }
.tk-ready .tk-frame { stroke: oklch(0.95 0.008 90 / 0.6); stroke-width: 1.25; }

/* The chain: a dark back, the metal, and a shine. Bronze is dull, with the shine along the middle
   of each link. Silver is polished: the shine sits on the lit side, with two glints, and three links that stand up at the top as a small crown. Diamond is
   cut stones and platinum bars set with small stones, a large stone on every corner, a faint glow
   and glints that twinkle. */
.tk-chain path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ch-back { stroke: oklch(0.07 0 0); }
.ch-bronze .ch-metal { stroke: oklch(0.56 0.11 50); }
.ch-bronze .ch-shine { stroke: oklch(0.76 0.1 62); }
.ch-silver .ch-metal { stroke: oklch(0.68 0.016 255); }
.ch-silver .ch-shade { stroke: oklch(0.4 0.022 260); }
.ch-silver .ch-shine { stroke: oklch(1 0 0); }
.ch-diamond .ch-metal { stroke: oklch(0.62 0.035 245); }
.ch-diamond .ch-pave { stroke: oklch(1 0 0); }
.ch-glow { fill: none; stroke: oklch(0.8 0.13 215); stroke-linejoin: round; opacity: 0.2; }
.ch-glow.far { opacity: 0.08; }
.tk-chain .ch-gem { fill: oklch(0.43 0.15 255); stroke: oklch(0.07 0 0); paint-order: stroke; }
.tk-chain .ch-f3 { fill: oklch(0.68 0.14 290); }
.tk-chain .ch-f2 { fill: oklch(0.8 0.11 215); }
.tk-chain .ch-f1 { fill: oklch(0.97 0.03 200); }
.tk-chain .ch-table { fill: oklch(1 0 0 / 0.62); }
.ch-glint { fill: oklch(1 0 0); pointer-events: none; }
.ch-diamond .ch-glint { transform-box: fill-box; transform-origin: center; animation: twinkle 3600ms ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.55); } 50% { opacity: 1; transform: scale(1); } }
.tk-cut { stroke: oklch(0 0 0 / 0.32); stroke-width: 0.8; stroke-linecap: round; }
.tk-cut.lite { stroke: oklch(1 0 0 / 0.16); }

/* Glyphs and the lock are ink: filled outlines made in icons.js. .k is a shape or line carved out. */
.tk-glyph, .tk-lock { fill: var(--ink); stroke: none; }
.tk-glyph .k, .tk-lock .k { fill: var(--cut); }
.tk-locked .tk-glyph { opacity: 0.2; }
.tk-ready .tk-glyph { opacity: 0.88; }

/* Not unlocked yet: a lock over the glyph, with the glyph faint under it. The dark edge keeps the
   lock apart from the lines below. */
.tk-lock { stroke: oklch(0.07 0 0 / 0.8); stroke-width: 2.4; stroke-linejoin: round; paint-order: stroke; }
.tk-lock .k { stroke: none; }
.tk-shut.tk-locked .tk-glyph { opacity: 0.22; }
.tk-shut.tk-locked .tk-lock { opacity: 0.62; }
.tk-shut.tk-ready .tk-glyph { opacity: 0.45; }

/* Can be unlocked next: a red outline on the frame that breathes slowly. Only opacity moves.
   With reduced motion the rule at the end of this file stops it, and the outline stays lit. */
.tk-ring { pointer-events: none; animation: ready 2600ms ease-in-out infinite; }
.tk-ring-line { fill: none; stroke: var(--accent); stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tk-ring-glow { fill: none; stroke: var(--accent); stroke-linejoin: round; opacity: 0.3; }
@keyframes ready { 0%, 100% { opacity: 0.28; } 50% { opacity: 1; } }

.tk-minus .tk-glyph { opacity: 0.55; }
/* The tutor's stars. Gold with a dark edge, so they stand off the frame and the page. */
.tk-star { fill: oklch(0.86 0.15 88); stroke: oklch(0.07 0 0); stroke-linejoin: round; paint-order: stroke; }

.pulse {
  fill: none; stroke: var(--ink); stroke-width: 2; pointer-events: none;
  transform-box: fill-box; transform-origin: center;
  animation: pulse 700ms ease-out forwards;
}
@keyframes pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.8); opacity: 0; } }

/* ---------- buttons ---------- */
.zoom { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 6px; }
.zoom button, .btn {
  font: 500 15px var(--sans);
  color: var(--ink);
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 40px; height: 40px; padding: 0 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease-out, border-color 150ms ease-out;
}
@media (hover: hover) { .zoom button:hover, .btn:hover:not(:disabled) { border-color: var(--dim); } }
.zoom button:active, .btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: oklch(0.98 0 0); padding: 0 20px; }
.btn:disabled { opacity: 0.45; cursor: default; }
:is(.btn, .zoom button, input):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- panel ---------- */
#panel {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 28px 28px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#panel > .view { animation: in 200ms ease-out; }
@keyframes in { from { transform: translateY(6px); } }
h1, h2 { font-family: var(--sans); margin: 0; }
h1 { font-weight: 300; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: 0.05em; text-transform: uppercase; }
h2 { font-weight: 500; font-size: 26px; line-height: 1.15; }
h3 { font: 500 16px/1.3 var(--sans); margin: 24px 0 4px; }
p { margin: 0; max-width: 60ch; }
.meta { color: var(--dim); margin-top: 6px; }
.status { margin-top: 16px; }
.status.done { font-weight: 500; }
.verdict { margin-top: 6px; color: var(--dim); }
.lede { margin-top: 14px; }
.ask {
  margin-top: 6px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: var(--bg-deep);
  border-radius: 0 6px 6px 0;
}
.row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.links { list-style: none; margin: 0; padding: 0; }
.links button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 3px 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 0.2em;
}
@media (hover: hover) { .links button:hover { text-decoration-color: var(--accent); } }

.card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
.card svg { width: 96px; height: 96px; display: block; overflow: visible; }

.legend { list-style: none; margin: 6px 0 0; padding: 0; }
.legend li { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; padding: 4px 0; }
.legend svg { width: 52px; height: 52px; display: block; overflow: visible; }
.legend + p { margin-top: 8px; }
.count { font: 300 26px/1.2 var(--sans); margin-top: 18px; }
.account { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); justify-content: space-between; }
.account span { color: var(--dim); }

/* ---------- unlocking ---------- */
.unlock { margin-top: 18px; padding: 16px; background: var(--bg-deep); border-radius: 8px; }
.unlock h3 { margin-top: 0; }
.unlock input.code {
  margin-top: 12px;
  font: 600 18px/1.3 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.unlock input.code::placeholder { color: var(--dim); font-weight: 400; }
input[type="text"], input[type="password"] {
  display: block; width: 100%;
  font: 400 16px/1.4 var(--sans);
  color: var(--ink);
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
.error { color: oklch(0.8 0.13 45); margin-top: 10px; min-height: 1.5em; }
.error:empty { min-height: 0; margin-top: 0; }

/* ---------- login: black page, the helix on the left, the form on the right ---------- */
.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  background: #000;
}
.login-art { position: relative; min-height: 100dvh; overflow: hidden; }
#helix {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  color: var(--ink);
  /* helix.js reads these. Same lettering as the headings: light, upper case. It sets the size itself. */
  font-family: var(--sans);
  font-weight: 300;
  text-transform: uppercase;
}
.login-side { display: grid; align-items: center; padding: 32px 48px 32px 16px; }
.login { width: 100%; max-width: 340px; }
.login h1 { font-size: 38px; }

/* The red tree beside the name. It sprouts once when the page opens: the trunk rises, the twigs reach out,
   then a bud opens at each tip. Without motion it simply shows fully grown. */
.brand { display: flex; align-items: flex-end; gap: 14px; }
/* The words beat like a heart: a soft red wash rises through the letters, bottom to top, twice, then they
   rest for one second. One cycle is 1.672s: two beats of 0.336s each, then 1s of rest.
   The letters are filled with a gradient three times their height: ink, a red band in the middle, ink.
   Sliding it from 0% to 100% carries the band up through the letters. Both ends are plain ink, so the jump
   back between beats does not show. Without the animation the letters are plain ink. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .beat {
    --wash: oklch(0.74 0.15 27);   /* the accent red, lightened, so the wash stays soft on the pale letters */
    background-image: linear-gradient(to top, var(--ink) 36%, var(--wash) 50%, var(--ink) 64%);
    background-size: 100% 300%;
    background-position: 0 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: beat 1.672s linear infinite;
  }
}
@keyframes beat {
  0% { background-position: 0 0; }
  20.1% { background-position: 0 100%; }
  20.11% { background-position: 0 0; }
  40.2%, 100% { background-position: 0 100%; }
}
.sprout { width: 0.95em; height: 1.2em; flex: none; margin-bottom: 0.08em; overflow: visible; }
.sprout .grow {
  fill: none; stroke: var(--accent); stroke-width: 5.6; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: sprout-grow 2.4s cubic-bezier(0.3, 0.6, 0.3, 1) both;
}
.sprout .bud {
  fill: var(--accent);
  transform-box: fill-box; transform-origin: center;
  animation: sprout-bud 0.9s ease-out both;
}
.sprout .trunk { animation-delay: 0.5s; }
.sprout .twig-right { animation-duration: 1.5s; animation-delay: 1.5s; }
.sprout .twig-left { animation-duration: 1.5s; animation-delay: 2.1s; }
.sprout .bud-right { animation-delay: 2.8s; }
.sprout .bud-top { animation-delay: 2.7s; }
.sprout .bud-left { animation-delay: 3.4s; }
@keyframes sprout-grow {
  from { stroke-dashoffset: 1; opacity: 0; }
  6% { opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes sprout-bud {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.login .lede { color: var(--dim); margin-top: 10px; }
.login label { display: block; font-weight: 500; margin: 22px 0 6px; }
.login input { background: oklch(0.15 0 0); height: 46px; }
.login .btn { width: 100%; height: 46px; margin-top: 26px; font-size: 16px; }
.login .meta { font-size: 15px; margin-top: 18px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* A link in running text: red and underlined. */
.text-link { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; }
@media (hover: hover) { .text-link:hover { text-decoration-thickness: 2px; } }
.text-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

/* ---------- registration: one field at a time ---------- */
.progress { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.progress li { font-size: 13px; color: var(--dim); transition: color 1400ms cubic-bezier(0.45, 0, 0.25, 1); }
.progress .bar { display: block; height: 3px; margin-bottom: 7px; border-radius: 2px; background: var(--line); overflow: hidden; }
/* register.js paints the stepper when the new field starts to fade in, so the fill runs with the fade-in. */
.progress .fill {
  display: block; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1400ms cubic-bezier(0.45, 0, 0.25, 1), background-color 1400ms cubic-bezier(0.45, 0, 0.25, 1);
}
.progress li.done .fill { background: var(--dim); transform: scaleX(1); }
.progress li[aria-current] { color: var(--ink); font-weight: 500; }
/* A step's name stays hidden until he reaches that step. register.js adds .seen then, and never takes it off. */
.progress .name { opacity: 0; visibility: hidden; transition: opacity 1400ms cubic-bezier(0.45, 0, 0.25, 1); }
.progress li.seen .name { opacity: 1; visibility: visible; }
.progress li[aria-current] .fill { transform: scaleX(1); }

/* The steps sit on top of each other. The one on screen is .is-on, the one leaving is .is-off.
   Two beats, one after the other: the submitted field swells a little and dissolves, as if you walked past it.
   Only when it is gone does register.js put .is-on on the next one, which starts small and faint and slowly
   grows clear, like walking up to something in the dark. Going back runs the other way.
   .is-off lasts OUT_MS in register.js. */
.steps { display: grid; }
.step {
  grid-area: 1 / 1; min-width: 0; pointer-events: none;
  opacity: 0; transform: scale(0.92); transform-origin: 50% 40%;
}
.steps.back .step { transform: scale(1.05); }
.steps .step.is-on {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity 1400ms cubic-bezier(0.45, 0, 0.25, 1), transform 1600ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.steps .step.is-off {
  opacity: 0; transform: scale(1.05);
  transition: opacity 650ms cubic-bezier(0.4, 0, 0.8, 0.6), transform 650ms cubic-bezier(0.4, 0, 0.8, 0.6);
}
.steps.back .step.is-off { transform: scale(0.92); }
.hint { color: var(--dim); font-size: 14px; margin-top: 8px; }
.step-buttons { display: flex; gap: 10px; margin-top: 24px; }
.login .step-buttons .btn { margin-top: 0; }
.step-buttons #back { width: auto; flex: 0 0 auto; padding: 0 18px; }
.step-buttons #back.is-hidden { display: none; }
.step-buttons #next { flex: 1 1 auto; }

/* ---------- log out: always at the top left of the tree page ---------- */
.logout {
  position: fixed; z-index: 10;
  top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left));
  background: oklch(0.235 0 0 / 0.88);
}

/* ---------- top right of the tree: All skills, and the button that folds the panel ---------- */
.corner {
  position: absolute; z-index: 5; display: flex; gap: 6px;
  top: max(12px, env(safe-area-inset-top)); right: 12px;
}
.corner .btn { background: oklch(0.235 0 0 / 0.88); }
.fold { padding: 0; width: 40px; display: grid; place-items: center; }
.fold svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 240ms ease-in-out;
}
.is-folded .fold svg { transform: rotate(180deg); }

/* The panel slides out to the right, then its column closes (app.js adds .folded). Opening runs the other way. */
.app { overflow: hidden; }
#panel { transition: transform 360ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 360ms ease-out; }
#panel.away { transform: translateX(100%); opacity: 0; transition-duration: 240ms; transition-timing-function: ease-in; }
.app.folded { grid-template-columns: minmax(0, 1fr); }
.app.folded #panel { display: none; }

/* ---------- the welcome after registration (intro.js) ----------
   Dark, then the two lines come up one after the other, stay a while and go. The dark lifts and the tree
   rises ring by ring from the centre (.rise-0 to .rise-7, set in app.js), then the buttons and the panel.
   The last step ends at 14.2 s. intro.js clears it all at END_MS. */
.intro { display: none; }
.intro-on body { background: oklch(0.1 0 0); }   /* the panel's column stays dark until the panel comes up */
.intro-on .intro {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center; padding: 24px;
  background: #000;
  animation: intro-out 1600ms ease-in-out 9000ms forwards;
}
.intro-words { max-width: 36rem; text-align: center; }
.intro-line { max-width: none; }
.intro-line.one { font: 300 clamp(26px, 3.4vw, 40px)/1.2 var(--sans); }
.intro-line.two { font: 400 clamp(17px, 1.7vw, 20px)/1.5 var(--sans); color: var(--dim); max-width: 32ch; margin: 20px auto 0; }
.intro-line, .intro-skip {
  animation: intro-in 1800ms cubic-bezier(0.45, 0, 0.25, 1) 700ms both, intro-out 1200ms ease-in 8000ms forwards;
}
.intro-line.two { animation-delay: 2400ms, 8000ms; }
.intro-skip {
  position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0;
  font: 400 16px var(--sans); color: var(--dim); background: none; border: 0; padding: 10px 16px; cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) { .intro-skip:hover { color: var(--ink); } }
.intro-skip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.intro-on .rise { animation: intro-in 1300ms ease-out both; }
.intro-on .rise-0 { animation-delay: 9400ms; }
.intro-on .rise-1 { animation-delay: 9850ms; }
.intro-on .rise-2 { animation-delay: 10300ms; }
.intro-on .rise-3 { animation-delay: 10750ms; }
.intro-on .rise-4 { animation-delay: 11200ms; }
.intro-on .rise-5 { animation-delay: 11650ms; }
.intro-on .rise-6 { animation-delay: 12100ms; }
.intro-on .rise-7 { animation-delay: 12600ms; }
.intro-on :is(.logout, .corner, .zoom, #panel) { animation: intro-in 1000ms ease-out 13200ms both; }

/* Skipped: everything shows at once and the dark lifts quickly. */
.intro-on.intro-skip-now :is(.rise, .logout, .corner, .zoom, #panel) { animation: none; }
.intro-on.intro-skip-now .intro { animation: intro-out 400ms ease-out forwards; }

@keyframes intro-in { from { opacity: 0; } }
@keyframes intro-out { to { opacity: 0; } }

@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: 42dvh auto; }
  .login-art { min-height: 42dvh; }
  .login-side { align-items: start; justify-items: center; padding: 8px 24px 40px; }
}
.shake { animation: shake 320ms ease-in-out; }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 54dvh 46dvh; }
  #panel { border-left: 0; border-top: 1px solid var(--line); padding: 20px 16px 32px; }
  /* Here the panel sits under the tree, so it folds downwards. */
  #panel.away { transform: translateY(100%); }
  .app.folded { grid-template-rows: 100dvh; }
  .fold svg { transform: rotate(90deg); }
  .is-folded .fold svg { transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
