/* The look, third pass: a trail map at night. Loaded after every other stylesheet, so it has the last word.
   What it sets: the heading typeface, the colours of both themes, the contour-map backdrop, depth on cards and
   buttons, and all of the site's movement, including the loading screen.
   Movement follows the site's own Animations setting (html[data-anim="off"] stops it), not the computer's. */

@font-face { font-family: "Bricolage Grotesque Variable"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations"); }

:root {
  --font-display: "Bricolage Grotesque Variable", "Inter Variable", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --map: url("../img/contours.svg");
}

/* ---------- colours: pine-dark and gold; paper and amber ---------- */
html[data-theme="dark"] {
  --bg: #0b1110; --sidebar: #090e0d; --panel: #111917; --panel-2: #18221f; --field: #0d1413; --code-bg: #0d1413;
  --ink: #eef3f0; --ink-soft: #c5cfca; --muted: #879691; --faint: #586762;
  --line: #1e2a27; --line-hover: #36473f;
  --hover: rgba(226, 255, 244, .05); --selected: rgba(226, 255, 244, .085);
  --good: #5ad69a; --sheen: rgba(255, 255, 255, .04);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .35); --lift-shadow: 0 18px 34px -20px rgba(0, 0, 0, .8);
  --shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
html[data-theme="light"] {
  --bg: #f3f1ea; --sidebar: #ece9df; --panel: #fdfcf8; --panel-2: #f2efe6; --field: #ffffff; --code-bg: #ffffff;
  --ink: #141a17; --ink-soft: #2e3632; --muted: #5d6762; --faint: #949c95;
  --line: #e0dacb; --line-hover: #c5bda9;
  --hover: rgba(20, 26, 23, .045); --selected: rgba(20, 26, 23, .075);
  --sheen: rgba(255, 255, 255, .9);
  --card-shadow: 0 1px 2px rgba(50, 42, 22, .06), 0 6px 16px -10px rgba(50, 42, 22, .12); --lift-shadow: 0 18px 30px -20px rgba(50, 42, 22, .35);
  --shadow: 0 24px 54px rgba(50, 42, 22, .2);
}
html[data-theme="dark"]:not([data-accent]), html[data-theme="dark"][data-accent=""], html[data-theme="dark"][data-accent="gold"] { --accent: #f4b942; }
html[data-theme="light"]:not([data-accent]), html[data-theme="light"][data-accent=""], html[data-theme="light"][data-accent="gold"] { --accent: #9a5b06; }
html[data-theme="dark"] { --accent-ink: #1b1303; }
::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-hover) transparent; }

/* ---------- the contour map behind the top of every page ---------- */
#view { position: relative; }
#view:not(.flush)::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 620px; pointer-events: none; background: var(--ink); opacity: .06;
  -webkit-mask: var(--map) center top / max(1600px, 100%) auto no-repeat, linear-gradient(#000 15%, transparent 96%); -webkit-mask-composite: source-in;
  mask: var(--map) center top / max(1600px, 100%) auto no-repeat, linear-gradient(#000 15%, transparent 96%); mask-composite: intersect; }
#view:not(.flush)::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 460px; pointer-events: none;
  background: radial-gradient(52% 100% at 78% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%); }
html[data-theme="light"] #view:not(.flush)::before { opacity: .075; }
.page { position: relative; z-index: 1; }

/* ---------- type ---------- */
.display { font-weight: 800; font-size: calc(42px * var(--text-scale)); letter-spacing: -.036em; line-height: 1.04; margin: 10px 0 14px; }
.display.small { font-size: calc(30px * var(--text-scale)); }
h2.section { font-weight: 700; font-size: calc(22px * var(--text-scale)); letter-spacing: -.028em; }
.cp-head .name, .cp-next .where, .award-summary .stat b, .today .goal-text b { font-family: var(--font-display); }
.stat b { font-weight: 700; letter-spacing: -.035em; }
.card-head h3, .card h3 { letter-spacing: -.02em; }
.card-head h3 { font-weight: 700; font-size: 19px; }
.continue .where, .cp-next .where { font-weight: 700; font-size: 22px; letter-spacing: -.03em; }
.cp-head .name { font-weight: 700; font-size: 17px; }
.prose h1, .prose h2, .prose h3 { font-family: var(--font-display); letter-spacing: -.025em; }
.prose h2 { font-weight: 700; }
.pitch-title { font-weight: 800; letter-spacing: -.04em; }
.login-card h1 { font-weight: 700; letter-spacing: -.03em; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .09em; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 16px; height: 2px; border-radius: 1px; background: currentColor; flex: none; opacity: .8; }
.modal .eyebrow::before, .login-card .eyebrow::before { display: none; }

/* ---------- header ---------- */
.site-header { background: color-mix(in srgb, var(--sidebar) 84%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
.h-brand .brand-name { font-weight: 800; font-size: 21px; letter-spacing: -.045em; }
.h-brand .brand-tile { transition: transform .35s var(--ease-spring); }
.h-brand:hover .brand-tile { transform: rotate(-8deg) scale(1.06); }
.hnav { font-weight: 550; }
.hnav.active { background: var(--selected); color: var(--ink); }
.hnav.active::after { left: 50%; right: auto; bottom: 3px; width: 14px; margin-left: -7px; height: 2px; }
.sidebar { background: var(--sidebar); }

/* ---------- surfaces: a little depth ---------- */
.card, .list { box-shadow: inset 0 1px 0 var(--sheen), var(--card-shadow); }
.card.link { transition: transform .26s var(--ease-out), border-color .18s, box-shadow .26s, background-color .18s; }
.card.link:hover, html[data-theme="light"] .card.link:hover { transform: translateY(-3px); background: var(--panel);
  border-color: color-mix(in srgb, var(--cc, var(--accent)) 50%, var(--line)); box-shadow: inset 0 1px 0 var(--sheen), var(--lift-shadow); }
.card.link:active { transform: translateY(-1px); }
.course-panel, .course-card { border-top: 2px solid color-mix(in srgb, var(--cc, var(--accent)) 75%, var(--line)); }
.course-card.planned { border-top-color: var(--line); }
.today { background: color-mix(in srgb, var(--panel) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qc-icon, .cp-head .glyph, .course-card .glyph { transition: transform .3s var(--ease-spring); }
.card.link:hover .qc-icon, .cp-head:hover .glyph, .course-card:hover .glyph { transform: rotate(-6deg) scale(1.08); }

/* ---------- buttons ---------- */
.btn { font-weight: 600; background: var(--panel-2); transition: transform .18s var(--ease-out), background-color .15s, border-color .15s, box-shadow .22s, color .15s; }
.btn:hover { transform: translateY(-1px); border-color: var(--line-hover); }
.btn:active { transform: translateY(0) scale(.975); transition-duration: .06s; }
.btn.ghost { background: none; }
.btn.ghost:hover { transform: none; }
.btn.primary, html[data-theme="light"] .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent)); border-color: color-mix(in srgb, var(--accent) 78%, #000);
  color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 1px 2px rgba(0, 0, 0, .3); }
.btn.primary:hover { filter: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.icon-btn svg { transition: transform .2s var(--ease-spring); }
.icon-btn:hover svg { transform: scale(1.12); }

/* ---------- progress ---------- */
.bar { height: 6px; border-radius: 3px; }
.bar > i { position: relative; overflow: hidden; border-radius: 3px; background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--accent)) 70%, var(--bg)), var(--c, var(--accent))); animation: bar-in 1s var(--ease-out) .15s backwards; }
.bar > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%); opacity: 0; animation: sheen 1.3s 1.05s ease-out; }
@keyframes sheen { from { transform: translateX(-100%); opacity: 1; } to { transform: translateX(100%); opacity: 1; } }
.ring .fill { animation: ring-in 1.2s var(--ease-out) .15s backwards; }
.h-streak svg { transform-origin: 50% 90%; animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.1, 1.16) rotate(-3deg); } 60% { transform: scale(.96, 1.05) rotate(3deg); } }

