:root {
  --ink: #e8e2d4;
  --black: #0a0b0b;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--black); color: var(--ink); font: 16px/1.6 var(--sans); overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* language switch */
html[data-lang="fr"] [lang="en"], html[data-lang="en"] [lang="fr"] { display: none !important; }
.lang b { font-weight: 400; opacity: .45; }
html[data-lang="fr"] .lang b[data-l="fr"], html[data-lang="en"] .lang b[data-l="en"] { opacity: 1; }

/* top bar: difference blend keeps it legible on every section colour */
.bar { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter); mix-blend-mode: difference; color: #fff;
  font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.bar a { text-decoration: none; }
.bar__nav { display: flex; gap: clamp(14px, 3vw, 32px); align-items: center; }
.bar__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.lang { font: inherit; letter-spacing: inherit; }

.label, .kicker { font: 500 11px/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; opacity: .6; margin: 0 0 24px; }

/* HERO */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; padding: 0 var(--gutter) clamp(72px, 12vh, 140px); overflow: hidden;
  background: radial-gradient(90% 70% at 70% 30%, #1b1d1a 0%, var(--black) 70%); }
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__copy { position: relative; max-width: 880px; pointer-events: none; }
.hero__title { font: 300 clamp(44px, 9vw, 132px)/.95 var(--serif); letter-spacing: -.02em; margin: 0 0 28px; }
.hero__title em { font-style: italic; color: #b9c2a6; }
.hero__lede { max-width: 520px; font-size: clamp(16px, 1.6vw, 19px); opacity: .78; margin: 0; }
.hero__cue { position: absolute; right: var(--gutter); bottom: 32px; font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; opacity: .7; }
.hero__cue:hover { opacity: 1; }

/* INDEX */
.index { position: relative; padding: clamp(80px, 14vh, 160px) var(--gutter); max-width: var(--max); margin: 0 auto; }
.index__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #2a2c2a; }
.index__list a { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid #2a2c2a; text-decoration: none; transition: padding .35s ease, color .35s; }
.index__list a:hover { padding-left: 12px; color: #fff; }
.index__list .n { font: 12px var(--mono); opacity: .5; }
.index__list .t { font: 300 clamp(28px, 4.4vw, 56px)/1.05 var(--serif); }
.index__list .d { font: 12px var(--mono); letter-spacing: .06em; opacity: .55; text-align: right; }
.index__preview { position: fixed; left: 0; top: 0; width: 320px; aspect-ratio: 16/10; object-fit: cover; pointer-events: none; z-index: 15;
  opacity: 0; transform: translate(-50%, -50%) scale(.92); transition: opacity .25s, transform .25s; border-radius: 4px; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.index__preview.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* WORK sections */
.work { padding: clamp(96px, 16vh, 180px) var(--gutter); --fg: var(--ink); --line: rgba(255,255,255,.14); color: var(--fg); }
.work > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.work--dark   { background: #080909; }
.work--forest { background: #0c120f; --fg: #e2e6dc; }
.work--paper  { background: #d7dad6; --fg: #17191b; --line: #a7ada6; color-scheme: light;
  background-image: repeating-linear-gradient(0deg, rgba(23,25,27,.035) 0 1px, transparent 1px 28px); }
.work--cream  { background: #f8f6f1; --fg: #22201c; --line: #d8d3c8; color-scheme: light; }
.work--white  { background: #fff; --fg: #111; --line: #ddd; color-scheme: light; }
.work--app    { background: #f3f1ee; --fg: #2a2733; --line: #d9d5de; color-scheme: light; }

.work__head { display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: 24px 48px; align-items: end; margin-bottom: 40px; }
.work__n { grid-column: 1 / -1; margin: 0; font: 12px var(--mono); letter-spacing: .14em; opacity: .55; }
.work__title { margin: 0; font: 300 clamp(52px, 10vw, 150px)/.9 var(--serif); letter-spacing: -.03em; }
.work--paper .work__title { font: 700 clamp(44px, 8vw, 120px)/.95 var(--mono); letter-spacing: -.02em; text-transform: uppercase; }
.work--white .work__title { font: 500 clamp(44px, 8vw, 120px)/.95 Arial, Helvetica, sans-serif; letter-spacing: -.035em; }
.work--app .work__title { font: 500 clamp(48px, 9vw, 130px)/.95 var(--sans); letter-spacing: -.045em; }
.work__sub { grid-column: 1; margin: 0; max-width: 620px; font: 300 clamp(19px, 2vw, 26px)/1.35 var(--serif); opacity: .85; }
.meta { grid-column: 2; grid-row: 2 / span 2; margin: 0; border-top: 1px solid var(--line); }
.meta div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meta dt { font: 11px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .55; }
.meta dd { margin: 0; font-size: 14px; }
.meta a { text-underline-offset: 3px; }
.work__body { max-width: 680px !important; margin: 0 0 56px !important; font-size: 17px; opacity: .82; }

figure { margin: 0; }
figure img, figure video { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; cursor: zoom-in; }
figure video { cursor: default; }
figcaption { margin-top: 10px; font: 11px/1.5 var(--mono); letter-spacing: .08em; opacity: .6; }
.grid { display: grid; gap: clamp(10px, 1.4vw, 20px); margin-top: clamp(10px, 1.4vw, 20px) !important; margin-bottom: clamp(48px, 7vw, 96px) !important; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--3 figure { aspect-ratio: 16/10; }
.grid--3 .turn { aspect-ratio: auto; }
.grid--3 .turn video { aspect-ratio: 16/10; height: auto; }
.film video { aspect-ratio: 16/9; }
.shot img { border: 1px solid var(--line); height: auto; }
.shot--flat img { box-shadow: 0 20px 60px rgba(0,0,0,.08); }

.grid--shell { grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); aspect-ratio: 16/11; }
.grid--shell .tall { grid-row: span 2; }
.xfade { position: relative; }
.xfade img + img { position: absolute; inset: 0; animation: xfade 12s ease-in-out infinite; }
@keyframes xfade { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .xfade img + img { animation: none; opacity: 0; } }

.grid--wall { grid-template-columns: 1fr 1fr 1fr 1fr; }
.grid--wall > figure:nth-child(1), .grid--wall > figure:nth-child(2) { grid-column: span 2; }
.grid--wall .span2 { grid-column: span 2; grid-row: span 2; align-self: start; }
.grid--wall figure img { height: auto; box-shadow: 0 12px 40px rgba(23,25,27,.12); }
.phone img { border-radius: 22px !important; border: 6px solid #17191b; aspect-ratio: 390/844; object-fit: cover; object-position: top; }

.grid--shinkui { grid-template-columns: 1fr 1fr minmax(200px, 300px); align-items: start; }
.grid--shinkui .span2 { grid-column: span 2; }
.grid--shinkui .span2 img { height: auto; }
.grid--shinkui .phone { grid-column: 3; grid-row: 1 / span 2; }
.grid--shinkui figure:nth-child(3), .grid--shinkui figure:nth-child(4) { aspect-ratio: 4/3; }

/* Myelin: steps + live embed */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 40px !important; border-top: 1px solid var(--line); counter-reset: s; }
.steps li { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); counter-increment: s; font-size: 14px; opacity: .8; }
.steps li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.steps b { display: block; font: 500 20px/1.3 var(--sans); letter-spacing: -.01em; opacity: 1; margin-bottom: 4px; }
.steps b::before { content: "0" counter(s) " "; font: 11px var(--mono); opacity: .5; vertical-align: middle; margin-right: 6px; }
.live { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 40px 100px rgba(42,39,51,.16); }
.live__bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #faf9f7; font: 12px var(--mono); }
.live__dots { display: flex; gap: 6px; }
.live__dots i { width: 10px; height: 10px; border-radius: 50%; background: #d9d5de; }
.live__url { flex: 1; text-align: center; opacity: .6; }
.live__open { text-decoration: none; opacity: .75; }
.live__open:hover { opacity: 1; text-decoration: underline; }
.live iframe { display: block; width: 100%; height: min(82vh, 860px); border: 0; background: #f7f6f4; }
.live__note { max-width: 680px !important; margin: 16px 0 72px !important; font-size: 15px; opacity: .72; }

/* Myelin gallery */
.gallery__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.gallery__tabs button { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: #fff; transition: background .2s, color .2s; }
.gallery__tabs button.on { background: #2a2733; color: #fff; border-color: #2a2733; }
.gallery__stage { position: relative; }
.gallery__stage figure { display: none; }
.gallery__stage figure.on { display: block; animation: fade .45s ease; }
.gallery__stage img { height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 30px 80px rgba(42,39,51,.12); }
.gallery__stage figcaption { font: 15px/1.5 var(--sans); letter-spacing: 0; opacity: .75; max-width: 640px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ABOUT + CONTACT */
.about, .contact { padding: clamp(96px, 16vh, 180px) var(--gutter); max-width: var(--max); margin: 0 auto; }
.about__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; }
.about__lede { margin: 0; font: 300 clamp(26px, 3.4vw, 44px)/1.2 var(--serif); }
.skills { margin: 0; border-top: 1px solid #2a2c2a; }
.skills div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid #2a2c2a; }
.skills dt { font: 11px/1.8 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .55; }
.skills dd { margin: 0; font-size: 15px; opacity: .85; }
.contact { border-top: 1px solid #2a2c2a; }
.contact__mail { display: inline-block; font: 300 clamp(30px, 6.4vw, 92px)/1.05 var(--serif); letter-spacing: -.02em; text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s ease; }
.contact__mail:hover { background-size: 100% 1px; }
.contact__foot { margin: 64px 0 0; font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .45; }

/* reveal */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,6,.94); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb button { position: absolute; top: 16px; right: 20px; font-size: 22px; color: #fff; }

@media (max-width: 860px) {
  .bar__name { display: none; }
  .bar { justify-content: flex-end; }
  .work__head { grid-template-columns: 1fr; }
  .meta { grid-column: 1; grid-row: auto; }
  .index__list a { grid-template-columns: 36px 1fr; }
  .index__list .d { grid-column: 2; text-align: left; }
  .index__preview { display: none; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--shell { grid-template-columns: 1fr 1fr; grid-template-rows: none; aspect-ratio: auto; }
  .grid--shell .tall { grid-column: span 2; grid-row: auto; }
  .grid--shell figure:not(.tall) { aspect-ratio: 4/5; }
  .grid--wall, .grid--shinkui { grid-template-columns: 1fr 1fr; }
  .grid--wall > figure:nth-child(1), .grid--wall > figure:nth-child(2), .grid--wall .span2, .grid--shinkui .span2 { grid-column: span 2; grid-row: auto; }
  .grid--shinkui .phone { grid-column: span 2; grid-row: auto; max-width: 260px; }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .live iframe { height: 78vh; }
  .skills div { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
}
