/* subkit — "Cinema Cut" design system
   ------------------------------------------------------------------
   Shared by the landing page and every documentation subpage.        */

@font-face { font-family: "Archivo Black"; font-display: swap; src: local("Archivo Black"); }

:root {
  /* surface */
  --black:    #0b0b0d;
  --panel:    #141418;
  --panel-2:  #1a1a20;
  --sunk:     #08080a;
  --line:     #26262e;
  --line-2:   #34343f;

  /* text */
  --white:    #f2f0ec;
  --grey:     #9aa0ab;
  --dim:      #6b7180;

  /* accent */
  --amber:    #f5a524;
  --amber-2:  #ff7a1a;
  --amber-dk: #6b4306;
  --green:    #6ee7a0;
  --red:      #e0564a;

  /* type */
  --disp: "Archivo Black", "Archivo", "Bahnschrift", Impact, sans-serif;
  --sans: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;

  /* metrics */
  --rail: 26px;
  --gut: 32px;
  --maxw: 1180px;
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 90;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  animation: grain 800ms steps(2) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-2%, 3%); }
  100% { transform: translate(0, 0); }
}

/* sprocket rails */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 20;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
}
.rail.l { left: 0;  border-right: 1px solid var(--line); }
.rail.r { right: 0; border-left:  1px solid var(--line); }
.rail i {
  display: block;
  width: 11px;
  height: 16px;
  border-radius: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
}
@media (max-width: 980px) { .rail { display: none; } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); position: relative; z-index: 1; }
@media (max-width: 620px) { :root { --gut: 20px; } }

