/* styles.css — Lab edition aesthetic
   Mono UI chrome + italic serif display. All values come from CSS vars set
   on .app by app.jsx — change palette/font in TWEAK_DEFAULTS or the panel. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg, #efeae0); color: var(--fg, #1a1814); }
body {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
ul { list-style: none; }
::selection { background: var(--fg); color: var(--bg); }

.app { min-height: 100vh; background: var(--bg); color: var(--fg); transition: background .3s, color .3s; }
main { padding-top: 64px; }

/* ── Nav: three-zone monospace ───────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  padding: 0 var(--page-pad);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}
.nav-zone { display: flex; align-items: center; gap: 24px; }
.nav-center { justify-content: center; color: color-mix(in srgb, var(--fg) 55%, transparent); }
.nav-right { justify-content: flex-end; }
.nav-name {
  font-family: var(--font-mono); font-style: normal;
  font-size: 12.5px; letter-spacing: 0.04em; line-height: 1;
  text-transform: uppercase;
}
.nav-counter { font-variant-numeric: tabular-nums; }
.nav-link, .nav-link.as-btn {
  color: color-mix(in srgb, var(--fg) 78%, transparent);
  transition: color .2s;
  font-family: var(--font-mono); font-size: 12.5px;
}
.nav-link:hover, .nav-link.as-btn:hover { color: var(--fg); }
.nav-right-grp { display: flex; align-items: center; gap: 24px; }

/* ── Reel ────────────────────────────────────────────────────────────────── */
.reel {
  position: fixed; inset: 0; z-index: 200; background: var(--fg); color: var(--bg);
  display: flex; flex-direction: column;
  animation: reel-out .6s ease 0s 1 backwards;
}
.reel.is-dismissed { animation: reel-out .6s ease forwards; }
@keyframes reel-out { to { opacity: 0; pointer-events: none; } }
.reel-stack { flex: 1; position: relative; overflow: hidden; }
.reel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.reel-slide.is-on { opacity: 1; }
.reel-slide img {
  width: 100%; height: 100%; object-fit: cover;
  animation: reel-zoom 5s ease forwards;
}
@keyframes reel-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.reel-cap {
  position: absolute; left: var(--page-pad); bottom: 96px;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(28px, 5vw, 64px);
  letter-spacing: -0.015em;
  color: var(--bg);
}
.reel-foot {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--page-pad);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
}
.reel-name { font-family: var(--font-display); font-style: italic; font-size: 16px; letter-spacing: 0; }
.reel-skip { opacity: 0.7; transition: opacity .2s; }
.reel-skip:hover { opacity: 1; }
.reel-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.reel-progress-bar {
  height: 100%; background: var(--bg); transform-origin: left;
  animation: reel-progress linear forwards;
}
@keyframes reel-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── Animations ──────────────────────────────────────────────────────────── */
.anim-off [data-fade] { opacity: 1; transform: none; }
.anim-subtle [data-fade] { opacity: 0; transform: translateY(12px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.6,.2,1); }
.anim-subtle [data-fade].is-in { opacity: 1; transform: none; }
.anim-expressive [data-fade] { opacity: 0; transform: translateY(28px) scale(.985); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.6,.2,1); }
.anim-expressive [data-fade].is-in { opacity: 1; transform: none; }

/* ── Home ────────────────────────────────────────────────────────────────── */
.home { padding: 0 var(--page-pad); }
.home-hero { padding: 80px 0 80px; max-width: 1400px; }
.home-hero-line {
  display: flex; justify-content: space-between;
  margin-bottom: 64px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--fg) 55%, transparent);
}
.home-hero-title {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(30px, 4vw, 60px);
  line-height: 1.08; letter-spacing: -0.02em; font-weight: 400;
  margin-bottom: 64px; text-wrap: balance;
  display: flex; flex-direction: column;
}
.home-hero-title span { display: block; }
.home-hero-summary {
  font-family: "Geist", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-style: normal; font-weight: 400;
  white-space: pre-line;
  font-size: clamp(14px, 1vw, 16px); line-height: 1.55;
  max-width: 56ch;
  color: color-mix(in srgb, var(--fg) 80%, transparent);
}

