/* Portfolio: light palette with clean media presentation. */

:root {
  --paper: #e4ebdf;
  --ink: #121a26;
  --ink-2: #4b5667;
  --accent: #1f4a8a;
  --line: rgb(31 74 138 / 0.16);
  --line-strong: rgb(31 74 138 / 0.32);
  --frame: #0c1522;

  --serif: "Crimson Pro", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --gutter: clamp(1rem, 4vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.wrap { width: min(100% - 2 * var(--gutter), 75rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; padding: 0.5rem 1rem; background: var(--ink); color: var(--paper); z-index: 10; }
.skip:focus { top: 1rem; }

.mono {
  font: 500 0.75rem/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.text-link { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); transition: text-decoration-color 0.2s; }
.text-link:hover { text-decoration-color: currentColor; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.5rem; min-height: 4.5rem; padding-block: 1.25rem; }
.wordmark { font: 500 1.375rem/1 var(--serif); letter-spacing: -0.01em; text-decoration: none; margin-right: auto; }
.nav { display: flex; gap: 2rem; font-size: 0.9375rem; }
.nav a { color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.nav a:hover { color: var(--ink); }
/* Hero */
.hero { padding-top: clamp(3.5rem, 9vw, 6rem); }
.hero .mono { margin-bottom: 1.75rem; }
.hero h1 {
  font: 400 clamp(3.5rem, 11vw, 9.5rem)/1.05 var(--serif);
  letter-spacing: -0.035em;
  text-wrap: balance;
  padding-bottom: 0.08em;
}
.hero-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 4rem; margin-top: 2.5rem; }
.hero-sub { max-width: 40ch; font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); }
.actions { display: flex; align-items: center; gap: 1.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 3rem;
  padding-inline: 1.4rem;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  transition: background-color 0.25s var(--ease), translate 0.15s;
}
.btn:hover { background: var(--accent); }
.btn:active { translate: 0 1px; }

/* Media */
.plate { margin: 0; }
.hero .plate { margin-top: clamp(4rem, 9vw, 7rem); }
.frame { position: relative; border: 1px solid var(--line-strong); background: var(--frame); }
.frame > video, .frame > img, .frame > a > img { width: 100%; height: auto; }
.frame > video { object-fit: cover; } /* posters can differ in aspect from the video */
.frame--light { background: #faf9f4; }

.plate figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; margin-top: 1.25rem; }
.cap-title { font-weight: 500; }
.cap-text { max-width: 34rem; color: var(--ink-2); }

.plate--side { display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); gap: 3rem; align-items: end; }
.plate--side figcaption { display: block; margin: 0; }
.plate-pair { display: grid; grid-template-columns: 487fr 627fr; gap: clamp(1.5rem, 4vw, 3.5rem); max-width: 48rem; }
.plate-pair figcaption { display: block; }

/* Sections */
.section { padding-block: clamp(3rem, 6vw, 5rem); }
main > :first-child + .section { margin-top: clamp(3rem, 6vw, 5rem); }
.sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2.5vw, 2rem); row-gap: 2.5rem; }
.sheet > .label { grid-column: 1 / span 3; align-self: start; position: sticky; top: 2rem; }
.sheet > .body { grid-column: 4 / -1; }
h2 { font: 400 clamp(1.75rem, 3vw, 2.5rem)/1.1 var(--serif); letter-spacing: -0.015em; }

.prose { max-width: 34rem; color: var(--ink-2); font-size: 1.0625rem; }
.prose > * + * { margin-top: 1.25rem; }
.prose ul { list-style: none; padding: 0; display: grid; gap: 1rem; }
.prose li { position: relative; padding-left: 1.75rem; }
.prose li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 0.875rem; height: 1px; background: var(--accent); }
.prose b, .prose strong { color: var(--ink); font-weight: 500; }
code { font: 0.875em var(--mono); color: var(--ink); background: var(--line); padding: 0.1em 0.35em; }

.lead { font: 400 clamp(1.5rem, 2.6vw, 2.25rem)/1.3 var(--serif); letter-spacing: -0.01em; color: var(--ink); max-width: 30ch; margin-bottom: 2.5rem; }