/* ---------- arriving on a page ---------- */
.page.fade-in { animation: pageIn .5s var(--ease-out) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } }
.page.fade-in > .today { animation: rise .5s var(--ease-out) .06s backwards; }
.page.fade-in > .home-panels > * { animation: rise .55s var(--ease-out) .12s backwards; }
.page.fade-in > .home-panels > :nth-child(2) { animation-delay: .2s; }
.page.fade-in > .home-panels > :nth-child(n+3) { animation-delay: .28s; }
.page.fade-in > .grid > *, .page.fade-in > .home-split > *, .page.fade-in > .trail > * { animation-duration: .55s; animation-timing-function: var(--ease-out); }
.page.fade-in .list > * { animation: rise .45s var(--ease-out) backwards; }
.page.fade-in .list > :nth-child(1) { animation-delay: .04s; } .page.fade-in .list > :nth-child(2) { animation-delay: .08s; } .page.fade-in .list > :nth-child(3) { animation-delay: .12s; }
.page.fade-in .list > :nth-child(4) { animation-delay: .16s; } .page.fade-in .list > :nth-child(5) { animation-delay: .2s; } .page.fade-in .list > :nth-child(6) { animation-delay: .24s; }
.page.fade-in .list > :nth-child(n+7) { animation-delay: .28s; }
.awards > * { animation: rise .45s var(--ease-out) backwards; }
.awards > :nth-child(3n+2) { animation-delay: .05s; } .awards > :nth-child(3n) { animation-delay: .1s; }
.cp-row { transition: background-color .14s, padding-left .2s var(--ease-out); }
.cp-row:hover { padding-left: 14px; }
.modal { animation: popIn .32s var(--ease-spring) backwards; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.heat i { transition: transform .15s var(--ease-out); }
.heat i:hover { transform: scale(1.5); }
#app.arriving > * { animation: appIn .9s var(--ease-out) backwards; }
@keyframes appIn { from { opacity: 0; transform: translateY(26px) scale(.985); } }

/* ---------- sign-in page ---------- */
.login-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: var(--ink); opacity: .055;
  -webkit-mask: var(--map) center / cover no-repeat; mask: var(--map) center / cover no-repeat; animation: mapDrift 60s ease-in-out infinite alternate; }