/* ── Scattered grid (default) ────────────────────────────────────────────── */
.grid { padding-bottom: 160px; }
.grid-scatter {
  display: grid; grid-template-columns: repeat(24, 1fr);
  gap: 0 16px;
  padding-top: 40px;
}
.card { display: block; cursor: pointer; }
.card-thumb {
  position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.6,.2,1);
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-meta {
  display: grid; grid-template-columns: auto 1fr;
  column-gap: 12px; row-gap: 4px;
  padding: 14px 0 0;
  font-family: var(--font-mono);
}
.card-num {
  font-size: 10.5px; letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--fg) 50%, transparent);
}
.card-tags {
  font-size: 10.5px; letter-spacing: 0.04em; text-align: right;
  color: color-mix(in srgb, var(--fg) 50%, transparent);
}
.card-title {
  grid-column: 1 / -1;
  font-family: "Geist", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-style: normal; font-weight: 400;
  font-size: 14px; letter-spacing: 0;
}

/* Asymmetric (tweak alt) */
.grid-asym { display: grid; grid-template-columns: repeat(12, 1fr); gap: 56px var(--gap); }
.card-asym .card-meta { font-family: var(--font-mono); }

/* Uniform (tweak alt) */
.grid-uniform { display: grid; grid-template-columns: repeat(12, 1fr); gap: 56px var(--gap); }
.grid-uniform .card-uniform { grid-column: span 4; }

/* List (tweak alt) */
.grid-list {
  position: relative; padding-bottom: 120px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
}
.grid-list .row {
  display: grid; grid-template-columns: 60px minmax(0, 2fr) minmax(0, 1.2fr) 32px;
  align-items: center; gap: 24px; padding: 24px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  transition: padding .3s ease;
}
.grid-list .row:hover { padding-left: 16px; }
.row-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--fg) 50%, transparent); }
.row-title {
  font-family: "Geist", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-style: normal; font-weight: 400;
  font-size: clamp(18px, 1.6vw, 24px); letter-spacing: 0;
}
.row-tags {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--fg) 55%, transparent);
}
.row-arrow { font-family: var(--font-mono); text-align: right; opacity: 0.4;
  transition: opacity .3s, transform .3s; }
.row:hover .row-arrow { opacity: 1; transform: translateX(8px); }
.grid-list-preview {
  position: fixed; width: 240px; height: 300px;
  pointer-events: none; z-index: 50; overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,.18);
  animation: fadeIn .2s ease;
}
.grid-list-preview img { width: 100%; height: 100%; object-fit: cover; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── About ───────────────────────────────────────────────────────────────── */
.about { padding: 64px var(--page-pad) 120px; max-width: 1400px; margin: 0 auto; }
.about-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 80px; align-items: start; }
.about-portrait { position: sticky; top: 96px; }
.about-portrait img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.about-title {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(40px, 5vw, 80px); line-height: 1.04;
  letter-spacing: -0.02em; font-weight: 400; margin-bottom: 48px; text-wrap: pretty;
}
.about-body {
  display: flex; flex-direction: column; gap: 18px;
  font-family: "Geist", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-style: normal; font-weight: 400;
  font-size: 14.5px; line-height: 1.6;
  max-width: 52ch;
  color: color-mix(in srgb, var(--fg) 85%, transparent);
}
.about-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  margin-top: 80px; padding-top: 48px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
}
.about-meta-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: color-mix(in srgb, var(--fg) 50%, transparent);
  margin-bottom: 16px;
}
.about-caps, .about-contact { display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; }
.about-caps li::before { content: "— "; color: color-mix(in srgb, var(--fg) 40%, transparent); }
.about-contact a { text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.about-contact a:hover { text-decoration-color: var(--fg); }

/* ── Project page ───────────────────────────────────────────────────────── */
.project { padding: 0 var(--page-pad); }

/* Meta strip — 4 columns of mono label/value */
.meta-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  padding: 56px 0 48px;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
}
.meta-cell { display: flex; flex-direction: column; gap: 8px; }
.meta-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: color-mix(in srgb, var(--fg) 45%, transparent);
}
.meta-value { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.01em; }

/* Brief — N° 01 — BRIEF eyebrow + italic serif summary */
.brief {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 32px; padding: 96px 0 96px;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
}
.brief-eye {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: color-mix(in srgb, var(--fg) 45%, transparent);
  align-self: end;
}
.brief-title {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(22px, 2.8vw, 49px); line-height: 1.18;
  letter-spacing: -0.005em; text-wrap: pretty;
  white-space: pre-line;
}

