/* keystroketv.com: the page's own layer. Brand tokens come from keystroke.css
   (generated from the brand system); the engine's mechanism from scrollcraft.css.
   Raw hex is avoided: everything reads brand tokens. */

:root {
  --sc-canvas: var(--ground);
  --sc-surface: var(--panel);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-dim);
  --sc-accent: var(--ink);
  --sc-accent-ink: var(--ground);
  --sc-font-display: var(--font-display);
  --sc-font-text: var(--font-body);
  --sc-font-mono: var(--font-mono);
  --folio: 88px;
  --pad: clamp(16px, 4.4vw, 64px);
}
html { scroll-padding-top: 0; }
body { font-family: var(--font-body); font-size: 17px; line-height: 28px; letter-spacing: 0; }
::selection { background: var(--ink); color: var(--ground); }
:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
a { color: inherit; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--ground); padding: 8px 12px; font: 700 12px/16px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.skip:focus { left: calc(var(--folio) + 8px); }

/* ------------------------------------------------------------ chapters -- */
main { margin-left: var(--folio); }
.ch { position: relative; background: var(--ground); color: var(--ink); }
.ch--paper { padding-block: clamp(80px, 11vw, 168px); }
.wrap { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--pad); }
.ch__head { margin-bottom: clamp(32px, 4vw, 56px); }
.ch__title {
  margin: 0; font-family: var(--font-display); font-weight: 300; text-transform: uppercase;
  letter-spacing: .06em; font-size: clamp(36px, 4.6vw, 64px); line-height: 1.04; color: var(--ink);
}
.ch__title--xl { font-size: clamp(64px, 12vw, 176px); letter-spacing: .08em; line-height: .95; }

/* typed titles: letters stay in the layout, hidden until entered */
.js [data-type] .tc { visibility: hidden; }
.js [data-type] .tc.on { visibility: visible; }
.caret { display: inline-block; width: .08em; min-width: 3px; height: .86em; margin-left: .06em; vertical-align: -.04em; background: currentColor; }
.caret.idle { animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --------------------------------------------------------------- folio -- */
.folio {
  position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: var(--folio);
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  padding: 22px 0 24px; background: var(--ground); border-right: 1px solid var(--hairline); color: var(--ink);
}
.folio__key { display: block; width: 40px; height: 40px; }
.folio__key svg, .bigkey svg { width: 100%; height: 100%; overflow: visible; }
.folio__key .lip, .bigkey .lip { fill: var(--key-lip); }
.folio__key .face > path:first-child, .bigkey .face > path:first-child { fill: var(--key-face); }
.folio__key .arrow, .bigkey .arrow { fill: none; stroke: #101010; stroke-width: 12; stroke-linecap: square; }
.bigkey .legend { fill: #101010; }
.folio__key .face { transition: transform var(--duration-press) var(--ease-out); }
.folio__key.is-down .face { transform: translateY(12px); }
.folio__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.folio__list a {
  display: block; writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 6px;
  font: 400 11px/14px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  color: var(--ink-faint); transition: color 160ms var(--ease-out);
}
.folio__list a:hover { color: var(--ink); }
.folio__list a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.folio__list a[aria-current="true"]::after { content: ""; display: inline-block; width: 2px; height: 14px; margin-top: 8px; background: var(--ink); }
.folio__now { display: none; }

/* ----------------------------------------------------------- title page -- */
.title { display: grid; align-items: center; background: var(--ground); }
.kbd {
  position: absolute; inset: -6% -4% auto auto; width: min(1100px, 82vw);
  display: grid; gap: 10px; opacity: .55; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 30%, transparent 75%);
}
.kbd__row { display: flex; gap: 10px; }
.kbd__row:nth-child(2) { margin-left: 34px; } .kbd__row:nth-child(3) { margin-left: 56px; } .kbd__row:nth-child(4) { margin-left: 92px; }
.kbd__k {
  --c: 8px; flex: none; width: 72px; height: 66px; position: relative; isolation: isolate;
  background: var(--hairline-strong);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%);
  transition: transform 90ms var(--ease-out), background-color 90ms var(--ease-out);
}
.kbd__k::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--ground); clip-path: polygon(0 0, calc(100% - var(--c) + .6px) 0, 100% calc(var(--c) - .6px), 100% 100%, 0 100%); }
.kbd__k span { position: absolute; left: 10px; top: 8px; font: 400 13px/1 var(--font-mono); color: var(--ink-faint); }
.kbd__k.is-down { transform: translateY(3px); background: var(--ink-dim); }
.kbd__k.is-down::before { background: var(--fill); }
.kbd__k.is-down span { color: var(--ink); }
.kbd__k--wide { width: 128px; }

