/* ============================================================================
   tutorials/tutorials.css — the /tutorials/ hub and tutorial pages
   ----------------------------------------------------------------------------
   Stands on its own: these pages load only fonts.css (for the two typefaces)
   and this file. Colours match tokens.css (--c-accent #35a1cd on black).
   Written phone first; the playlist moves beside the article from 1000px.
   ========================================================================== */
:root {
  --bg: #000;
  --panel: #0d1c26;
  --panel-lift: #17303d;
  --rule: rgb(255 255 255 / 0.16);
  --text: rgb(255 255 255 / 0.88);
  --muted: rgb(255 255 255 / 0.6);
  --accent: #35a1cd;
  --accent-light: #6fc3e4;
  --display: 'Big Shoulders Display', 'Saira Extra Condensed', 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* color-scheme tells the browser to draw its own controls (scroll bars, the
   video controls) dark; the two rules after it tint the scroll bars to match. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: dark; scrollbar-color: var(--panel-lift) var(--bg); }
.pl { scrollbar-width: thin; scrollbar-color: rgb(53 161 205 / 0.45) transparent; }
.pl::-webkit-scrollbar { width: 8px; }
.pl::-webkit-scrollbar-track { background: transparent; }
.pl::-webkit-scrollbar-thumb { background: rgb(53 161 205 / 0.45); border-radius: 999px; }
.pl::-webkit-scrollbar-thumb:hover { background: var(--accent); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-light); }
a:focus-visible, video:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* ------------------------------------------------------------------ top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; background: rgb(0 0 0 / 0.92); backdrop-filter: blur(8px); }
.top__brand { display: flex; align-items: center; gap: 10px; }
.top__mark { height: 30px; width: auto; }
.top__word { height: 18px; width: auto; }
@media (max-width: 419px) { .top__word { display: none; } }
.top__nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.top__nav a { color: var(--text); text-decoration: none; white-space: nowrap; }
.top__nav a:hover { color: var(--accent-light); }
.top__nav .top__cta { color: #000; background: var(--accent); padding: 8px 12px; border-radius: 999px; font-weight: 500; }
.top__nav .top__cta:hover { color: #000; background: var(--accent-light); }
@media (max-width: 479px) { .top__nav a:nth-child(2) { display: none; } }

/* -------------------------------------------------------------------- shell */
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 16px 56px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-light); }
.eyebrow { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-light); }
h1 { margin: 0 0 16px; font-family: var(--display); font-weight: 200; text-transform: uppercase; color: var(--accent); font-size: clamp(34px, 7.5vw, 58px); line-height: 1; letter-spacing: 0.01em; text-wrap: balance; }
h2 { margin: 48px 0 14px; font-family: var(--display); font-weight: 200; text-transform: uppercase; color: #fff; font-size: clamp(26px, 5vw, 34px); line-height: 1.05; letter-spacing: 0.02em; }
h3 { margin: 24px 0 6px; font-size: 18px; font-weight: 500; color: #fff; line-height: 1.35; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: #fff; max-width: 68ch; }

.btn { display: inline-block; background: var(--accent); color: #000; font-weight: 500; text-decoration: none; padding: 13px 20px; border-radius: 999px; line-height: 1.25; }
.btn:hover { background: var(--accent-light); }
.btn--ghost { background: none; color: var(--accent-light); box-shadow: inset 0 0 0 1px var(--accent); }
.btn--ghost:hover { background: var(--panel-lift); }

/* ------------------------------------------------- tutorial: layout + stage */
.layout { display: grid; gap: 40px; }
.main { min-width: 0; }
.stage { display: grid; gap: 20px; margin-top: 20px; }
.lead--after { margin-top: 32px; }
.player { position: relative; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--rule); }
.player video { width: 100%; aspect-ratio: 9 / 16; background: var(--panel); }
.upnext { position: absolute; left: 12px; right: 12px; bottom: 64px; display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--accent); color: #000; text-decoration: none; box-shadow: 0 8px 30px rgb(0 0 0 / 0.5); }
.upnext[hidden] { display: none; }
.upnext__k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.upnext__t { font-size: 19px; font-weight: 500; line-height: 1.2; }
.upnext__go { font-size: 14px; }

.side .btn { display: block; text-align: center; }
.side__note { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.side__h { margin: 24px 0 10px; font-family: var(--body); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ticks { list-style: none; margin: 0 0 22px; padding: 0; }
.ticks li { position: relative; padding: 0 0 8px 26px; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: 0.5em; width: 12px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.main > .pager { margin-top: 48px; }
.pager__btn { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; text-decoration: none; background: var(--panel); min-width: 0; }
.pager__btn:hover { border-color: var(--accent); background: var(--panel-lift); }
.pager__btn--next { text-align: right; border-color: var(--accent); }
.pager__dir { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-light); }
.pager__name { color: #fff; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }

/* --------------------------------------------------------- tutorial: article */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 52px; scroll-margin-top: 72px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-lift); color: var(--accent-light); font-weight: 500; border: 1px solid var(--accent); }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 18px; top: 40px; bottom: 2px; width: 1px; background: var(--rule); }
.steps h3 { margin: 4px 0 4px; }
.steps p { margin: 0; color: var(--text); }

.tables { display: grid; gap: 16px; margin-bottom: 8px; }
.kv { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; font-size: 16px; }
.kv caption { text-align: left; padding: 0 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kv th, .kv td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.kv tr:first-child th, .kv tr:first-child td { border-top: 0; }
.kv th { font-weight: 400; color: var(--muted); width: 44%; }
.kv td { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* -------------------------------------------------------------- the playlist */
.pl { border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); padding: 14px 8px 8px; align-self: start; }
.pl__h { margin: 0 8px 8px; display: flex; align-items: baseline; justify-content: space-between; font-size: 24px; }
.pl__h span { font-family: var(--body); font-size: 13px; letter-spacing: 0.04em; text-transform: none; color: var(--muted); }
.pl__list { list-style: none; margin: 0; padding: 0; }
.pl__list a { display: grid; grid-template-columns: 20px 48px 1fr; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--text); }
.pl__list a:hover { background: var(--panel-lift); }
.pl__list .is-current a { background: var(--panel-lift); box-shadow: inset 3px 0 0 var(--accent); }
.pl__n { font-size: 13px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.pl__thumb { width: 48px; height: 60px; object-fit: cover; border-radius: 6px; background: #000; }
.pl__text { display: grid; min-width: 0; }
.pl__title { color: #fff; font-weight: 500; line-height: 1.25; }
.pl__time { font-size: 13px; color: var(--muted); }
.is-current .pl__time { color: var(--accent-light); }
.pl__all { display: block; margin: 8px; padding: 10px; text-align: center; font-size: 14px; text-decoration: none; border-top: 1px solid var(--rule); }

/* --------------------------------------------------------------------- hub */
.hub__cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.cards { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
.card { display: grid; gap: 2px; text-decoration: none; color: var(--text); }
.card__img { position: relative; display: block; margin-bottom: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule); background: var(--panel); transition: border-color 0.2s; }
.card__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.card__play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgb(0 0 0 / 0.55); border: 1px solid rgb(255 255 255 / 0.5); }
.card__play::after { content: ''; position: absolute; left: 18px; top: 14px; border-left: 13px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.card__time { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgb(0 0 0 / 0.78); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.card__n { font-size: 12px; letter-spacing: 0.1em; color: var(--accent-light); font-variant-numeric: tabular-nums; }
.card__title { margin: 0; font-family: var(--body); font-size: 17px; font-weight: 500; text-transform: none; letter-spacing: 0; line-height: 1.25; color: #fff; }
.card__text { font-size: 14px; line-height: 1.4; color: var(--muted); }
.card:hover .card__img, .card:focus-visible .card__img { border-color: var(--accent); }
.card:hover .card__play { background: var(--accent); border-color: var(--accent); }
.card:hover .card__title { color: var(--accent-light); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.about { max-width: 72ch; margin-top: 24px; font-size: 15px; color: var(--muted); }
.about h2 { font-size: 22px; color: var(--text); }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--rule); padding: 32px 16px 40px; max-width: 1180px; margin: 0 auto; font-size: 15px; color: var(--muted); }
.foot__lead { max-width: 70ch; color: var(--text); }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot__legal { margin: 0; font-size: 13px; }

/* ------------------------------------------------------------------ wider */
@media (min-width: 700px) {
  .wrap { padding: 24px 28px 72px; }
  .top { padding: 14px 28px; }
  .foot { padding: 40px 28px 48px; }
  .stage { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .player { margin: 0; }
  .side .btn { display: inline-block; }
  .side__note { text-align: left; }
  .tables { grid-template-columns: 1fr 1fr; align-items: start; }

}
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; }
  .pl { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