/* Section eye — small mono label used inside body */
.section-eye {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: color-mix(in srgb, var(--fg) 45%, transparent);
  margin-bottom: 24px;
}
.section-eye-mt { margin-top: 48px; }

/* Body text inside project */
.project-para {
  font-family: "Geist", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-style: normal; font-weight: 400;
  font-size: 14px; line-height: 1.6; letter-spacing: 0;
  margin-bottom: 14px;
  color: color-mix(in srgb, var(--fg) 85%, transparent);
}
.project-para .inline-link {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 40%, transparent);
  transition: border-color .2s ease;
  white-space: nowrap;
}
.project-para .inline-link:hover {
  border-bottom-color: var(--fg);
}
.project-tools {
  font-family: var(--font-mono); font-size: 12.5px;
  display: flex; flex-direction: column; gap: 4px;
}
.project-tools li::before { content: "— "; color: color-mix(in srgb, var(--fg) 40%, transparent); }

/* Rich layout — fixed/scroll */
/* Fixed layout: text on the RIGHT (default) */
.project-fixed .project-body {
  display: grid; grid-template-columns: 1fr 360px;
  gap: 64px; align-items: start;
}
.project-fixed .project-side { order: 2; }
.project-fixed .project-media { order: 1; }
/* Multi-section alternating layout: section index 1, 3, 5… flips sides. */
.project-fixed .project-body.is-flipped {
  grid-template-columns: 360px 1fr;
}
.project-fixed .project-body.is-flipped .project-side { order: 1; }
.project-fixed .project-body.is-flipped .project-media { order: 2; }
.project-fixed .project-body.is-flipped .media-half:nth-of-type(even) { margin-left: 0; }
.project-fixed .project-body.is-flipped .media-half:nth-of-type(odd) { margin-left: auto; }
.project-multi .project-body-section { margin-top: 96px; }
.project-multi .project-body-section:first-of-type { margin-top: 0; }
.project-fixed .project-side.is-fixed {
  position: sticky; top: 96px; align-self: start;
  max-height: calc(100vh - 120px); overflow-y: auto;
  scrollbar-width: none; padding-right: 8px;
}
.project-fixed .project-side.is-fixed::-webkit-scrollbar { display: none; }
.project-flow .project-body { display: flex; flex-direction: column; gap: 64px; padding: 80px 0 0; }
.project-flow .project-side { max-width: 56ch; }

.project-media {
  display: flex; flex-direction: column; gap: 64px;
  padding-bottom: 96px;
}
.project-flow .project-media { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; }

/* Editorial scatter inside a section: cell controls width/offset; the inner
   media fills its cell so per-class media-full/wide/half rules are bypassed. */
.project-media.is-scatter { display: flex; flex-direction: column; gap: 0; }
.project-media.is-scatter .media-cell { display: block; }
.project-media.is-scatter .media-cell > .media,
.project-media.is-scatter .media-cell > .media.media-full,
.project-media.is-scatter .media-cell > .media.media-wide,
.project-media.is-scatter .media-cell > .media.media-half {
  width: 100%; margin-left: 0; max-width: none;
}

/* Free-form scatter section: text + media flow as a single varied-width stream
   across the full page width, no sticky text, no 2-col grid. */
.scatter-section {
  display: block;
  padding: 144px 0 0;
}
.scatter-section:first-of-type { padding-top: 72px; }
.scatter-section.is-last { padding-bottom: 96px; }
.scatter-section.is-flush { padding-top: 0; margin-top: -24px; }
.scatter-section .media-cell,
.scatter-section .scatter-text {
  display: block; box-sizing: border-box;
}
.scatter-section .media-cell > .media,
.scatter-section .media-cell > .media.media-full,
.scatter-section .media-cell > .media.media-wide,
.scatter-section .media-cell > .media.media-half {
  width: 100%; margin-left: 0; max-width: none;
}
.scatter-text { padding: 8px 0; }
.scatter-text .project-para { max-width: 50ch; }

/* Tools block standing on its own, under the pair-row media column. */
.scatter-tools-block { display: block; padding-top: 40px; box-sizing: border-box; }

/* Pair row: first media item + text card sit side-by-side at top of section */
.scatter-pair-row {
  display: flex;
  align-items: stretch;
  gap: 72px;
  margin-bottom: 16px;
}
.scatter-pair-row.is-flipped { flex-direction: row-reverse; }
.scatter-pair-row .scatter-pair-media { flex: 0 0 auto; }
.scatter-pair-row .scatter-pair-text {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 56px;
  display: flex;
  flex-direction: column;
}
/* Tools sit at the bottom of the text card so they align with the bottom of
   the adjacent media item. */
