/* Site-level styles: header, landing page, lesson page furniture. Player styles live in style.css. */
:root {
  --beginner: #2f9e63; --intermediate: #2b6cb0; --adept: #0e8f8f; --pro: #e8741c; --master: #d6322e;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
a { color: var(--accent-dark); }
h1 { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.15; margin: 8px 0 14px; }
h2 { line-height: 1.25; }
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; }
ul.plain li { margin: 4px 0; }

.top .brand { color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--ink); }

.btn { text-decoration: none; display: inline-block; color: var(--ink); }
.btn.primary { color: #fff; }
.btn.big { padding: 12px 22px; font-size: 16px; border-radius: 11px; }

/* hero */
.hero { padding: 48px 0 36px; background: linear-gradient(180deg, var(--hero-from), var(--bg)); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { color: var(--accent-dark); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.lead { font-size: 18px; color: var(--text-soft); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.mock-wrap { position: relative; }
table.mock { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px var(--shadow-lg); overflow: hidden; font-size: 15px; }
.mock th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 12px; border: 1px solid var(--line); padding: 5px 10px; }
.mock td { border: 1px solid var(--line); padding: 7px 10px; }
.mock td.r { text-align: right; }
.mock td.hl { outline: 2px solid var(--sel-edge); outline-offset: -2px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.mock-ok { margin: 12px 0 0 auto; width: fit-content; background: var(--good-soft); color: var(--good-dark); border: 1px solid var(--ok-edge); border-radius: 10px; padding: 7px 12px; font-size: 14px; }

/* sections */
.how { padding: 40px 20px 10px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; }
.three > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.three h3 { margin: 8px 0 4px; }
.three p { margin: 0; color: var(--muted); }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
#levels { padding-top: 36px; }
.lede-sm { margin: -6px 0 18px; }

.level { margin: 28px 0 34px; }
.level-head h3 { font-size: 24px; margin: 8px 0 4px; }
.level-head p { margin: 0 0 14px; color: var(--text-soft); max-width: 70ch; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--accent); }
.lvl-beginner { background: var(--beginner); }
.lvl-intermediate { background: var(--intermediate); }
.lvl-adept { background: var(--adept); }
.lvl-pro { background: var(--pro); }
.lvl-master { background: var(--master); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px 52px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.related .card { padding-left: 16px; }
.card:hover { box-shadow: 0 8px 22px var(--shadow-sm); transform: translateY(-2px); }
.card-num { position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.card.complete .card-num { background: var(--good); color: #fff; }
.card-sum { color: var(--muted); font-size: 14px; }
.card-meta { color: var(--muted); font-size: 12px; margin-top: auto; }
.card-progress { color: var(--good-dark); font-weight: 600; }
.soon-label { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li { border: 1px dashed var(--chip-edge); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 13px; background: var(--surface-3); }

#faq { padding: 20px 20px 50px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 2px; color: var(--text-soft); }

/* ads */
.ad-slot { margin: 28px auto; max-width: 970px; min-height: 90px; }
.ad-slot.placeholder { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; background: var(--surface-3); }

/* lesson page */
.crumbs { margin: 18px 0 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
.lesson-head { margin-bottom: 18px; }
.lesson-head .lead { margin: 10px 0 14px; max-width: 70ch; }
.learn { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; max-width: 70ch; }
.learn ul { margin: 6px 0 2px; padding-left: 20px; }
.player .layout { padding: 0; max-width: none; margin: 0; }
.player .msg.no { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 9px 12px; }
.prose { max-width: 760px; margin: 10px auto 0; }
.prose h2 { margin-top: 30px; }
.syntax { background: var(--syntax-bg, #14231c); color: #e6f5ec; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose p { color: var(--text-body); }
.prevnext { display: flex; justify-content: space-between; gap: 14px; margin: 30px 0; flex-wrap: wrap; }
.pn { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); min-width: 220px; }
.pn span { font-size: 12px; color: var(--muted); }
.pn.right { text-align: right; margin-left: auto; }
.related { margin: 20px 0 40px; }

/* footer */
.site-footer { padding: 56px 0 26px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 30px; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .top { padding: 10px 14px; }
}

/* simple text pages (about, privacy) */
.prose-page { padding-top: 28px; padding-bottom: 20px; }
.prose-page h2 { margin-top: 28px; }
.prose-page p { color: var(--text-body); }
.footer-links { margin-bottom: 6px; }
.footer-links a { color: var(--muted); }
.sort-group { display: inline-flex; gap: 6px; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line); }

/* capstone projects */
.card.capstone { grid-column: 1 / -1; padding-left: 52px; background: linear-gradient(135deg, var(--cap-from), var(--surface)); border-color: var(--ok-edge); border-width: 2px; }
.card.capstone strong { font-size: 18px; }
.card.capstone.soon { border-style: dashed; background: var(--surface-3); color: var(--muted); }
.card.capstone.soon:hover { transform: none; box-shadow: none; }
.cap-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.card.capstone.soon .cap-tag { color: var(--muted); }
.cap-badge { background: var(--cap-badge); margin-left: 6px; }
.mistakes { padding-left: 20px; }
.mistakes li { margin: 8px 0; color: var(--text-body); }

/* theme toggle */
.top-right { display: flex; align-items: center; gap: 16px; }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; display: grid; place-items: center; }
.theme-toggle:hover { background: var(--hover); }
.syntax { border: 1px solid var(--line); }

/* hero animation: a full budget planner builds itself */
.container.wide { max-width: 1280px; }
.hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 36px; }
.hero h1 { font-size: clamp(28px, 3.5vw, 42px); }
.hero .lead { font-size: 17px; }
.hero-stage { container-type: inline-size; width: 100%; }

.hero-demo { position: relative; font-size: clamp(10px, 1.85cqw, 13.5px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 46px var(--shadow-lg); padding: 1em 1em .8em; min-height: 36em; transition: opacity .5s; overflow: hidden; }
.hero-demo.fading { opacity: 0; }
.hd-bar { display: flex; align-items: center; gap: .6em; margin-bottom: .7em; }
.hd-name { min-width: 3.4em; text-align: center; padding: .25em .5em; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.hd-fx { color: var(--muted); font-style: italic; font-family: serif; }
.hd-formula { flex: 1; min-height: 1.9em; padding: .25em .7em; border: 1px solid var(--line); border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: .95em; white-space: nowrap; overflow: hidden; background: var(--surface); }

.hd-grid { border-collapse: collapse; width: 100%; table-layout: fixed; }
.hd-grid th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: .85em; border: 1px solid var(--line); padding: .2em .3em; }
.hd-grid td { border: 1px solid var(--line); height: 2.15em; padding: 0 .6em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); transition: background .25s; }
.hd-grid td.num { text-align: right; }
.hd-grid td.center { text-align: center; padding: 0 .2em; }
.hd-grid td.bold { font-weight: 700; }
.hd-grid td.neg { color: var(--bad); }
.hd-grid td.sel { background: var(--sel); }
.hd-grid td.rowover { background: var(--bad-soft); }
.hd-grid td.locked { background: var(--hint-bg); outline: 2px dashed var(--accent); outline-offset: -2px; }
.hd-grid td.active { outline: 2px solid var(--sel-edge); outline-offset: -2px; }
.hd-grid td.typing { font-family: ui-monospace, Consolas, monospace; font-size: .95em; text-align: left; }
.hd-grid td.typing::after { content: ""; display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; background: var(--ink); vertical-align: middle; animation: hd-caret .8s steps(1) infinite; }
.hd-grid td.flash { animation: hd-flash .75s ease-out; }
.pill { display: inline-block; padding: .08em .75em; border-radius: 999px; font-size: .88em; font-weight: 700; }
.pill.ok { background: var(--good-soft); color: var(--good-dark); }
.pill.over { background: var(--bad-edge); color: var(--bad); }
@keyframes hd-caret { 50% { opacity: 0; } }
@keyframes hd-flash { from { background: var(--accent-soft); } to { background: var(--surface); } }

.hd-lower { display: grid; grid-template-columns: 1.7fr 1fr; gap: .8em; margin-top: .8em; }
.hd-chartbox { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-3); padding: .7em .8em .5em; opacity: 0; transition: opacity .4s; }
.hd-chartbox.on { opacity: 1; }
.hd-chart { display: flex; justify-content: space-around; align-items: flex-end; height: 7.6em; }
.hd-group { display: flex; flex-direction: column; align-items: center; gap: .3em; height: 100%; justify-content: flex-end; flex: 1; }
.hd-bars { display: flex; align-items: flex-end; gap: .25em; height: 6em; }
.hd-bars span { width: 1.05em; border-radius: 3px 3px 0 0; transform-origin: bottom; transition: transform .65s cubic-bezier(.2, .8, .2, 1); }
.hd-bar-planned { background: var(--chip-edge); }
.hd-bar-actual { background: var(--accent); }
.hd-bar-actual.over { background: var(--bad); }
.hd-label { font-size: .78em; color: var(--muted); white-space: nowrap; }
.hd-legend { display: flex; gap: 1em; justify-content: center; margin-top: .4em; font-size: .78em; color: var(--muted); }
.hd-legend i { display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin-right: .35em; vertical-align: -1px; }
.hd-legend .p { background: var(--chip-edge); }
.hd-legend .a { background: var(--accent); }
.hd-legend .o { background: var(--bad); }

.hd-kpis { display: grid; grid-template-rows: repeat(3, 1fr); gap: .5em; opacity: 0; transition: opacity .4s; }
.hd-kpis.on { opacity: 1; }
.hd-kpi { display: flex; flex-direction: column; justify-content: center; padding: .3em .9em; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-3); }
.hd-kpi-label { font-size: .78em; color: var(--muted); }
.hd-kpi-value { font-size: 1.65em; font-weight: 800; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.hd-kpi-value.bump { animation: hd-bump .5s ease-out; }
@keyframes hd-bump { 40% { color: var(--accent-dark); transform: scale(1.06); transform-origin: left; } }

.hd-caption { display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; margin-top: .9em; min-height: 3em; }
.hd-step { font-size: 1.15em; font-weight: 700; color: var(--accent-dark); }
.hd-note { color: var(--muted); font-size: .92em; margin-top: .1em; }
.hd-dots { display: inline-flex; gap: .4em; padding-bottom: .3em; }
.hd-dots i { width: .6em; height: .6em; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.hd-dots i.on { background: var(--accent); transform: scale(1.4); }
.hd-dots i.done { background: var(--accent); opacity: .5; }
.hd-progress { height: 3px; border-radius: 3px; background: var(--line); margin-top: .6em; overflow: hidden; }
.hd-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s ease; }

.hd-pointer { position: absolute; left: 0; top: 0; width: 20px; height: 20px; pointer-events: none; z-index: 5; opacity: 0; transition: transform .5s cubic-bezier(.3, .7, .2, 1), opacity .3s; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.hd-pointer.on { opacity: 1; }
.hd-pointer::after { content: ""; position: absolute; left: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--sel-edge); opacity: 0; }
.hd-pointer.click::after { animation: hd-click .5s ease-out; }
@keyframes hd-click { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(1.8); } }

.hd-toast { position: absolute; right: 1em; top: .8em; background: var(--good); color: #fff; padding: .5em 1.1em; border-radius: 999px; font-weight: 700; box-shadow: 0 8px 20px var(--shadow-sm); opacity: 0; transform: translateY(-8px) scale(.96); transition: opacity .35s, transform .35s; z-index: 6; }
.hd-toast.on { opacity: 1; transform: none; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-demo { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-grid td.flash, .hd-grid td.typing::after, .hd-kpi-value.bump, .hd-pointer.click::after { animation: none; }
  .hd-bars span, .hero-demo, .hd-progress span { transition: none; }
}

/* accounts */
.nav { align-items: center; }
.nav-account { font-weight: 600; color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.nav .btn.primary { color: #fff; }
.auth-wrap { max-width: 440px; margin: 40px auto 60px; padding: 0 16px; }
.auth-wrap.wide { max-width: 640px; }
.auth-wrap h1 { font-size: 28px; margin: 0 0 14px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 18px; margin: 0 0 16px; }
.auth-card h1 { margin-top: 0; }
.auth-card h2 { font-size: 17px; margin: 0 0 10px; }
.auth-card.danger { border-color: var(--bad-edge); }
.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.field input { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.field input:focus { outline: 2px solid var(--sel-edge); outline-offset: 1px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.form-error, .form-ok, .form-info { padding: 9px 12px; border-radius: 10px; margin: 0 0 14px; font-size: 14px; border: 1px solid; }
.form-error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-edge); }
.form-ok { background: var(--good-soft); color: var(--good-dark); border-color: var(--ok-edge); }
.form-info { background: var(--surface-3); color: var(--ink); border-color: var(--line); }
.form-note { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
form.inline { display: inline; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
.tag.ok { color: var(--good-dark); border-color: var(--ok-edge); background: var(--good-soft); }
.tag.warn { color: #b7791f; border-color: var(--hint-edge); background: var(--hint-bg); }
.plain-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.plain-table th, .plain-table td { text-align: left; padding: 5px 10px 5px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.plain-table tr:last-child th, .plain-table tr:last-child td { border-bottom: 0; }
.plain-table th { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) { .nav { gap: 12px; } }

/* ---------- full-width bands: each page is a stack of sections, each with its own background ---------- */
.band { padding: 60px 0; background: var(--band-plain); }
.band.alt { background: var(--band-alt); }
.band.tint { background: linear-gradient(180deg, var(--hero-from), var(--band-plain)); }
.band.tight { padding: 30px 0; }
/* The dark "glow" bands (hero and closing call to action): a near-black base with big soft indigo and violet glows, as on That's Relatable. */
.band.deep, .site-footer {
  --h: var(--theme-h, 152);
  position: relative; overflow: hidden; border: 0; color: #fff;
  background-color: hsl(var(--h) 38% 6%);
  background-image:
    radial-gradient(46rem 34rem at 16% 24%, hsla(var(--h) 100% 62% / .48), transparent 66%),
    radial-gradient(40rem 32rem at 88% 74%, hsla(calc(var(--h) + 30) 80% 55% / .40), transparent 66%),
    radial-gradient(64rem 22rem at 50% 108%, hsla(var(--h) 85% 55% / .30), transparent 72%);
}
.band.cta.deep {
  background-image:
    radial-gradient(40rem 26rem at 50% -8%, hsla(var(--h) 100% 62% / .44), transparent 68%),
    radial-gradient(36rem 26rem at 14% 108%, hsla(calc(var(--h) + 30) 80% 55% / .28), transparent 66%),
    radial-gradient(36rem 26rem at 90% 108%, hsla(var(--h) 90% 58% / .24), transparent 66%);
}
.band.deep .eyebrow { color: hsl(var(--h) 100% 84%); }
.band.deep .hero-demo, .band.deep .mock-wrap { box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08); }
.band.deep h1, .band.deep h2, .band.deep h3, .band.deep .lead { color: #fff; }
.band.deep .lead { opacity: .94; }
.band.deep .muted { color: rgba(255, 255, 255, .82); }
.band.deep .btn { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .65); }
.band.deep .btn:hover { background: rgba(255, 255, 255, .14); }
.band.deep .btn.primary { background: #fff; color: var(--deep-a); border-color: #fff; box-shadow: 0 8px 28px -8px hsla(var(--h), 100%, 70%, .7); }
.band.deep .btn.primary:hover { background: hsl(var(--h) 60% 96%); }
.band-ad { background: var(--bg); padding: 6px 0; }
.band-ad .ad-slot { margin: 14px auto; }
.band-head { text-align: center; margin: 0 auto 30px; max-width: 62ch; }
.band-head h2 { font-size: clamp(25px, 3.2vw, 34px); margin: 6px 0 8px; line-height: 1.2; }
.band-head p { margin: 0; color: var(--text-soft); }
.band .center { text-align: center; }
.level-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.level-nav a { text-decoration: none; }
.level-nav .badge { font-size: 13px; padding: 6px 16px; }
/* a heading on the left and the content on the right */
.band-split { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 56px; align-items: start; }
.band-split > h2 { position: sticky; top: 24px; margin: 0; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; }
.band-split > h2 small { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }
.band-split .prose { max-width: none; margin: 0; }
.band-split .prose > :first-child { margin-top: 0; }
.band-split .syntax { margin: 0; }
.head-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.head-grid .lesson-head { margin: 0; }
.head-grid .learn { max-width: none; margin: 0; box-shadow: 0 12px 34px var(--shadow-sm); }
.head-grid .learn strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); }
.band.tint .crumbs { margin: 0 0 18px; }
.band.player-band { padding: 34px 0 40px; }
.band.hero { padding: 64px 0 60px; }
.band.how .three > div { background: var(--band-plain); }
.band.level .level-head { margin-bottom: 22px; }
.band.cta { text-align: center; padding: 70px 0; }
.band.cta h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 10px; }
.band.cta p { max-width: 56ch; margin: 0 auto 22px; font-size: 17px; }
.band.cta .cta-row { justify-content: center; }
.band .narrow details { background: var(--band-plain); }
.band.alt .card, .band.alt .three > div, .band.alt details { background: var(--band-plain); }
.band.related .card { padding-left: 16px; }
@media (max-width: 820px) {
  .band { padding: 38px 0; }
  .band.hero { padding: 40px 0 36px; }
  .band.cta { padding: 46px 0; }
  .band-split { grid-template-columns: 1fr; gap: 14px; }
  .band-split > h2 { position: static; }
  .head-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* small phones: keep the header on one line, and stop wide code blocks widening the page */
@media (max-width: 480px) {
  .top { padding: 10px 12px; gap: 8px; }
  .top-right { gap: 8px; }
  .nav { gap: 10px; }
  .nav a[href$="#faq"] { display: none; }
  .brand { font-size: 16px; }
}
.band-split > * { min-width: 0; }
@media (max-width: 820px) { .band-split { grid-template-columns: minmax(0, 1fr); } }
.syntax { max-width: 100%; }
.nav a, .nav .btn { white-space: nowrap; }

/* dark footer */
.site-footer .brand { color: #fff; }
.site-footer strong { color: #fff; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.site-footer .muted, .site-footer .small { color: rgba(255, 255, 255, .68); }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .plain { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.footer-legal { padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); }

/* popular lessons: three columns */
.cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.cols-3 .card:not(.has-thumb) { padding-left: 18px; }
.card-level { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
@media (max-width: 820px) { .cards.cols-3 { grid-template-columns: 1fr; } .footer-grid { grid-template-columns: 1fr; } }

/* bands sit flush against each other: no margin, and the same padding whatever older rules say */
.band.level { margin: 0; }
.band#levels, .band#faq, .band#popular { padding: 60px 0; }
@media (max-width: 820px) { .band#levels, .band#faq, .band#popular { padding: 38px 0; } }
.band.level + .band.level { padding-top: 60px; }

.band.related { margin: 0; }
/* the demo sheet is a light card inside a dark band: give it its own text colour instead of inheriting the band's white */
.band.deep .hero-demo, .band.deep .mock-wrap, .band.deep .hero-stage { color: var(--ink); }
.band.deep .hero-demo h1, .band.deep .hero-demo h2, .band.deep .hero-demo h3 { color: var(--ink); }

/* lesson page: the dark glow hero, with a glass panel for "In this lesson you will" */
.band.lesson-hero { padding: 40px 0 52px; }
.band.lesson-hero .crumbs, .band.lesson-hero .crumbs a { color: rgba(255, 255, 255, .72); }
.band.lesson-hero .crumbs a:hover { color: #fff; }
.band.lesson-hero .learn { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .92); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.band.lesson-hero .cap-badge { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff; }

/* lesson cards with a picture on top */
.card.has-thumb { padding: 0; gap: 0; overflow: hidden; border-radius: 16px; box-shadow: 0 1px 2px var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.card.has-thumb:hover { transform: translateY(-4px); box-shadow: 0 18px 38px -14px rgba(30, 20, 90, .35); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; flex: 1; }
.card-body strong { font-size: 17px; line-height: 1.25; }
.card.has-thumb .card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: auto; padding-top: 8px; }
.card-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.tag-ico { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background-image: linear-gradient(rgba(255,255,255,.85) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(255,255,255,.85) 1.5px, transparent 1.5px); background-size: 100% 6px, 6px 100%; background-position: 0 3px, 3px 0; }
.card.has-thumb .card-progress:empty { display: none; }
.thumb { position: relative; display: block; padding: 18px 18px 0; height: 150px; overflow: hidden; }
.thumb-num { position: absolute; top: 10px; left: 10px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.95); color: #2a2078; display: grid; place-items: center; font-weight: 700; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.card.complete .thumb-num { background: var(--good); color: #fff; }
.mini { display: block; background: #fff; color: #333; border-radius: 10px 10px 0 0; box-shadow: 0 10px 24px -8px rgba(0,0,0,.35); padding: 8px 10px 0; height: 100%; transition: transform .25s; }
.card:hover .mini { transform: translateY(-4px); }
.mini-bar { display: flex; align-items: center; gap: 5px; padding-bottom: 7px; border-bottom: 1px solid #e6e6ee; font-size: 10px; white-space: nowrap; overflow: hidden; }
.mini-bar i { width: 6px; height: 6px; border-radius: 50%; background: #d7d7e2; flex: none; }
.mini-bar b { margin-left: 6px; font-style: italic; font-weight: 400; color: #9a9ab0; }
.mini-bar em { font-style: normal; font-family: ui-monospace, Consolas, monospace; color: hsl(var(--theme-h, 152) 60% 32%); overflow: hidden; text-overflow: ellipsis; }
.mini-grid { display: grid; grid-template-columns: 14px repeat(4, 1fr); margin-top: 6px; }
.mini-grid u { text-decoration: none; text-align: center; font-size: 8px; line-height: 14px; color: #9a9ab0; background: #f4f4f9; }
.mini-grid s { display: block; height: 18px; border-right: 1px solid #ececf3; border-bottom: 1px solid #ececf3; padding: 7px 5px 0; text-decoration: none; }
.mini-grid s i { display: block; height: 4px; border-radius: 2px; background: #dedeea; }
.mini-grid s.hot { outline: 2px solid var(--accent, #5b4bdb); outline-offset: -2px; background: hsl(var(--theme-h, 152) 70% 95%); }
.mini-grid s.hot i { background: var(--accent, #5b4bdb); }
@media (prefers-reduced-motion: reduce) { .card.has-thumb, .mini { transition: none; } .card.has-thumb:hover, .card:hover .mini { transform: none; } }

.band.lesson-hero .learn strong { color: hsl(var(--h) 100% 84%); }

/* level lists: three columns, so the graduation project fills the rest of the row after lesson 19 */
.band.level .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.band.level .card.capstone { grid-column: span 2; padding: 22px 26px 22px 62px; justify-content: center; }
.band.level .card.capstone .card-num { left: 22px; top: 22px; }
.band.level .cards:has(.card.capstone.soon) .card.capstone { grid-column: 1 / -1; }
@media (max-width: 900px) { .band.level .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .band.level .card.capstone { grid-column: 1 / -1; } }
@media (max-width: 600px) { .band.level .cards { grid-template-columns: minmax(0, 1fr); } }
.band.level .card.capstone .card-meta { margin-top: 10px; }
.band.level .card.capstone strong { font-size: 22px; }
.band.level .card.capstone .card-sum { font-size: 15px; max-width: 60ch; }

/* the whole lesson page takes the colour of its level */
.theme-beginner { --theme-h: 152; }
.theme-intermediate { --theme-h: 214; }
.theme-adept { --theme-h: 178; }
.theme-pro { --theme-h: 26; }
.theme-master { --theme-h: 2; }
body[class*="theme-"] {
  --accent: hsl(var(--theme-h) 62% 40%);
  --accent-dark: hsl(var(--theme-h) 64% 31%);
  --accent-hover: hsl(var(--theme-h) 64% 31%);
  --accent-soft: hsl(var(--theme-h) 55% 94%);
  --hero-from: hsl(var(--theme-h) 60% 96%);
  --band-alt: hsl(var(--theme-h) 40% 95%);
  --deep-a: hsl(var(--theme-h) 62% 26%);
  --deep-b: hsl(var(--theme-h) 58% 44%);
  --cap-from: hsl(var(--theme-h) 55% 96%);
}
:root[data-theme="dark"] body[class*="theme-"] {
  --accent: hsl(var(--theme-h) 60% 46%);
  --accent-dark: hsl(var(--theme-h) 90% 76%);
  --accent-hover: hsl(var(--theme-h) 58% 34%);
  --accent-soft: hsl(var(--theme-h) 40% 17%);
  --hero-from: #17171a;
  --band-alt: #1f1f24;
  --deep-a: hsl(var(--theme-h) 60% 20%);
  --deep-b: hsl(var(--theme-h) 55% 34%);
  --cap-from: #1a1a1d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[class*="theme-"] {
    --accent: hsl(var(--theme-h) 60% 46%);
    --accent-dark: hsl(var(--theme-h) 90% 76%);
    --accent-hover: hsl(var(--theme-h) 58% 34%);
    --accent-soft: hsl(var(--theme-h) 40% 17%);
    --hero-from: #17171a;
    --band-alt: #1f1f24;
    --deep-a: hsl(var(--theme-h) 60% 20%);
    --deep-b: hsl(var(--theme-h) 55% 34%);
    --cap-from: #1a1a1d;
  }
}

/* admin preview notice */
.preview-bar { background: #fff3cd; color: #5c4400; padding: 10px 16px; text-align: center; font-size: 14px; border-bottom: 1px solid #e6cf85; }
.preview-bar a { color: inherit; font-weight: 600; }

/* admin area */
.admin-wrap { max-width: 920px; margin: 28px auto 64px; padding: 0 16px; }
.admin-wrap h1 { font-size: 28px; margin: 6px 0 12px; }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.admin-nav a { padding: 9px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; }
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.admin-publish { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.admin-publish.pending { background: var(--hint-bg); border-color: var(--hint-edge); }
.admin-publish form { margin: 0; }
.admin-wrap .auth-card { max-width: none; }
.afield { display: grid; gap: 4px; margin: 0 0 14px; }
.afield label { font-weight: 600; font-size: 14px; }
.afield input, .afield textarea, .afield select, .admin-filter input, .admin-filter select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box; }
.afield textarea { resize: vertical; line-height: 1.45; }
.afield textarea.mono, .diff pre, .hist pre { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.afield small { color: var(--muted); }
.afield input:focus, .afield textarea:focus, .afield select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 14px; }
.check input { margin-top: 3px; }
.step-edit, .adv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; background: var(--surface); }
.step-edit > summary, .adv > summary { cursor: pointer; font-weight: 600; }
.step-edit[open] > summary, .adv[open] > summary { margin-bottom: 12px; }
.adv { background: var(--surface-3, var(--surface)); }
.text-page > summary { cursor: pointer; list-style: revert; }
.text-page > summary h2 { display: inline; margin: 0; }
.text-item { padding-top: 6px; border-top: 1px solid var(--line); }
.text-item:first-of-type { border-top: 0; }
.hist pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 4px 0 8px; }
.admin-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.admin-filter input { width: auto; flex: 1 1 200px; }
.admin-filter select { width: auto; }
.table-scroll { overflow-x: auto; }
.admin-table td, .admin-table th { padding-right: 14px; }
.admin-table .level-row td { padding-top: 16px; border-bottom-color: var(--accent); color: var(--accent-dark); }
.small-btn { padding: 4px 12px; font-size: 13px; }
.admin-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.crumb { margin: 0; font-size: 14px; color: var(--muted); }
.diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); max-height: 320px; overflow: auto; }
@media (max-width: 700px) { .diff-cols { grid-template-columns: 1fr; } }

/* intro animation: smaller, so the hero does not push the page down */
.hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; }
.hero-demo { font-size: clamp(9.5px, 1.35cqw, 11.5px); min-height: 26em; }
.band.hero { padding: 48px 0 44px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-demo { min-height: 0; } }

/* lesson sections: heading and picture on one side, text on the other, swapping sides down the page */
.band-split > .split-head { position: sticky; top: 24px; align-self: start; }
.band-split > .split-head > h2 { position: static; margin: 0; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; }
.band-split.flip { grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); }
.band-split.flip > .split-head { order: 2; }
.band-split.flip > .prose { order: 1; }
.section-art { display: block; width: 100%; max-width: 240px; height: auto; margin-top: 18px; }
.section-art .a-card { fill: var(--band-plain, #fff); stroke: var(--accent); stroke-width: 2; }
.section-art .a-edge { stroke-linejoin: round; }
.section-art .a-line { fill: none; stroke: var(--accent); stroke-opacity: .35; stroke-width: 1.5; }
.section-art .a-thick { stroke-width: 4; stroke-opacity: 1; stroke-linecap: round; }
.section-art .a-soft { fill: var(--accent-soft); }
.section-art .a-hot { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.section-art .a-solid { fill: var(--accent); }
.section-art .a-solid-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.section-art .a-fx { font: italic 13px Georgia, serif; fill: var(--accent-dark); }
.band.alt .section-art .a-card { fill: var(--band-plain, #fff); }
@media (max-width: 820px) {
  .band-split > .split-head, .band-split.flip > .split-head { position: static; order: 0; }
  .band-split.flip > .prose { order: 0; }
  .band-split.flip { grid-template-columns: minmax(0, 1fr); }
  .section-art { max-width: 180px; margin-top: 12px; }
}
.band-split .split-head h2 small { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }

/* content easing in on scroll (assets/js/reveal.js adds .rv only to things below the fold) */
.rv.rv.rv { opacity: 0; transform: translate3d(var(--rx, 0), var(--ry, 28px), 0); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--rd, 0ms); will-change: opacity, transform; }
.rv.rv.rv.rv-in { opacity: 1; transform: none; }
@media print, (prefers-reduced-motion: reduce) { .rv.rv.rv { opacity: 1; transform: none; transition: none; } }
