:root {
  --ink: #1d1a14;
  --cream: #d9cfc0;
  --text: #cfc6b8;
  --muted: #a69d90;
  --teal: #62c6c4;
  --gold: #f0c36d;
  --line: rgb(217 207 192 / .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Space Grotesk", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 300 18px/1.45 var(--serif);
  -webkit-font-smoothing: antialiased;
}
/* Background life: slow drifting light leaks (amber, teal, rose) under fine film grain */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
body::before {
  inset: -25%;
  background:
    radial-gradient(closest-side at 22% 30%, rgb(240 160 70 / .26), transparent),
    radial-gradient(closest-side at 78% 22%, rgb(70 180 180 / .22), transparent),
    radial-gradient(closest-side at 62% 78%, rgb(190 70 90 / .20), transparent),
    radial-gradient(closest-side at 18% 82%, rgb(98 198 196 / .14), transparent);
  filter: blur(30px);
  animation: drift 48s ease-in-out infinite alternate;
}
body::after {
  inset: 0; opacity: .07; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(6%, -4%) rotate(8deg) scale(1.08); }
  100% { transform: translate(-5%, 5%) rotate(-6deg) scale(1.02); }
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--cream); margin: 0; line-height: 1.05; }
h2 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -.01em; }
h2::after { content: ""; display: block; width: 44px; height: 2px; margin-top: 18px; background: var(--gold); }
.featured > h2::after, .contact-title::after { margin-inline: auto; }
h3 { font-size: clamp(26px, 3vw, 34px); }
.small { font: 400 14px/1.5 var(--sans); color: var(--muted); }
.tiny { font: 400 12px/1.4 var(--sans); color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
hr { border: 0; border-top: 3px double rgb(217 207 192 / .7); margin: 48px 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 clamp(16px, 4vw, 56px);
  background: rgb(29 26 20 / .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 18px; color: var(--cream); }
.brand svg, .studio-head svg { width: 28px; height: 28px; fill: currentColor; }
.nav nav { display: flex; gap: clamp(14px, 2.5vw, 30px); }
.nav nav a { text-decoration: none; font: 400 15px var(--sans); letter-spacing: .02em; white-space: nowrap; transition: color .2s; }
.brand { white-space: nowrap; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--teal); }

/* Hero */
.hero { padding: 20px clamp(16px, 3vw, 40px) 8px; }
.hero-frame { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1360 / 656; max-height: 82vh; width: 100%; box-shadow: 0 30px 80px -30px rgb(0 0 0 / .7); }
.hero-frame video { width: 100%; height: 100%; object-fit: cover; }
.hero-frame::after { /* faint scanlines, as on the old site */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgb(0 0 0 / .45)),
    repeating-linear-gradient(transparent 0 2px, rgb(0 0 0 / .08) 2px 3px);
}
.hero-title { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; color: #fff; text-shadow: 0 2px 24px rgb(0 0 0 / .35); }
.hero-title h1 { color: #fff; font-weight: 700; font-size: clamp(48px, 9vw, 128px); text-transform: uppercase; letter-spacing: -.01em; }
.hero-title p { margin: 14px 0 0; font: 500 clamp(12px, 1.5vw, 19px) var(--sans); text-transform: uppercase; letter-spacing: .38em; }
.hero-title p span { color: var(--gold); }
.hero-title > * { animation: rise 1.2s var(--ease) both; }
.hero-title p { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Intro: who Ben is and Élément Magique, before the work. AI sits lower, in .approach */
.intro { padding: 72px max(16px, calc((100% - 1080px) / 2)) 80px; border-bottom: 1px solid var(--line); }
.statement { max-width: 860px; margin: 0 0 48px; font: 400 clamp(26px, 3.2vw, 38px)/1.25 var(--serif); color: var(--cream); letter-spacing: -.01em; }
.intro-em { max-width: 560px; padding-top: 20px; border-top: 1px solid var(--line); }
.approach { padding: 72px 16px; border-top: 1px solid var(--line); text-align: center; }
.approach p { max-width: 600px; margin: 0 auto; font-size: 17px; line-height: 1.6; }
.ai-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; max-width: 920px; margin: 44px auto 0; text-align: left; }
.ai-cols h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 13px var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--cream); }
.ai-cols h3 img { width: 22px; height: 22px; }
.ai-cols .sparkle { color: var(--gold); font-size: 18px; letter-spacing: 0; }
.tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tool { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); transition: transform .3s var(--ease), border-color .3s, background .3s; }
.tool:hover { transform: translateY(-3px) rotate(-.4deg); border-color: rgba(240,195,109,.45); background: rgba(255,255,255,.06); }
.tool-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: transform .4s var(--ease); }
.tool-icon img { width: 28px; height: 28px; }
.tool-icon.pair { position: relative; }
.tool-icon.pair img { position: absolute; width: 19px; height: 19px; }
.tool-icon.pair img:first-child { top: 5px; left: 5px; }
.tool-icon.pair img:last-child { bottom: 5px; right: 5px; }
.tool:hover .tool-icon { transform: rotate(-8deg) scale(1.08); }
.tool h4 { margin: 2px 0 2px; font: 500 15px var(--sans); color: var(--gold); }
.tool .via { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: 11px; letter-spacing: .06em; color: var(--cream); vertical-align: 1px; }
.tool p { margin: 0; max-width: none; font-size: 15px; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .tool, .tool-icon { transition: none; } .tool:hover, .tool:hover .tool-icon { transform: none; } }
.intro-em p { margin: 0; font-size: 17px; line-height: 1.6; max-width: 460px; }
.eyebrow { margin: 0 0 12px; font: 500 13px var(--sans); text-transform: uppercase; letter-spacing: .24em; color: var(--gold); }
.eyebrow::after { content: none; }
.more-link { display: inline-block; margin-top: 16px; font: 500 15px var(--sans); color: var(--cream); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; transition: color .2s; }
.more-link span { display: inline-block; transition: transform .25s var(--ease); }
.more-link:hover { color: var(--gold); }
.more-link:hover span { transform: translateX(4px); }