.scatter-pair-text.has-tools-bottom .scatter-tools-bottom { margin-top: auto; }

/* Media-pair section: two media side-by-side, text BELOW the first media. */
.scatter-media-pair-row {
  display: flex;
  align-items: stretch;
  gap: 56px;
  margin-bottom: 32px;
}
.scatter-media-pair-row.is-flipped { flex-direction: row-reverse; }
.scatter-media-pair-row .scatter-pair-media,
.scatter-media-pair-row .scatter-pair-second { flex: 0 0 auto; min-width: 0; display: flex; flex-direction: column; }
.scatter-media-pair-row .scatter-pair-media > .media,
.scatter-media-pair-row .scatter-pair-second > .media { width: 100%; max-width: none; }
.scatter-media-pair-row .scatter-pair-second {
  /* Let the grid stretch the full height of the left column (video + text). */
  align-self: stretch;
}
.scatter-media-pair-row .scatter-pair-second > .media.media-grid {
  height: 100%;
  /* Allow the grid to grow with the right column — no 92vh cap. */
  max-height: none;
  display: flex;
  flex-direction: column;
}
.scatter-media-pair-row .scatter-pair-second .grid-collection {
  flex: 1 1 auto;
  align-content: start;
  /* Stretch rows to fill the right column down to where the left column
     (video + text) ends. */
  grid-auto-rows: 1fr;
  align-items: stretch;
}
.scatter-media-pair-row .scatter-pair-second .grid-collection .grid-cell {
  min-height: 0;
}
.scatter-media-pair-row .scatter-pair-second .grid-collection .grid-frame {
  /* Override the fixed aspect-ratio (1/1) on the item so the frame can
     grow with its row when the grid is stretching to fill the column. */
  aspect-ratio: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.scatter-media-pair-text { padding-top: 0; }
.scatter-media-pair-text.is-left { margin-left: 0; }
.scatter-media-pair-text.is-right { margin-left: auto; }
.scatter-media-pair-text .project-para { max-width: 50ch; }
/* Text nested inside the left column (video + text), so the right column
   (grid) stretches the full height of the pair-row. */
.scatter-media-pair-row .scatter-media-pair-text-inline { padding-top: 0; }
.scatter-media-pair-row .scatter-media-pair-text-inline .scatter-pair-text { padding-left: 0; }
.scatter-media-pair-row .scatter-media-pair-text-inline .project-para { max-width: 50ch; }

@media (max-width: 720px) {
  .scatter-media-pair-row,
  .scatter-media-pair-row.is-flipped { flex-direction: column; gap: 24px; }
  .scatter-media-pair-row .scatter-pair-media,
  .scatter-media-pair-row .scatter-pair-second { width: 100% !important; }
  .scatter-media-pair-text { width: 100% !important; margin-left: 0 !important; }
}

/* Editorial image pair: two side-by-side images on a 12-col grid with
   independent column spans and top offsets — feels placed, not stacked. */
.scatter-image-pair {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  margin-top: 96px;
}
.scatter-image-pair .scatter-pair-cell { min-width: 0; }
.scatter-image-pair .scatter-pair-cell.has-tools-above {
  align-self: start;
  /* When tools sits above the small image, neutralise the offset so the
     tools header aligns with the top of the LARGE image on the other side. */
  margin-top: 0 !important;
}
.scatter-tools-inpair { margin-bottom: 32px; }
.scatter-tools-inpair .section-eye { margin-top: 0 !important; }
.scatter-image-pair .scatter-pair-cell > .media,
.scatter-image-pair .scatter-pair-cell > .media.media-full,
.scatter-image-pair .scatter-pair-cell > .media.media-wide,
.scatter-image-pair .scatter-pair-cell > .media.media-half {
  width: 100%; margin-left: 0; max-width: none;
}

.media { position: relative; max-height: 92vh; overflow: hidden; }
.media img { width: 100%; height: auto; object-fit: cover; max-height: 92vh; }
/* Per-media opt-out: video/image shows in full, no 92vh clip. */
.media.media-no-crop { max-height: none; overflow: visible; }
.media.media-no-crop img { max-height: none; }

/* Natural aspect mode: images flow at their real proportions, never cropped. */
.project-natural-aspect .media { max-height: none; overflow: visible; }
.project-natural-aspect .media img { max-height: none; object-fit: contain; }
/* Images with a forced aspect-ratio go back to cover so the box stays exact. */
.project-natural-aspect .media-forced-aspect { overflow: hidden; }
.project-natural-aspect .media-forced-aspect img { object-fit: cover; }
/* Push scatter sections inward so images don't touch page margins. */
.project-natural-aspect .scatter-section {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}
/* Side-margin mode: caps body width without touching image rendering.
   Used on projects that should keep their full-bleed hero video but pull
   the inline body content inward to match the Extending Photoshoots feel. */
.project-side-margin .scatter-section {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}
.media-video { position: relative; background: var(--bg); overflow: hidden; line-height: 0; }
.media-video iframe { border: 0; display: block; background: transparent; }
.media-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  display: block; overflow: hidden;
}
.media-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.6,.2,1); }
.media-poster:hover img { transform: scale(1.03); }
.media-play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.25), rgba(0,0,0,0) 60%);
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  transition: background .3s;
}
.media-poster:hover .media-play { background: linear-gradient(to top, rgba(0,0,0,.4), rgba(0,0,0,.1) 80%); }
.media-play svg {
  width: 64px; height: 64px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 18px 16px 18px 20px;
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(4px);
  transition: transform .3s cubic-bezier(.2,.6,.2,1);
}
.media-poster:hover .media-play svg { transform: scale(1.08); }
.media-play-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.media-cap {
  margin-top: 12px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--fg) 55%, transparent);
  max-width: 60ch;
}
.project-fixed .media-full { width: 100%; }
.project-fixed .media-wide { width: 88%; }
.project-fixed .media-half { width: 64%; }
.project-fixed .media-half:nth-of-type(even) { margin-left: auto; }
.project-flow .media-full, .project-min-media .media-full { grid-column: span 12; }
.project-flow .media-wide, .project-min-media .media-wide { grid-column: 2 / span 10; }
.project-flow .media-half, .project-min-media .media-half { grid-column: span 6; }

