/* ============================================================
   Arsh Jaiswwal — Director's Cut
   Design tokens live here. Change a colour once, it changes everywhere.
   ============================================================ */

:root {
  /* Palette: projector screen, ink, tungsten lamp */
  --paper: #f1f0eb;        /* projector-screen white, not cream */
  --ink: #1c1916;          /* warm black of a darkened theatre */
  --dust: #6f6a63;         /* secondary text */
  --rule: #d6d3cb;         /* hairlines */
  --tungsten: #c97f12;     /* the one accent: a 3200K lamp */
  --tungsten-soft: #f3dcb4;
  --room: #14110e;         /* screening room */
  --room-ink: #ebe4d7;
  --room-dust: #9a9184;

  /* Type */
  --f-title: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-text: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Scale (1.25, minor third-ish steps) */
  --t-xs: 0.8125rem;
  --t-s: 0.9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.375rem;
  --t-xl: clamp(1.75rem, 3.2vw, 2.5rem);
  --t-xxl: clamp(2.6rem, 7vw, 5.5rem);
  --t-title: clamp(4rem, 16vw, 9.5rem);

  /* Space */
  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 38rem;
  --wide: 72rem;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: var(--t-m);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--tungsten); }

:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: .5rem;
  background: var(--ink); color: var(--paper); padding: .5rem .75rem; z-index: 100;
}
.skip:focus { left: .5rem; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Draft banner (remove at launch) ---------- */
.draft {
  background: var(--tungsten-soft);
  color: var(--ink);
  font-size: var(--t-xs);
  text-align: center;
  padding: .45rem var(--gutter);
}
.tbc {
  border-bottom: 1px dashed var(--tungsten);
  cursor: help;
}

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.5rem;
}
.brand {
  font-family: var(--f-title); font-size: 1.25rem; font-weight: 600;
  text-decoration: none; letter-spacing: -.01em;
}
.nav { display: flex; gap: clamp(.75rem, 2.5vw, 1.75rem); font-size: var(--t-s); }
.nav a { text-decoration: none; color: var(--dust); padding: .25rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--tungsten); }

@media (max-width: 560px) {
  .site-head .wrap { flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
  .nav { width: 100%; justify-content: space-between; }
}

/* ---------- Timecode (the signature) ---------- */
.timecode {
  position: fixed; left: calc(var(--gutter) - .6rem); bottom: .75rem; z-index: 30;
  font-family: var(--f-code); font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
  color: var(--dust);
  display: flex; align-items: center; gap: .5rem;
  pointer-events: none;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  padding: .3rem .6rem;
  border-radius: 2px;
}
.timecode .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--tungsten); }
.timecode .reel { color: var(--ink); }
body.in-room .timecode { color: var(--room-dust); background: color-mix(in srgb, var(--room) 88%, transparent); }
body.in-room .timecode .reel { color: var(--room-ink); }

/* ---------- Title card (home hero) ---------- */
.titlecard {
  position: relative;
  background: var(--room);
  color: var(--room-ink);
  min-height: calc(100svh - 3.5rem);
  display: grid;
  align-content: center;
  overflow: hidden;
}
.titlecard::before, .titlecard::after {     /* letterbox bars */
  content: ""; position: absolute; left: 0; right: 0; height: 9svh;
  background: #000; z-index: 1;
  transition: transform 1.4s var(--ease);
}
.titlecard::before { top: 0; transform-origin: top; }
.titlecard::after { bottom: 0; transform-origin: bottom; }
.titlecard.is-open::before, .titlecard.is-open::after { transform: scaleY(.45); }

.titlecard .wrap { position: relative; z-index: 2; width: 100%; }
.titlecard h1 {
  font-family: var(--f-title);
  font-size: var(--t-title);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.035em;
  margin: 0 0 .1em -.04em;
}
.titlecard h1 span { display: block; }
.titlecard h1 span + span { padding-left: .9em; font-style: italic; font-weight: 400; }
.titlecard .logline {
  max-width: 30rem;
  font-size: var(--t-l);
  line-height: 1.4;
  color: var(--room-ink);
  margin: 2rem 0 0;
}
.titlecard .credit {
  margin-top: 2.5rem;
  color: var(--room-dust);
  font-size: var(--t-s);
  max-width: 34rem;
}
.titlecard .credit a { color: var(--room-ink); }

