/* Aporia Films. Brand palette (Nitrate) and type (Original pairing: Archivo + JetBrains Mono), chosen October 2026; keep to these tokens. */
:root {
  --ground: #1b1e1e;
  --panel: #252a2a;
  --line: #2d3333;
  --line-2: #343b3b;
  --text: #e9eeec;
  --text-2: #d0d6d3;
  --muted: #c5cac9;
  --dim: #5c6664; /* fails 4.5:1 on ground: decorative, aria-hidden labels only */
  --accent: #b5cec9; /* faded film-stock cyan, used sparingly: active link, tagline, status, section labels */
  /* text-2, muted and accent are lighter than the palette swatch so they stay readable on the mottled texture */
  --display: "Archivo", system-ui, sans-serif;
  --sans: "Archivo", system-ui, sans-serif;
  --label: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 64px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 300 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.label {
  font: 400 11px/1.4 var(--label);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
}

/* Grain: fixed above the ground, below content */
/* Texture: soft mottling (like an aged film base) with fine grain on top, behind all content */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.grain::before, .grain::after { content: ""; position: absolute; inset: 0; }
.grain::before { background: url("/assets/mottle.jpg") 0 0 / 900px repeat; mix-blend-mode: soft-light; opacity: .35; }
.grain::after { background: url("/assets/grain-fine.png") 0 0 / 180px repeat; mix-blend-mode: overlay; opacity: .12; }
main, .footer { position: relative; z-index: 1; }
/* Section pages hold their content until the JSON copy has rendered, so nothing jumps (app.js adds .data-ready). */
.js:not(.data-ready):not([data-page="home"]) main,
.js:not(.data-ready):not([data-page="home"]) .footer { visibility: hidden; }

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 30;
  padding: 10px 14px; background: var(--text); color: var(--ground);
  font: 500 12px var(--label); text-transform: uppercase; letter-spacing: .18em;
}
.skip-link:focus { top: 12px; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  background: rgba(27, 30, 30, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 12px; min-height: 44px; font: 500 13px var(--display); letter-spacing: .17em; text-transform: uppercase; }
.nav-brand img { height: 26px; width: auto; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 400 15px var(--display); color: var(--muted);
  transition: color .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current] { color: var(--accent); }

/* Hero */
.hero {
  min-height: 92vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 96px;
  text-align: center;
  position: relative;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero-inner:focus, main:focus { outline: none; }
.hero-mark { position: relative; width: 300px; max-width: 70vw; aspect-ratio: 640 / 738; }
.mark-img { width: 100%; height: 100%; }
.mark-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-wordmark { margin-top: 30px; line-height: 0; }
.hero-wordmark img { width: 340px; max-width: 78vw; height: auto; }
.hero-intro:empty { display: none; }
.hero-intro { margin-top: 32px; max-width: 520px; min-height: 3.1em; /* reserves two lines until site.json arrives */ font-size: 18px; line-height: 1.55; color: var(--text-2); font-weight: 300; }
.hero-strip {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.hero-strip > * { flex: 1; }
.hero-strip > :first-child { text-align: left; }
.hero-strip > :last-child { text-align: right; }
.hero-strip a { transition: color .25s; }
.hero-strip a:hover { color: var(--text); }
.hero-strip [data-site="tagline"] { color: var(--accent); }
.status { color: var(--accent); }
.about-grid > div > .label:first-child, .contact > .wrap > .label:first-child, .page-head .wrap > .label:first-child { color: var(--accent); }

/* Intro starting states (the animation itself lives in app.js): the logo is drawn on the canvas, then the image takes over */
.intro .hero-wordmark,
.intro .hero-intro,
.intro .hero-strip,
.intro .nav { opacity: .01; }
.intro .mark-img { opacity: 0; }
.intro body { cursor: pointer; }

/* Sections */
.section { padding: 128px var(--gutter); border-top: 1px solid var(--line); }
.wrap { max-width: 1280px; margin: 0 auto; }
h1, h2, h3, .partner-name, .founder-name { font-family: var(--display); font-weight: 300; }
h2 { font-weight: 300; letter-spacing: -.02em; line-height: 1.08; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 48px; }
.section-head h2 { font-size: 56px; }
/* Heading row on home: the H2 with a bright section link beside it, on the heading's baseline.
   app.js adds .is-stacked when the H2 runs to more than one line, which puts the link underneath. */
.head-title { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 32px; row-gap: 12px; }
.section .head-title h2 { margin-top: 0; }
.head-title.is-stacked { flex-direction: column; align-items: flex-start; }
.about .head-title, .contact .head-title { margin-top: 24px; }

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Project grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px solid var(--line-2);
  overflow: hidden;
  isolation: isolate;
}
.card img, .card-body { will-change: transform; backface-visibility: hidden; transform: translateZ(0); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(27, 30, 30, .9) 0%, rgba(27, 30, 30, .55) 30%, rgba(27, 30, 30, 0) 62%);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: var(--ground); opacity: 0; transition: opacity .3s ease;
}
.card.is-covered::after { opacity: 1; }
.card.is-active::after { opacity: .55; }
.card-body { position: absolute; left: 24px; right: 72px; bottom: 22px; z-index: 2; transition: transform .6s var(--ease); }
.card h3 { font-size: 26px; font-weight: 300; line-height: 1.15; letter-spacing: -.005em; }
.card-hit { text-align: left; }
.card-hit::after { content: ""; position: absolute; inset: -1000px; z-index: 4; }
.card .card-hit:focus-visible { outline: none; }
.card:has(.card-hit:focus-visible) { outline: 2px solid var(--text); outline-offset: 3px; }
.card .label { margin-top: 8px; color: var(--text-2); }
.card .index { position: absolute; right: 24px; bottom: 24px; z-index: 2; }
.index { font: 400 11px/1 var(--label); letter-spacing: .18em; color: var(--dim); }
.card:hover img { transform: translateZ(0) scale(1.03); }
.card--nostill::before { display: none; }
.card--soon { background: transparent; border-style: dashed; }
.card--soon::before { display: none; }
.card--soon h3 { color: var(--text-2); font-weight: 400; }
.card--soon .label { color: var(--muted); }
.card:hover .card-body { transform: translate3d(0, -2px, 0); }

/* Detail panel */
.panel-row { grid-column: 1 / -1; }
.panel {
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .5s var(--ease), opacity .4s ease;
}
.panel.is-open { opacity: 1; }
.panel-inner {
  position: relative;
  display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 40px;
  padding: 32px; background: var(--panel); border: 1px solid var(--line-2);
}
.panel-still { aspect-ratio: 16 / 9; background: var(--ground); overflow: hidden; }
.panel-still img { width: 100%; height: 100%; object-fit: cover; }
.panel h3 { font-size: 40px; font-weight: 300; letter-spacing: -.01em; line-height: 1.1; padding-right: 56px; }
.panel h3:focus { outline: none; }
.panel .label { margin-top: 12px; }
.panel-synopsis { margin-top: 24px; color: var(--text-2); font-size: 17px; max-width: 60ch; }
.credits { margin-top: 28px; display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; }
.credits dt { font: 400 11px/1.9 var(--label); text-transform: uppercase; letter-spacing: .18em; color: var(--muted); }
.credits dd { margin: 0; font-weight: 400; }
.panel-links { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border: 1px solid var(--line-2);
  font: 500 12px var(--label); text-transform: uppercase; letter-spacing: .18em;
  transition: border-color .25s, background-color .25s;
}
.btn:hover { border-color: var(--muted); }
.panel-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-2); transition: border-color .25s;
}
.panel-close:hover { border-color: var(--muted); }
.panel-close svg { width: 14px; height: 14px; stroke: var(--text); stroke-width: 1.5; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 96px; align-items: start; }
.about h2 { margin-top: 24px; font-size: 48px; max-width: 16ch; }
.about-story { margin-top: 32px; max-width: 56ch; color: var(--text-2); font-size: 17px; }
.partners { border-top: 1px solid var(--line-2); margin-top: 40px; }
.partners li { display: flex; justify-content: space-between; align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line-2); }
.partner-name { font-size: 28px; font-weight: 300; letter-spacing: -.01em; line-height: 1.2; }
.partners .label { margin-top: 8px; }