/* Work */
.work-head { margin-bottom: clamp(3rem, 6vw, 5rem); }
.work-grid { list-style: none; margin: 0; padding: 0 0 8rem; display: grid; grid-template-columns: 1fr 1fr; gap: 6rem clamp(2rem, 5vw, 5rem); }
.work-grid > li:nth-child(even) { translate: 0 8rem; }
.work-link { display: block; text-decoration: none; }
.work-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line-strong); background: var(--frame); }
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s var(--ease); }
.work-link:hover img { scale: 1.03; }
.work-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.work-title { margin-top: 0.75rem; font: 400 clamp(1.75rem, 2.6vw, 2.25rem)/1.15 var(--serif); letter-spacing: -0.015em; }
.work-link:hover .work-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.work-desc { margin-top: 0.6rem; max-width: 46ch; color: var(--ink-2); }
.stack { margin-top: 1rem; font: 0.8125rem/1.6 var(--mono); color: var(--ink-2); }
.work-extra { display: inline-block; margin-top: 0.75rem; font-size: 0.9375rem; }

/* Experience */
.job { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem 2rem; padding-block: 2.75rem; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; padding-top: 0; }
.job h3 { font: 400 1.625rem/1.2 var(--serif); letter-spacing: -0.01em; }
.job-org { margin-top: 0.35rem; font-weight: 500; }
.job-desc { margin-top: 1rem; max-width: 34rem; color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin-top: 1.25rem; }

.clips { grid-column: 1 / -1; margin-top: 1rem; }
.clips-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(12rem, 1fr); gap: 1rem; margin-top: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
.clips-row iframe { width: 100%; aspect-ratio: 9 / 16; height: auto; border: 1px solid var(--line-strong); background: var(--frame); scroll-snap-align: start; }

/* Contact */
.contact-mail { display: inline-block; font: 400 clamp(1.75rem, 5.5vw, 4.5rem)/1.1 var(--serif); letter-spacing: -0.025em; text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 0.15em; overflow-wrap: anywhere; transition: text-decoration-color 0.2s; }
.contact-mail:hover { text-decoration-color: currentColor; }
.contact-note { margin-bottom: 0.5rem; font-size: 0.9375rem; color: var(--ink-2); }

.site-footer { display: flex; justify-content: flex-end; gap: 1rem; padding-block: 1.75rem 2.5rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* Project pages */
.back { display: inline-block; margin-top: clamp(2rem, 5vw, 3.5rem); text-decoration: none; }
.back:hover { color: var(--ink); }
.project-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.project-head .mono { margin-bottom: 1.5rem; }
.project-head h1 { font: 400 clamp(3rem, 8vw, 7rem)/1.02 var(--serif); letter-spacing: -0.035em; padding-bottom: 0.08em; }
.project-lede { margin-top: 1.5rem; max-width: 44ch; font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); }

.titleblock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(3rem, 6vw, 4.5rem) 0 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.titleblock > div { padding: 1rem 1.25rem 1.25rem; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.titleblock dt { font: 500 0.6875rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.titleblock dd { margin: 0.5rem 0 0; }
.titleblock .wide { grid-column: span 2; }
.titleblock .links { margin-top: 0.5rem; gap: 0.25rem 1.25rem; }

.project-media { margin-top: clamp(3.5rem, 7vw, 5.5rem); }

.next { padding-block: clamp(3.5rem, 8vw, 6rem); }
.next a { display: inline-block; text-decoration: none; }
.next-title { display: block; margin-top: 0.75rem; font: 400 clamp(2rem, 5vw, 3.75rem)/1.1 var(--serif); letter-spacing: -0.025em; }
.next a:hover .next-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }

/* Lenis smooth scrolling (js/site.js): the library's own stylesheet, inlined */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-lenis-prevent-wheel], .lenis [data-lenis-prevent-touch], .lenis [data-lenis-prevent-vertical], .lenis [data-lenis-prevent-horizontal] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }

/* Mobile */
@media (max-width: 767px) {
  .nav { order: 3; width: 100%; gap: 1.5rem; }
  .sheet > .label, .sheet > .body { grid-column: 1 / -1; position: static; }
  .plate figcaption { flex-direction: column; }
  .plate--side { grid-template-columns: 1fr; gap: 0; }
  .plate--side figcaption { margin-top: 1.25rem; }
  .work-grid { grid-template-columns: 1fr; gap: 4.5rem; padding-bottom: 0; }
  .work-grid > li:nth-child(even) { translate: none; }
  .job { grid-template-columns: 1fr; gap: 0.75rem; }
  .clips-row { grid-auto-columns: 62%; }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Respect reduced motion for native smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  html:not(.lenis) { scroll-behavior: smooth; } /* fallback if Lenis doesn't load */
}