/* Minimal layout */
.project-minimal { max-width: 1400px; margin: 0 auto; }
.project-min-body {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 80px;
  padding: 80px 0; align-items: start;
}
.project-min-side { padding-top: 0; }
.project-min-media { display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 32px; padding-bottom: 96px; }

/* Next project */
.next-project {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 32px;
  padding: 80px var(--page-pad);
  margin: 0 calc(-1 * var(--page-pad));
  border-top: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
}
.next-link {
  display: block;
  flex: 1 1 auto; min-width: 0;
  padding-left: 0;
  transition: padding-left .4s ease;
  color: inherit;
}
.next-link:hover { padding-left: 24px; }
.next-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: color-mix(in srgb, var(--fg) 55%, transparent);
  margin-bottom: 16px;
}
/* Next project: smaller title + custom arrow */
.next-row { display: inline-flex; align-items: center; justify-content: flex-start; gap: 24px; }
.next-title {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(22px, 2.2vw, 36px); letter-spacing: -0.005em;
  text-wrap: pretty;
}
.next-arrow {
  width: 64px; height: 10px; flex-shrink: 0;
  transition: transform .4s cubic-bezier(.2,.6,.2,1);
}
.next-link:hover .next-arrow { transform: translateX(12px); }

/* Previous project (top-right, aligned with "Næste projekt" eyebrow) */
.prev-link {
  position: absolute;
  right: var(--page-pad);
  top: 84px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; line-height: 1.55;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fg) 60%, transparent);
  transition: color .2s ease;
}
.prev-link:hover { color: var(--fg); }
.prev-arrow {
  width: 64px; height: 10px; flex-shrink: 0;
  transition: transform .4s cubic-bezier(.2,.6,.2,1);
}
.prev-link:hover .prev-arrow { transform: translateX(-12px); }
.prev-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* (override earlier .next-title) */

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  padding: 64px var(--page-pad) 48px;
  margin-top: 80px;
}
.footer-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
}
.footer-tagline {
  font-family: var(--font-display); font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 40ch;
  margin: 0 0 56px;
  text-wrap: pretty;
}
.footer-name {
  font-family: var(--font-mono); font-style: normal;
  font-size: 12.5px; letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.footer-list {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.01em;
  display: flex; flex-direction: column; gap: 6px;
}
.footer-list a { text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.footer-list a:hover { text-decoration-color: var(--fg); }
.footer-col-right { text-align: right; }
.footer-col-right .footer-list { color: color-mix(in srgb, var(--fg) 60%, transparent); }

/* ── Editorial grid collection ─────────────────────────────────────────── */
/* Light-background framed thumbnails with "img NN" labels — used to present
   AI references, sketches, palettes etc. as a labeled overview. */
.media-grid { background: color-mix(in srgb, var(--fg) 4%, var(--bg)); padding: 32px 32px 24px; }
.grid-collection { display: grid; gap: 32px 24px; align-items: start; }
.grid-collection .grid-cell { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grid-collection .grid-frame {
  position: relative;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  padding: 10px;
  aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.grid-collection .grid-frame img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  display: block; object-fit: contain;
}
.grid-collection .grid-label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--fg) 65%, transparent);
  text-align: left;
}
@media (max-width: 720px) {
  .media-grid { padding: 16px 12px 14px; }
  .grid-collection { gap: 20px 12px; }
  .grid-collection .grid-frame { padding: 6px; }
  .grid-collection .grid-label { font-size: 9.5px; }
}
.home-hero-title, .brief-title, .row-title, .next-title,
.project-headline-title, .about-title, .card-title, .reel-cap, .reel-name {
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1, "tnum" 0;
}