/* Contact */
.contact { min-height: calc(100vh - var(--nav-h) - 74px); }
.contact h2 { margin-top: 24px; font-size: 72px; }
.emails { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 32px 56px; }
.emails .label { margin-bottom: 6px; }
.emails a {
  display: inline-block; padding: 8px 0 6px;
  font-size: 22px; font-weight: 300;
  border-bottom: 1px solid var(--line-2);
  transition: border-color .25s;
}
.emails a:hover { border-color: var(--text); }

/* Footer */
.footer {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 28px var(--gutter); border-top: 1px solid var(--line);
}
.footer img { height: 22px; width: auto; opacity: .8; }
.footer :last-child { text-align: right; }

/* Section links on home ("All projects →") */
.section-foot { display: flex; justify-content: flex-end; margin-top: 56px; }
.more-link {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  border-bottom: 1px solid var(--line-2);
  transition: color .25s, border-color .25s;
}
.more-link:hover { color: var(--text); border-color: var(--text); }
.arrow { fill: none; stroke: currentColor; stroke-width: 1.2; transition: transform .35s var(--ease); }
.more-link:hover .arrow { transform: translateX(3px); }
.more-link--bright { color: var(--text); }
.more-link--bright:hover { color: #fff; border-color: #fff; }
.more-link--bright:hover .arrow { transform: translateX(4px); }

/* Section pages */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head { padding: calc(var(--nav-h) + 112px) var(--gutter) 72px; }
.page-head h1 { margin-top: 24px; font-size: 72px; font-weight: 300; letter-spacing: -.015em; line-height: 1.04; }
.page-sub { margin-top: 24px; max-width: 60ch; color: var(--text-2); font-size: 18px; }
.page-head h1.page-statement { font-size: 56px; max-width: 760px; line-height: 1.12; }
.section--tight { padding-top: 56px; }

.filters[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.chip {
  height: 44px; padding: 0 18px;
  border: 1px solid var(--line-2);
  font: 500 12px var(--label); text-transform: uppercase; letter-spacing: .18em; color: var(--text-2);
  transition: border-color .25s, color .25s, background-color .25s;
}
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ground); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-empty { padding: 48px 0; }
.grid-note { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line-2); }