.login-page::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(48% 60% at 22% 18%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.login-page > * { position: relative; z-index: 1; }
@keyframes mapDrift { from { transform: scale(1.04) translate(-1%, -1%); } to { transform: scale(1.12) translate(1.5%, 1%); } }

/* ---------- the loading screen ----------
   Every moving part rests in its finished state and animates from somewhere else, so the screen still makes
   sense with animations switched off. --k stretches the delays and --d the durations: a reload plays the same
   scene in about a third of the time. */
.splash { --k: 1; --d: 1; position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: #0b1110; color: #eef3f0; cursor: default; overflow: hidden;
  clip-path: inset(0 0 0 0); transition: clip-path .8s cubic-bezier(.7, 0, .2, 1), visibility 0s .8s; }
.splash.quick { --k: .3; --d: .55; }
html[data-theme="light"] .splash { background: #f3f1ea; color: #141a17; }
.splash-map { position: absolute; inset: -6%; background: currentColor; opacity: .1; -webkit-mask: var(--map) center / cover no-repeat; mask: var(--map) center / cover no-repeat;
  animation: spMap calc(7s * var(--d)) cubic-bezier(.2, .6, .2, 1) backwards; }
.splash-glow { position: absolute; left: 50%; top: 44%; width: 720px; height: 720px; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(244, 185, 66, .2), rgba(244, 185, 66, .05) 55%, transparent); animation: spGlow calc(2.4s * var(--d)) calc(2.3s * var(--k)) ease-out backwards; }
.splash-stage { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .6s cubic-bezier(.7, 0, .2, 1), opacity .45s; }
.splash-cairn { width: 168px; height: 168px; overflow: visible; }
.sp-stone { transform-box: fill-box; transform-origin: 50% 100%; animation: spDrop calc(.8s * var(--d)) cubic-bezier(.35, 0, .3, 1) backwards; }
.sp-stone.s1 { animation-delay: calc(.5s * var(--k)); } .sp-stone.s2 { animation-delay: calc(1s * var(--k)); }
.sp-stone.s3 { animation-delay: calc(1.5s * var(--k)); } .sp-stone.s4 { animation-delay: calc(2s * var(--k)); }
.sp-ripple { fill: none; stroke: #f4b942; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: spRipple calc(.8s * var(--d)) ease-out; }
.sp-ripple.r1 { animation-delay: calc(.98s * var(--k)); } .sp-ripple.r2 { animation-delay: calc(1.48s * var(--k)); }
.sp-ripple.r3 { animation-delay: calc(1.98s * var(--k)); } .sp-ripple.r4 { animation-delay: calc(2.48s * var(--k)); }
.sp-wob { transform-box: fill-box; transform-origin: 50% 100%; animation: spSettle calc(1.1s * var(--d)) calc(2.5s * var(--k)) ease-in-out, spBreathe 3.4s calc(4.2s * var(--k)) ease-in-out infinite; }
.sp-shadow { fill: #000; opacity: .32; transform-box: fill-box; transform-origin: 50% 50%; animation: spShadow calc(2.2s * var(--d)) calc(.4s * var(--k)) ease-out backwards; }
html[data-theme="light"] .sp-shadow { opacity: .14; }
.sp-ring { fill: none; stroke: #f4b942; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: spRing calc(1.3s * var(--d)) calc(2.55s * var(--k)) ease-out; }
.sp-spark { fill: #ffe9b8; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: spSpark calc(1.1s * var(--d)) calc(2.55s * var(--k)) ease-out; }
html[data-theme="light"] .sp-spark { fill: #c98a14; }
.sp-spark.k1 { --dx: -52px; --dy: -38px; } .sp-spark.k2 { --dx: 50px; --dy: -44px; } .sp-spark.k3 { --dx: -24px; --dy: -66px; }
.sp-spark.k4 { --dx: 30px; --dy: -70px; } .sp-spark.k5 { --dx: 70px; --dy: -10px; } .sp-spark.k6 { --dx: -72px; --dy: -8px; }
.splash-word { display: flex; margin-top: 26px; font-family: var(--font-display); font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -.05em; overflow: hidden; padding: 0 6px 8px; }
.splash-word span { display: inline-block; animation: spLetter calc(.8s * var(--d)) var(--ease-out) backwards; }
.splash-word span:nth-child(1) { animation-delay: calc(2.8s * var(--k)); } .splash-word span:nth-child(2) { animation-delay: calc(2.88s * var(--k)); }
.splash-word span:nth-child(3) { animation-delay: calc(2.96s * var(--k)); } .splash-word span:nth-child(4) { animation-delay: calc(3.04s * var(--k)); }
.splash-word span:nth-child(5) { animation-delay: calc(3.12s * var(--k)); }
.splash-tag { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .62; animation: spTag calc(1s * var(--d)) calc(3.5s * var(--k)) var(--ease-out) backwards; }
.splash-bar { width: 180px; height: 3px; margin-top: 34px; border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; animation: spFade calc(.6s * var(--d)) calc(.9s * var(--k)) ease-out backwards; }
.splash-bar i { display: block; height: 100%; width: 100%; border-radius: 2px; background: linear-gradient(90deg, #d99520, #f4b942, #ffe1a0); transform-origin: 0 50%; animation: spFill calc(4s * var(--k)) calc(1.1s * var(--k)) cubic-bezier(.4, 0, .2, 1) backwards; }
.splash-steps { position: relative; height: 18px; width: 260px; margin-top: 12px; font-size: 12.5px; text-align: center; }
.splash-steps span { position: absolute; inset: 0; opacity: 0; color: color-mix(in srgb, currentColor 58%, transparent); }
.splash-steps span:nth-child(1) { animation: spStep calc(1.55s * var(--k)) calc(1s * var(--k)) ease-out; }
.splash-steps span:nth-child(2) { animation: spStep calc(1.45s * var(--k)) calc(2.5s * var(--k)) ease-out; }
.splash-steps span:nth-child(3) { opacity: 1; animation: spStepIn calc(.5s * var(--d)) calc(3.9s * var(--k)) ease-out backwards; }
.splash-skip { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; font-size: 12px; opacity: .38; animation: spFade .8s 1.4s backwards; }
.splash.quick .splash-skip { display: none; }
.splash.out { pointer-events: none; clip-path: inset(0 0 100% 0); visibility: hidden; }
.splash.out .splash-stage { transform: translateY(-46px) scale(1.05); opacity: 0; }
html[data-anim="off"] .splash.out { clip-path: none; }
@keyframes spMap { from { opacity: 0; transform: scale(1.16) rotate(-2deg); } 30% { opacity: .1; } }
@keyframes spGlow { from { opacity: 0; scale: .6; } }
@keyframes spDrop { 0% { opacity: 0; transform: translateY(-300px) rotate(-9deg); } 12% { opacity: 1; } 58% { transform: translateY(0) scale(1.1, .82); } 76% { transform: translateY(-9px) scale(.97, 1.05); } 100% { transform: none; } }
@keyframes spRipple { 0% { opacity: .6; transform: scale(.25); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes spSettle { 0%, 100% { transform: rotate(0); } 22% { transform: rotate(-3.2deg); } 48% { transform: rotate(2.2deg); } 74% { transform: rotate(-1deg); } }
@keyframes spBreathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes spShadow { from { opacity: 0; transform: scaleX(.2); } }
@keyframes spRing { 0% { opacity: .6; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes spSpark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 22% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
@keyframes spLetter { from { opacity: 0; transform: translateY(110%) rotate(8deg); } }
@keyframes spTag { from { opacity: 0; letter-spacing: .5em; } }
@keyframes spFade { from { opacity: 0; } }
@keyframes spFill { 0% { transform: scaleX(0); } 22% { transform: scaleX(.2); } 36% { transform: scaleX(.34); } 58% { transform: scaleX(.62); } 70% { transform: scaleX(.7); } 100% { transform: scaleX(1); } }
@keyframes spStep { 0% { opacity: 0; transform: translateY(7px); } 14%, 84% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-7px); } }
@keyframes spStepIn { from { opacity: 0; transform: translateY(7px); } }
@media (max-width: 520px) { .splash-cairn { width: 132px; height: 132px; } .splash-word { font-size: 42px; } }

/* ---------- phones: the header has to fit a menu button, the logo, two links and three buttons ---------- */
@media (max-width: 460px) {
  .site-header { gap: 2px; padding: 0 8px; }
  .h-brand { margin: 0 4px 0 0; }
  .hnav { padding: 7px 7px; font-size: 13.5px; }
  .h-nav { min-width: 0; overflow: hidden; }
  .display { font-size: calc(32px * var(--text-scale)); }
}

/* ---------- settings: code style ---------- */
.style-demo { margin: 4px 0 6px; }
.style-preview { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px); background: var(--code-bg, var(--field)); font-size: 13px; line-height: 1.55; overflow: auto; tab-size: 4; }
.style-preview code { font-family: var(--font-mono); white-space: pre; }
.setting.stack { flex-direction: column; align-items: stretch; gap: 12px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-chip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-xs, 4px); background: var(--field); color: var(--muted); font-size: 13px; cursor: pointer; text-align: left;
  transition: border-color .18s, color .18s, background .18s, transform .18s var(--ease, ease); }
.theme-chip:hover { color: var(--ink); border-color: var(--line-2, var(--muted)); transform: translateY(-1px); }
.theme-chip.on { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--field)); }
.theme-chip .dots { display: inline-flex; gap: 3px; flex: none; }
.theme-chip .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.seg { flex-wrap: wrap; }

/* ---------- home: small on purpose ---------- */
.page.home { padding-top: 56px; }
.home-today { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.home-today b { color: var(--ink); font-weight: 600; }
.home-today a { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; transition: color .18s, border-color .18s; }
.home-today a:hover { color: var(--ink); border-bottom-color: var(--muted); }
.home-today span { display: inline-flex; align-items: center; gap: 6px; }
.home-today svg { width: 14px; height: 14px; color: var(--accent); }
.home-today .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.home-next { margin-top: 30px; padding: 30px 32px 26px; border-top: 2px solid color-mix(in srgb, var(--cc, var(--accent)) 75%, var(--line)); display: flex; flex-direction: column; gap: 10px; }
.home-next h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: calc(28px * var(--text-scale, 1)); line-height: 1.15; letter-spacing: -.025em; font-weight: 650; }
.home-next p { margin: 0 0 10px; font-size: 14px; }
.home-next .btn.big { padding: 11px 22px; font-size: 15px; }
.home-progress { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-progress .bar { flex: 1; }
h2.section.small { font-size: calc(15px * var(--text-scale, 1)); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; color: var(--muted); margin: 38px 0 10px; }
.home-courses { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px); background: color-mix(in srgb, var(--panel) 70%, transparent); overflow: hidden; }
.home-course { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(60px, 1fr) 44px 16px; align-items: center; gap: 14px; padding: 12px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line);
  transition: background-color .18s, padding-left .22s var(--ease-out, ease); }
.home-course:last-child { border-bottom: 0; }
.home-course:hover { background: var(--hover); text-decoration: none; padding-left: 20px; }
.home-course .glyph { min-width: 34px; height: 26px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--radius-xs, 4px); font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--cc, var(--accent)) 16%, var(--panel-2)); color: color-mix(in srgb, var(--cc, var(--accent)) 80%, var(--ink)); }
.home-course .name { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-course .pct { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.home-course > svg { width: 15px; height: 15px; color: var(--faint); transition: transform .22s var(--ease-out, ease), color .18s; }
.home-course:hover > svg { transform: translateX(3px); color: var(--accent); }
.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 30px; }
.home-links a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px);
  color: inherit; text-decoration: none; transition: border-color .18s, background-color .18s, transform .22s var(--ease-out, ease); }
.home-links a:hover { border-color: var(--line-hover, var(--muted)); background: var(--hover); transform: translateY(-2px); text-decoration: none; }
.home-links svg { grid-row: 1 / 3; width: 18px; height: 18px; color: var(--muted); transition: color .18s, transform .3s var(--ease-spring, ease); }
.home-links a:hover svg { color: var(--accent); transform: scale(1.12) rotate(-4deg); }
.home-links span { font-size: 14px; font-weight: 600; }
.home-links small { font-size: 12px; color: var(--muted); }
.page.fade-in > .home-today { animation: rise .5s var(--ease-out) .05s backwards; }
.page.fade-in > .home-next { animation: rise .55s var(--ease-out) .12s backwards; }
.page.fade-in > .home-courses, .page.fade-in > h2.section.small { animation: rise .55s var(--ease-out) .2s backwards; }
.page.fade-in > .home-links { animation: rise .55s var(--ease-out) .26s backwards; }
.award-activity { margin-top: 40px; }
@media (max-width: 620px) { .home-course { grid-template-columns: auto minmax(0, 1fr) 44px 16px; } .home-course .bar { display: none; } .home-next { padding: 22px 20px; } }

/* ---------- menus and small things ----------
   Short, soft movement on the parts that open, close and respond: menus, the search box, toggles, tabs, rows.
   All of it stops with the site's Animations setting (html[data-anim="off"] above). */
@keyframes menuPop { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes menuItemIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes veilIn { from { opacity: 0; } }
@keyframes paletteIn { from { opacity: 0; transform: translateY(-16px) scale(.975); } }
@keyframes softIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes tabLine { from { transform: scaleX(0); } }

.menu, .user-menu, .tracker { animation: menuPop .22s var(--ease-out) backwards; transform-origin: 85% 0; }
.menu { transform-origin: 15% 0; }
.menu > *, .user-menu > * { animation: menuItemIn .28s var(--ease-out) backwards; }
.menu > :nth-child(2), .user-menu > :nth-child(2) { animation-delay: .02s; }
.menu > :nth-child(3), .user-menu > :nth-child(3) { animation-delay: .04s; }
.menu > :nth-child(4), .user-menu > :nth-child(4) { animation-delay: .06s; }
.menu > :nth-child(5), .user-menu > :nth-child(5) { animation-delay: .08s; }
.menu > :nth-child(6), .user-menu > :nth-child(6) { animation-delay: .1s; }
.menu > :nth-child(7), .user-menu > :nth-child(7) { animation-delay: .115s; }
.menu > :nth-child(8), .user-menu > :nth-child(8) { animation-delay: .13s; }
.menu > :nth-child(n+9), .user-menu > :nth-child(n+9) { animation-delay: .145s; }
.menu-item, .user-menu a, .user-menu button { transition: background-color .16s, color .16s; }
.menu-item svg, .user-menu svg { transition: transform .22s var(--ease-spring), color .16s; }
.menu-item:hover svg, .user-menu a:hover svg, .user-menu button:hover svg { transform: scale(1.14); color: var(--accent); }
.menu-item.danger:hover svg { color: var(--bad); }

.overlay { animation: veilIn .2s ease-out; }
.palette { animation: paletteIn .26s var(--ease-out) backwards; }
.palette-item { transition: background-color .14s; }
.palette-item svg { transition: transform .2s var(--ease-spring), color .14s; }
.palette-item.on svg { transform: scale(1.12); color: var(--accent); }
.palette-list > * { animation: softIn .22s var(--ease-out) backwards; }

/* toggles, choices and tabs */
.switch i { transition: background-color .22s, border-color .22s; }
.switch i::after { transition: transform .3s var(--ease-spring), background-color .2s, width .18s; }
.switch:active i::after { width: 20px; }
.switch input:checked:active + i::after { transform: translateX(14px); }
.seg button { transition: background-color .2s, color .2s, box-shadow .2s, transform .14s var(--ease-out); }
.seg button:active { transform: scale(.95); }
.swatch { transition: transform .22s var(--ease-spring), box-shadow .2s; }
.swatch:hover { transform: scale(1.12); }
.tabs button, .pane-tabs button.tab { transition: color .18s, border-color .22s, background-color .18s; }
.tabs button.on { animation: none; }
.ide-tab { transition: color .16s, background-color .16s; }
.ide-tab.on::after { animation: tabLine .24s var(--ease-out) backwards; transform-origin: 0 50%; }
.ide-tab .x { transition: opacity .16s, background-color .16s, transform .2s var(--ease-spring); }
.ide-tab .x:hover { transform: rotate(90deg); }

/* rows, links and fields */
.nav-item { transition: background-color .16s, color .16s, padding-left .2s var(--ease-out); }
.nav-item:hover { padding-left: 13px; }
.nav-item.active::before { animation: tabLine .3s var(--ease-out) backwards; transform-origin: 50% 50%; }
.list-row { transition: background-color .16s, padding-left .2s var(--ease-out); }
.list-row:hover { padding-left: 20px; }
.list-row > svg:last-child, .cp-head > svg, .course-card .arrow { transition: transform .22s var(--ease-out), color .16s; }
.list-row:hover > svg:last-child { transform: translateX(3px); }
input, select, textarea { transition: border-color .18s, box-shadow .22s, background-color .18s; }
.chip { transition: background-color .18s, color .18s, border-color .18s, transform .18s var(--ease-out); }
.codeblock-head .btn { transition: opacity .2s, transform .18s var(--ease-out), background-color .15s, color .15s; }
.codeblock .codeblock-head .btn.ghost { opacity: .55; }
.codeblock:hover .codeblock-head .btn.ghost, .codeblock-head .btn.ghost:focus-visible { opacity: 1; }
.setting { transition: background-color .2s; }
details > summary { transition: color .16s; }
details[open] > :not(summary) { animation: softIn .28s var(--ease-out) backwards; }
kbd { transition: transform .14s var(--ease-out), box-shadow .14s; }
.h-user svg:last-child { transition: transform .25s var(--ease-out); }
.h-user:hover svg:last-child { transform: translateY(2px); }
.hnav { transition: color .18s, background-color .18s; }
.ring circle + circle, .bar > i { transition: stroke-dashoffset .7s var(--ease-out), width .7s var(--ease-out); }

/* the editor's own popups: suggestions, hovers, parameter hints, the right-click menu */
.monaco-editor .suggest-widget, .monaco-editor .parameter-hints-widget, .monaco-hover, .monaco-editor .monaco-hover { animation: softIn .16s var(--ease-out) backwards; }
.monaco-menu-container, .context-view .monaco-menu, .quick-input-widget { animation: menuPop .18s var(--ease-out) backwards; transform-origin: 20% 0; }
.monaco-editor .suggest-widget .monaco-list-row { transition: background-color .1s; }
.monaco-editor .cursor { transition-timing-function: var(--ease-out); }
.errlens-e, .errlens-w { animation: softIn .28s var(--ease-out) backwards; }
.monaco-editor .squiggly-error, .monaco-editor .squiggly-warning { animation: veilIn .25s ease-out backwards; }

/* ---------- the look, as chosen in Settings (attributes on <html>, set by applySettings and theme.js) ---------- */
html[data-uifont="system"] { --font-body: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif; --font-display: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif; }
html[data-corners="square"] { --radius: 0px; --radius-sm: 0px; --radius-xs: 0px; }
html[data-corners="round"] { --radius: 16px; --radius-sm: 11px; --radius-xs: 8px; }
html[data-corners="square"] .switch i, html[data-corners="square"] .switch i::after, html[data-corners="square"] .swatch, html[data-corners="square"] .avatar { border-radius: 0; }
html[data-backdrop="off"] #view::before { display: none; }
html[data-theme="dark"][data-contrast="high"] { --ink-soft: #e2e9e5; --muted: #b3beb9; --faint: #8a9792; --line: #36453f; --line-hover: #5b6e66; }
html[data-theme="light"][data-contrast="high"] { --ink-soft: #1b211e; --muted: #3f4843; --faint: #68716b; --line: #c2b9a3; --line-hover: #988e76; }
html[data-contrast="high"] .btn, html[data-contrast="high"] .card, html[data-contrast="high"] input, html[data-contrast="high"] textarea { border-color: var(--line-hover); }
html[data-density="compact"] .page { padding-top: 30px; padding-bottom: 72px; }
html[data-density="compact"] .card { padding: 15px 17px; }
html[data-density="compact"] .list-row { padding: 8px 14px; }
html[data-density="compact"] .setting { padding: 10px 0; gap: 16px; }
html[data-density="compact"] h2.section { margin: 30px 0 10px; }
html[data-density="compact"] .nav-item { padding: 5px 10px; }
html[data-density="compact"] .home-next { padding: 22px 24px 20px; margin-top: 22px; }
html[data-density="compact"] .home-course { padding: 9px 14px; }
html[data-density="compact"] .prose p, html[data-density="compact"] .prose ul, html[data-density="compact"] .prose ol { margin-top: .7em; margin-bottom: .7em; }
html[data-density="compact"] .prose h2 { margin-top: 1.7em; }
html[data-density="compact"] .grid { gap: 10px; }
html[data-reading="serif"] .prose { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif; font-size: calc(16.6px * var(--text-scale)); }
html[data-reading="serif"] .prose table, html[data-reading="serif"] .prose .quiz, html[data-reading="serif"] .prose .demo { font-family: var(--font-body); font-size: calc(14.5px * var(--text-scale)); }
html[data-leading="tight"] .prose { line-height: 1.52; }
html[data-leading="relaxed"] .prose { line-height: 1.95; }
html[data-codewrap="on"] .codeblock:not(.diagram) pre { white-space: pre-wrap; overflow-wrap: anywhere; }
html[data-codewrap="on"] .codeblock:not(.diagram) pre code { white-space: pre-wrap; }
html[data-links="underline"] .prose a, html[data-links="underline"] .lede a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.console-out, .console-in input { font-size: var(--term-size, 13px); }

/* ---------- settings: finding one, and a colour of your own ---------- */
.settings-tools { position: sticky; top: 0; z-index: 5; margin: 22px -12px 0; padding: 12px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.settings-find-wrap { position: relative; }
.settings-find-wrap svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
input.settings-find { width: 100%; padding: 10px 14px 10px 38px; font-size: 14.5px; }
.settings-jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.settings-jumps button { border: 1px solid var(--line); background: none; color: var(--muted); padding: 4px 10px; border-radius: var(--radius-xs); font-size: 12.5px; cursor: pointer; transition: color .16s, border-color .16s, background-color .16s, transform .16s var(--ease-out); }
.settings-jumps button:hover { color: var(--ink); border-color: var(--line-hover); background: var(--hover); transform: translateY(-1px); }
.settings-page h2.section { scroll-margin-top: 120px; }
.swatches { flex-wrap: wrap; justify-content: flex-end; }
.swatch.custom { position: relative; display: grid; place-items: center; cursor: pointer; background: var(--sw, transparent); border: 1px dashed var(--line-hover); overflow: hidden; }
.swatch.custom.on { border-style: solid; }
.swatch.custom input { position: absolute; inset: -6px; width: 200%; height: 200%; opacity: 0; cursor: pointer; }
.swatch.custom svg { width: 13px; height: 13px; color: var(--muted); pointer-events: none; }

/* ---------- catalogue: finding a course ---------- */
.catalog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 26px 0 4px; }
.catalog-tools .settings-find-wrap { flex: 1; min-width: 220px; max-width: 380px; }
.catalog-tools .seg button { padding: 5px 11px; }
.course-card.is-hidden { display: none; }

/* ---------- small notices in the header ---------- */
.h-offline { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--warn, #e8c05a) 45%, var(--line)); border-radius: var(--radius-xs); font-size: 12px; color: var(--warn, #e8c05a); white-space: nowrap; animation: softIn .3s var(--ease-out) backwards; }
.h-offline svg { width: 13px; height: 13px; }

/* ---------- what is new ---------- */
.whats-new { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; padding-right: 6px; }
.whats-new .wn-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.whats-new .wn-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent); }
.whats-new .wn-ico svg { width: 17px; height: 17px; }
.whats-new b { display: block; font-size: 14.5px; }
.whats-new span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.whats-new a { color: var(--accent); }

/* ---------- the search box: sections, recent places ---------- */
.palette-group { padding: 8px 12px 4px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-family: var(--font-mono); }
.palette-item .hint { font-size: 11px; color: var(--faint); font-family: var(--font-mono); white-space: nowrap; }

/* ---------- lessons: picking up where you stopped ---------- */
.resume-chip { position: sticky; top: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 7px 8px 7px 14px; border: 1px solid var(--line-hover); border-radius: var(--radius); background: var(--panel); box-shadow: var(--card-shadow); font-size: 13px; animation: softIn .35s var(--ease-out) backwards; }
.resume-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px 7px; border-radius: var(--radius-xs); font-size: 12.5px; }
.resume-chip button:hover { color: var(--ink); background: var(--hover); }
.resume-chip button.go { color: var(--accent); font-weight: 600; }

/* ---------- printing a lesson or a reference page: the text, nothing else ---------- */
@media print {
  html, body { background: #fff !important; color: #000 !important; }
  .site-header, .sidebar, .scrim, #toasts, .to-top, .read-progress, .toc, .lesson-foot, .done-box, .codeblock-head .btn, #splash, .resume-chip, .h-offline, textarea, .qa-rate { display: none !important; }
  #app, .shell-body, #main, #view { display: block !important; height: auto !important; overflow: visible !important; position: static !important; }
  #view::before { display: none !important; }
  .page { max-width: none !important; padding: 0 !important; }
  .lesson-layout { display: block !important; }
  .prose, .prose p, .prose li, h1, h2, h3 { color: #000 !important; }
  .codeblock, .card, .summary-card, .callout { border: 1px solid #bbb !important; background: #fff !important; box-shadow: none !important; break-inside: avoid; }
  .codeblock pre { white-space: pre-wrap !important; }
  .codeblock pre span { color: #111 !important; }
  a { color: #000 !important; text-decoration: underline; }
  * { animation: none !important; transition: none !important; }
}
input.settings-find { background: var(--field); border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius-sm); font-family: var(--font-body); outline: none; -webkit-appearance: none; appearance: none; }
input.settings-find:focus { border-color: var(--accent); box-shadow: var(--ring, 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent)); }
input.settings-find::placeholder { color: var(--faint); }