/* Commercial */
.commercial {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 48px;
  padding: 88px max(16px, calc((100% - 1080px) / 2)) 96px;
  border-bottom: 1px solid var(--line);
}
.commercial h2 { margin-bottom: 40px; }
.commercial .lead { font-size: 22px; color: var(--cream); margin: 0 0 24px; }
.commercial p { max-width: 360px; }
.partner { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font: 400 15px/1.5 var(--sans); color: var(--muted); }
.partner a { color: var(--cream); text-decoration-color: var(--gold); text-underline-offset: 4px; transition: color .2s; }
.partner a:hover { color: var(--gold); }
.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 1px; background: var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: start; }
.logos li { display: grid; place-items: center; height: 96px; padding: 18px; background: rgb(29 26 20 / .72); }
.logos a { display: contents; }
.logos img { width: auto; height: auto; max-width: 100%; max-height: 40px; filter: grayscale(1); opacity: .72; transition: opacity .25s, transform .25s var(--ease); }
.logos li:hover img { opacity: 1; transform: scale(1.05); }
/* Oakland Theater Project: white type on dark paint, so keep the paint dark */
.logos img.lift { filter: grayscale(1) brightness(1.15); opacity: .9; max-height: 56px; }
/* Dark logos are shown as white silhouettes, as on the old site */
img.mono { filter: brightness(0) invert(1); }
.logos .more { font: 400 14px var(--sans); color: var(--muted); letter-spacing: .04em; grid-column: 1 / -1; height: 56px; }

