/* ==========================================================================
   Elevate Media HI, inner pages (portfolio, contact, terms)

   Loaded after playhead.css, which already carries the tokens, the fonts, the
   top bar, the footer and the form. This file adds what the inner pages need
   on top: a solid bar that stays put, page sections and type, the portfolio's
   justified rows, the contact layout and the legal prose. Nothing here hides
   content waiting for a script.

   Sections
     01  Page frame
     02  Type
     03  Portfolio rows
     04  Projects
     05  Contact
     06  Legal
     07  Reduced motion
   ========================================================================== */

/* -- 01  Page frame ------------------------------------------------------ */

:root {
  /* The portfolio markup sets section backgrounds inline with these names */
  --ink-0: var(--bg);
  --ink-1: #ECE8E1;
  --ink-2: #E4DFD6;
  --line-2: var(--line);
}

.page .bar { position: sticky; }
.page .bar-nav a[aria-current="page"] { color: var(--fg); border-bottom: 1px solid var(--fg); }
.page .footer { padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)); }

.sec { padding-block: clamp(56px, 8vw, 120px); }
.sec-tight { padding-block: clamp(48px, 6vw, 88px); }
.page-top { padding-top: clamp(48px, 7vw, 104px); }
.wrap { width: min(860px, 100%); margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.wrap-wide { width: min(1320px, 100%); margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 4vw, 56px); }

/* -- 02  Type ------------------------------------------------------------ */

.h1 { margin: 14px 0 0; font-family: var(--title); font-weight: 400; font-size: clamp(36px, 5vw, 72px); line-height: 1.08; letter-spacing: .04em; text-wrap: balance; }
.h1 em { font-style: normal; }
.sec-head .h1 { margin: 0; font-size: clamp(28px, 3.4vw, 48px); }
.h2 { margin: 0; font-family: var(--title); font-weight: 400; font-size: clamp(26px, 3vw, 42px); line-height: 1.15; letter-spacing: .04em; text-wrap: balance; }
.lede { font-size: clamp(18px, 1.4vw, 21px); line-height: 1.6; max-width: 58ch; }
.muted { color: var(--mute); }
.tlink { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); }
.tlink:hover { border-color: var(--ember); color: var(--ember); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; }
.btn .arrow { width: 18px; height: 18px; flex: none; }

/* -- 03  Portfolio rows -------------------------------------------------- */
/* The same justified-row engine the page has always used: each item grows by
   its own aspect ratio against a zero basis, so every item in a row lands at
   the same height with no cropping. The rows are packed at build time by
   tools/build-portfolio.py and written into the markup. */

.pf-intro > .lede { margin-top: 26px; }
.row { --pg: clamp(8px, .9vw, 14px); display: flex; gap: var(--pg); margin-bottom: var(--pg); }
.row:last-child { margin-bottom: 0; }
.row > .fig { flex: var(--r) 1 0; min-width: 0; }
/* A row of one cannot flush, so it takes its share of a target ratio sum instead of stretching */
.row-solo > .fig { flex: 0 1 auto; width: min(100%, calc(var(--r) / var(--tsum, 2.47) * 100%)); }

.fig { position: relative; display: block; margin: 0; padding: 0; border: 0; overflow: hidden; background: var(--ink-2); }
.fig img { display: block; width: 100%; height: auto; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.fig:hover img { transform: scale(1.03); }

/* A video is just another ratio in its row; the poster holds the packed ratio */
.fig-vid { cursor: pointer; color: inherit; width: 100%; font: inherit; }
.fig-vid img { aspect-ratio: var(--r); object-fit: cover; }
.fig-vid iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.fig-play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: clamp(48px, 4.4vw, 66px); aspect-ratio: 1;
  display: grid; place-items: center; border-radius: 50%; background: var(--fg); color: var(--bg); transition: transform .4s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.fig-vid:hover .fig-play { transform: translate(-50%, -50%) scale(1.08); }
.fig-vid:focus-visible { outline-offset: 3px; }
.fig-play svg { width: 38%; height: 38%; fill: currentColor; margin-left: 8%; }
.fig-label { position: absolute; left: 0; bottom: 0; padding: 9px 14px; background: var(--bg); font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg); pointer-events: none; }

.reel { max-width: 82%; }
.gal { display: block; }
.pf-cta { text-align: center; display: grid; justify-items: center; gap: 26px; }

/* -- 04  Projects -------------------------------------------------------- */
/* The title sits beside the work and holds while the media scrolls past */

.proj { display: grid; grid-template-columns: minmax(0, clamp(168px, 17%, 250px)) minmax(0, 1fr); gap: clamp(20px, 3vw, 54px);
  padding-block: clamp(44px, 5vw, 86px); border-top: 1px solid var(--line); }
.proj:first-of-type { border-top: 0; padding-top: 0; }
.proj-meta { position: sticky; top: 96px; align-self: start; }
.proj-meta h2 { margin: 0; font-family: var(--title); font-weight: 400; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.25; letter-spacing: .04em; }
.proj-title { margin: 8px 0 0; color: var(--mute); font-size: 16px; line-height: 1.5; }
.proj-role { display: block; margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ember); }
.proj-note { margin: 16px 0 0; color: var(--mute); font-size: 16px; line-height: 1.65; }
.proj-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: 16px; }

@media (max-width: 900px) {
  .proj { grid-template-columns: minmax(0, 1fr); }
  .proj-meta { position: static; }
  .reel { max-width: 100%; }
}
/* Below this the rows are the wrong shape, so each item takes the full width */
@media (max-width: 560px) {
  .row { flex-direction: column; }
  .row > .fig, .row-solo > .fig { width: 100%; flex: none; }
}

/* -- 05  Contact --------------------------------------------------------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-lede { display: grid; gap: 22px; align-content: start; }
.contact-lede .h1 { margin: 0; }
.contact-portrait { margin: 8px 0 0; display: grid; gap: 10px; max-width: 320px; }
.contact-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.contact-portrait figcaption { font-size: 16px; color: var(--mute); }
.contact-meta { display: grid; gap: 4px; justify-items: start; font-size: 19px; }
.contact-meta .tlink { display: inline-flex; align-items: center; min-height: 44px; }
.contact-meta p { margin: 4px 0 0; font-size: 16px; }
.form-note .tlink { display: inline; }

@media (max-width: 760px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-portrait { max-width: 220px; }   /* keeps the form close to the top on a phone */
}

/* -- 06  Legal ----------------------------------------------------------- */

.legal { font-size: 17px; line-height: 1.7; }
.legal .h1 { font-size: clamp(32px, 4.2vw, 56px); }
.legal .eff { margin-top: 14px; color: var(--mute); }
.legal > p, .legal li { color: rgba(28, 26, 23, .88); }
.legal > p { margin-top: 14px; }
.legal h2 { margin: 48px 0 0; font-family: var(--title); font-weight: 400; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: .04em; }
.legal h3 { margin: 32px 0 0; font-size: 18px; font-weight: 500; letter-spacing: .02em; }
.legal ul { margin-top: 12px; padding-left: 22px; list-style: disc; display: grid; gap: 6px; }
.legal blockquote { margin: 16px 0 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--line); color: var(--mute); }
.legal .hairline { margin: 48px 0 0; border: 0; border-top: 1px solid var(--line); }
.legal .tlink { display: inline; }

/* -- 07  Reduced motion -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .fig img, .fig-play { transition: none; }
  .fig:hover img { transform: none; }
  .fig-vid:hover .fig-play { transform: translate(-50%, -50%); }
}