.title__grid {
  position: relative; z-index: 2; display: flex; align-items: center; gap: clamp(20px, 3vw, 48px);
  padding: 0 var(--pad); margin-top: -4vh;
}
.bigkey { flex: none; width: clamp(150px, 21vw, 320px); aspect-ratio: 1; }
.bigkey .face { transform: translateY(calc(var(--press, 0) * 13px)); }
.bigkey { filter: drop-shadow(0 calc(26px - var(--press, 0) * 18px) 40px rgba(245, 165, 36, calc(.16 - var(--press, 0) * .1))); }
.title__words { position: relative; min-width: 0; padding-top: 34px; }
.name {
  margin: 0; font-family: var(--font-display); font-weight: 300; text-transform: uppercase;
  font-size: clamp(44px, 8.4vw, 136px); line-height: .9; letter-spacing: .16em; white-space: nowrap;
  color: var(--ink);
}
.js .name .nc { color: var(--hairline-strong); transition: color 80ms linear; }
.js .name .nc.on { color: var(--ink); }
.name .caret { height: .8em; vertical-align: 0; margin-left: -.1em; }
.tagline { margin: 22px 0 0; font: 400 13px/16px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); }
.title__after { position: absolute; left: 0; top: 100%; width: min(560px, calc(100vw - var(--folio) - 2 * var(--pad))); margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; max-width: 760px; }
.js .title__after { opacity: var(--after, 0); transform: translateY(calc((1 - var(--after, 0)) * 12px)); }
.cue {
  position: absolute; z-index: 3; left: 50%; bottom: clamp(28px, 6vh, 56px); translate: -50% 0; margin: 0;
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  font: 400 12px/16px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim);
  opacity: var(--cue, 1); pointer-events: none;
}
.cue__cap {
  --c: 6px; position: relative; isolation: isolate; display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--hairline-strong); border-bottom: 3px solid var(--hairline-strong);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%);
  animation: cue-press 2.4s var(--ease-out) infinite;
}
.cue__cap::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--panel); clip-path: polygon(0 0, calc(100% - var(--c) + .6px) 0, 100% calc(var(--c) - .6px), 100% 100%, 0 100%); }
.cue__cap svg { width: 16px; height: 16px; color: var(--ink); }
@keyframes cue-press { 0%, 70%, 100% { transform: none; border-bottom-width: 3px; } 78%, 86% { transform: translateY(3px); border-bottom-width: 0; } }
.title__lede { margin: 0; max-width: 440px; color: var(--ink-dim); font-size: 17px; line-height: 28px; }

/* --------------------------------------------------------- on the record -- */
.spread { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.pull { margin: 0; font-family: var(--font-display); font-weight: 300; text-transform: uppercase; letter-spacing: .05em; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.12; }
.spread__body { max-width: var(--measure); }
.spread__body p { margin: 0 0 20px; }
.spread__body .body-l { font-size: 20px; line-height: 32px; }
.words { margin-top: clamp(64px, 8vw, 120px); padding-top: 32px; border-top: 1px solid var(--hairline-strong); }
.words__head, .series__head { margin: 0 0 32px; font: 700 13px/16px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.words__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px clamp(32px, 5vw, 80px); }
.words__list li { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.words__list .ks-label > span { background: var(--ground); min-width: 168px; }
.words__list p { margin: 0; font-size: 16px; line-height: 26px; }
.words__note { margin: 40px 0 0; font-size: 15px; line-height: 24px; color: var(--ink-dim); max-width: 640px; }
.words__note b { font: 700 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }

/* --------------------------------------------------------------- ARTEX -- */
.ep-head { padding-top: clamp(96px, 12vw, 176px); padding-bottom: 24px; }
.ep-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 28px; font: 400 13px/20px var(--font-mono); letter-spacing: .04em; color: var(--ink-dim); }
.ep-head__dek { margin: 0; max-width: 720px; font-size: 20px; line-height: 32px; color: var(--ink); }

.clock__stage { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 4vw, 64px); align-items: center; padding: 0 var(--pad); max-width: calc(var(--content-max) + 2 * var(--pad)); margin-inline: auto; background: var(--ground); }
.clock__media { margin: 0; }
.clock__media header span { margin-left: auto; }
.clock__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #101010; }
.clock__copy { position: relative; height: 300px; }
.beat { position: absolute; inset: 0 0 auto 0; }
.beat__when { margin: 0 0 12px; font: 700 13px/16px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.beat__line { margin: 0 0 20px; font-family: var(--font-display); font-weight: 300; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.18; }

.parts { padding-block: clamp(36px, 5vw, 72px); }
.parts--first { padding-top: clamp(64px, 8vw, 120px); }
.parts--last { padding-bottom: clamp(80px, 10vw, 140px); }
.part { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; margin-bottom: clamp(48px, 6vw, 96px); }
.part--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.part--flip .part__media { order: 2; }
.part__media { margin: 0; }
.part__img { --c: var(--cut-xl); position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--fill); clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%); }
.part__img img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; }
.part__media figcaption { margin-top: 12px; font: 400 12px/18px var(--font-mono); letter-spacing: .04em; color: var(--ink-dim); }
.part__title { margin: 0 0 20px; font-family: var(--font-display); font-weight: 300; text-transform: uppercase; letter-spacing: .05em; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.05; }
.part__title span { display: block; margin-bottom: 10px; font: 400 12px/16px var(--font-mono); letter-spacing: .16em; color: var(--ink-dim); }
.part__text > p { margin: 0 0 20px; max-width: 460px; color: var(--ink); }
.part__text .figure { margin: 0 0 8px; font-family: var(--font-display); font-weight: 300; font-size: clamp(56px, 6vw, 88px); line-height: 1; letter-spacing: .02em; color: var(--truth); }
.part__text .ks-quote { margin: 0 0 20px; font-size: 26px; line-height: 36px; }
.sources { margin: 0; padding-top: 24px; border-top: 1px solid var(--hairline); font: 400 12px/20px var(--font-mono); letter-spacing: .02em; color: var(--ink-dim); max-width: 880px; }