/* Studio */
.studio {
  padding: 48px max(16px, calc((100% - 864px) / 2)) 72px;
  background: linear-gradient(#25222f 0%, #2f2533 45%, #4a2b1d 100%);
}
.studio-head { text-align: center; border-bottom: 3px double rgb(217 207 192 / .7); padding-bottom: 20px; margin: 0 -40px 24px; }
.studio-head svg { margin: 0 auto 10px; color: var(--cream); }
.studio-intro { margin: 0 0 40px; }
.studio-intro::after { content: ""; display: block; width: 114px; margin: 48px auto 0; border-top: 1px solid var(--muted); }
.project-meta { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 40px; }
.project-meta > div { max-width: 260px; }
.project-meta h3 { margin-bottom: 12px; }
.soul { display: grid; grid-template-columns: 289px 1fr; gap: 48px 15%; align-items: start; }
.soul figure { margin: 0; }
.soul figcaption { margin-bottom: 12px; }
.soul h3 { margin: 28px 0 12px; }

.slideshow { position: relative; margin-top: 40px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 2px; }
.slides::-webkit-scrollbar { display: none; }
.slides img { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 862 / 457; object-fit: cover; }
.slideshow button {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgb(0 0 0 / .45); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.slideshow .prev { left: 10px; }
.slideshow .next { right: 10px; }

/* Featured */
.featured { padding-top: 88px; }
.featured > h2 { text-align: center; margin-bottom: 24px; }
.featured > .eyebrow { text-align: center; }
.client { padding: 72px max(16px, calc((100% - 1000px) / 2)) 88px; text-align: center; border-top: 1px solid var(--line); }
.featured > h2 + .client { border-top: 0; }
.client h3 { margin-top: 20px; font-weight: 400; font-style: italic; font-size: clamp(24px, 2.6vw, 30px); }
.client h3 + .grid { margin-top: 40px; }
.client > p { max-width: 620px; margin: 20px auto 44px; font-size: 17px; line-height: 1.6; }
.client-logo { margin: 0 auto; max-height: 72px; width: auto; }
.client > .role { margin: 16px auto 0; max-width: none; font: 400 12px var(--sans); text-transform: uppercase; letter-spacing: .22em; color: var(--muted); }
.client > .role + p { margin-top: 16px; }
.client-credo { background: radial-gradient(ellipse at 50% 30%, rgb(18 40 58 / .9), transparent 70%); }
.client-credo .client-logo { max-height: 56px; }
.client-ikea { background: radial-gradient(ellipse at 50% 40%, rgb(43 38 34 / .8), transparent 75%); }
.client-stanford {
  background: linear-gradient(rgb(29 26 20 / .82), rgb(29 26 20 / .9)), url("/img/stanford-hospital.jpg") center / cover;
}
/* Each client leads with one big film; the rest share the row beneath it */
.grid { display: flex; flex-wrap: wrap; gap: 20px; }
.grid > .video-tile { flex: 1 1 0; min-width: 0; }
.grid > .video-tile:first-child { flex-basis: 100%; }
.grid > .video-tile:first-child img { aspect-ratio: 16 / 9; }
.grid:not(.grid-solo) > .video-tile:first-child::after { opacity: 1; transform: none; padding: 64px 24px 20px; font: 600 clamp(20px, 2.4vw, 28px)/1.1 var(--serif); }
.grid-solo { margin: 0 auto; }
.grid-solo > .video-tile { flex-basis: 100%; }
.grid-solo .video-tile img { aspect-ratio: 16 / 9; }
.grid-solo .play { width: 76px; height: 76px; }

.video-tile {
  position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 6px; overflow: hidden; color: inherit;
  box-shadow: 0 14px 34px -18px rgb(0 0 0 / .8);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.video-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s var(--ease), filter .4s; }
/* Silent preview loop that fades in over the still (main.js) */
.video-tile video.loop { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease); }
.video-tile.live video.loop { opacity: 1; }
.video-tile.live img { transform: none; }
.video-tile::after { /* the title, from data-title */
  content: attr(data-title); position: absolute; inset: auto 0 0; padding: 28px 14px 11px;
  background: linear-gradient(transparent, rgb(0 0 0 / .72)); color: #fff;
  font: 400 13px/1.3 var(--sans); letter-spacing: .02em; text-align: left;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease);
}
.video-tile:hover, .video-tile:focus-visible { transform: translateY(-4px); box-shadow: 0 22px 44px -18px rgb(0 0 0 / .9); }
.video-tile:hover::after, .video-tile:focus-visible::after { opacity: 1; transform: none; }
.video-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.video-tile.wide img { aspect-ratio: 864 / 529; }
.video-tile:hover img, .video-tile:focus-visible img { transform: scale(1.04); filter: brightness(1.08); }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 52px; height: 52px; border: 1.5px solid rgb(255 255 255 / .85); border-radius: 50%;
  background: rgb(255 255 255 / .12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: scale .35s var(--ease), background .35s;
}
.play::after { content: ""; position: absolute; left: 54%; top: 50%; translate: -50% -50%; border: 8px solid transparent; border-left: 13px solid #fff; border-right: 0; }
.video-tile:hover .play, .video-tile:focus-visible .play { scale: 1.12; background: rgb(240 195 109 / .35); }
.play, .video-tile::after { z-index: 1; }
/* With a mouse, the play ring waits for hover so the films read as pictures */
@media (hover: hover) {
  .video-tile .play { opacity: 0; transition: opacity .3s, scale .35s var(--ease), background .35s; }
  .video-tile:hover .play, .video-tile:focus-visible .play { opacity: 1; }
}

/* Contact */
.contact { padding: 88px max(16px, calc((100% - 940px) / 2)) 96px; border-top: 1px solid var(--line); }
.contact-title { text-align: center; margin-bottom: 48px; }
.about img { filter: grayscale(1); border-radius: 8px; }
.about { display: grid; grid-template-columns: 379px 1fr; align-items: center; gap: 40px; }
.bio p { margin: 0 0 18px; font-size: 18px; line-height: 1.6; max-width: 480px; }
.bio a { color: var(--cream); text-decoration-color: var(--gold); text-underline-offset: 4px; }
.bio a:hover { color: var(--gold); }
.bio .social { justify-content: flex-start; gap: 40px; margin-top: 28px; }
.bio .social img { width: 44px; }
.social { display: flex; justify-content: center; align-items: center; gap: 64px; }
.social img { width: 64px; height: auto; opacity: .85; transition: opacity .2s, transform .25s var(--ease); }
.social a:hover img { opacity: 1; transform: translateY(-3px); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; max-width: 492px; margin: 0 auto; font: 400 13px var(--sans); color: var(--muted); }
.contact-form label { display: grid; gap: 6px; }
.contact-form .full { grid-column: 1 / -1; }
.contact-form input, .contact-form textarea {
  font: 400 16px var(--sans); color: var(--cream); background: transparent;
  border: 0; border-bottom: 1px solid var(--muted); padding: 8px 0; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--gold); }