.story-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.story-grid > :first-child { grid-column: 1 / span 3; }
.story-grid > .story { grid-column: 4 / -1; }
.story p { color: var(--text-2); font-size: 18px; max-width: 720px; }
.story p + p { margin-top: 1.2em; }

.founders { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 48px; }
.founder { flex: 0 1 360px; max-width: 360px; }
.founder-photo {
  width: 320px; max-width: 100%;
  aspect-ratio: 1; display: grid; place-items: center; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line-2);
}
.founder-photo img { width: 100%; height: 100%; object-fit: cover; }
.founder-name { margin-top: 28px; font-size: 28px; font-weight: 300; letter-spacing: -.01em; line-height: 1.15; }
.founder .label { margin-top: 8px; }
.founder-bio { margin-top: 20px; color: var(--text-2); max-width: 52ch; }
.founder-email { margin-top: 20px; }
.founder-email a, .contact-list a, .socials a {
  display: inline-block; padding: 6px 0 4px; border-bottom: 1px solid var(--line-2);
  transition: border-color .25s;
}
.founder-email a:hover, .contact-list a:hover, .socials a:hover { border-color: var(--text); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 96px; align-items: start; }
.contact-list li + li { margin-top: 32px; }
.contact-list a { margin-top: 6px; font-size: 22px; font-weight: 300; }
.contact-place { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line-2); }
.socials { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.socials:empty { display: none; }
.socials a { font-size: 17px; }

.form { display: grid; gap: 24px; }
.field label {
  display: block; margin-bottom: 10px;
  font: 400 11px/1.4 var(--label); text-transform: uppercase; letter-spacing: .18em; color: var(--muted);
}
.field input, .field textarea {
  display: block; width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 0;
  color: var(--text); font: 300 16px/1.5 var(--sans);
}
.field textarea { min-height: 176px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--text); outline-offset: 2px; border-color: var(--text); }
.btn--solid { justify-self: start; height: 48px; padding: 0 28px; background: var(--text); color: var(--ground); border-color: var(--text); }
.btn--solid:hover { background: var(--text-2); border-color: var(--text-2); }
.form-note { margin-top: -10px; }
.form-error { color: var(--text); }