/* ------------------------------------------------------------- for you -- */
.you__dek { margin: 0 0 48px; max-width: 640px; font-size: 20px; line-height: 32px; }
.you__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(24px, 4vw, 56px); }
.you__list li { display: flex; gap: 24px; align-items: center; padding: 20px 24px 20px 20px; background: var(--panel); --c: var(--cut-l); clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%); }
.you__list { filter: drop-shadow(var(--shadow-paper)); }
.you__list .ks-tile { flex: none; }
.you__list h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; font-size: 22px; line-height: 1.15; }
.you__list p { margin: 0; font-size: 15px; line-height: 24px; color: var(--ink-dim); }
.series { margin-top: clamp(72px, 9vw, 128px); padding-top: 32px; border-top: 1px solid var(--hairline-strong); }
.series__list { list-style: none; margin: 0; padding: 0; }
.series__list li { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--hairline); }
.series__list p { margin: 0; }

/* ------------------------------------------------------------ colophon -- */
.colophon__stage { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(80px, 14vh, 160px) var(--pad) 28px; background: var(--ground); }
.colophon__plate { max-width: 860px; }
.colophon__plate .ch__title { margin-bottom: 36px; }
.colophon__run { margin: 0 0 20px; max-width: 780px; font-size: 22px; line-height: 36px; color: var(--ink); }
.colophon__run a { text-decoration: underline; text-decoration-color: var(--ink-dim); text-decoration-thickness: 1px; text-underline-offset: 5px; }
.colophon__run a:hover { text-decoration-color: var(--ink); }
.colophon__run--s { font-size: 17px; line-height: 28px; color: var(--ink-dim); }
.colophon__run--s a { color: var(--ink); }
.colophon__mast { margin-top: clamp(40px, 7vh, 80px); }
.colophon__mast img { width: clamp(200px, 24vw, 320px); height: auto; }
.colophon__mast .tagline { margin-top: 14px; font-size: 12px; }
.colophon__fine { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 16px; border-top: 1px solid var(--hairline); font: 400 12px/18px var(--font-mono); color: var(--ink-dim); }
.colophon__fine .ver { margin-left: auto; color: var(--ink-faint); }

/* --------------------------------------------------------------- phone -- */
@media (max-width: 860px) {
  :root { --folio: 0px; }
  .folio {
    top: auto; bottom: 12px; left: 12px; width: auto; height: auto; flex-direction: row; gap: 10px;
    padding: 8px 14px 8px 8px; border: 1px solid var(--hairline-strong);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  }
  .folio__key { width: 30px; height: 30px; }
  .folio__list { display: none; }
  .folio__now { display: block; margin: 0; font: 700 11px/14px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
  .title__grid { flex-direction: column; align-items: center; text-align: center; margin-top: -8vh; }
  .title__words { display: flex; flex-direction: column; align-items: center; }
  .name { margin-right: -.14em; }
  .title__after { left: 50%; width: calc(100vw - 2 * var(--pad)); margin-left: calc(50vw * -1 + var(--pad)); justify-content: center; margin-top: 32px; }
  .title__lede { margin-inline: auto; }
  .cue { bottom: 86px; }
  .bigkey { width: clamp(120px, 34vw, 190px); }
  .name { font-size: clamp(34px, 11.4vw, 64px); letter-spacing: .14em; }
  .kbd { inset: 3% auto auto 50%; width: 760px; opacity: .45; transform-origin: top left; scale: .62; translate: -236px 0; }
  .spread, .words__list, .you__list { grid-template-columns: 1fr; }
  .words__list li, .series__list li { grid-template-columns: 1fr; gap: 12px; }
  .clock__stage { grid-template-columns: 1fr; align-content: center; gap: 24px; }
  .clock__copy { height: 270px; }
  .clock__media header span { display: none; }
  .part, .part--flip { grid-template-columns: 1fr; gap: 24px; }
  .part--flip .part__media { order: 0; }
  .colophon__run { font-size: 19px; line-height: 31px; }
  .colophon__fine .ver { margin-left: 0; }
  .colophon__stage { padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .title__after { opacity: 1; transform: none; }
  .js .name .nc { color: var(--ink); }
  .caret { display: none; }
  .cue__cap { animation: none; }
  .folio__key .face { transition: none; }
}
/* a stagger container is a reveal trigger, not a thing that fades */
[data-sc-in][data-sc-stagger] { opacity: 1; transform: none; }