.reveal { opacity: 0; transform: translateY(.6rem); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.is-open .reveal { opacity: 1; transform: none; }
.is-open .reveal.d1 { transition-delay: .5s; }
.is-open .reveal.d2 { transition-delay: .9s; }
.is-open .reveal.d3 { transition-delay: 1.3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .titlecard::before, .titlecard::after { transition: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 10vw, 8rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }

h2 {
  font-family: var(--f-title);
  font-size: var(--t-xxl);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.025em;
  margin: 0 0 2rem;
}
h3 {
  font-family: var(--f-title);
  font-size: var(--t-xl);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: 0 0 .75rem;
}
p { margin: 0 0 1rem; }
.lede { font-size: var(--t-l); line-height: 1.45; max-width: var(--measure); }
.muted { color: var(--dust); }
.prose { max-width: var(--measure); }

/* ---------- Numbers strip ---------- */
.numbers {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
  border-top: 1px solid var(--ink);
  padding-top: 1.5rem;
}
.numbers figure { margin: 0; }
.numbers .n {
  font-family: var(--f-title); font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1; letter-spacing: -.03em; display: block;
}
.numbers figcaption { font-size: var(--t-s); color: var(--dust); margin-top: .5rem; max-width: 16rem; }
@media (max-width: 720px) { .numbers { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Act index (home) ---------- */
.acts { list-style: none; margin: 0; padding: 0; counter-reset: act; }
.acts li { border-top: 1px solid var(--rule); }
.acts li:last-child { border-bottom: 1px solid var(--rule); }
.acts a {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 0;
  text-decoration: none;
}
.acts .roman { font-family: var(--f-title); font-style: italic; color: var(--tungsten); font-size: var(--t-l); }
.acts .what { font-family: var(--f-title); font-size: var(--t-xl); line-height: 1.1; }
.acts .when { font-family: var(--f-code); font-size: var(--t-xs); color: var(--dust); white-space: nowrap; }
.acts a:hover .what { color: var(--tungsten); }
@media (max-width: 560px) {
  .acts a { grid-template-columns: 2.5rem 1fr; }
  .acts .when { grid-column: 2; }
}

/* ---------- Placeholder footage ---------- */
.footage {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.035) 22px 23px),
    var(--room);
  color: var(--room-dust);
  display: grid; place-items: center;
  text-align: center;
  font-size: var(--t-s);
  padding: 1.5rem;
}
.footage::before, .footage::after {          /* sprocket holes */
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background: radial-gradient(circle, var(--paper) 2.5px, transparent 3px) 0 50% / 18px 10px repeat-x;
  opacity: .18;
}
.footage::before { top: 6px; }
.footage::after { bottom: 6px; }
.footage strong { display: block; color: var(--room-ink); font-weight: 500; margin-bottom: .25rem; }

.reelstrip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(16rem, 1fr);
  gap: 3px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
}
.reelstrip > * { scroll-snap-align: start; }

/* ---------- Journey ---------- */
.journey-head { padding: clamp(3.5rem, 9vw, 7rem) 0 2rem; }
.route {
  font-family: var(--f-code); font-size: var(--t-xs); color: var(--dust);
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem;
  margin-top: 1.5rem;
}
.route span[aria-hidden] { color: var(--tungsten); }
.route .here { color: var(--ink); }

.act { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--rule); }
.act-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 1rem; margin-bottom: 2.5rem;
}
.act-head .roman {
  font-family: var(--f-title); font-style: italic; color: var(--tungsten);
  font-size: var(--t-xl); display: block; margin-bottom: .25rem;
}
.act-head h2 { margin: 0; }
.act-head .when { font-family: var(--f-code); font-size: var(--t-xs); color: var(--dust); text-align: right; }

.scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--gutter);
  padding: 2rem 0;
  border-top: 1px dashed var(--rule);
}
.scene:first-of-type { border-top: 0; padding-top: 0; }
.scene .role { font-family: var(--f-title); font-size: var(--t-l); line-height: 1.2; margin: 0 0 .25rem; }
.scene .org { color: var(--dust); font-size: var(--t-s); margin: 0 0 1rem; }
.scene ul { margin: 0; padding: 0 0 0 1.1rem; }
.scene li { margin-bottom: .5rem; }
.scene li::marker { color: var(--tungsten); }
.scene .skills { font-size: var(--t-s); color: var(--dust); margin-top: 1rem; }
@media (max-width: 820px) { .scene { grid-template-columns: 1fr; } }