@media (max-width: 1100px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .about-grid, .story-grid, .contact-grid { grid-template-columns: 1fr; gap: 24px; }
  .story-grid > :first-child, .story-grid > .story { grid-column: 1 / -1; }
  .contact-grid { gap: 64px; }
}

@media (max-width: 720px) {
  :root { --nav-h: 92px; }
  .nav { flex-direction: column; justify-content: center; gap: 0; height: auto; min-height: var(--nav-h); padding-top: 6px; padding-bottom: 2px; }
  .nav-links { gap: 0 24px; justify-content: center; }
  .grid, .grid--3 { grid-template-columns: 1fr; }
  .hero { min-height: 100vh; min-height: 100svh; }
  .hero-intro { min-height: 4.65em; }
  .page-head { padding-top: calc(var(--nav-h) + 64px); padding-bottom: 48px; }
  .page-head h1 { font-size: 48px; }
  .page-head h1.page-statement { font-size: 36px; }
  .founders { row-gap: 64px; }
  .section-foot { margin-top: 40px; }
  .hero-mark { width: 200px; }
  .hero-wordmark { margin-top: 22px; }
  .hero-wordmark img { width: 240px; }
  .hero-intro { font-size: 17px; }
  /* phones: tagline over city, centred; no "Scroll" (nobody needs telling on a phone) */
  .hero-strip { flex-direction: column; gap: 8px; font-size: 11px; letter-spacing: .14em; bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 16px)); }
  .hero-strip > *, .hero-strip > :first-child, .hero-strip > :last-child { flex: none; text-align: center; }
  .hero-strip > :first-child { order: 2; }
  .hero-strip > :last-child { display: none; }
  .footer { font-size: 11px; letter-spacing: .12em; grid-template-columns: 1fr; justify-items: center; gap: 12px; text-align: center; padding-bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 16px)); }
  .footer :last-child { text-align: center; }
  .section { padding: 88px var(--gutter); }
  .section-head h2 { font-size: 44px; }
  .section-head > .label { display: none; }
  .head-title { flex-direction: column; align-items: flex-start; }
  .about h2 { font-size: 36px; }
  .contact h2 { font-size: 48px; }
  .emails { flex-direction: column; }
  .panel-inner { grid-template-columns: 1fr; gap: 24px; padding: 20px; }
  .panel h3 { font-size: 32px; }
  .card h3 { font-size: 22px; }
  .card-body { left: 18px; bottom: 16px; }
  .card .index { right: 18px; bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Comfortable tap targets for small links */
.socials a { display: inline-flex; align-items: center; min-height: 44px; }
.hero-strip a { padding-block: 15px; margin-block: -15px; } /* bigger tap area, same layout */
.founder:not(:has(.founder-photo)) .founder-name { margin-top: 0; }
