/* ─────────────────────────────────────────────────────────────
   Mesa - portfolio
   Everything is drawn on a 1440 grid and scaled with --u, so a
   value written here is the value on the design.
   ───────────────────────────────────────────────────────────── */

:root {
  --u: calc(100vw / 1440);
  --bg: #fff;
  --ink: #000;
  --ground: #dedfd9;
  --rule: #e1e1e1;
  --quiet: #b2b2b2;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}
/* the same page by night: the inks swap, the shaders follow (gl.js) */
:root[data-theme="dark"] {
  --bg: #0d0d0c;
  --ink: #f2f2ee;
  --ground: #1c1c1a;
  --rule: #232321;
  --quiet: #6e6e6a;
  color-scheme: dark;
}
.is-theming, .is-theming * { transition: background-color .5s, color .5s, border-color .5s !important; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  font-size: calc(12 * var(--u));
  line-height: calc(14 * var(--u));
  letter-spacing: -.02em;
  overflow-x: hidden;
}
i { font-style: normal; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
::selection { background: var(--ink); color: var(--bg); }

/* nothing shows until the machinery has placed it */
.preloader, .side, .intro, .title, .hint { visibility: hidden; }
.is-up .preloader, .is-up .side, .is-up .intro, .is-up .title, .is-up .hint { visibility: visible; }

/* the machinery never came: everything at rest, nothing in the way */
.is-plain .preloader, .is-plain .veil { display: none; }
.is-plain .ml > i { transform: none; }

/* ── layers ─────────────────────────────────────────────────── */
.gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.page { position: relative; z-index: 2; }
[data-gl] { position: relative; overflow: hidden; }
[data-gl] img, [data-gl] video { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 50%; }
[data-gl].is-gl img, [data-gl].is-gl video { opacity: 0; }

/* a line of type that climbs out of its own mask */
.ml { display: block; overflow: hidden; }
.ml > i { display: block; white-space: nowrap; transform: translateY(100%); }

/* the underline that leaves on the right and comes back on the left */
.sweep { position: relative; display: inline-block; }
.sweep::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform-origin: 100% 50%; }
.sweep:hover::after { animation: sweep .5s var(--ease-io); }
@keyframes sweep {
  0% { transform-origin: 100% 50%; transform: scaleX(1); }
  49.9% { transform-origin: 100% 50%; transform: scaleX(0); }
  50% { transform-origin: 0 50%; transform: scaleX(0); }
  100% { transform-origin: 0 50%; transform: scaleX(1); }
}

/* ── the modular word ───────────────────────────────────────── */
.word { position: absolute; inset: 0; }
.word i { position: absolute; display: block; background: var(--ink); }

/* ── the ground that covers the page between two pages ─────── */
.veil { position: fixed; inset: 0; z-index: 60; background: var(--ground); pointer-events: none; transform: translateY(100%); }

/* ── preloader ──────────────────────────────────────────────── */
.preloader { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.preloader__ground { position: absolute; inset: 0; background: var(--ground); will-change: transform; }
.preloader__count { position: absolute; left: calc(19 * var(--u)); bottom: calc(14 * var(--u)); z-index: 2; mix-blend-mode: difference; color: #fff; }

/* ── the band that becomes the side ─────────────────────────── */
.side { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 7; cursor: pointer; }
.side__ground { position: absolute; inset: 0; background: var(--ground); }

/* ── intro ──────────────────────────────────────────────────── */
/* the plate sits 24 under the first line and 24 over the capitals of MESA ©26, whatever the height; it grows to the left of the list */
.intro { --ph: max(400 * var(--u), 100vh - 214 * var(--u)); --pw: min(var(--ph) * 385 / 476, 510 * var(--u)); position: relative; height: calc(900 * var(--u)); min-height: 100vh; }
.intro__series, .intro__about, .intro__count { position: absolute; top: calc(84 * var(--u)); white-space: nowrap; }
.intro__series { left: calc(19 * var(--u)); }
.intro__about { left: calc(760 * var(--u) - var(--pw)); }
.intro__count { right: calc(21 * var(--u)); }
.intro__cross { width: calc(5 * var(--u)); height: calc(5 * var(--u)); margin: 0 calc(3.5 * var(--u)) 0 calc(4 * var(--u)); position: relative; top: calc(-1 * var(--u)); fill: currentColor; display: inline-block; }
.plate { position: absolute; left: calc(760 * var(--u) - var(--pw)); top: calc(122 * var(--u)); width: var(--pw); height: var(--ph); }
/* 2.5 up: the capitals of the first line sit level with the top of the plate */
.list { position: absolute; left: calc(770 * var(--u)); top: calc(119.5 * var(--u)); width: calc(649 * var(--u)); }
.rules { position: absolute; left: 0; right: 0; top: calc(14 * var(--u)); }
.rules i { position: absolute; left: 0; width: 100%; height: 1px; background: var(--rule); transform-origin: 0 50%; transform: scaleX(0); }
.entry-l { position: relative; height: calc(42 * var(--u)); cursor: pointer; transition: opacity .35s; }
.entry-l .n { position: absolute; left: 0; top: 0; }
.entry-l .tt { position: absolute; top: 0; }
.entry-l .y { position: absolute; right: 0; top: 0; }
.list.is-hover .entry-l { opacity: .3; }
.list .entry-l.is-on { opacity: 1; }
.entry-l::before { content: ''; position: absolute; left: calc(-12 * var(--u)); top: calc(4 * var(--u)); width: calc(6 * var(--u)); height: calc(6 * var(--u)); border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .45s var(--ease-out); }
.entry-l.is-on::before { transform: scale(1); }
.hint { position: fixed; left: calc(19 * var(--u)); bottom: calc(10 * var(--u)); color: var(--quiet); z-index: 4; white-space: nowrap; }
.hint span { display: inline-block; overflow: hidden; vertical-align: top; }
.hint i { display: block; transform: translateY(100%); }

/* ── the project's title, laid over everything ──────────────── */
.title { position: fixed; left: 0; bottom: 0; width: 100%; height: calc(72 * var(--u)); margin: 0; z-index: 6; pointer-events: none; color: #fff; mix-blend-mode: difference; font-weight: 400; font-size: calc(60 * var(--u)); line-height: calc(72 * var(--u)); letter-spacing: -.06em; text-transform: uppercase; }
.title__w { position: absolute; top: 0; white-space: nowrap; }
.title__m { display: inline-block; overflow: hidden; vertical-align: top; margin-right: -.06em; letter-spacing: normal; }
.title__m:last-child { margin-right: 0; }
.title__m i { display: block; white-space: pre; transform: translateY(105%); }

/* ── column lines over the work ─────────────────────────────── */
.cols { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s; }
.cols.is-on { opacity: 1; }
.cols i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }

/* ── section head ───────────────────────────────────────────── */
.shead { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: calc(10 * var(--u)); padding: 0 calc(20 * var(--u)) 0 calc(110 * var(--u)); }
.shead > span:last-child { justify-self: end; grid-column: 4; }

/* ── work ───────────────────────────────────────────────────── */
.work { position: relative; padding: calc(150 * var(--u)) 0 calc(80 * var(--u)); }
.rows { padding: calc(90 * var(--u)) calc(20 * var(--u)) 0 calc(110 * var(--u)); }
.row { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: calc(10 * var(--u)); align-items: start; margin-bottom: calc(110 * var(--u)); }
.entry { --span: 1; position: relative; }
.entry__bar { display: block; height: calc(20 * var(--u)); background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.entry__meta { display: grid; grid-template-columns: repeat(var(--span), 1fr); column-gap: calc(10 * var(--u)); padding-top: calc(16 * var(--u)); height: calc(90 * var(--u)); }
.entry__meta .n { grid-column: 1; grid-row: 1; }
.entry__meta .t { grid-column: var(--span); grid-row: 1; }
.entry__meta .y { grid-column: var(--span); grid-row: 1; justify-self: end; }
.entry[data-span="1"] .entry__meta .t { padding-left: calc(40 * var(--u)); }
.entry__frame { display: block; width: 100%; }
.has-cursor { cursor: none; }

/* the label that follows the hand over a picture */
.cursor { position: fixed; left: 0; top: 0; z-index: 9; visibility: hidden; pointer-events: none; white-space: nowrap; color: #fff; mix-blend-mode: difference; }
.cursor span { display: inline-block; overflow: hidden; vertical-align: top; }
.cursor i { display: block; transform: translateY(100%); }

/* ── method: the grid built in front of you ─────────────────── */
.story { position: relative; height: 640vh; }
.story__stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.story__col { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); transform-origin: 50% 0; }
.story__fill { position: absolute; inset: 0 -1px; background: var(--ink); clip-path: inset(0 0 0 100%); }
.story__media { position: absolute; inset: 0; }
.story__band { position: absolute; top: 0; height: 100%; transform: scaleY(0); transform-origin: 50% 0; background: var(--ground); }
.story__num { position: absolute; top: 50%; transform: translate(-50%, -50%); overflow: hidden; color: var(--quiet); }
.story__num i { display: block; }
.story__steps { position: absolute; left: calc(770 * var(--u)); top: calc(128 * var(--u)); z-index: 2; color: #fff; mix-blend-mode: difference; }
.story__step { display: block; opacity: .4; transition: opacity .4s; position: relative; padding-left: calc(12 * var(--u)); }
.story__step::before { content: ''; position: absolute; left: 0; top: calc(4 * var(--u)); width: calc(6 * var(--u)); height: calc(6 * var(--u)); border-radius: 50%; background: currentColor; transform: scale(0); transition: transform .45s var(--ease-out); }
.story__step.is-on { opacity: 1; }
.story__step.is-on::before { transform: scale(1); }
.story__label { position: absolute; left: calc(110 * var(--u)); top: calc(128 * var(--u)); z-index: 2; color: #fff; mix-blend-mode: difference; }
.story__cap { position: absolute; bottom: calc(-12 * var(--u)); font-size: calc(180 * var(--u)); line-height: 1.2; letter-spacing: -.06em; text-transform: uppercase; white-space: nowrap; z-index: 4; mix-blend-mode: difference; color: #fff; }
.story__cap--l { left: calc(110 * var(--u)); }
.story__cap--r { right: calc(20 * var(--u)); }
.story__cap span { display: inline-block; overflow: hidden; vertical-align: top; margin-right: -.06em; letter-spacing: normal; }
.story__cap i { display: block; }

/* ── about ──────────────────────────────────────────────────── */
.about { position: relative; padding: calc(150 * var(--u)) calc(20 * var(--u)) calc(160 * var(--u)) calc(110 * var(--u)); }
.about__grid { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: calc(10 * var(--u)); }
.about__label { grid-column: 1; }
.about__copy { grid-column: 2 / span 3; font-size: calc(40 * var(--u)); line-height: calc(44 * var(--u)); letter-spacing: -.04em; }
.about__copy .ml { height: calc(44 * var(--u)); }
.about__copy .q i, .about__copy .g { color: var(--quiet); }
/* the CV, in the pill's smoked glass */
.about__cv { grid-column: 2 / span 3; margin-top: calc(40 * var(--u)); }
.cv { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); padding: calc(11 * var(--u)) calc(20 * var(--u)) calc(12 * var(--u)); border-radius: 999px; color: #f4f4f2; background: rgba(14, 14, 14, .62); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 14px 40px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .1); transition: transform .45s var(--ease-out); }
.cv:hover { transform: scale(1.03); }
[data-theme="dark"] .cv { background: rgba(44, 44, 42, .55); border-color: rgba(255, 255, 255, .16); }
.about__table { grid-column: 2 / span 3; margin-top: calc(110 * var(--u)); display: grid; grid-template-columns: repeat(3, 1fr); column-gap: calc(10 * var(--u)); }
.about__col h3 { font: inherit; color: var(--quiet); margin: 0 0 calc(14 * var(--u)); }
.about__row { display: grid; grid-template-columns: calc(40 * var(--u)) 1fr; border-top: 1px solid var(--rule); padding: calc(7 * var(--u)) 0 calc(21 * var(--u)); transition: opacity .35s; position: relative; }
.about__row::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .6s var(--ease-io); }
.about__row:hover::before { transform: scaleX(1); transform-origin: 0 50%; }
.about__col:hover .about__row { opacity: .3; }
.about__col .about__row:hover { opacity: 1; }
.about__row:last-child { border-bottom: 1px solid var(--rule); }
/* a tool, or a network, with its mark: a rounded square in the ink of the text */
.mark { width: calc(16 * var(--u)); height: calc(16 * var(--u)); flex: none; }
/* the mark overhangs the line rather than growing it, so the rules of the three columns stay level */
.tool { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); height: calc(14 * var(--u)); }

/* ── finale ─────────────────────────────────────────────────── */
.finale { position: relative; background: var(--ground); z-index: 3; overflow: hidden; }
.is-gl-on .finale { background: transparent; }
.finale__word { position: absolute; left: 0; right: 0; bottom: 0; cursor: crosshair; }
.is-gl-on .finale__word .word { display: none; }

/* ── small screens ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --u: min(100vw / 390, 1.3px); }
  .intro { height: auto; min-height: 100vh; padding: calc(100 * var(--u)) 16px calc(120 * var(--u)); }
  .intro__series, .intro__about, .intro__count, .plate, .list { position: relative; left: auto; right: auto; top: auto; width: auto; }
  .intro__about, .intro__series, .intro__count { white-space: normal; margin-bottom: 20px; }
  .intro__about { margin-bottom: 0; }
  .intro__about .ml > i { white-space: normal; }
  .plate { height: min(110vw, 72vh); margin-bottom: 40px; }
  .entry-l::before, .cols { display: none; }
  /* the title closes the first screen's list instead of floating over it */
  body:not(.is-project) .title { position: absolute; bottom: auto; }
  .hint { display: none; }
  .title { font-size: calc(44 * var(--u)); height: calc(54 * var(--u)); line-height: calc(54 * var(--u)); }
  /* never under 80: the band (64) would cover the heading */
  .work { padding-top: calc(90 * var(--u)); }
  .shead { grid-template-columns: 1fr auto; padding: 0 16px; }
  .shead > span:nth-child(2), .shead > span:nth-child(3) { display: none; }
  .shead > span:last-child { grid-column: 2; }
  .rows { padding: 40px 16px 0; }
  .row { grid-template-columns: 1fr; margin-bottom: 0; }
  .entry { grid-column: 1 / -1 !important; margin: 0 0 60px !important; }
  /* the covers are wide: a square frame, where a portrait one cut half of them */
  .entry__frame { height: calc(100vw - 32px) !important; }
  .has-cursor { cursor: auto; }
  .story { height: 600vh; }
  .story__label { left: 24px; top: 64px; }
  .story__steps { left: 24px; top: calc(64px + 24 * var(--u)); }
  /* the number over its word, both on the left */
  .story__cap { font-size: calc(60 * var(--u)); line-height: 1.05; }
  .story__cap--l { left: 24px; bottom: calc(24px + 60 * var(--u)); }
  .story__cap--r { left: 24px; right: auto; bottom: 20px; }
  .about { padding: 100px 16px; }
  .about__grid { grid-template-columns: 1fr; }
  .about__table { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); column-gap: 24px; margin-top: 64px; }
  .about__label, .about__copy, .about__table, .about__cv { grid-column: 1; }
  .about__copy { font-size: 24px; line-height: 28px; }
  .about__copy .ml { height: auto; }
  .about__copy .ml > i { white-space: normal; }
  /* the profile's five lines run on as one paragraph */
  #profil .about__copy .ml, #profil .about__copy .ml > i { display: inline; }
  #profil .about__copy .ml::after { content: ' '; }
  .about__label { margin-bottom: 20px; }
  .about__col { margin-bottom: 40px; }
}

/* ── tablets: two pictures side by side ─────────────────────── */
@media (min-width: 640px) and (max-width: 1100px) {
  .row { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .entry { grid-column: auto !important; }
  .entry:only-child, .entry:nth-child(3):last-child { grid-column: 1 / -1 !important; }
  .entry__frame { height: calc(50vw - 24px) !important; }
  :where(.row) > .entry:only-child .entry__frame, :where(.row) > .entry:nth-child(3):last-child .entry__frame { height: 60vw !important; }
  .about__copy { font-size: 32px; line-height: 38px; max-width: 24em; }
}
@media (hover: none) { .cursor { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .ml > i, .title__m i, .hint i { transform: none !important; }
}
