/* AI Practitioner course site.
   Tokens follow redstonelogic.com (css/site.css and css/home.css): ink and
   graphite grounds, bone text, Share Tech headings in sentence case,
   Montserrat body, hairline rules instead of boxes. Emerson red marks the
   path and progress; Royal Aqua is kept for links and focus only. */
:root {
  --ink: #121212;
  --graphite: #1E1E1E;
  --steel: #2D2D2D;
  --bone: #EFECEB;
  --muted: rgba(239, 236, 235, 0.68);
  --faint: rgba(239, 236, 235, 0.46);
  --rule: rgba(239, 236, 235, 0.14);
  --red: #B63C35;
  --red-lift: #D9574F; /* red that holds up as small text on ink */
  --aqua: #00C4D9;
  --display: 'Share Tech', 'Segoe UI', system-ui, sans-serif;
  --body: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--ink); color: var(--bone); font-family: var(--body); font-size: 16px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 600px) { :root { --gutter: 18px; } }

/* Header */
.top { border-bottom: 1px solid var(--rule); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.top-logo img { height: 30px; width: auto; }
.top-nav { display: flex; align-items: center; gap: 24px; }
.top-link { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 6px 0; }
.top-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.top-link[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
@media (max-width: 420px) { .top-nav { gap: 16px; } .top-logo img { height: 26px; } }

/* Buttons */
.btn { display: inline-block; font-family: var(--body); font-weight: 600; font-size: 16px; line-height: 1.3; padding: 12px 26px;
  border-radius: 4px; border: 2px solid transparent; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: #9c332d; border-color: #9c332d; }
.btn-quiet { background: transparent; border-color: rgba(255, 255, 255, 0.32); color: #fff; padding: 9px 18px; font-size: 14px; }
.btn-quiet:hover { border-color: #fff; }
.btn-quiet[aria-pressed="true"] { border-color: var(--red); background: rgba(182, 60, 53, 0.16); }
.linkish { background: none; border: 0; padding: 0; color: #fff; font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--red); text-underline-offset: 4px; cursor: pointer; }

/* Course page: intro */
.intro { padding: 72px 0 40px; }
.intro h1 { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 7vw, 84px); line-height: 1; letter-spacing: 0.005em; color: #fff; }
.lede { margin-top: 20px; font-size: 18px; font-weight: 300; line-height: 1.65; color: var(--muted); max-width: 58ch; }
.intro-status { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.intro-status .btn { white-space: normal; }
.tally { font-size: 15px; color: var(--muted); }

/* Course page: the path. One red rail runs down the levels; it is the page's
   single bold element. Level numbers sit on it as stations. */
.path { padding: 24px 0 96px; }
.levels { list-style: none; position: relative; }
.levels::before { content: ''; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--red), rgba(182, 60, 53, 0.25)); }
.level { position: relative; padding-left: 72px; padding-bottom: 48px; }
.level:last-child { padding-bottom: 0; }
.level-head { display: flex; align-items: baseline; gap: 18px; min-height: 44px; }
.level-num { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); border: 2px solid var(--red);
  display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: #fff; }
.level--empty .level-num { border-color: rgba(182, 60, 53, 0.45); color: var(--faint); }
.level-name { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; color: #fff; padding-top: 4px; }
.level--empty .level-name { color: var(--muted); }
.level-soon { margin-top: 6px; font-size: 15px; color: var(--faint); }

.mods { list-style: none; margin-top: 18px; border-top: 1px solid var(--rule); }
.mod { border-bottom: 1px solid var(--rule); }
.mod-link { display: grid; grid-template-columns: 200px 1fr auto; gap: 24px; align-items: center; padding: 20px 0; text-decoration: none; }
.mod-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--graphite); border-radius: 3px; overflow: hidden; }
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--share, 0) * 100%); background: var(--red); }
.mod-body { display: block; min-width: 0; }
.mod-num { display: block; font-size: 13px; color: var(--faint); }
.mod-title { display: block; font-family: var(--display); font-size: 26px; line-height: 1.15; color: #fff; margin-top: 2px; }
.mod-link:hover .mod-title { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; text-decoration-color: var(--red); }
.mod-summary { display: block; margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.mod-meta { display: block; margin-top: 8px; font-size: 13px; color: var(--faint); }
.mod-status { font-size: 14px; color: var(--muted); white-space: nowrap; }
.mod--done .mod-status { color: var(--red-lift); font-weight: 600; }
.mod--started .mod-status { color: #fff; }
.path-empty { color: var(--muted); }

@media (max-width: 760px) {
  .intro { padding: 44px 0 28px; }
  .levels::before { left: 15px; }
  .level { padding-left: 48px; }
  .level-num { width: 32px; height: 32px; font-size: 17px; }
  .level-head { min-height: 32px; }
  .level-name { font-size: 22px; padding-top: 1px; }
  .mod-link { grid-template-columns: 112px 1fr; gap: 6px 14px; align-items: start; padding: 16px 0; }
  .mod-thumb { grid-row: span 2; }
  .mod-title { font-size: 21px; }
  .mod-summary { font-size: 14px; }
  .mod-status { grid-column: 2; font-size: 13px; }
}

/* Player page */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'stage side' 'info side' 'terms side' 'pager side';
  grid-template-rows: auto auto auto 1fr; gap: 0 36px; padding-top: 28px; padding-bottom: 72px; align-items: start; }
.stage { grid-area: stage; }
.info { grid-area: info; }
.side { grid-area: side; position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); min-height: 0; }
.pager { grid-area: pager; }
.terms { grid-area: terms; }

.stage video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 3px; }
video::cue { font-family: var(--body); background: rgba(0, 0, 0, 0.78); color: #fff; }

.info { padding-top: 22px; }
.info-level { font-size: 14px; color: var(--faint); }
.info-title { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; color: #fff; margin-top: 4px; }
.info-summary { margin-top: 12px; font-size: 16px; line-height: 1.65; color: var(--muted); max-width: 64ch; }
.note { margin-top: 14px; font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--red); max-width: 64ch; }
.note--error { color: #fff; }
.info-actions { margin-top: 20px; }

.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--rule); flex: none; }
.tab { background: none; border: 0; padding: 10px 0 12px; font-size: 15px; font-weight: 600; color: var(--faint); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--red); }
.tab:hover { color: #fff; }
.panel { position: relative; overflow-y: auto; min-height: 0; flex: 1; padding: 8px 2px 8px 0; scrollbar-width: thin; scrollbar-color: var(--steel) transparent; }

.chapters { list-style: none; counter-reset: none; }
.chapter { border-bottom: 1px solid var(--rule); }
.chapter-btn { display: grid; grid-template-columns: 52px 1fr; gap: 12px; width: 100%; text-align: left; background: none; border: 0;
  padding: 11px 10px 11px 12px; cursor: pointer; border-left: 2px solid transparent; }
.chapter-btn:hover { background: rgba(255, 255, 255, 0.04); }
.chapter-time { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 1px; }
.chapter-title { font-size: 15px; line-height: 1.45; color: var(--muted); }
.chapter.is-active .chapter-btn { border-left-color: var(--red); background: rgba(182, 60, 53, 0.1); }
.chapter.is-active .chapter-title { color: #fff; }
.chapter-none, .tx-none { padding: 14px 0; font-size: 15px; color: var(--faint); }

.transcript { padding: 4px 12px 40px 0; }
.tx-head { font-family: var(--display); font-weight: 400; font-size: 19px; color: #fff; margin: 22px 0 6px; }
.tx-head:first-child { margin-top: 10px; }
.tx-para { font-size: 15px; line-height: 1.75; color: var(--faint); }
.tx-line { cursor: pointer; border-radius: 2px; transition: color 0.2s ease; }
.tx-line:hover { color: var(--bone); }
.tx-line.is-active { color: #fff; background: rgba(182, 60, 53, 0.22); box-shadow: 0 0 0 2px rgba(182, 60, 53, 0.22); }
@media (prefers-reduced-motion: reduce) { .tx-line { transition: none; } }

/* Player page: terms in this module, each linking to its glossary entry. */
.terms { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.terms-head { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; color: #fff; }
.terms-list { list-style: none; margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.terms-item { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.terms-link { text-decoration: none; }
.terms-term { font-family: var(--display); font-size: 19px; color: #fff; }
.terms-exp { font-size: 13px; color: var(--faint); }
.terms-link:hover .terms-term { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.terms-short { display: block; margin-top: 2px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.terms-more { margin-top: 16px; font-size: 14px; }
.terms-more a { color: #fff; font-weight: 600; text-decoration-color: var(--red); text-underline-offset: 4px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.pager-link { display: block; text-decoration: none; padding: 4px 0; }
.pager-next { grid-column: 2; text-align: right; }
.pager-dir { display: block; font-size: 13px; color: var(--faint); }
.pager-title { display: block; font-family: var(--display); font-size: 22px; line-height: 1.2; color: #fff; margin-top: 2px; }
.pager-link:hover .pager-title { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 5px; text-decoration-thickness: 1px; }

@media (max-width: 1000px) {
  .player { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'stage' 'info' 'side' 'terms' 'pager'; grid-template-rows: none; padding-top: 0; }
  .wrap.player { padding-left: 0; padding-right: 0; }
  .info, .side, .pager { padding-left: var(--gutter); padding-right: var(--gutter); }
  .terms { margin-left: var(--gutter); margin-right: var(--gutter); }
  /* Keep the video in view while reading along. */
  .stage { position: sticky; top: 0; z-index: 5; background: var(--ink); }
  .stage video { border-radius: 0; }
  .side { position: static; max-height: none; margin-top: 28px; }
  .panel { max-height: 56vh; }
  .pager { margin-top: 32px; }
  .pager { margin-left: var(--gutter); margin-right: var(--gutter); padding-left: 0; padding-right: 0; }
}
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 520px) {
  .stage { position: static; }
}
@media (max-width: 520px) {
  .pager-title { font-size: 18px; }
  .terms-list { grid-template-columns: minmax(0, 1fr); }
}

/* Glossary page. Each entry reads like a dictionary line: the term large on
   the left, what it means on the right; stacked on a phone. */
.g-intro { padding-bottom: 28px; }
.g-tools { position: sticky; top: 0; z-index: 5; background: var(--ink); border-bottom: 1px solid var(--rule); }
.g-tools-inner { display: grid; grid-template-columns: auto minmax(0, 360px) auto minmax(0, 1fr); align-items: center; gap: 10px 16px; padding-top: 14px; padding-bottom: 14px; }
.g-filter-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.g-filter { width: 100%; font: inherit; font-size: 16px; color: #fff; background: var(--graphite); border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px; padding: 9px 12px; }
.g-filter::placeholder { color: var(--faint); }
.g-filter:focus { border-color: var(--aqua); outline: none; box-shadow: 0 0 0 1px var(--aqua); }
.g-count { font-size: 14px; color: var(--faint); white-space: nowrap; }
.g-jump { min-width: 0; justify-self: end; }
.g-jump-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.g-jump-link { display: grid; place-items: center; min-width: 30px; height: 32px; font-family: var(--display); font-size: 17px; color: var(--muted); text-decoration: none; border-radius: 3px; }
.g-jump-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.g-body { padding-top: 8px; padding-bottom: 96px; }
.g-group { margin-top: 36px; }
.g-letter { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--red-lift); padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.g-letter, .g-entry { scroll-margin-top: 96px; }
.g-entry { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: 'term short' 'exp text' '. video' '. meta';
  grid-template-rows: auto auto auto 1fr; gap: 0 40px; padding: 28px 0 30px; border-bottom: 1px solid var(--rule); border-left: 2px solid transparent; }
.g-entry:target { border-left-color: var(--red); padding-left: 18px; background: linear-gradient(90deg, rgba(182, 60, 53, 0.08), transparent 60%); }
.g-term { grid-area: term; font-family: var(--display); font-weight: 400; font-size: clamp(32px, 3.4vw, 44px); line-height: 1.05; color: #fff; overflow-wrap: break-word; hyphens: auto; }
.g-anchor { text-decoration: none; }
.g-anchor:hover { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 6px; text-decoration-thickness: 1px; }
.g-expansion { grid-area: exp; margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--muted); }
.g-expansion::first-letter { text-transform: uppercase; }
.g-short { grid-area: short; font-size: 19px; font-weight: 500; line-height: 1.5; color: #fff; max-width: 60ch; padding-top: 4px; }
.g-text { grid-area: text; margin-top: 10px; font-size: 16px; line-height: 1.7; color: var(--muted); max-width: 64ch; }
.g-text code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.92em; color: var(--bone); background: var(--graphite); padding: 1px 5px; border-radius: 3px; }
.g-video { grid-area: video; margin-top: 18px; max-width: 420px; }
.g-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 3px; }
.g-meta { grid-area: meta; margin-top: 16px; display: grid; gap: 6px; font-size: 14px; }
.g-meta-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.g-meta-label { color: var(--faint); min-width: 72px; }
.g-meta-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.g-meta-links a { color: var(--bone); text-decoration-color: var(--red); text-underline-offset: 4px; }
.g-meta-links a:hover { color: #fff; }
.g-none { margin-top: 32px; color: var(--muted); }

@media (max-width: 1000px) {
  .g-tools-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .g-jump { grid-column: 1 / -1; justify-self: stretch; }
  .g-jump-list { justify-content: flex-start; }
  .g-letter, .g-entry { scroll-margin-top: 140px; }
}
@media (max-width: 760px) {
  .g-tools-inner { grid-template-columns: minmax(0, 1fr) auto; padding-top: 10px; padding-bottom: 8px; gap: 6px 12px; }
  .g-filter-label { grid-column: 1 / -1; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .g-jump-list { gap: 0; }
  .g-jump-link { min-width: 32px; height: 34px; }
  .g-entry { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'term' 'exp' 'short' 'text' 'video' 'meta'; grid-template-rows: none; padding: 22px 0 24px; }
  .g-entry:target { padding-left: 14px; }
  .g-term { font-size: 34px; }
  .g-short { margin-top: 12px; font-size: 17px; padding-top: 0; }
  .g-text { font-size: 15px; }
  .g-group { margin-top: 28px; }
  .g-letter { font-size: 32px; }
  .g-letter, .g-entry { scroll-margin-top: 152px; }
}

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 24px 0; font-size: 13px; color: var(--faint); }

/* Sign-in pages */
.auth { padding-top: 72px; padding-bottom: 72px; max-width: 560px; margin-left: auto; margin-right: auto; }
@media (min-width: 900px) { .auth { margin-left: max(var(--gutter), calc((100vw - 1180px) / 2)); } }
.auth-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red-lift); }
.auth-title { margin-top: 10px; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 60px); line-height: 1.05; color: #fff; }
.auth-lede { margin-top: 18px; font-size: 17px; font-weight: 300; line-height: 1.65; color: var(--muted); }
.auth-lede strong { color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.auth-lede a, .auth-aside a, .foot a { color: #fff; text-decoration-color: var(--red); text-underline-offset: 4px; }
.auth-msg { margin-top: 24px; }
.auth-form { margin-top: 32px; display: grid; gap: 10px; }
.auth-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.auth-input { width: 100%; font: inherit; font-size: 17px; color: #fff; background: var(--graphite); border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px; padding: 13px 14px; }
.auth-input::placeholder { color: var(--faint); }
.auth-input:focus { border-color: var(--aqua); outline: none; box-shadow: 0 0 0 1px var(--aqua); }
.auth-submit { margin-top: 10px; justify-self: start; }
.auth-submit:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 480px) { .auth { padding-top: 48px; } .auth-submit { justify-self: stretch; } }
.auth-aside { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--faint); }
.auth-actions { margin-top: 32px; }

/* Header sign-out and footer links */
.top-form { display: contents; }
.top-button { background: none; border: 0; cursor: pointer; font-family: var(--body); }
.foot-sep { margin: 0 6px; }
.foot-link { font-size: inherit; font-weight: 400; color: inherit; }
.foot a { color: inherit; }
