/* PURIN — portfolio · light-table / contact-sheet system */
:root {
  --table: #E7EBEA;      /* backlit light table */
  --sheet: #F6F8F7;      /* paper print */
  --ink: #131518;        /* graphite */
  --mute: #60666C;       /* pencil */
  --base: #17130F;       /* film base, warm black */
  --edge: #D9A441;       /* film edge-print amber */
  --grease: #E0332A;     /* grease-pencil red — the only accent */
  --line: rgba(19,21,24,.14);
  --font: "Prompt", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--table); color: var(--ink); font: 300 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--grease); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px var(--pad); background: rgba(231,235,234,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar nav { display: flex; gap: 22px; }
.bar nav a { text-decoration: none; color: var(--mute); }
.bar nav a:hover { color: var(--ink); }
.bar .cta { text-decoration: none; background: var(--ink); color: var(--sheet); padding: 8px 14px; border-radius: 2px; }
.bar .cta:hover { background: var(--grease); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(40px, 7vw, 96px) var(--pad) clamp(48px, 7vw, 104px); }
.hero h1 { font-weight: 800; font-size: clamp(64px, 10.5vw, 168px); line-height: .84; letter-spacing: -.045em; }
.hero h1 .th { display: block; font-weight: 300; font-size: .2em; letter-spacing: 0; line-height: 1.3; margin-top: .9em; color: var(--mute); }
.hero .roles { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero .roles span::before { content: "■ "; color: var(--grease); }
.hero p.lead { margin-top: 22px; max-width: 34ch; font-size: 18px; }
.hero .actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 15px var(--font); padding: 12px 18px; border: 1.5px solid var(--ink); border-radius: 2px; background: none; color: var(--ink); cursor: pointer; }
.btn.solid { background: var(--ink); color: var(--sheet); }
.btn:hover { border-color: var(--grease); background: var(--grease); color: #fff; }

/* the contact sheet — signature */
.sheet { position: relative; background: var(--base); padding: 26px 14px 30px; border-radius: 3px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); transform: rotate(-1.2deg); }
.sheet::before, .sheet::after { content: ""; position: absolute; left: 14px; right: 14px; height: 9px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(231,235,234,.55) 10px 18px); border-radius: 1px; }
.sheet::before { top: 8px; } .sheet::after { bottom: 10px; }
.sheet .frames { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; }
.frame { position: relative; }
.frame img { width: 100%; aspect-ratio: 3/2; object-fit: cover; filter: saturate(.92); }
.frame .code { position: absolute; left: 0; bottom: -14px; font: 500 9px/1 var(--mono); color: var(--edge); letter-spacing: .08em; }
.frame svg.mark { position: absolute; inset: -14% -10%; width: 120%; height: 128%; pointer-events: none; overflow: visible; }
.frame svg.mark path { fill: none; stroke: var(--grease); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520;
  animation: draw .9s cubic-bezier(.6,.1,.3,1) forwards; }
