/* Shared by the showreel and the library: the palette, the type, the header, the footer and the
   controls. An edit bay: quiet greys that let the footage carry the colour, one blue for what you
   can act on, and mono for timecodes and code. */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --ink: #14161b;
  --muted: #5b606c;
  --faint: #8b909b;
  --line: #dde0e6;
  --accent: #2b54de;
  --accent-ink: #ffffff;
  --stage: #0b0c0f;
  --code-bg: #f6f7f9;
  --header-bg: rgba(242, 243, 245, 0.82);
  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --wide: 1320px;
  --gutter: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f12; --surface: #17191e; --ink: #eceef2; --muted: #a0a6b2; --faint: #6f7581; --line: #262a31;
    --accent: #7e9cff; --accent-ink: #0e0f12; --stage: #000000; --code-bg: #0b0c0f; --header-bg: rgba(14, 15, 18, 0.82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f12; --surface: #17191e; --ink: #eceef2; --muted: #a0a6b2; --faint: #6f7581; --line: #262a31;
  --accent: #7e9cff; --accent-ink: #0e0f12; --stage: #000000; --code-bg: #0b0c0f; --header-bg: rgba(14, 15, 18, 0.82);
  color-scheme: dark;
}
@media (max-width: 640px) { :root { --gutter: 16px; } }

body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input { font: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: the name, and the two pages. */
header.site { position: sticky; top: 0; z-index: 20; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
header.site .bar { max-width: var(--wide); margin: 0 auto; padding-inline: var(--gutter); height: 58px; display: flex; align-items: center; gap: 28px; }
.mark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 700 21px/1 var(--display); letter-spacing: -0.02em; }
.mark i { width: 24px; height: 24px; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.mark i::before { content: ''; width: 0; height: 0; margin-left: 2px; border-left: 8px solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
header.site nav { display: flex; gap: 4px; }
header.site nav a { color: var(--muted); text-decoration: none; font: 500 14px var(--body); padding: 6px 12px; border-radius: 999px; }
header.site nav a:hover { color: var(--ink); background: var(--surface); }
header.site nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
header.site .byline { margin-left: auto; font: 500 12px var(--mono); color: var(--faint); }
header.site .gh { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font: 600 14px var(--body); padding: 6px 12px; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); background: var(--surface); margin-left: -12px; }
header.site .gh:hover { box-shadow: 0 0 0 1px var(--faint); }
header.site .gh svg, footer.site .gh svg { width: 16px; height: 16px; fill: currentColor; }
footer.site .gh { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { header.site .byline { display: none; } header.site .bar { gap: 14px; } header.site .gh { margin-left: auto; } header.site .gh span { display: none; } }

.page { max-width: var(--wide); margin: 0 auto; padding-inline: var(--gutter); padding-block: 40px 80px; display: grid; gap: 72px; }
@media (max-width: 640px) { .page { padding-block: 24px 56px; gap: 52px; } }

/* Type. */
.eyebrow { margin: 0; font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font: 700 clamp(38px, 5.6vw, 72px)/0.98 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
h1 span { color: var(--accent); }
h2 { margin: 0; font: 700 clamp(24px, 2.6vw, 30px)/1.1 var(--display); letter-spacing: -0.015em; }
.lede { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 60ch; text-wrap: pretty; }
.note { margin: 0; color: var(--muted); max-width: 72ch; text-wrap: pretty; }
.count { font: 500 13px var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
section.block { display: grid; gap: 18px; }

/* Buttons and chips. */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: 0.9; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips > span { font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); min-width: 56px; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 13px var(--body); padding: 5px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.chip:hover { border-color: var(--faint); }
.chip b { font: 500 12px var(--mono); color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] b { color: inherit; opacity: 0.7; }

/* A frame of footage: poster, a preview loop over it, a timecode. */
.frame { position: relative; width: 100%; aspect-ratio: var(--a, 1.7778); max-width: 100%; background: var(--stage); border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04); }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame video { opacity: 0; transition: opacity 0.25s; }
.frame video.on { opacity: 1; }
.frame .tc { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.66); color: #fff; font: 500 12px var(--mono); font-variant-numeric: tabular-nums; }

footer.site { border-top: 1px solid var(--line); }
footer.site .bar { max-width: var(--wide); margin: 0 auto; padding: 28px var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; color: var(--muted); font-size: 14px; }
footer.site .bar a { color: var(--muted); text-decoration: none; }
footer.site .bar a:hover { color: var(--ink); }
footer.site .bar .grow { flex: 1; }
footer.site .mono { font: 400 12px var(--mono); color: var(--faint); }

@media (prefers-reduced-motion: reduce) { .frame video { transition: none; } }