/* Project headline above meta-strip */
.project-headline {
  display: grid; grid-template-columns: 1fr auto;
  align-items: end; gap: 32px;
  padding: 64px 0 48px;
}
.project-headline-eye {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: color-mix(in srgb, var(--fg) 45%, transparent);
  align-self: end; padding-bottom: 8px;
}
.project-headline-title {
  grid-column: 1;
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(48px, 6.5vw, 104px); line-height: 1; letter-spacing: -0.02em;
  margin: 0; text-wrap: pretty;
}

/* Hero media block (first media before body) */
.project-hero { padding: 24px 0 8px; }
/* Full-bleed hero: break out of the page padding so the media reaches the
   viewport edges. Used for projects that want a cinematic top-of-page video. */
.project-hero-fullbleed {
  margin-left: calc(-1 * var(--page-pad));
  margin-right: calc(-1 * var(--page-pad));
}
.project-hero-fullbleed .media { width: 100%; }
/* Framed hero: full-bleed colored background section with the hero media
   centered inside at a narrower width. Used by Sometime Soon AW23. */
.project-hero-framed {
  margin: 24px calc(-1 * var(--page-pad)) 24px;
  padding: 64px var(--page-pad);
  display: flex; justify-content: center;
}
.project-hero-framed .project-hero-frame { width: var(--hero-frame-width, 55%); margin: 0 auto; }
.project-hero-framed .media { margin: 0; }
.project-hero-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.project-hero-pair .media { margin: 0; }
@media (max-width: 720px) {
  .project-hero-pair { grid-template-columns: 1fr; }
}
.project-hero-min { padding: 24px 0 24px; max-width: none; }
.project-hero .media img { width: 100%; height: auto; }

/* Meta strip now sits below the headline — soften top spacing */
.meta-strip { padding-top: 32px; }

/* Brief sits AFTER the first media now — keep spacing comfortable */
.brief { padding: 80px 0 80px; }

/* Project body — minimal spacing tweaks */
.project-fixed .project-body, .project-flow .project-body { padding: 64px 0 0; }
.not-found h1 {
  font-family: var(--font-display); font-style: italic;
  font-size: 120px; margin-bottom: 24px;
}