.frame:nth-child(n) svg.mark path { animation-delay: var(--d, .6s); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* sections */
section.cat { padding: clamp(56px, 8vw, 120px) var(--pad) 0; }
.cat-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px 24px; border-top: 1.5px solid var(--ink); padding-top: 14px; margin-bottom: 28px; }
.cat-head h2 { font-weight: 700; font-size: clamp(32px, 4.6vw, 64px); line-height: 1; letter-spacing: -.03em; }
.cat-head .tally { text-align: right; color: var(--mute); }
.cat-head .tally b { color: var(--grease); font-weight: 500; }
.cat-head p { grid-column: 1 / -1; max-width: 60ch; color: var(--mute); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; }
.grid figure { position: relative; overflow: hidden; background: #d5dad8; cursor: zoom-in; }
.grid figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.grid figure.fl { min-height: 100%; } /* takes its row's height from the neighbour that sets the ratio */
.grid figure:hover img { transform: scale(1.025); }
.grid figcaption { position: absolute; left: 10px; bottom: 8px; color: #fff; opacity: 0; transition: opacity .3s; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.grid figure:hover figcaption, .grid figure:focus-visible figcaption { opacity: 1; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.r1 { aspect-ratio: 3/2; } .rt { aspect-ratio: 2/3; } .rs { aspect-ratio: 4/5; } .rw { aspect-ratio: 16/9; }

/* video — the screening room */
section.reel { margin-top: clamp(56px, 8vw, 120px); background: var(--base); color: var(--sheet); padding: clamp(56px, 8vw, 110px) var(--pad); }
.reel .cat-head { border-top-color: var(--sheet); }
.reel .cat-head .tally, .reel .cat-head p { color: #a9a39b; }
.player { position: relative; background: #000; aspect-ratio: 16/9; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; color: var(--edge); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.filters button { background: none; color: #a9a39b; border: 1px solid rgba(246,248,247,.22); border-radius: 2px; padding: 8px 12px; cursor: pointer; }
.filters button span { color: var(--edge); margin-left: 4px; }
.filters button:hover { color: var(--sheet); border-color: var(--sheet); }
.filters button[aria-pressed="true"] { background: var(--grease); border-color: var(--grease); color: #fff; }
.filters button[aria-pressed="true"] span { color: #fff; }
.clip[hidden] { display: none; }
.clips { margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.clip { background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.clip .thumb { display: block; position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; outline: 1px solid rgba(255,255,255,.08); }
.clip .thumb img, .clip .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip .thumb video { opacity: 0; transition: opacity .3s; }
.clip:hover .thumb video { opacity: 1; }
.clip[aria-current="true"] .thumb { outline: 2px solid var(--grease); }
.clip .t { display: block; margin-top: 8px; font-weight: 500; font-size: 15px; line-height: 1.35; }
.clip .k { display: block; color: #a9a39b; margin-top: 2px; }

/* worked with */
.clients { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.clients li { list-style: none; border: 1px solid var(--line); background: var(--sheet); padding: 8px 14px; font-weight: 400; }

/* contact */
.contact { padding: clamp(64px, 9vw, 130px) var(--pad); display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: end; }
.contact h2 { font-weight: 800; font-size: clamp(44px, 7vw, 108px); line-height: .9; letter-spacing: -.04em; }
.contact h2 em { font-style: normal; color: var(--grease); }
.contact ul { list-style: none; }
.contact li { border-top: 1px solid var(--line); padding: 14px 0; display: flex; justify-content: space-between; gap: 16px; }
.contact li a { font-weight: 500; font-size: 18px; text-decoration: none; }
.contact li a:hover { color: var(--grease); }
footer { padding: 18px var(--pad); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: var(--mute); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(12,10,8,.94); display: none; place-items: center; padding: 24px; }
.lb.open { display: grid; }
.lb img { max-height: 88vh; width: auto; max-width: 100%; }
.lb .cap { position: absolute; left: 24px; bottom: 18px; color: var(--edge); }
.lb button { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font: 400 32px var(--font); cursor: pointer; }

/* reveal */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .sheet { transform: none; margin-bottom: 36px; }
  .grid { grid-template-columns: repeat(6, 1fr); }
  .s3, .s4 { grid-column: span 3; } .s5, .s6, .s7, .s8, .s12 { grid-column: span 6; }
  .grid figure.fl { aspect-ratio: 3/2; }
  .clips { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .bar nav { display: none; }
}
@media (max-width: 520px) {
  .sheet .frames { grid-template-columns: repeat(3, 1fr); }
  .sheet .frames .frame:nth-child(n+10) { display: none; }
  .cat-head { grid-template-columns: 1fr; } .cat-head .tally { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame svg.mark path { animation: none; stroke-dashoffset: 0; }
  .rv { opacity: 1; transform: none; transition: none; }
  .grid figure img { transition: none; }
}
