:root {
  --ink: #1a1a1a; --muted: #666; --line: #e5e5e5; --bg: #fafaf8; --card: #fff;
  --accent: #111; --accent-ink: #fff; --ok: #1f7a3a; --go: #3f9d8b; --warn: #b26a00; --err: #b00020; --brand: #ffbc00; --footer-bg: #f1f1f1; --course-band: #f9fae3; --teal: #09a59a;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
/* Sticky footer. On a short page (/help, an expired reset link, a 404) the footer used to stop
   partway up with page background below it. NOT position:fixed -- that would pin it over the
   content on a long lesson page. A flex column with main allowed to grow puts it at the bottom when
   there is room and lets it flow normally when there is not. */
html { height: 100%; }
body { min-height: 100%; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > .site-footer { flex-shrink: 0; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 1.2em 0 .5em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.15rem; }
.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.container.wide { max-width: 1200px; }
/* Full-width <main>, for pages whose sections manage their own measure (the homepage bands). */
.bleed { width: 100%; }
.narrow { max-width: 460px; }
.muted { color: var(--muted); } .meta { color: var(--muted); font-size: .9rem; }
small { color: var(--muted); }

.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
/* The wordmark sits BELOW the header rule rather than beside the logo. It is plain text, not a
   second link to "/", and it is aria-hidden: the logo above it is already a link whose alt text is
   this same string, so to a screen reader the wordmark is a verbatim repeat of the name it just
   announced. Hiding it keeps the visual design and drops the stutter. */
.site-wordmark { background: #fff; border-bottom: 1px solid var(--line); }
.site-wordmark span { display: inline-block; padding: .55rem 0 .7rem; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
/* Intrinsic 161x48. Height-constrained so it sits inside the 56px header; width auto keeps
   the ratio, and the explicit width/height attributes in the markup reserve the box so the
   header does not reflow as it loads. */
.brand-logo { height: 28px; width: auto; display: block; }
.nav nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav nav a { text-decoration: none; }
/* Who you are signed in as. Muted so it reads as a label rather than another nav destination, and
   allowed to truncate -- some imported addresses are long and would otherwise push Log out off. */
.nav-who { color: var(--muted); font-size: .92rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

.hero { padding: 2rem 0 1rem; }
.hero h1 { margin-top: 0; }

/* Homepage hero, matching appsumo.teachable.com so students recognise the page they land on.
   The artwork is 1200x500; aspect-ratio keeps those proportions instead of letting the band stretch
   to whatever the content needs, which is what made it crop badly. No overlay -- the copy sits over
   the light left-hand side of the image (measured 235-253/255 luminance there), so near-black text
   reads without dropping out white over a flattened photo.
   background-position keeps the right-hand figure in frame as the viewport narrows. */
.hero-band {
  position: relative; color: var(--ink);
  background:
    linear-gradient(to right, rgba(255,255,255,.92) 0%, rgba(255,255,255,.88) 42%, rgba(255,255,255,0) 66%),
    url('/static/homepage-hero.png') 70% center / cover no-repeat #f3f3f1;
  aspect-ratio: 1200 / 500; min-height: 340px;
  display: flex; align-items: center;
}
.hero-copy { padding-left: 15%; padding-right: 1rem; max-width: 46rem; }
.hero-band h1 { margin: 0 0 .4rem; font-size: clamp(1.8rem, 4.4vw, 3rem); letter-spacing: -.02em; line-height: 1.08; }
.hero-sub { margin: 0 0 .5rem; font-size: clamp(1rem, 1.6vw, 1.2rem); font-weight: 600; }
/* Ours, not Teachable's: the sentence telling password-less imported buyers how to get back in. */
.hero-note { margin: 0 0 1.2rem; max-width: 30rem; font-size: .95rem; color: #3a4444; }
/* The one link the imported buyers actually need -- underlined and darker than the sentence around
   it so it reads as an action, not emphasis. */
.hero-note a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.hero-cta { margin: 0; }
/* Teachable's own brand_secondary, read from its theme CSS -- the same turquoise its Sign up pill
   used. Solid fill and a generous radius so it reads as a button over the busy artwork behind it. */
.hero-band .btn-hero { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 700; padding: .95rem 2.4rem; font-size: 1.15rem; border-radius: 999px; }
.hero-band .btn-hero:hover { filter: brightness(1.06); }

/* Below the artwork, not inside it -- see .hero-band. The course list is the one thing the old page
   did not have, so it gets its own band rather than being squeezed over the image. */
.course-band { background: var(--course-band); padding: 2.4rem 0 2.6rem; }
/* The homepage ends on a colour band, so the footer's usual breathing room would show as a strip of
   page background between two filled areas. Scoped to the bleed layout (the homepage) so every other
   page keeps its 3rem. */
/* main is a flex item allowed to grow (see the sticky footer above), so on a tall viewport it
   extends past .course-band -- painting page background in the gap the sibling rule below exists to
   close. Carrying the band colour on main itself makes the growth invisible. */
main.bleed { background: var(--course-band); }
main.bleed + .site-footer { margin-top: 0; }
.hero-courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 330px)); gap: 1rem; justify-content: center; }

/* On a phone the artwork would be ~160px tall and the copy would not fit over it, so the image
   becomes a banner above the text rather than a backdrop behind it. */
@media (max-width: 720px) {
  .hero-band { aspect-ratio: auto; min-height: 0; display: block; background-image: none; background: #f3f3f1; }
  .hero-band::before { content: ''; display: block; aspect-ratio: 1200 / 500; background: url('/static/homepage-hero.png') center / cover no-repeat; }
  .hero-copy { padding: 1.6rem 1rem 2rem; max-width: none; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 1rem; margin: 1rem 0; justify-content: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.card h3 { margin-top: 0; } .card h3 a { text-decoration: none; }

/* Course thumbnails (Migration 7). The image is full-bleed, so it pulls out to the card edge with a
   negative margin matching .card's padding, and the radius is clipped to the card's top corners.
   A fixed 16:9 box -- via aspect-ratio, with the height fallback for older engines -- means the grid
   stays even whether a course has an image or not, and reserves the space so nothing reflows as
   images load. Teachable's originals vary from 16:9 to about 1.9:1, hence object-fit: cover. */
.card-has-thumb { padding-top: 0; overflow: hidden; }
.card-thumb-link { display: block; margin: 0 -1.2rem .9rem; }
.card-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
@supports not (aspect-ratio: 1) { .card-thumb { height: 158px; } }
.card-thumb-none { background: linear-gradient(135deg, var(--course-band), #eef0d4); }
.tag { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; background: #eee; color: #333; vertical-align: middle; }
.tag-ok { background: #e3f4e8; color: var(--ok); } .tag-warn { background: #fff1d6; color: var(--warn); } .tag-muted { background: #f0f0f0; color: var(--muted); }
.bar { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin: .4rem 0 .8rem; }
.bar-fill { height: 100%; background: var(--ok); }

.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; padding: .65rem 1.2rem; border-radius: 8px; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { opacity: .9; }
.btn-small { padding: .35rem .8rem; font-size: .9rem; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid #bbb; }
.btn-complete { background: var(--go); color: #fff; }
.btn-complete.btn-secondary { background: #fff; color: var(--go); border-color: var(--go); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.linklike.danger { color: var(--err); font-size: .85rem; }
.inline { display: inline; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.inline-form input.tiny { width: 5rem; }

form label { display: block; margin: .8rem 0; font-weight: 600; }
form label small { display: block; font-weight: 400; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid #bbb; border-radius: 6px; background: #fff; margin-top: .25rem; }
.inline-form input, .inline-form select { display: inline-block; width: auto; margin: 0; }
label.check { font-weight: 400; } label.check input { display: inline; width: auto; margin-right: .4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.flash { padding: .8rem 1rem; border-radius: 8px; margin: 1rem 0; background: #eef; border: 1px solid #ccd; }
.flash-ok { background: #e3f4e8; border-color: #b9e0c4; } .flash-warn { background: #fff1d6; border-color: #f2d9a6; } .flash-error { background: #fde7ea; border-color: #f3b8c1; }

.course-head .cta { margin: 1rem 0; }
.module { margin: 1rem 0 1.5rem; }
.lessons { list-style: decimal; padding-left: 1.6rem; }
.lessons li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.lessons li.done a { color: var(--muted); }
.locked { color: var(--muted); } .locked::before { content: "🔒 "; }

.lesson-layout { display: grid; grid-template-columns: 290px 1fr; gap: 2.5rem; margin-top: 1rem; }
@media (max-width: 800px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-nav { order: 2; } }
.lesson-nav { font-size: .92rem; } .lesson-nav h4 { margin: 1rem 0 .3rem; }
.lesson-nav ol { list-style: none; padding: 0; margin: 0; }
.lesson-nav li { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem .5rem; border-radius: 6px; }
.lesson-nav li.current { background: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.lesson-nav li.done a { color: var(--muted); }
.lesson-nav .dot { flex: 0 0 14px; width: 14px; height: 14px; margin-top: .3rem; border-radius: 50%; border: 2px solid #bbb; background: #fff; }
.lesson-nav li.current .dot { border-color: var(--brand); background: linear-gradient(90deg, var(--brand) 50%, #fff 50%); }
.lesson-nav li.done .dot { border-color: var(--ok); background: var(--ok); }
.lesson-nav li.done.current .dot { background: var(--ok); }
.lesson-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.lesson-actions .center { text-align: center; margin-bottom: 1rem; }
.lesson h1 { margin-top: .2rem; }
.video { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin: 1rem auto 1.4rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-missing, .video-pending { background: #fff1d6; padding: .8rem 1rem; border-radius: 8px; max-width: 720px; margin: .5rem auto 1rem; font-size: .95rem; }
.lesson-body { max-width: 820px; }
.lesson-body p, .lesson-body li { line-height: 1.65; }
.lesson-body img { margin: 1.4rem auto; display: block; }
.lesson-body img[width] { max-width: 100%; } /* author-set width from Teachable wins, but never overflows */
.lesson-body h2, .lesson-body h3 { margin-top: 1.8em; }
.lesson-actions { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: .5rem 0 1.5rem; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f5f5f3; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; }
.stats b { display: block; font-size: 1.5rem; } .stats span { color: var(--muted); font-size: .85rem; }
.admin-module { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
details summary { cursor: pointer; color: var(--muted); margin: .5rem 0; }

/* imported lesson content */
.lesson-body img { max-width: min(100%, 640px); height: auto; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.lesson-body iframe { display: block; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; margin: 1.4rem auto; background: #000; }
.lesson-body blockquote { border-left: 4px solid var(--brand); margin: 1rem 0; padding: .3rem 1rem; color: #444; background: #fff; }
.lesson-body h1 { font-size: 1.5rem; } .lesson-body h5 { font-size: 1rem; }
.quiz { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2.2rem 1.5rem 1.5rem; margin: 2rem 0; text-align: center; }
.quiz-tag { position: absolute; top: 0; left: 0; background: #2b2b2b; color: #fff; font-size: .8rem; font-weight: 600; padding: .25rem .8rem; border-radius: 9px 0 8px 0; }
.quiz h4 { margin: .5rem auto 1.3rem; font-size: 1.35rem; font-weight: 500; max-width: 640px; line-height: 1.35; }
.quiz .choices { display: flex; flex-direction: column; gap: .7rem; max-width: 620px; margin: 0 auto 1rem; }
.quiz .choice { display: block; width: 100%; font: inherit; font-size: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; text-align: center; transition: border-color .1s, color .1s; }
.quiz .choice:hover { border-color: #888; color: var(--ink); }
.quiz .choice.chosen { border: 2px solid var(--ink); color: var(--ink); font-weight: 600; }
.quiz label.choice input { display: none; }
.quiz textarea { max-width: 620px; margin: 0 auto .8rem; text-align: left; }
.quiz .center { text-align: center; } .quiz .saved { font-size: .85rem; margin: 0; }
.download-btn { display: inline-block; background: var(--brand); color: #111; padding: .6rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none; margin: .5rem 0; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }

/* code redemption landing page (/redeem/:slug) */
.redeem-landing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; margin: 1.5rem 0; }
.redeem-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--line); margin-bottom: 1rem; }
.redeem-kicker { margin: 0; color: var(--teal); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.redeem-course h1 { margin-top: .3rem; }
.redeem-points { padding-left: 1.2rem; color: #3a4444; } .redeem-points li { margin: .2rem 0; }
.redeem-card { padding: 1.2rem 1.4rem; } .redeem-card h2 { margin-top: 0; }
.redeem-card .btn { width: 100%; }
@media (max-width: 760px) { .redeem-landing { grid-template-columns: 1fr; gap: 1rem; } }

/* admin: access codes */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0; }
.tabs a { text-decoration: none; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .9rem; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: .8rem 0 1.5rem; }
.panel h2, .panel h3 { margin-top: .2rem; }
.copy-field { display: flex; gap: .5rem; align-items: center; } .copy-field input { margin: 0; }
.code-list { max-height: 14rem; overflow: auto; background: #f5f5f3; border-radius: 6px; padding: .5rem .8rem; font-size: .85rem; }
.pager-inline { display: flex; gap: 1rem; align-items: center; }
td .btn { white-space: nowrap; }