/* ── skip link ─────────────────────────────────────────────── */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--amber);
  color: #1a1000;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 12px 18px;
  text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── site header ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 11, 13, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 15px;
  padding-bottom: 15px;
}
.logo {
  font-family: var(--disp);
  font-size: 20px;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  white-space: nowrap;
}
.logo span { color: var(--amber); }
.topnav { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.topnav a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.topnav a:hover { color: var(--amber); }
.topnav a[aria-current="page"] { color: var(--white); }
.topnav a[aria-current="page"]::before { content: "▸ "; color: var(--amber); }
@media (max-width: 720px) {
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topnav { gap: 16px; }
}

/* ── shared type ───────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}
h1, h2, h3 { letter-spacing: -.02em; }
.display {
  font-family: var(--disp);
  text-transform: uppercase;
  line-height: .88;
  letter-spacing: -.02em;
  margin: 0;
}
.hot {
  background: linear-gradient(96deg, var(--amber) 0%, var(--amber-2) 58%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { font-size: 19px; color: var(--grey); line-height: 1.55; max-width: 58ch; }
.lede b { color: var(--white); font-weight: 600; }

code, kbd, pre, samp { font-family: var(--mono); }
:not(pre) > code {
  font-size: .87em;
  color: var(--amber);
  background: rgba(245, 165, 36, .09);
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
}

/* ── buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: #1a1000;
  padding: 13px 20px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--amber-2); border-color: var(--amber-2); transform: translateY(-2px); box-shadow: 0 12px 28px -14px var(--amber-2); }
.btn.ghost { background: transparent; color: var(--white); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); box-shadow: none; }

.copy {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: transparent;
  color: var(--grey);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 13px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
  flex: none;
}
.copy:hover { color: var(--amber); border-color: var(--amber); }
.copy[data-done="1"] { color: var(--green); border-color: var(--green); }

/* ── code blocks ───────────────────────────────────────────── */
.code {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.code-head .fname { color: var(--grey); }
.code-head .copy { margin-left: auto; }
.code pre {
  margin: 0;
  padding: 16px 16px;
  font-size: 13px;
  line-height: 1.85;
  overflow-x: auto;
  color: var(--white);
  tab-size: 2;
}
/* token colours */
.t-cm { color: var(--dim); }            /* comment  */
.t-fl { color: var(--amber); }          /* flag     */
.t-st { color: var(--green); }          /* string   */
.t-nu { color: #8fbcff; }               /* number   */
.t-ky { color: var(--grey); }           /* key      */
.t-ok { color: var(--green); }
.t-tc { color: var(--amber); }          /* timecode */
.t-sp { color: #c58cff; }               /* speaker  */
.prompt::before { content: "$ "; color: var(--dim); }

/* ── tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--grey);
  padding: 9px 15px;
  border-radius: 3px;
  cursor: pointer;
  transition: .15s;
}
.tab:hover { color: var(--white); }
.tab[aria-selected="true"] { border-color: var(--amber); color: var(--amber); background: rgba(245, 165, 36, .08); }
.panel[hidden] { display: none; }

/* ── section scaffolding ───────────────────────────────────── */
section { padding: 104px 0 0; }
.sec-title {
  font-family: var(--disp);
  text-transform: uppercase;
  font-size: clamp(28px, 4.6vw, 52px);
  line-height: .95;
  letter-spacing: -.015em;
  margin: 0 0 18px;
}
.sec-sub { color: var(--grey); font-size: 16.5px; max-width: 62ch; margin: 0 0 38px; }

/* ── footer ────────────────────────────────────────────────── */
footer.site {
  margin-top: 110px;
  border-top: 1px solid var(--line);
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 64px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
footer.site a { color: var(--dim); text-decoration: none; margin-right: 22px; }
footer.site a:hover { color: var(--amber); }

/* ── documentation pages ───────────────────────────────────── */
.doc { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 56px; padding: 52px 0 0; align-items: start; }
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; gap: 32px; } }

.toc { position: sticky; top: 96px; }
@media (max-width: 900px) { .toc { position: static; border-bottom: 1px solid var(--line); padding-bottom: 22px; } }
.toc h2 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 14px;
  font-weight: 500;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.toc a {
  display: block;
  font-size: 13.5px;
  color: var(--grey);
  text-decoration: none;
  padding: 6px 0 6px 13px;
  border-left: 2px solid var(--line);
  transition: .15s;
}
.toc a:hover { color: var(--white); border-color: var(--line-2); }
.toc a.active { color: var(--amber); border-color: var(--amber); }

.doc-body { min-width: 0; padding-bottom: 40px; }
.doc-body h1 {
  font-family: var(--disp);
  text-transform: uppercase;
  font-size: clamp(32px, 5.6vw, 60px);
  line-height: .92;
  margin: 0 0 18px;
}
.doc-body > .lede { margin: 0 0 44px; }
.doc-body h2 {
  font-family: var(--disp);
  text-transform: uppercase;
  font-size: 25px;
  line-height: 1.05;
  margin: 62px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.doc-body h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.doc-body h3 { font-size: 17px; font-weight: 700; margin: 34px 0 10px; }
.doc-body p { color: var(--grey); margin: 0 0 16px; max-width: 72ch; }
.doc-body p b, .doc-body li b { color: var(--white); font-weight: 600; }
.doc-body ul, .doc-body ol { color: var(--grey); max-width: 72ch; padding-left: 20px; margin: 0 0 18px; }
.doc-body li { margin-bottom: 8px; }
.doc-body .code { margin: 0 0 20px; }
.doc-body a { color: var(--amber); text-decoration: underline; text-decoration-color: var(--amber-dk); text-underline-offset: 3px; }
.doc-body a:hover { text-decoration-color: var(--amber); }

/* definition table used across docs */
.dl { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; }
.dl th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--line);
}
.dl td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--grey); }
.dl td:first-child { color: var(--white); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.dl td:first-child .short { color: var(--dim); }
.dl tr:last-child td { border-bottom: 0; }
@media (max-width: 700px) {
  .dl, .dl tbody, .dl tr, .dl td { display: block; width: auto; }
  .dl thead { display: none; }
  .dl tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .dl td { border: 0; padding: 3px 0; }
  .dl td:first-child { white-space: normal; margin-bottom: 4px; }
}

/* callout */
.note {
  border-left: 2px solid var(--amber);
  background: rgba(245, 165, 36, .05);
  padding: 14px 18px;
  margin: 0 0 22px;
  font-size: 14.5px;
  color: var(--grey);
  border-radius: 0 var(--r) var(--r) 0;
}
.note b { color: var(--white); }
.note.warn { border-color: var(--red); background: rgba(224, 86, 74, .06); }

/* next / prev */
.pagenav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--line); }
.pagenav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 18px;
  transition: .15s;
}
.pagenav a:hover { color: var(--amber); border-color: var(--amber); }

/* ── motion preferences ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
