/* Cinematic theme: full-bleed footage, letterbox bars, condensed display titles. */
@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("assets/fonts/big-shoulders-display-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/figtree-latin.woff2") format("woff2");
}

:root {
  --bg: #050506;
  --surface: #0f0f11;
  --fg: #f3f1ee;
  --fg-dim: #bdb9b3;
  --fg-mute: #8d8983;
  --line: rgb(243 241 238 / 0.1);
  --line-strong: rgb(243 241 238 / 0.2);
  --accent: #f0c38e;
  --accent-hover: #f6d6b0;
  --dev: #f0c38e;
  --early: #8fd3c1;
  --live: #a8dc85;
  --rec: #e5484d;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: Figtree, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1180px;
  --bar: 52px;
  --gutter: max(20px, calc((100% - var(--max)) / 2 + 20px));
  --ease: 180ms ease;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 30; padding: 8px 14px;
  background: var(--fg); color: var(--bg); font-weight: 600;
}
.skip:focus { top: 8px; }
main:focus { outline: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }

/* Header: the top letterbox bar */
header.site { position: sticky; top: 0; z-index: 20; background: #000; border-bottom: 1px solid #141416; }
header.site nav { display: flex; align-items: center; gap: 26px; height: var(--bar); }
header.site .brand {
  margin-right: auto; color: var(--fg); font: 800 1.2rem/1 var(--display);
  letter-spacing: 0.12em; text-transform: uppercase;
}
header.site nav a:not(.brand) {
  color: var(--fg-mute); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  transition: color var(--ease);
}
header.site nav a:hover, header.site nav a[aria-current] { color: var(--fg); text-decoration: none; }
header.site .brand:hover { text-decoration: none; }
footer.site { border-top: 1px solid var(--line); color: var(--fg-mute); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px 48px; }
footer.site a { color: var(--fg-mute); }
footer.site a:hover { color: var(--fg); }

/* Shared bits */
.kicker { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 0; }
.rec { display: inline-flex; align-items: center; gap: 10px; }
.rec::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rec);
  box-shadow: 0 0 0 4px rgb(229 72 77 / 0.22); animation: rec 1.6s steps(2, end) infinite;
}
@keyframes rec { 50% { opacity: 0.25; } }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; color: var(--fg);
  border: 1px solid rgb(255 255 255 / 0.28); background: rgb(255 255 255 / 0.08); backdrop-filter: blur(6px);
  transition: background var(--ease), color var(--ease);
}
.btn:hover { background: rgb(255 255 255 / 0.16); text-decoration: none; }
.btn.primary { background: var(--fg); border-color: var(--fg); color: #050506; }
.btn.primary:hover { background: #fff; }
.badges { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.badge { color: var(--fg-dim); white-space: nowrap; }
.badge + .badge::before { content: "·"; margin-inline: 8px; color: var(--fg-mute); }
.badge.dev { color: var(--dev); }
.badge.early { color: var(--early); }
.badge.live { color: var(--live); }
.static {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    #0b0b0d;
  opacity: 0.3; animation: static 0.5s steps(4) infinite;
}
@keyframes static { 0% { background-position: 0 0; } 25% { background-position: -60px 40px; } 50% { background-position: 80px -30px; } 75% { background-position: -20px -70px; } 100% { background-position: 0 0; } }

/* Home: the feature presentation */
.stage { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end; min-height: min(86vh, 760px); background: #000; }
.stage > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 40%; z-index: -2;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.03); } to { transform: scale(1.1) translateX(-2%); } }
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(5 5 6 / 0.88) 0%, rgb(5 5 6 / 0.45) 42%, rgb(5 5 6 / 0) 70%),
              linear-gradient(0deg, rgb(5 5 6 / 0.9) 0%, rgb(5 5 6 / 0) 38%);
}
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: #000; z-index: 1; }
.stage-copy { padding-block: 96px 96px; display: grid; gap: 18px; justify-items: start; width: 100%; }
.stage-title { font: 900 clamp(4rem, 11vw, 10.5rem)/0.84 var(--display); text-transform: uppercase; letter-spacing: -0.005em; }
.stage-title a { color: var(--fg); }
.stage-title a:hover { text-decoration: none; color: #fff; }
.logline { margin: 0; max-width: 46ch; font-size: 1.15rem; color: #dedad5; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.reel { display: flex; gap: 10px; margin-top: 10px; }
.reel a { display: block; width: 128px; border: 1px solid rgb(255 255 255 / 0.22); transition: border-color var(--ease), opacity var(--ease); opacity: 0.85; }
.reel a:hover { border-color: var(--fg); opacity: 1; }
.reel img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 48px; align-items: end; padding-block: 64px 48px; }
.intro h1, .intro .lead { font: 800 clamp(2.4rem, 4.6vw, 4rem)/0.92 var(--display); text-transform: uppercase; margin: 0; }
.intro p { margin: 0; color: var(--fg-dim); font-size: 1.1rem; max-width: 52ch; }
.intro .lead { color: var(--fg); max-width: none; }
.intro p a { text-decoration: underline; text-underline-offset: 3px; }

/* Work index */
.index { padding-bottom: 6px; scroll-margin-top: var(--bar); }
.index-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 0 22px; }
.index-head h2 { font: 800 2.1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.index-head > a { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; padding: 8px 15px; border-radius: 999px;
  background: none; color: var(--fg-dim); border: 1px solid var(--line-strong); transition: color var(--ease), background var(--ease);
}
.filters button:hover { color: var(--fg); }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.filters .n { color: var(--fg-mute); margin-left: 6px; font-variant-numeric: tabular-nums; }
.filters button[aria-pressed="true"] .n { color: #57534d; }

.scenes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.scene {
  position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end;
  min-height: 400px; color: var(--fg); background: var(--surface); min-width: 0;
}
.scene:hover { text-decoration: none; }
.scene.wide { grid-column: 1 / -1; min-height: 480px; }
.scene > img, .scene > .static { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.scene > img { transition: transform 1.2s ease; }
.scene:hover > img, .scene:focus-visible > img { transform: scale(1.04); }
.scene::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgb(5 5 6 / 0.94) 0%, rgb(5 5 6 / 0.55) 42%, rgb(5 5 6 / 0.08) 78%);
}
.scene:focus-visible { outline-offset: -4px; }
.scene-copy { display: grid; gap: 10px; justify-items: start; padding: 32px 28px; }
.scene.wide .scene-copy { padding-inline: var(--gutter); padding-block: 40px; }
.scene h3 { font: 800 clamp(2.4rem, 4.2vw, 3.6rem)/0.88 var(--display); text-transform: uppercase; transition: color var(--ease); }
.scene.wide h3 { font-size: clamp(2.8rem, 7vw, 6rem); }
.scene:hover h3 { color: var(--accent); }
.scene .line { margin: 0; max-width: 54ch; color: #dad6d0; }
.scene .updated { margin: 0; color: var(--fg-mute); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.scene .no-footage { position: absolute; top: 18px; right: 20px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-mute); }

/* Devlog lists */
.home-devlog { padding-block: 72px 80px; }
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-item { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.post-item time { color: var(--fg-mute); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; padding-top: 6px; font-variant-numeric: tabular-nums; }
.post-item div { display: grid; gap: 8px; justify-items: start; }
.post-item .post-title { color: var(--fg); font: 800 1.9rem/0.95 var(--display); text-transform: uppercase; }
.post-item .post-title:hover { color: var(--accent); text-decoration: none; }
.post-item p { margin: 0; color: var(--fg-dim); max-width: 70ch; }
.post-item .badge { color: var(--accent); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.devlog { padding-bottom: 80px; }
.muted { color: var(--fg-mute); }

/* Project page */
.p-stage { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end; min-height: min(78vh, 680px); background: #000; }
.p-stage > img, .p-stage > .static { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.p-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(5 5 6 / 0.85) 0%, rgb(5 5 6 / 0.35) 50%, rgb(5 5 6 / 0) 75%),
              linear-gradient(0deg, rgb(5 5 6 / 0.95) 0%, rgb(5 5 6 / 0) 45%);
}
.p-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: #000; z-index: 1; }
.p-stage .back { position: absolute; top: 20px; left: var(--gutter); z-index: 2; }
.back { color: var(--fg-dim); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.back:hover { color: var(--fg); text-decoration: none; }
.p-head { display: grid; gap: 16px; justify-items: start; padding-block: 96px 92px; width: 100%; }
.p-head h1 { font: 900 clamp(3.4rem, 9vw, 8rem)/0.86 var(--display); text-transform: uppercase; }
.p-head .tag { margin: 0; max-width: 52ch; font-size: 1.15rem; color: #dedad5; }
.p-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; padding-block: 56px 24px; }
.p-main { display: grid; gap: 22px; min-width: 0; }
.pitch { max-width: 62ch; font-size: 1.08rem; }
.pitch p { margin: 0 0 14px; }
.pitch p:last-child { margin-bottom: 0; }
.pitch a { text-decoration: underline; text-underline-offset: 3px; }
.p-links { display: flex; gap: 10px; flex-wrap: wrap; }
.p-links .btn:not(.primary) { background: none; }
.facts { margin: 0; border-top: 1px solid var(--line-strong); }
.facts div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.facts dt { color: var(--fg-mute); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; padding-top: 3px; }
.facts dd { margin: 0; }
.project section > h2, .section-title { font: 800 2rem/1 var(--display); text-transform: uppercase; margin-bottom: 18px; }
.gallery { padding-block: 40px 16px; scroll-margin-top: var(--bar); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.shots a { cursor: zoom-in; display: grid; gap: 10px; align-content: start; color: var(--fg-dim); font-size: 0.88rem; }
.shots a:hover { text-decoration: none; color: var(--fg); }
.shots img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); transition: border-color var(--ease); }
.shots a:hover img { border-color: var(--fg); }
.related { padding-block: 40px 16px; }
.more { padding-top: 56px; }
.more .section-title { padding-inline: var(--gutter); }

/* Post page */
.post { padding-block: 40px 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 800px; }
.post .p-head { padding: 0; gap: 14px; }
.post .p-head h1 { font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: 0.9; }
.post .p-head .tag { color: var(--fg-dim); }
.post-meta { margin: 0; color: var(--fg-mute); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.post-meta a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body { font-size: 1.08rem; line-height: 1.75; }
.post-body > * { margin: 0 0 18px; }
.post-body h2 { font: 800 2rem/1 var(--display); text-transform: uppercase; margin-top: 40px; }
.post-body h3 { font-size: 1.15rem; font-weight: 700; margin-top: 28px; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }
.post-body img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-strong); }
.post-body figure { margin: 8px 0 26px; display: grid; gap: 10px; }
.post-body figcaption { color: var(--fg-mute); font-size: 0.88rem; }
.post-body ul, .post-body ol { padding-left: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.post-body th { color: var(--fg-mute); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.post-body blockquote { margin-left: 0; padding-left: 16px; border-left: 2px solid var(--accent); color: var(--fg-dim); font-style: italic; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.post-nav a { display: grid; gap: 4px; color: var(--fg); max-width: 45%; font-weight: 600; }
.post-nav a span { color: var(--fg-mute); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }
.post-nav .newer { text-align: right; justify-items: end; }

/* Screenshot viewer */
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 56px 72px;
  border: 0; background: #000; color: var(--fg); touch-action: pan-y;
}
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgb(0 0 0 / 0.7); }
.viewer figure { margin: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.viewer img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.viewer figcaption { font-size: 0.9rem; color: var(--fg-dim); text-align: center; }
.viewer-count { color: var(--fg-mute); font-variant-numeric: tabular-nums; margin-right: 8px; }
.viewer-nav, .viewer-close {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgb(15 15 17 / 0.85); color: var(--fg);
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.viewer-nav:hover, .viewer-close:hover { background: #1b1b1e; }
.viewer-nav { top: 50%; transform: translateY(-50%); }
.viewer-nav.prev { left: 16px; }
.viewer-nav.next { right: 16px; }
.viewer-close { top: 12px; right: 16px; font-size: 1.4rem; }

@media (max-width: 860px) {
  .intro { grid-template-columns: minmax(0, 1fr); padding-block: 48px 36px; }
  .p-body { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .scenes { grid-template-columns: minmax(0, 1fr); }
  .scene, .scene.wide { min-height: 380px; }
  .scene .scene-copy, .scene.wide .scene-copy { padding: 28px 20px; }
  .scene::before { background: linear-gradient(0deg, rgb(5 5 6 / 0.96) 0%, rgb(5 5 6 / 0.82) 45%, rgb(5 5 6 / 0.2) 85%); }
}
@media (max-width: 640px) {
  :root { --bar: 48px; }
  header.site nav { gap: 18px; }
  header.site .brand { font-size: 1.05rem; letter-spacing: 0.08em; }
  .stage { min-height: 600px; }
  .stage > img { object-position: 60% 40%; }
  .stage-copy { padding-block: 64px 76px; }
  .stage::before { background: linear-gradient(0deg, rgb(5 5 6 / 0.95) 0%, rgb(5 5 6 / 0.55) 55%, rgb(5 5 6 / 0.15) 100%); }
  .stage::after, .p-stage::after { height: 28px; }
  .reel a { width: 88px; }
  .p-head { padding-block: 72px 64px; }
  .post-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .facts div:last-child { border-bottom: 0; }
  .viewer { padding: 56px 12px 80px; }
  .viewer img { max-height: calc(100vh - 150px); }
  .viewer-nav { top: auto; bottom: 16px; transform: none; }
}
@media (max-width: 400px) {
  header.site nav a:not(.brand) { letter-spacing: 0.1em; }
  header.site .brand { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage > img, .static, .rec::before { animation: none; }
  .scene > img { transition: none; }
  .scene:hover > img { transform: none; }
}