/* ════════════════════════════════════════════════════════════════════════
   MOBILE (≤ 767px) — additive overrides. Desktop layout untouched.
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* ── Globals ─────────────────────────────────────────────────────────── */
  html, body { overflow-x: hidden; }
  .app { --page-pad: 20px; }
  img, video, iframe { max-width: 100%; height: auto; }
  main { padding-top: 56px; }

  /* ── Nav: 3-zone grid → name left + single link right ────────────────── */
  .nav {
    height: 56px;
    grid-template-columns: 1fr auto;
    padding: 0 16px;
    font-size: 11.5px;
  }
  .nav-center { display: none; }
  .nav-zone { gap: 16px; min-height: 44px; }
  .nav-right { justify-content: flex-end; }
  .nav-right-grp { gap: 14px; }
  .nav-name { font-size: 11px; }
  .nav-link, .nav-link.as-btn {
    font-size: 11.5px;
    min-height: 44px;
    display: inline-flex; align-items: center;
  }

  /* ── Reel ────────────────────────────────────────────────────────────── */
  .reel-cap {
    left: 20px; right: 20px; bottom: 88px;
    font-size: clamp(24px, 8vw, 40px);
  }
  .reel-foot {
    padding: 20px;
    font-size: 10.5px;
    flex-wrap: wrap; gap: 8px;
  }
  .reel-skip { min-height: 44px; display: inline-flex; align-items: center; }

  /* ── Home hero ───────────────────────────────────────────────────────── */
  .home-hero { padding: 40px 0 48px; }
  .home-hero-line { margin-bottom: 32px; font-size: 9.5px; flex-wrap: wrap; gap: 8px; }
  .home-hero-title { font-size: clamp(32px, 9.5vw, 48px); margin-bottom: 40px; }
  /* Mobile: collapse forced line breaks so the headline wraps naturally
     based on viewport width instead of the desktop 3-line split. */
  .home-hero-title { display: block; }
  .home-hero-title span { display: inline; }
  .home-hero-summary { font-size: 14px; line-height: 1.55; }

  /* ── Project grid: scattered → fluid auto-fit, no overlap ────────────── */
  .grid { padding-bottom: 80px; }
  .grid-scatter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px 16px;
    padding-top: 24px;
  }
  /* Wipe any inline grid-column/row spans the scattered layout sets */
  .grid-scatter > * {
    grid-column: auto !important;
    grid-row: auto !important;
    /* Also kill the per-card top offset so spacing between every project
       is uniform on mobile. */
    margin-top: 0 !important;
  }
  .card-thumb { aspect-ratio: 4/5; }
  .card-thumb img { height: 100%; }

  /* Asymmetric & uniform → same fluid auto-fit */
  .grid-asym, .grid-uniform {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px 16px;
  }
  /* Same as scattered: drop any per-card marginTop so every project gets
     the same vertical rhythm on mobile. */
  .grid-asym > *, .grid-uniform > * {
    margin-top: 0 !important;
  }
  .grid-uniform .card-uniform { grid-column: auto; }

  /* List view: tighter rows, drop hover-only preview */
  .grid-list .row {
    grid-template-columns: 40px 1fr 24px;
    gap: 12px; padding: 18px 0;
    min-height: 44px;
  }
  .grid-list .row .row-tags { display: none; }
  .grid-list .row:hover { padding-left: 0; }
  .grid-list-preview { display: none; }
  .row-title { font-size: 16px; }

  /* ── About: stack to single column, drop sticky portrait ────────────── */
  .about { padding: 32px 20px 64px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-portrait { position: static; }
  .about-portrait img { aspect-ratio: 4/5; }
  .about-title { font-size: clamp(28px, 8vw, 44px); margin-bottom: 24px; }
  .about-body { font-size: 16px; }
  .about-meta {
    grid-template-columns: 1fr;
    gap: 32px; margin-top: 48px; padding-top: 32px;
  }

  /* ── Project headline ────────────────────────────────────────────────── */
  .project-headline {
    grid-template-columns: 1fr;
    gap: 12px; padding: 32px 0 24px;
  }
  .project-headline-eye { align-self: start; padding-bottom: 0; }
  .project-headline-title { font-size: clamp(32px, 9vw, 48px); }

  /* ── Meta strip: 4 cols → fluid auto-fit ─────────────────────────────── */
  .meta-strip {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px; padding: 24px 0 28px;
  }

  /* ── Brief: stacked ──────────────────────────────────────────────────── */
  .brief {
    grid-template-columns: 1fr;
    gap: 16px; padding: 48px 0 48px;
  }
  .brief-eye { align-self: start; }
  .brief-title { font-size: clamp(22px, 6vw, 32px); line-height: 1.25; }

  /* ── Hero media spacing ──────────────────────────────────────────────── */
  .project-hero { padding: 16px 0 8px; }
  .project-hero-min { padding: 16px 0; }

  /* ── Project body: kill multi-col + sticky sidebar ───────────────────── */
  .project-fixed .project-body,
  .project-flow .project-body {
    grid-template-columns: 1fr;
    gap: 32px; padding: 40px 0 0;
  }
  .project-fixed .project-side,
  .project-fixed .project-side.is-fixed {
    position: static; order: 0;
    max-height: none; overflow: visible;
    padding-right: 0;
  }
  .project-fixed .project-media { order: 0; }

  /* Rich media offsets collapse to full width */
  .project-fixed .media-full,
  .project-fixed .media-wide,
  .project-fixed .media-half { width: 100%; margin-left: 0; }
  .project-media { gap: 32px; padding-bottom: 56px; }

  /* Flow + minimal media grids → single column */
  .project-flow .project-media,
  .project-min-media {
    grid-template-columns: 1fr;
    gap: 32px; padding-bottom: 56px;
  }
  .project-flow .media-full,
  .project-flow .media-wide,
  .project-flow .media-half,
  .project-min-media .media-full,
  .project-min-media .media-wide,
  .project-min-media .media-half { grid-column: auto; }

  /* Editorial scatter collapses to a clean stack on mobile */
  .project-media.is-scatter .media-cell,
  .scatter-section .media-cell,
  .scatter-section .scatter-text {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 32px !important;
  }
  .project-media.is-scatter .media-cell:first-child,
  .scatter-section .media-cell:first-child { margin-top: 0 !important; }
  .scatter-section { padding-top: 56px !important; }
  .scatter-section:first-of-type { padding-top: 24px !important; }
  /* Pair row → stack vertically on small screens */
  .scatter-pair-row,
  .scatter-pair-row.is-flipped { flex-direction: column; gap: 24px; }
  .scatter-pair-row .scatter-pair-media,
  .scatter-pair-row .scatter-pair-text { width: 100% !important; }
  /* Image pair → stack vertically on small screens */
  .scatter-image-pair {
    grid-template-columns: 1fr;
    column-gap: 0; row-gap: 32px;
    margin-top: 56px;
  }
  .scatter-image-pair .scatter-pair-cell {
    grid-column: 1 / -1 !important;
    margin-top: 0 !important;
  }

  /* Minimal layout body */
  .project-min-body {
    grid-template-columns: 1fr;
    gap: 32px; padding: 40px 0;
  }

  /* ── Body type ───────────────────────────────────────────────────────── */
  .project-para { font-size: 16px; line-height: 1.6; margin-bottom: 14px; }
  .section-eye { margin-bottom: 16px; }
  .section-eye-mt { margin-top: 32px; }

  /* ── Next project ────────────────────────────────────────────────────── */
  .next-project { padding: 48px 20px; flex-wrap: wrap; gap: 24px; }
  .next-link:hover { padding-left: 0; }
  .next-row { flex-wrap: wrap; gap: 12px; }
  .next-title { font-size: clamp(20px, 6vw, 28px); }
  .next-arrow { width: 48px; }
  .prev-arrow { width: 48px; }

  /* ── Footer: stack to one column ─────────────────────────────────────── */
  .footer { padding: 48px 20px 32px; margin-top: 56px; }
  .footer-tagline { font-size: 22px; max-width: 100%; margin-bottom: 32px; }
  .footer-row { grid-template-columns: 1fr; gap: 32px; }
  .footer-col-right { text-align: left; }
  .footer-name { font-size: 11px; margin-bottom: 6px; }
  .footer-list { font-size: 12px; gap: 8px; }
  .footer-list a, .footer-list li { min-height: 44px; display: flex; align-items: center; }

  /* ── Not found ───────────────────────────────────────────────────────── */
  .not-found { padding: 120px 20px; }
  .not-found h1 { font-size: 72px; }

  /* ── Tweaks panel: contain so it can't obstruct content ──────────────── */
  .tweaks-panel,
  .tp-root,
  .tweaks-panel-root,
  [data-tweaks-panel] {
    max-width: calc(100vw - 24px) !important;
    max-height: 70vh !important;
    right: 12px !important; left: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    overflow-y: auto !important;
    transform: none !important;
  }
  .tweaks-toggle,
  [data-tweaks-toggle] {
    min-width: 44px; min-height: 44px;
    right: 12px !important; bottom: 12px !important;
  }
}

/* ── Tablet (768–1023px): light tightening only ─────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .app { --page-pad: 32px; }
  .home-hero-title { font-size: clamp(28px, 4.2vw, 42px); }
  .meta-strip { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .project-fixed .project-body { grid-template-columns: 1fr 300px; gap: 40px; }
  .about-grid { gap: 56px; }
}