.act { transition: opacity .6s var(--ease); }
.js .act:not(.is-active) { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .js .act:not(.is-active) { opacity: 1; } }

/* ---------- Work ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.filters button {
  font: inherit; font-size: var(--t-s);
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px;
  padding: .4rem 1rem; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.work-list { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.case {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--gutter); align-items: start;
}
.case[hidden] { display: none; }
.case .kind { font-size: var(--t-s); color: var(--tungsten); margin-bottom: .5rem; }
.case dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 1.25rem 0 0; font-size: var(--t-s); }
.case dt { color: var(--dust); }
.case dd { margin: 0; }
@media (max-width: 820px) { .case { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--gutter); }
.portrait { aspect-ratio: 4 / 5; }
.index { columns: 2; column-gap: var(--gutter); padding: 0; list-style: none; font-size: var(--t-s); }
.index li { break-inside: avoid; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } .index { columns: 1; } }

/* ---------- Contact ---------- */
.routes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.routes article { border-top: 1px solid var(--ink); padding-top: 1.25rem; }
@media (max-width: 820px) { .routes { grid-template-columns: 1fr; } }

.button {
  display: inline-block;
  background: var(--ink); color: var(--paper);
  text-decoration: none; font-size: var(--t-s);
  padding: .75rem 1.25rem; border-radius: 2px;
}
.button:hover { background: var(--tungsten); color: var(--ink); }
.button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- Footer ---------- */
.site-foot {
  background: var(--room); color: var(--room-dust);
  padding: 3rem 0 4.5rem; font-size: var(--t-s);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-foot a { color: var(--room-ink); }
.site-foot .end { font-family: var(--f-title); font-style: italic; font-size: var(--t-l); color: var(--room-ink); }

h1.page-title {
  font-family: var(--f-title);
  font-size: var(--t-xxl);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.025em;
  margin: 0 0 2rem;
}

/* ---------- Linked footage tiles ---------- */
a.footage { text-decoration: none; transition: color .3s var(--ease); }
a.footage:hover, a.footage:focus-visible { color: var(--tungsten); }

/* ---------- Journey additions ---------- */
.act-intro { max-width: var(--measure); margin: -0.5rem 0 2rem; font-family: var(--f-title); font-style: italic; }
.interlude { padding: 1.5rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.interlude .mono, .mono { font-family: var(--f-code); font-size: var(--t-xs); letter-spacing: .04em; }

/* ---------- Case studies ---------- */
.case h3 a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--tungsten), var(--tungsten)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .4s var(--ease); }
.case h3 a:hover, .case h3 a:focus-visible { background-size: 100% 1px; }
.casestudy .kind a { color: inherit; }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem 2rem; margin: 2.5rem 0; padding: 1.25rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cs-facts dt { font-family: var(--f-code); font-size: var(--t-xs); color: var(--dust); text-transform: uppercase; letter-spacing: .06em; }
.cs-facts dd { margin: .25rem 0 0; }
.cs-body { max-width: var(--measure); }
.cs-h { font-size: var(--t-xl); margin: 3rem 0 1rem; }
.cs-body ul { padding-left: 1.1rem; }
.cs-body li { margin: .5rem 0; }
.casestudy .reelstrip { padding: 0; }

/* ---------- About & contact additions ---------- */
.casestudy .kind { font-size: var(--t-s); color: var(--tungsten); margin-bottom: .5rem; }
.how { padding-left: 1.2rem; }
.how li { margin: .4rem 0; }
.skill-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.5rem 2rem; }
.skill-cols .mono { margin-bottom: .5rem; }
.route-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.routes article:target { box-shadow: inset 3px 0 0 var(--tungsten); padding-left: 1rem; }
.cs-facts { grid-template-columns: none; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .35rem 2rem; }
@media (max-width: 640px) {
  .cs-facts { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: max-content 1fr; gap: .6rem 1.25rem; }
  .cs-facts dd { margin: 0; }
}