.contact-form button {
  justify-self: start; width: 148px; height: 38px; border: 0; border-radius: 19px;
  background: var(--gold); color: var(--ink); font: 500 14px var(--sans); letter-spacing: .04em; cursor: pointer;
  transition: background .2s, transform .2s var(--ease);
}
.contact-form button:hover { background: #f6d28b; transform: translateY(-1px); }
.contact-form button:disabled { opacity: .6; cursor: wait; }
.hp { position: absolute; left: -9999px; }
.form-status { grid-column: 1 / -1; margin: 0; min-height: 1.4em; color: var(--cream); }

.foot { padding: 32px 24px; border-top: 1px solid var(--line); text-align: center; font: 400 12px var(--sans); color: var(--muted); }

/* Sections ease in as they scroll into view */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Video player */
.player { width: min(1100px, 92vw); padding: 0; border: 0; background: #000; overflow: visible; }
.player::backdrop { background: rgb(0 0 0 / .85); }
.player-body { aspect-ratio: 16 / 9; }
.player-body video, .player-body iframe { width: 100%; height: 100%; border: 0; }
.player .close {
  position: absolute; right: -6px; top: -44px; border: 0; background: none;
  color: #fff; font-size: 36px; line-height: 1; cursor: pointer;
}

@media (max-width: 760px) {
  .nav { height: 52px; }
  .brand { font-size: 16px; }
  .nav nav { gap: 14px; }
  .nav nav a { font-size: 14px; }
  .wide-only { display: none; }
  .nav nav a[href="#top"], .nav nav a[href="#films"] { display: none; }
  .hero { padding: 12px 16px; }
  .hero-frame { aspect-ratio: 4 / 5; }
  .commercial, .soul, .about { grid-template-columns: 1fr; }
  .intro { padding: 48px 16px 56px; }
  .approach { padding: 48px 16px; }
  .ai-cols { grid-template-columns: 1fr; gap: 24px; margin-top: 32px; }
  .statement { margin-bottom: 32px; }
  .bio .social { justify-content: center; }
  .client > .role { font-size: 11px; letter-spacing: .14em; }
  .commercial h2 { margin-bottom: 24px; }
  .commercial .lead { margin-bottom: 24px; }
  .commercial, .featured, .contact { padding-top: 56px; }
  .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logos li { height: 80px; }
  .client { padding-top: 48px; padding-bottom: 56px; }
  .studio-head { margin: 0 0 24px; }
  .project-meta { flex-direction: column; align-items: flex-start; }
  .soul figure img { max-width: 240px; }
  .grid { gap: 12px; }
  .grid { justify-content: center; }
  .grid > .video-tile { flex: 0 0 calc((100% - 12px) / 2); }
  .grid > .video-tile:first-child::after { padding: 40px 14px 12px; }
  .about img { max-width: 300px; margin: 0 auto; }
  .contact-form { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .nav nav a[href="#work"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .video-tile, .video-tile img, .video-tile::after, .play { transition: none; }
  .video-tile video.loop { display: none; }
  .hero-title > * { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  body::before { animation: none; }
}

/* Cross-links between the two sites */
.crosslink { margin: 0 0 8px; font-size: 14px; color: var(--text); }

/* Élément Magique site */
.em .studio { padding-top: 64px; }
.em-hero h1 { font-size: clamp(44px, 8vw, 96px); }
.em-hero svg { width: 44px; height: 44px; }
.em .contact { text-align: center; padding-top: 64px; }
.contact-title { margin-bottom: 32px; }
.em .contact .contact-form { text-align: left; }
