/* ==========================================================================
   Mouhcine Lahmer — Portfolio
   One family (Archivo, width + weight axes), three colours: ink, paper, signal orange.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Grained";
  src: url("../fonts/grained.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --serif: "Grained", "Archivo", system-ui, sans-serif;
  --paper: #faf2e8;
  --ink: #000;
  --orange: #ff5a1f;
  --soft: #f0e4d3;
  --mute: #5f5f5a;
  --pad: clamp(18px, 3.4vw, 52px);
  --r-panel: clamp(28px, 4vw, 60px);
  --r-card: 26px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-stretch: 100%;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Set here as well as on body: otherwise body's value moves up to the viewport and phones still
     widen the page to fit the tilted marquee and other decorations that hang past the edge. */
  overflow-x: clip;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  overflow-x: clip;
  font-size: clamp(16px, 0.35vw + 14.5px, 19px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.panel--orange :focus-visible, .banner--orange :focus-visible, .btn--orange:focus-visible, .nav__logo:focus-visible { outline-color: #000; }
::selection { background: var(--orange); color: #000; }

.skip { position: fixed; left: 12px; top: -80px; z-index: 400; background: #000; color: #fff; padding: .7em 1.1em; border-radius: 999px; transition: top .3s var(--ease); }
.skip:focus { top: 12px; }

/* The display voice: ultra-condensed, black weight */
.display {
  font-weight: 900;
  font-stretch: 62%;
  text-transform: uppercase;
  line-height: .88;
  letter-spacing: -.005em;
}
.h-xl { font-size: clamp(40px, 6vw, 92px); margin-bottom: .35em; }

/* ---------- Loader / curtain / progress / cursor ---------- */
.loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--orange); color: #000;
  overflow: hidden;
}
html:not(.js) .loader, html.seen .loader { display: none; }
.loader__name { position: absolute; left: var(--pad); bottom: var(--pad); display: flex; flex-direction: column; font-size: clamp(54px, 12vw, 190px); }
.loader__name span { display: block; overflow: hidden; padding-top: .04em; }
.loader__name span > i { display: block; font-style: normal; }
.loader__count { position: absolute; right: var(--pad); top: var(--pad); display: flex; align-items: flex-start; font-size: clamp(64px, 14vw, 230px); font-variant-numeric: tabular-nums; }
.loader__count i { font-style: normal; font-size: .4em; margin-top: .12em; }
.loader__wave { position: absolute; left: 0; right: 0; top: 46%; width: 100%; height: clamp(40px, 9vw, 130px); transform: translateY(-50%); }
.loader__wave path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.wipe { position: fixed; inset: 0; z-index: 290; background: #000; transform: translateY(101%); pointer-events: none; }
html.wipe-in .wipe { transform: none; }

.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 90; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }

.cursor {
  display: none; position: fixed; left: 0; top: 0; z-index: 250; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--orange); place-items: center;
  transition: width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), opacity .3s, background .3s;
}
.cursor__label { font-size: 13px; font-weight: 800; font-stretch: 85%; color: #000; opacity: 0; transition: opacity .25s; letter-spacing: .02em; }
.cursor.is-link { width: 46px; height: 46px; margin: -23px 0 0 -23px; opacity: .55; }
.cursor.is-label { width: 96px; height: 96px; margin: -48px 0 0 -48px; }
.cursor.is-label .cursor__label { opacity: 1; }
html.lb-open .cursor { opacity: 0 !important; }
@media (hover: hover) and (pointer: fine) {
  html.js .cursor { display: grid; }
  html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor [tabindex] { cursor: none; }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(12px, 1.5vw, 22px) var(--pad);
  transition: transform .6s var(--ease);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav.is-hidden { transform: translateY(-130%); }
.nav__logo {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #000; text-decoration: none;
  padding: .55em 1em; border-radius: 999px; border: 2px solid #000;
  font-weight: 900; font-stretch: 75%; letter-spacing: .02em; font-size: 1.05rem; line-height: 1;
}
.nav__logo svg { width: 30px; height: 11px; }
.nav__logo path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .8s var(--ease); }
.nav__logo:hover path { animation: draw 1s var(--ease); }
.nav__links {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: .2rem; padding: .28rem;
  background: var(--paper); border: 2px solid #000; border-radius: 999px;
}
.nav__links a {
  padding: .5em 1.15em; border-radius: 999px; text-decoration: none; line-height: 1.1;
  font-weight: 650; font-stretch: 92%; transition: background .3s, color .3s;
}
.nav__links a:hover, .nav__links a.is-on { background: #000; color: #fff; }
.nav__right { display: flex; align-items: center; gap: .6rem; }
.nav__cta { outline: 2px solid var(--paper); outline-offset: 0; }

.lang {
  position: relative; display: flex; padding: 2px; cursor: pointer;
  background: var(--paper); border: 2px solid #000; border-radius: 999px;
  font-weight: 800; font-size: .8rem; letter-spacing: .05em; line-height: 1;
}
.lang__opt { position: relative; z-index: 1; padding: .55em .8em; color: #fff; transition: color .35s; }
html[lang="en"] .lang__opt[data-l="fr"] { color: #000; }
html[lang="en"] .lang__opt[data-l="en"] { color: #fff; }
html[lang="fr"] .lang__opt[data-l="en"] { color: #000; }
.lang__dot { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); background: #000; border-radius: 999px; transition: transform .55s var(--ease); }
html[lang="en"] .lang__dot { transform: translateX(100%); }

/* ---------- Buttons ---------- */
.btn {
  --sweep: var(--paper); --sweep-fg: #000;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  padding: .85em 1.4em; border-radius: 999px; text-decoration: none; border: 2px solid currentColor;
  font-weight: 700; font-stretch: 92%; line-height: 1.1; white-space: nowrap; cursor: pointer;
  transition: color .35s, border-color .35s;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: 0; height: 130%; z-index: -1;
  background: var(--sweep); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: translateY(105%); transition: transform .55s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover, .btn:focus-visible { color: var(--sweep-fg); }
.btn--ink { background: #000; color: #fff; border-color: #000; --sweep: var(--orange); --sweep-fg: #000; }
.btn--ink:hover { border-color: #000; }
.btn--orange { background: var(--orange); color: #000; border-color: var(--orange); --sweep: var(--paper); --sweep-fg: #000; }
.btn--line { color: #fff; --sweep: var(--paper); --sweep-fg: #000; }

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100svh; min-height: 640px; max-height: 1080px;
  padding-top: clamp(96px, 12.5vh, 132px); overflow: hidden;
}
.tools { position: relative; z-index: 6; display: flex; justify-content: center; gap: clamp(8px, 1.1vw, 16px); }
.tool {
  width: clamp(38px, 4vw, 58px); aspect-ratio: 1; display: grid; place-items: center;
  background: #000; color: #fff; border-radius: 24%;
  font-weight: 800; font-size: clamp(15px, 1.7vw, 24px); letter-spacing: -.02em; line-height: 1;
  transition: transform .6s var(--ease), background .3s;
}
.tool:hover { transform: translateY(-8px) rotate(-7deg); background: var(--orange); color: #000; }
.tool--ai svg { width: 52%; height: 52%; fill: var(--orange); transition: fill .3s; }
.tool--ai:hover svg { fill: #000; }

.doodle { position: absolute; z-index: 2; }
.doodle path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.doodle--wave { left: 3.2vw; top: 21%; width: clamp(80px, 9vw, 150px); height: auto; }
.doodle--arcs { left: 2vw; top: 46%; width: clamp(26px, 3.2vw, 52px); height: auto; }
.doodle--dot { right: 4.5vw; top: 23%; width: clamp(34px, 4.4vw, 70px); aspect-ratio: 1; border-radius: 50%; background: #000; box-shadow: 0 0 0 clamp(5px, .7vw, 10px) var(--paper), 0 0 0 clamp(8px, 1.1vw, 16px) var(--orange); }

.hero__stage { position: absolute; inset: 0; pointer-events: none; }
.hero__titlewrap {
  position: absolute; left: var(--pad); right: var(--pad);
  top: clamp(150px, 23vh, 240px);
  display: flex; justify-content: center; z-index: 1;
}
.hero__title {
  display: inline-flex; color: var(--orange); font-size: var(--fs, 17vw); line-height: 1;
  transform: scaleY(var(--sy, 1.55)); transform-origin: 50% 0; pointer-events: auto;
  font-weight: 900; font-stretch: 62%;
}
.ch { display: inline-block; overflow: hidden; }
.ch b { display: block; font-weight: inherit; transform-origin: 50% 100%; }
.hero.is-live .ch { overflow: visible; }
.hero__portrait {
  position: absolute; left: 50%; bottom: 0; z-index: 3;
  height: min(77%, 118vw); aspect-ratio: 815 / 1086;
  user-select: none; -webkit-user-drag: none; will-change: transform;
}
.hero__portrait img, .hero__portrait video {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain;
  -webkit-user-drag: none; pointer-events: none;
}
/* Ink lines that carry the shoulders past the edge of the illustration, so the crop reads as a design choice */
.hero__wings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hero__wings .draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.hero__img { transition: opacity .5s; }
.hero__live { opacity: 0; transition: opacity .5s; }
.hero.has-live .hero__live { opacity: 1; }
.hero.has-live .hero__img { opacity: 0; }

.hero__col { position: absolute; z-index: 5; bottom: clamp(58px, 10.5vh, 104px); max-width: min(27ch, 24vw); }
.hero__col--l { left: var(--pad); display: flex; align-items: flex-end; gap: 1.1rem; max-width: min(40ch, 34vw); }
.hero__col--r { right: var(--pad); text-align: right; }
.hero__lead { font-size: clamp(15px, 1.3vw, 21px); line-height: 1.35; font-weight: 550; font-stretch: 95%; }
.hero__name { font-size: clamp(20px, 2.4vw, 38px); font-weight: 900; font-stretch: 70%; text-transform: uppercase; line-height: 1; margin-bottom: .5rem; }
.hero__meta { font-size: clamp(14px, 1.05vw, 17px); color: var(--mute); line-height: 1.4; }
.hero__scroll { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #000; color: #fff; transition: background .3s, color .3s, transform .5s var(--ease); }
.hero__scroll svg { width: 22px; height: 22px; transform: rotate(180deg); animation: bob 1.8s var(--ease-io) infinite; }
.hero__scroll:hover { background: var(--orange); color: #000; transform: scale(1.1); }

.badge { position: absolute; z-index: 5; right: clamp(16px, 17vw, 300px); top: 56%; width: clamp(92px, 10vw, 156px); aspect-ratio: 1; }
.badge__ring { width: 100%; height: 100%; animation: spin 22s linear infinite; }
.badge__ring text { font-size: 15px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; fill: #000; }
.badge__core { position: absolute; inset: 31%; width: 38%; height: 38%; fill: var(--orange); animation: spin 9s linear infinite reverse; }

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: 7; width: 104%; margin: -1.6vw 0 0 -2%;
  background: #000; color: #fff; overflow: hidden; padding: clamp(10px, 1.2vw, 18px) 0;
  border-block: 4px solid var(--orange); transform: rotate(-1.6deg);
}
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); padding-right: clamp(18px, 2.4vw, 36px); flex: none; }
.marquee span { font-size: clamp(28px, 4.4vw, 68px); font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: 1.05; white-space: nowrap; }
.marquee i { flex: none; width: clamp(20px, 2.6vw, 40px); aspect-ratio: 1; background: var(--orange); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* ---------- Sections + banners ---------- */
.section { position: relative; padding: clamp(80px, 10vw, 150px) var(--pad); }

.banner {
  position: relative; display: grid; place-items: center; overflow: hidden;
  height: clamp(110px, 14vw, 210px); border-radius: var(--r-panel);
  margin-bottom: clamp(36px, 5vw, 80px);
}
.banner--orange { background: var(--orange); color: #000; }
.banner--ink { background: #000; color: #fff; }
.banner__title { position: relative; z-index: 1; font-size: clamp(44px, 8.6vw, 132px); }
.banner__ic { position: absolute; top: 50%; width: clamp(34px, 5vw, 76px); height: clamp(34px, 5vw, 76px); margin-top: calc(clamp(34px, 5vw, 76px) / -2); opacity: .22; }
.banner__ic--1 { left: 4%; } .banner__ic--2 { left: 14%; } .banner__ic--3 { left: 24%; }
.banner__ic--4 { right: 24%; } .banner__ic--5 { right: 14%; } .banner__ic--6 { right: 4%; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 110px); align-items: center; }
.about__photo { position: relative; justify-self: center; width: min(100%, 520px); }
.about__frame {
  padding: clamp(10px, 1.1vw, 16px); background: var(--orange);
  border-radius: var(--r-panel); overflow: hidden; clip-path: inset(0 round var(--r-panel));
}
.about__frame img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: calc(var(--r-panel) - 10px);
  filter: grayscale(1) contrast(1.12); transition: filter .7s var(--ease), transform 1.1s var(--ease);
}
.about__photo:hover .about__frame img { filter: none; }
.about__squig { position: absolute; right: -8%; bottom: -5%; width: 46%; height: auto; z-index: 2; }
.about__squig path { stroke-dasharray: 1; stroke-dashoffset: 0; }

.about__hi { font-size: clamp(38px, 5.2vw, 84px); font-weight: 800; font-stretch: 72%; letter-spacing: -.02em; line-height: .96; margin-bottom: .55em; }
.about__hi .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.about__hi .w > span { display: inline-block; }
.about__text > p { max-width: 58ch; margin-bottom: 1em; color: #1b1b19; }

.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; align-items: end; gap: clamp(18px, 4vw, 64px); margin: clamp(24px, 3vw, 44px) 0; padding: clamp(16px, 2vw, 26px) 0; border-block: 2px solid #000; }
.stat { display: flex; flex-direction: column-reverse; }
.stat dd { font-size: clamp(46px, 6vw, 96px); font-weight: 900; font-stretch: 62%; line-height: .9; font-variant-numeric: tabular-nums; }
.stat dt { font-size: .86rem; color: var(--mute); max-width: 16ch; line-height: 1.25; margin-top: .4rem; min-height: 2.5em; }

.pills { display: flex; flex-wrap: wrap; gap: .55rem; }
.pills li {
  padding: .5em 1.05em; border: 2px solid #000; border-radius: 999px;
  font-weight: 650; font-stretch: 90%; line-height: 1.1; font-size: .94rem;
  transition: background .3s, transform .5s var(--ease), border-color .3s; cursor: default;
}
.pills li:hover { background: var(--orange); transform: rotate(-3deg) scale(1.07); }

/* ---------- Journey ---------- */
/* Experience | Education on top, Languages | Tools below. Both rows share the same two columns and
   each row is as tall as its tallest block, so the blocks stretch to fill instead of leaving gaps. */
.journey { padding-top: 0; padding-bottom: clamp(30px, 4vw, 60px); }
.journey__grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(44px, 5.5vw, 88px) clamp(32px, 6vw, 110px);
  border-top: 2px solid #000; padding-top: clamp(48px, 6vw, 96px);
}
.jblock { display: flex; flex-direction: column; min-width: 0; }
.jblock > .h-xl { flex: none; }

.tlwrap { position: relative; padding-left: 46px; }
.tl__rail { position: absolute; left: 11px; top: 14px; bottom: 14px; width: 4px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.tl__fill { display: block; width: 100%; height: 100%; background: var(--orange); transform-origin: 50% 0; transform: scaleY(0); }
.tl__item { position: relative; padding-bottom: clamp(26px, 3vw, 44px); }
.tl__item:last-child { padding-bottom: 0; }
.tl__node { position: absolute; left: -46px; top: .1em; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, var(--orange) 0 32%, #000 35%); }
.tl__date { font-size: .88rem; color: var(--mute); }
.tl__item h3 { font-size: clamp(24px, 2.6vw, 38px); font-weight: 800; font-stretch: 75%; line-height: 1.05; margin: .15em 0 .1em; }
.tl__org { font-weight: 650; }
.tl__desc { margin-top: .5em; max-width: 46ch; color: #2b2b28; }

.edu { flex: 1; display: grid; grid-auto-rows: 1fr; gap: 14px; }
.edu li {
  display: flex; flex-direction: column; gap: .3rem; padding: clamp(18px, 2vw, 30px); min-height: 150px;
  background: var(--soft); border-radius: var(--r-card); transition: background .45s var(--ease), transform .6s var(--ease);
}
.edu li:hover { background: var(--orange); transform: translateY(-4px); }
.edu span { order: -1; align-self: flex-start; padding: .3em .85em; border: 2px solid #000; border-radius: 999px; font-size: .86rem; font-weight: 650; line-height: 1.2; }
.edu h3 { margin-top: auto; font-size: clamp(24px, 2.6vw, 40px); font-weight: 800; font-stretch: 75%; line-height: 1.05; }
.edu p { font-weight: 550; }

.rings { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ring {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; text-align: center;
  padding: clamp(16px, 1.8vw, 28px) 10px; background: var(--soft); border-radius: var(--r-card);
}
.ring__dial { position: relative; width: min(100%, 132px); }
.ring svg { width: 100%; transform: rotate(-90deg); }
.ring__bg, .ring__fg { fill: none; stroke-width: 9; }
.ring__bg { stroke: var(--paper); }
.ring__fg { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-stretch: 70%; font-size: clamp(18px, 1.9vw, 28px); }
.ring span { display: block; font-weight: 650; font-size: .95rem; }

.toolrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.toolrow li { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem .55rem .55rem; border: 2px solid #000; border-radius: 18px; transition: background .3s, transform .5s var(--ease); }
.toolrow li:hover { background: #000; color: #fff; transform: translateY(-4px); }
.toolrow .app { flex: none; width: 40px; height: 40px; transition: transform .5s var(--ease); }
.toolrow li:hover .app { transform: rotate(-8deg) scale(1.1); }
.toolrow .app text { font-family: var(--sans, "Archivo", system-ui, sans-serif); }
.toolrow span { font-size: .8rem; line-height: 1.1; font-weight: 600; }
.toolnote { margin-top: auto; padding-top: 1.2rem; max-width: 52ch; color: var(--mute); font-size: .95rem; }

/* ---------- Work: stacked panels ---------- */
.work { padding-top: clamp(60px, 7vw, 110px); }
.stack { position: relative; }
.panel {
  --pp: clamp(26px, 4vw, 64px);
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: clamp(22px, 3vw, 44px);
  padding: var(--pp); border-radius: var(--r-panel); overflow: hidden;
  transform-origin: 50% 0;
}
.panel + .panel { margin-top: 24px; }
.panel--orange { background: var(--orange); color: #000; }
.panel--ink { background: #000; color: #fff; }
.panel--paper { background: #fff; color: #000; border: 2px solid #000; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem 3rem; flex-wrap: wrap; }
.panel__title { font-size: clamp(52px, 9vw, 150px); }
.panel__sub { max-width: 36ch; font-size: 1rem; line-height: 1.45; }

@media (min-width: 960px) and (min-height: 720px) {
  .panel { position: sticky; top: 3vh; min-height: min(94svh, 900px); }
  .panel + .panel { margin-top: 10vh; }
}

.reel { --h: clamp(310px, 57vh, 660px); display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 30px); }
.vcard {
  position: relative; height: var(--h); padding: 0; border: 0; overflow: hidden; color: #fff; background: #111; cursor: pointer;
  border-radius: var(--r-card); flex: 0 1 auto; text-align: left;
  transition: transform .7s var(--ease), border-radius .7s var(--ease);
}
.vcard--45 { aspect-ratio: 4 / 5; }
.vcard--916 { aspect-ratio: 9 / 16; }
/* the main card sits in front and is the tallest; the two side cards tuck in behind it */
.vcard--main { z-index: 2; height: calc(var(--h) * 1.12); box-shadow: 0 34px 60px -28px rgba(0,0,0,.6); }
.vcard--side { height: calc(var(--h) * .86); }
.vcard--side:first-child { margin-right: calc(var(--h) * -.05); transform: rotate(-3.5deg) translateY(3%); }
.vcard--side:last-child { margin-left: calc(var(--h) * -.05); transform: rotate(3.5deg) translateY(3%); }
.vcard video { width: 100%; height: 100%; object-fit: cover; }
.vcard__cap {
  position: absolute; inset: auto 0 0 0; display: grid; gap: .1rem; padding: 2.6rem 1.1rem 1.05rem;
  background: linear-gradient(to top, rgba(0,0,0,.78), transparent);
  transform: translateY(30%); opacity: 0; transition: transform .6s var(--ease), opacity .4s;
}
.vcard__cap b { font-size: 1.05rem; font-weight: 800; font-stretch: 85%; line-height: 1.1; }
.vcard__cap em { font-style: normal; font-size: .85rem; opacity: .85; line-height: 1.2; }
/* personal projects: a square and a vertical loop, tilted towards each other */
.reel--duo { gap: clamp(18px, 3vw, 46px); }
.vcard--sq { aspect-ratio: 1; height: calc(var(--h) * .9); transform: rotate(-2.5deg) translateY(2%); }
.vcard--tall { height: calc(var(--h) * 1.02); transform: rotate(2deg); }
.vcard--sq:hover, .vcard--sq:focus-visible { transform: rotate(-1deg) translateY(-3%); border-radius: 56px; }
.vcard--tall:hover, .vcard--tall:focus-visible { transform: rotate(1deg) translateY(-3%); border-radius: 56px; }
/* some of these clips have white frames, so each card gets an outline to stay visible on the white panel */
#personal .vcard { box-shadow: 0 0 0 2px #000; }
.vcard--third { height: calc(var(--h) * .86); transform: rotate(-2deg) translateY(2%); }
.vcard--third:hover, .vcard--third:focus-visible { transform: rotate(-.5deg) translateY(-3%); border-radius: 56px; }
.vcard__loop {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px;
  background: #000; color: #fff; border-radius: 50%; pointer-events: none;
}
.vcard__loop svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; animation: spin 7s linear infinite; }
.vcard--side:first-child:hover, .vcard--side:first-child:focus-visible { transform: rotate(-1deg) translateY(-3%); border-radius: 56px; }
.vcard--side:last-child:hover, .vcard--side:last-child:focus-visible { transform: rotate(1deg) translateY(-3%); border-radius: 56px; }
.vcard--main:hover, .vcard--main:focus-visible { transform: translateY(-12px) scale(1.025); border-radius: 56px; }
.vcard:hover .vcard__cap, .vcard:focus-visible .vcard__cap { transform: none; opacity: 1; }
@media (hover: none) { .vcard__cap { transform: none; opacity: 1; } }

.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); }
.dcard {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9; padding: clamp(16px, 2vw, 30px); border: 0; border-radius: var(--r-card);
  background: #111; color: #fff; text-align: left; cursor: pointer;
  transition: transform .7s var(--ease), border-radius .7s var(--ease);
}
.dcard:hover, .dcard:focus-visible { transform: translateY(-10px) rotate(-.8deg); border-radius: 56px; }
.dcard:nth-child(2):hover, .dcard:nth-child(2):focus-visible { transform: translateY(-10px) rotate(.8deg); }
.dcard__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1.3s var(--ease); }
.dcard:hover .dcard__img, .dcard:focus-visible .dcard__img { transform: scale(1.07); }
.dcard__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0) 58%); }
.dcard__len {
  position: absolute; left: clamp(14px, 1.6vw, 24px); top: clamp(14px, 1.6vw, 24px);
  display: inline-flex; align-items: center; gap: .6rem; padding: .45em .95em .45em .75em;
  background: #000; color: #fff; border-radius: 999px; font-size: .9rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.dcard__bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.dcard__bars i { display: block; width: 3px; height: 100%; border-radius: 2px; background: var(--orange); transform-origin: 50% 100%; transform: scaleY(.3); animation: eq 1s ease-in-out infinite alternate; }
.dcard__bars i:nth-child(2) { animation-duration: .7s; animation-delay: -.3s; }
.dcard__bars i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.6s; }
.dcard__bars i:nth-child(4) { animation-duration: .85s; animation-delay: -.1s; }
.dcard:hover .dcard__bars i { animation-duration: .4s; }
.dcard__foot { display: flex; align-items: center; gap: 1rem; }
.dcard__play { display: grid; place-items: center; flex: none; width: clamp(48px, 5vw, 68px); aspect-ratio: 1; border-radius: 50%; background: var(--orange); color: #000; transition: transform .6s var(--ease); }
.dcard__play svg { width: 54%; height: 54%; }
.dcard:hover .dcard__play { transform: scale(1.18) rotate(-8deg); }
.dcard__t { display: grid; line-height: 1.15; min-width: 0; }
.dcard__t b { font-size: clamp(17px, 1.7vw, 26px); font-weight: 800; font-stretch: 80%; }
.dcard__t em { font-style: normal; font-size: .88rem; opacity: .85; }

/* ---------- Brand: two sliding chains ---------- */
.brand { position: relative; background: var(--soft); margin-top: clamp(40px, 6vw, 90px); overflow: hidden; }
.brand__inner { display: flex; flex-direction: column; gap: clamp(22px, 3.6vh, 40px); padding: clamp(72px, 10vh, 110px) 0 clamp(48px, 8vh, 90px); }
.brand__head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1.2rem 3rem; padding: 0 var(--pad); }
.brand__title { font-size: clamp(48px, min(8.4vw, 15vh), 140px); }
.brand__info { max-width: 38ch; font-size: .98rem; line-height: 1.45; }

.chain { --sw: clamp(230px, min(27vw, calc((100svh - 400px) * 8 / 9)), 470px); --gap: clamp(14px, 1.8vw, 26px); display: grid; gap: 14px; }
.chain__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 2rem; padding: 0 var(--pad); }
.chain__name { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem 1rem; line-height: 1.2; }
.chain__name b { font-size: clamp(20px, 2.1vw, 32px); font-weight: 900; font-stretch: 70%; text-transform: uppercase; }
.chain__name span { font-size: .95rem; color: var(--mute); }
.swatches { display: flex; gap: 8px; padding-bottom: 14px; }
.swatches button { position: relative; width: clamp(30px, 2.8vw, 40px); aspect-ratio: 1; border: 2px solid #000; border-radius: 50%; background: var(--c); cursor: pointer; transition: transform .5s var(--ease); }
.swatches button:hover, .swatches button:focus-visible { transform: translateY(-5px) scale(1.12); }
.swatches span { position: absolute; left: 50%; top: calc(100% + 6px); transform: translate(-50%, -4px); font-size: 11px; font-weight: 700; letter-spacing: .04em; opacity: 0; pointer-events: none; transition: opacity .25s, transform .4s var(--ease); white-space: nowrap; }
.swatches button:hover span, .swatches button:focus-visible span { opacity: 1; transform: translate(-50%, 0); }

/* Without script or with reduced motion the chain is a plain swipeable strip. */
.chain__viewport { overflow-x: auto; scrollbar-width: none; padding: 16px var(--pad) 46px; margin: -16px 0 -46px; }
.chain__viewport::-webkit-scrollbar { display: none; }
html.js:not(.reduce) .chain__viewport { overflow: hidden; padding-inline: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.chain__track { display: flex; width: max-content; will-change: transform; }
.slide {
  flex: none; width: var(--sw); margin-right: var(--gap); aspect-ratio: 16 / 9; padding: 0; border: 0; background: #fff;
  border-radius: var(--r-card); overflow: hidden; cursor: pointer; box-shadow: 0 22px 44px -26px rgba(0,0,0,.45);
  transition: transform .7s var(--ease);
}
.slide img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.slide:hover, .slide:focus-visible { transform: translateY(-8px) rotate(-.6deg); }
.chain[data-dir="1"] .slide:hover, .chain[data-dir="1"] .slide:focus-visible { transform: translateY(-8px) rotate(.6deg); }
.slide:hover img { transform: scale(1.045); }

/* ---------- Services ---------- */
.services { padding-top: clamp(70px, 8vw, 130px); }
.services__title { font-size: clamp(52px, 10vw, 170px); margin-bottom: .3em; }
.srv { border-top: 2px solid #000; }
.srv__row {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 2rem;
  padding: clamp(18px, 2.4vw, 34px) clamp(0px, 1vw, 16px); border-bottom: 2px solid #000; cursor: pointer;
}
.srv__row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--orange); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .6s var(--ease); }
.srv__row:hover::before, .srv__row:focus-visible::before { transform: scaleY(1); }
.srv__name { font-size: clamp(30px, 5.2vw, 82px); font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: .95; transition: transform .6s var(--ease); }
.srv__row:hover .srv__name, .srv__row:focus-visible .srv__name { transform: translateX(1.6vw); }
.srv__desc { max-width: 36ch; justify-self: end; line-height: 1.4; transition: transform .6s var(--ease); }
.srv__row:hover .srv__desc { transform: translateX(-1vw); }
.srv__peek { position: fixed; left: 0; top: 0; z-index: 60; width: clamp(180px, 21vw, 320px); aspect-ratio: 4 / 3; pointer-events: none; border-radius: 22px; overflow: hidden; opacity: 0; box-shadow: 0 24px 50px -20px rgba(0,0,0,.5); border: 3px solid #000; background: #fff; }
.srv__peek img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Contact ---------- */
.contact { position: relative; background: #000; color: #fff; border-radius: var(--r-panel) var(--r-panel) 0 0; padding: clamp(70px, 9vw, 140px) var(--pad) 0; overflow: hidden; }
.contact__title { display: flex; flex-direction: column; color: var(--orange); font-size: clamp(44px, 17vw, 320px); line-height: .84; }
.cl { display: block; overflow: hidden; padding-top: .05em; margin-top: -.05em; }
.cl > span { display: block; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: clamp(28px, 4vw, 56px); }
.contact__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem 2rem; margin-top: clamp(36px, 5vw, 72px); padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.22); }
.contact__list li { display: grid; gap: .25rem; }
.contact__list span { font-size: .88rem; color: rgba(255,255,255,.6); }
.contact__list a, .contact__list b { font-size: clamp(18px, 2vw, 30px); font-weight: 700; font-stretch: 80%; text-decoration: none; line-height: 1.15; overflow-wrap: anywhere; background: linear-gradient(var(--orange), var(--orange)) 0 100% / 0 3px no-repeat; transition: background-size .5s var(--ease); justify-self: start; }
.contact__list a:hover { background-size: 100% 3px; }
.contact__list em { display: block; font-style: normal; font-weight: 500; font-size: .7em; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.contact__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: clamp(28px, 4vw, 52px) 0; margin-top: clamp(28px, 4vw, 52px); color: rgba(255,255,255,.6); font-size: .9rem; }
.totop { display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--orange); color: #000; cursor: pointer; transition: transform .6s var(--ease); }
.totop svg { width: 24px; height: 24px; }
.totop:hover { transform: translateY(-6px) rotate(-8deg); }

/* ---------- Lightbox + toast ---------- */
.lb { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: clamp(12px, 3vw, 40px); }
.lb[hidden] { display: none; }
.lb__bg { position: absolute; inset: 0; background: rgba(0,0,0,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lb__box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.lb__media { display: grid; place-items: center; overflow: hidden; border-radius: 24px; background: #000; max-width: 100%; }
.lb__media video, .lb__media img { max-width: 100%; max-height: calc(100svh - 118px); width: auto; height: auto; }
.lb__media iframe { border: 0; width: min(92vw, calc((100svh - 130px) * 16 / 9), 1280px); aspect-ratio: 16 / 9; }
.lb__bar { display: flex; align-items: center; gap: 1rem; width: 100%; color: #fff; }
.lb__title { flex: 1; font-weight: 700; font-stretch: 85%; min-width: 0; }
.lb__ext { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; opacity: .85; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.5); }
.lb__ext[hidden] { display: none; }
.lb__ext svg { width: 16px; height: 16px; }
.lb__ext:hover { opacity: 1; }
.lb__close { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--orange); color: #000; cursor: pointer; transition: transform .5s var(--ease); }
.lb__close svg { width: 22px; height: 22px; }
.lb__close:hover { transform: rotate(90deg) scale(1.08); }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 130; opacity: 0; transform: translate(-50%, 24px); background: #000; color: #fff; padding: .75em 1.3em; border-radius: 999px; font-weight: 650; border: 2px solid var(--orange); transition: transform .6s var(--ease), opacity .3s; pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: rotate(180deg) translateY(0); } 50% { transform: rotate(180deg) translateY(-5px); } }
@keyframes eq { to { transform: scaleY(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Big titles: Grained ---------- */
/* Grained is a regular-weight fat-face serif and is only used for the section titles (About, Experience, Work...).
   The hero PORTFOLIO and everything else stay in Archivo. The demo file has no digits and no accented letters, so É and À are drawn by .ac (see main.js). */
.banner__title, .h-xl, .panel__title, .brand__title, .contact__title {
  font-family: var(--serif); font-weight: 400; font-stretch: 100%; font-synthesis: none; letter-spacing: 0; line-height: 1;
}
.h-xl { font-size: clamp(36px, 5.6vw, 92px); }
.services__title { font-size: clamp(36px, 8vw, 128px); }
.banner__title { font-size: clamp(30px, 6vw, 112px); }
.panel__title { font-size: clamp(34px, 6.2vw, 108px); }
.brand__title { font-size: clamp(34px, min(6.2vw, 13vh), 108px); }
.contact__title { font-size: clamp(44px, 11.5vw, 220px); line-height: .92; }
#personal .reel { --h: clamp(300px, 50vh, 620px); }

/* Accent marks for the capitals the demo font lacks (É, À): the letter is Grained, the mark is drawn on top. */
.ac { position: relative; display: inline-block; }
.nw { white-space: nowrap; }   /* a word holding an .ac letter must not break around it */
.ac::after {
  content: ""; position: absolute; left: 50%; top: -.3em; width: .2em; height: .29em; margin-left: -.06em; background: currentColor;
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat;
}
.ac--acute { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 58'%3E%3Cpath d='M3 57C9 43 19 22 25 3L40 8C36 25 22 44 3 57Z'/%3E%3C/svg%3E"); }
.ac--grave { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 58'%3E%3Cpath d='M37 57C31 43 21 22 15 3L0 8C4 25 18 44 37 57Z'/%3E%3C/svg%3E"); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .badge { right: 6vw; top: 50%; }
}

@media (max-width: 1000px) {
  .nav__links { display: none; }
}

/* Upright tablets: a full-height portrait would cover most of PORTFOLIO, so it overlaps only the base of the letters */
@media (orientation: portrait) and (min-width: 561px) and (max-width: 1100px) {
  .hero__portrait { height: min(60%, 118vw); }
  .badge { top: 52%; }
}

@media (max-width: 959px) {
  .about__grid, .journey__grid { grid-template-columns: 1fr; }
  .about__photo { width: min(100%, 440px); justify-self: start; }
  .dgrid { grid-template-columns: 1fr; }
  .contact__list { grid-template-columns: 1fr; }
  .hero__col { display: none; }

  /* Video rows become a swipe strip: equal-width cards that snap into place and run to the panel's
     edges, so the next card peeks in and shows there is more. Height follows each video's shape. */
  .reel, #personal .reel {
    --cw: min(40vw, 300px);
    justify-content: flex-start; align-items: center; gap: 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(var(--pp) * -1); padding: 6px var(--pp) 10px; scroll-padding-inline: var(--pp);
  }
  .reel::-webkit-scrollbar { display: none; }
  .vcard, .vcard--main, .vcard--side, .vcard--sq, .vcard--tall, .vcard--third {
    flex: none; width: var(--cw); height: auto; max-height: 68svh; margin: 0; transform: none; scroll-snap-align: start;
  }
  /* the tallest card leads each strip, so the shorter ones sit beside it rather than in an empty frame */
  .vcard--main, .vcard--tall { order: -1; }
  .vcard--main { box-shadow: none; }
  .vcard--side:first-child, .vcard--side:last-child { margin: 0; transform: none; }
  .vcard:hover, .vcard:focus-visible,
  .vcard--side:first-child:hover, .vcard--side:first-child:focus-visible, .vcard--side:last-child:hover, .vcard--side:last-child:focus-visible,
  .vcard--main:hover, .vcard--main:focus-visible, .vcard--sq:hover, .vcard--sq:focus-visible,
  .vcard--tall:hover, .vcard--tall:focus-visible, .vcard--third:hover, .vcard--third:focus-visible { transform: none; border-radius: var(--r-card); }

  .chain { --sw: min(74vw, 440px); }
  .srv__row { grid-template-columns: 1fr; gap: .5rem; }
  .srv__desc { justify-self: start; }
  .srv__peek { display: none; }
}

@media (max-width: 760px) {
  /* nav + hero */
  .nav__links { display: none; }
  .nav__cta { padding: .7em 1.1em; font-size: .88rem; }
  .badge { top: 47%; right: 4vw; width: 84px; }
  .doodle { display: none; }
  .hero__col--l { display: none; }
  .tools { gap: 6px; }
  .marquee { transform: rotate(-2.4deg); }

  /* tighter vertical rhythm */
  .section { padding-top: 64px; padding-bottom: 64px; }
  .journey { padding-top: 0; padding-bottom: 24px; }
  .journey__grid { gap: 48px; padding-top: 44px; }
  .work { padding-top: 48px; padding-bottom: 40px; }
  .services { padding-top: 56px; }

  /* banners: the title gets the whole width (the icons crowded it) and the pill grows to fit two lines */
  .banner { height: auto; min-height: 96px; padding: 22px 18px; border-radius: 28px; margin-bottom: 32px; }
  .banner__ic { display: none; }
  .banner__title { font-size: clamp(26px, 8.4vw, 40px); line-height: 1.04; text-align: center; }

  /* about */
  .about__photo { width: min(88%, 360px); justify-self: center; }
  .about__hi { font-size: clamp(34px, 10vw, 44px); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .stat dd { font-size: clamp(32px, 9.4vw, 44px); }
  .stat dt { font-size: .78rem; }
  .pills { gap: .45rem; }
  .pills li { font-size: .86rem; padding: .45em .95em; }

  /* journey */
  .tlwrap { padding-left: 40px; }
  .tl__node { left: -40px; }
  .edu li { min-height: 0; gap: .55rem; }
  .rings { gap: 10px; }
  .ring { padding: 16px 6px; }
  .ring span { font-size: .88rem; }
  .toolrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolrow span { font-size: .88rem; }

  /* work panels */
  .panel { --pp: 20px; border-radius: 28px; gap: 22px; }
  .panel + .panel { margin-top: 16px; }
  .panel__head { gap: .8rem; }
  .reel, #personal .reel { --cw: min(76vw, 320px); }

  /* brand */
  .brand { margin-top: 16px; }
  .brand__inner { gap: 28px; padding: 56px 0 44px; }

  /* contact: one full-width button per row, easy to tap */
  .contact__actions { flex-direction: column; }
  .contact__actions .btn { width: 100%; }
  .contact__list { gap: 1.2rem; }
}

@media (max-width: 600px) {
  /* explainer cards: a taller frame gives the caption room off the busy part of the thumbnail */
  .dcard { aspect-ratio: 4 / 3; }
  .dcard__foot { gap: .75rem; }
  .dcard__play { width: 46px; }
  .dcard__t b { font-size: 18px; }
  .dcard__t em { font-size: .8rem; text-wrap: balance; }
  .dcard__len { font-size: .8rem; }
}

@media (max-width: 380px) {
  .nav__logo { padding: .5em .8em; }
  .nav__logo svg { display: none; }
  .nav__right { gap: .4rem; }
  .lang__opt { padding: .5em .65em; }
  .nav__cta { padding: .65em .95em; font-size: .84rem; }
}

@media (max-height: 640px) and (min-width: 760px) {
  .hero__col { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .dcard__bars i { transform: scaleY(.6); }
}
