/* Matheus Dias — portfolio
   Tokens, base, components, pages, transitions, print. */

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
/* Used only for the MATHEUS DIAS wordmark (letters A-Z). */
@font-face {
  font-family: "Bricolage Wordmark";
  src: url("../fonts/wordmark.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --bg: #ececec;
  --paper: #ffffff;
  --ink: #141414;
  --mute: #595959;
  --cobalt: #3a3a3a;
  --cobalt-deep: #262626;
  --yellow: #d2d2d2;
  --line: rgba(20, 20, 20, 0.14);

  --display: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wordmark: "Bricolage Wordmark", "Arial Narrow", sans-serif;
  --red: #6b6b6b;

  --pad: clamp(20px, 5vw, 56px);
  --radius: 20px;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--yellow); }

/* Language switch: both languages live in the markup, one is shown. */
html[data-lang="en"] body [lang="pt"],
html[data-lang="pt"] body [lang="en"] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--pad); }

/* ---------- Type ---------- */
.display {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.h-xl { font-size: clamp(2rem, 4.5vw, 3.6rem); }
.h-lg { font-size: clamp(1.7rem, 3.5vw, 2.7rem); }
.h-md { font-size: clamp(1.3rem, 2.1vw, 1.65rem); line-height: 1.08; }
.h-sm { font-weight: 800; font-size: 1.08rem; line-height: 1.2; letter-spacing: .02em; text-transform: uppercase; }
.wordmark { font-family: var(--wordmark); font-weight: 800; font-stretch: 78%; text-transform: uppercase; line-height: .95; letter-spacing: 0; }
.wordmark.h-xl { font-size: clamp(2.6rem, 7vw, 5.2rem); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.45; max-width: 56ch; }
.mute { color: var(--mute); }
.prose p { max-width: 66ch; }
.prose p + p { margin-top: 1em; }
.prose a { color: var(--cobalt); text-underline-offset: 3px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 24px;
  border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: #fff;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s, transform .18s;
}
.btn:hover { background: var(--cobalt); border-color: var(--cobalt); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn.yellow:hover { background: #fff; border-color: #fff; }
.btn.pop { background: var(--yellow); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn.pop:hover { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 4px 4px 0 var(--cobalt); transform: translate(-1px, -1px); }
.btn.pop:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 5px; text-decoration-color: var(--cobalt);
}
.link:hover { color: var(--cobalt); }
.ext { width: .7em; height: .7em; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  view-transition-name: site-header;
}
.site-header .wrap { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark {
  width: 42px; height: 36px; flex: none; border-radius: 10px; background: var(--ink);
  display: grid; place-items: center; transition: background-color .18s;
}
.brand:hover .brand-mark { background: var(--cobalt); }
.brand-mark img { width: 27px; }
.brand-name { font-family: var(--wordmark); font-weight: 800; font-stretch: 78%; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .01em; line-height: 1; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .top-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .98rem;
  transition: background-color .18s;
}
.nav a:hover, .top-link:hover { background: rgba(20, 20, 20, .08); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.lang { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(20, 20, 20, .09); flex: none; }
.lang button {
  border: 0; background: transparent; cursor: pointer;
  min-width: 40px; min-height: 34px; padding: 0 10px; border-radius: 999px;
  font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}
.lang button[aria-pressed="true"] { background: var(--paper); box-shadow: 0 1px 3px rgba(20, 20, 20, .22); }

.menu-btn {
  display: none; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px;
  background: var(--ink); cursor: pointer; place-items: center;
}
.menu-btn span, .menu-btn span::before {
  content: ""; display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .2s;
}
.menu-btn span { transform: translateY(-3px); }
.menu-btn span::before { transform: translateY(6px); }
.menu-btn[aria-expanded="true"] span { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span::before { transform: rotate(-90deg); }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .brand-name { display: none; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--pad) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 16px; font-size: 1.15rem; }
}
@media (max-width: 380px) {
  .site-header .wrap { gap: 8px; }
  .top-link { padding-inline: 8px; }
}

/* ---------- Sections ---------- */
main { display: block; }
.section { padding-block: clamp(56px, 9vw, 120px); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(28px, 4vw, 52px); }
.section-head p { max-width: 44ch; }

/* ---------- Hero (home) ---------- */
.hero { padding-block: clamp(28px, 4vw, 56px) clamp(32px, 4.5vw, 60px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero .lede { margin-top: 18px; }
.hero .btn-row { margin-top: 24px; }

/* Caption-style headline: words land one at a time, like auto-captions. */
.cap .w { display: inline-block; padding: 0 .08em; margin: 0 -.08em; border-radius: .12em; }
@media (prefers-reduced-motion: no-preference) {
  .cap .w { animation: cap-in .5s both; animation-delay: calc(var(--i) * .13s + .15s); }
}
@keyframes cap-in {
  0% { opacity: .14; background: transparent; }
  1%, 55% { opacity: 1; background: var(--yellow); }
  100% { opacity: 1; background: transparent; }
}

.reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); align-items: center; }
.reel {
  position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: clamp(12px, 1.6vw, 20px); background: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(20, 20, 20, .55);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
.reel img { width: 100%; height: 100%; object-fit: cover; }
.reel:nth-child(1) { transform: translateY(8%) rotate(-3deg); }
.reel:nth-child(2) { transform: translateY(-6%); z-index: 1; }
.reel:nth-child(3) { transform: translateY(10%) rotate(3deg); }
.reel:hover { transform: translateY(-4%) rotate(0); z-index: 2; }
.reel .views {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px; border-radius: 999px;
  background: rgba(20, 20, 20, .78); color: #fff;
  font-weight: 700; font-size: clamp(.72rem, 1.1vw, .9rem); line-height: 1.2;
}
.reel .views svg { width: .8em; height: .8em; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .reels { max-width: 520px; padding-block: 14px 26px; }
}

/* ---------- Brand marquee ---------- */
.brands { border-block: 1px solid var(--line); padding-block: 22px; overflow: hidden; }
.brands-label { font-size: .95rem; font-weight: 600; color: var(--mute); margin-bottom: 14px; }
.marquee { display: flex; width: max-content; }
.marquee ul { display: flex; align-items: center; flex: none; }
.marquee li {
  display: flex; align-items: center; height: 44px; padding-inline: clamp(22px, 3.4vw, 46px);
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem); letter-spacing: .06em; white-space: nowrap;
  color: var(--ink); opacity: .72;
}
.marquee li img { height: auto; width: auto; }
@media (prefers-reduced-motion: no-preference) {
  .marquee { animation: marquee 38s linear infinite; }
  .brands:hover .marquee { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { width: auto; }
  .marquee ul { flex-wrap: wrap; justify-content: center; }
  .marquee ul[aria-hidden="true"] { display: none; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Numbers ---------- */
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.numbers > div { padding: 22px 20px 4px 0; }
.numbers > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.numbers dt { font-family: var(--display); font-weight: 900; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.numbers dd { margin-top: 10px; color: var(--mute); max-width: 24ch; font-size: .98rem; line-height: 1.4; }
@media (max-width: 860px) {
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers > div { padding-bottom: 22px; }
  .numbers > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .numbers > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Home: larger, coloured, counted up on reveal */
.numbers.big dt { font-size: clamp(2.6rem, 5.4vw, 4.6rem); color: var(--cobalt); }
.numbers.big dd { color: var(--ink); font-weight: 600; font-size: 1.05rem; }

/* Case pages: one coloured tile per metric */
.numbers.tiles { border-top: 0; gap: clamp(10px, 1.4vw, 18px); }
.numbers.tiles > div, .numbers.tiles > div + div {
  padding: clamp(18px, 2.4vw, 30px); border: 0; border-radius: var(--radius);
  min-height: clamp(150px, 16vw, 210px); display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.numbers.tiles dt { font-size: clamp(2.4rem, 5.2vw, 4.4rem); }
.numbers.tiles dd { margin: 0; color: inherit; font-weight: 600; max-width: 22ch; }
.numbers.tiles > div:nth-child(1) { background: #3a3a3a; color: #fff; }
.numbers.tiles > div:nth-child(2) { background: #d2d2d2; color: #141414; }
.numbers.tiles > div:nth-child(3) { background: #6b6b6b; color: #fff; }
.numbers.tiles > div:nth-child(4) { background: #141414; color: #d2d2d2; }
.numbers.tiles > div:nth-child(4) dd { color: #fff; }
.impact strong { background: var(--yellow); padding: .05em .28em; border-radius: .3em; font-weight: 700; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- Case cards ---------- */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.case-card { display: block; text-decoration: none; }
.case-card .cover { border-radius: var(--radius); overflow: hidden; background: var(--ink); aspect-ratio: 4 / 3; }
.case-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.case-card:hover .cover img { transform: scale(1.04); }
.case-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.case-card h3 { margin-top: 12px; }
.case-card p { margin-top: 8px; color: var(--mute); max-width: 44ch; }
.case-card:hover h3 { color: var(--cobalt); }
.tag { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: .85rem; font-weight: 600; line-height: 1.4; }
.tag.fill { background: var(--yellow); border-color: var(--yellow); }
@media (max-width: 700px) { .cases { grid-template-columns: 1fr; } }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 5vw, 72px); }
.services li { padding-block: 24px; border-top: 1px solid var(--line); }
.services p { margin-top: 6px; color: var(--mute); max-width: 44ch; }
@media (max-width: 700px) { .services { grid-template-columns: 1fr; } }

/* ---------- Blue block (next-case banner) ---------- */
.block {
  background: var(--cobalt); color: #fff; border-radius: clamp(20px, 3vw, 36px);
  padding: clamp(24px, 4vw, 48px);
}

/* ---------- About (home): plain two-column text ---------- */
.about { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px clamp(28px, 6vw, 88px); padding-top: clamp(28px, 4vw, 48px); border-top: 2px solid var(--ink); }
.about .prose p { font-size: clamp(1.1rem, 1.5vw, 1.25rem); max-width: 58ch; }
.about .btn { margin-top: 28px; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #fff; margin-top: clamp(40px, 6vw, 80px); padding-block: clamp(48px, 8vw, 104px) 32px; }
.site-footer .display { max-width: 14ch; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 36px; align-items: end; }
.foot-links { display: grid; gap: 4px; }
.foot-links a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-block: 14px; border-bottom: 1px solid rgba(255, 255, 255, .22);
  text-decoration: none; font-weight: 600; overflow-wrap: anywhere;
}
.fl { display: inline-flex; align-items: center; gap: 12px; }
.ico { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; transition: color .18s; }
.foot-links a:hover .ico { color: var(--yellow); }
.foot-links a span:last-child { color: rgba(255, 255, 255, .7); font-weight: 400; text-align: right; }
.foot-links a:hover span:last-child { color: var(--yellow); }
.site-footer .btn-row { margin-top: 28px; }
.foot-base { margin-top: clamp(40px, 6vw, 72px); font-size: .9rem; color: rgba(255, 255, 255, .62); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Page heads (inner pages) ---------- */
.page-head { padding-block: clamp(28px, 4.5vw, 60px) clamp(24px, 4vw, 48px); }
.page-head .lede { margin-top: 22px; }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; font-weight: 600; text-decoration: none; }
.back:hover { color: var(--cobalt); }
.back svg { width: 1em; height: 1em; }

/* ---------- Case study ---------- */
.case-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.case-cover { border-radius: var(--radius); overflow: hidden; background: var(--ink); aspect-ratio: 1; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 34px; border-top: 2px solid var(--ink); }
.facts > div { padding-block: 14px; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .88rem; color: var(--mute); }
.facts dd { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 860px) { .case-top { grid-template-columns: 1fr; } .case-cover { aspect-ratio: 4 / 3; } }

.split { display: grid; grid-template-columns: minmax(0, .38fr) minmax(0, .62fr); gap: 16px clamp(24px, 5vw, 64px); padding-block: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.work { display: grid; gap: clamp(32px, 6vw, 72px); }
.work-item { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(20px, 5vw, 64px); align-items: center; }
.work-item:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.work-item:nth-child(even) .shot { order: 2; }
.shot { border-radius: var(--radius); overflow: hidden; background: var(--ink); justify-self: center; width: 100%; }
.shot img { width: 100%; }
.shot.tall { max-width: 290px; }
.work-item h3 { margin-top: 14px; }
.work-item p { margin-top: 10px; max-width: 54ch; }
.outcome { margin-top: 18px; padding: 14px 18px; border-radius: 14px; background: var(--paper); max-width: 54ch; }
.outcome b { display: block; font-size: .88rem; color: var(--mute); font-weight: 600; }
.work-item .link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; }
@media (max-width: 760px) {
  .work-item, .work-item:nth-child(even) { grid-template-columns: 1fr; }
  .work-item:nth-child(even) .shot { order: 0; }
  .shot { max-width: 420px; justify-self: start; }
}

/* Razer: carousel of posts */
.car-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.car-head .section-head { margin: 0; }
.car-nav { display: flex; gap: 8px; flex: none; }
.car-nav button { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background .18s, color .18s, opacity .18s; }
.car-nav button:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.car-nav button:disabled { opacity: .3; cursor: default; }
.car-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.car-track { list-style: none; margin: 0; padding: 4px var(--pad) 18px; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: thin; align-items: stretch; }
.car-track:focus-visible { outline-offset: -3px; }
.slide { flex: 0 0 min(88vw, 410px); scroll-snap-align: start; background: var(--paper); border-radius: var(--radius); padding: 14px 14px 22px; display: flex; flex-direction: column; gap: 14px; }
.slide-shot { margin: 0; border-radius: calc(var(--radius) - 8px); overflow: hidden; background: #d8d8d8; aspect-ratio: 4 / 5; }
.slide-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.slide-body { display: flex; flex-direction: column; gap: 10px; padding-inline: 8px; flex: 1; }
.slide-body h3 { margin-top: 4px; }
.slide-body p { margin: 0; }
.slide-body .link { margin-top: auto; padding-top: 12px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; }
.slide-body .tag { align-self: flex-start; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-tiles > :only-child { grid-column: 1 / -1; }
.stat { margin: 0; padding: 14px 16px 12px; border-radius: calc(var(--radius) - 8px); display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 96px; }
.stat b { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 900; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-weight: 600; line-height: 1.25; font-size: .92rem; }
.stat.blue { background: #3a3a3a; color: #fff; }
.stat.yellow { background: #d2d2d2; color: #141414; }
.stat.ink { background: #141414; color: #d2d2d2; }
.stat.ink span { color: #fff; }
.stat.wide { grid-column: 1 / -1; min-height: 0; }
.stat.wide b { font-size: 1.7rem; }
@media (max-width: 600px) { .car-head { align-items: center; } }

.placeholder-note {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px;
  border: 2px dashed var(--cobalt); color: var(--cobalt); font-weight: 600; font-size: .9rem;
}
.next-case { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; text-decoration: none; }
.next-case:hover .display { color: var(--yellow); }

/* ---------- Résumé ---------- */
.cv { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.cv-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 28px; }
.cv-side h2, .cv-main > section > h2 { font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 12px; }
.cv-main > section > h2 { font-size: clamp(1.3rem, 2.1vw, 1.65rem); font-weight: 900; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 0; }
.cv-main > section + section { margin-top: clamp(40px, 6vw, 64px); }
.cv-side dl > div + div { margin-top: 10px; }
.cv-side dt { font-size: .88rem; color: var(--mute); }
.cv-side dd { font-weight: 600; overflow-wrap: anywhere; }
.cv-side dd a { text-decoration-color: var(--cobalt); text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 11px; border-radius: 999px; background: var(--paper); font-size: .9rem; line-height: 1.45; }
.cv-summary { padding-top: 20px; font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.5; max-width: 62ch; }
.job { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 6px 28px; padding-block: 26px; border-bottom: 1px solid var(--line); }
.job .when { color: var(--mute); font-size: .95rem; padding-top: 3px; }
.job .where { color: var(--mute); margin-top: 2px; }
.job ul { margin-top: 12px; display: grid; gap: 8px; }
.job li { position: relative; padding-left: 18px; max-width: 68ch; }
.job li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); }
.skills-grid { padding-top: 20px; }
@media (max-width: 900px) {
  .cv { grid-template-columns: 1fr; }
  .cv-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cv-side { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.form { background: var(--paper); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid rgba(20, 20, 20, .3); background: var(--bg);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--cobalt); outline-offset: 1px; border-color: var(--cobalt); }
.form .hint { grid-column: 1 / -1; font-size: .92rem; color: var(--mute); }
.form .btn { grid-column: 1 / -1; justify-self: start; }
.details { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.details > div { padding-block: 18px; border-bottom: 1px solid var(--line); }
.details dt { font-size: .9rem; color: var(--mute); }
.details dd { font-weight: 600; font-size: 1.12rem; overflow-wrap: anywhere; }
.details dd a { text-decoration-color: var(--cobalt); text-underline-offset: 4px; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }

/* ---------- Scroll reveal ----------
   Pieces of each page rise and fade in as they enter the screen. Hidden only when
   JS is running (html.js) and motion is allowed. site.js adds .in and sets --d (stagger). */
@media (prefers-reduced-motion: no-preference) {
  html.js :is(
    .hero .lede, .hero .btn-row, .reels, .brands, .section-head,
    .numbers > div, .case-card, .services li, .about > *, .foot-grid > *,
    .page-head .lede, .page-head .btn-row, .back, .case-top .lede, .facts, .case-cover,
    .split, .work-item, .next-case, .contact > *, .cv-side > section, .cv-summary,
    .cv-main > section > h2, .cv-main .chips, .job
  ) {
    opacity: 0;
    transform: translate3d(0, 36px, 0);
    transition: opacity .8s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 90ms),
                transform 1s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 90ms);
  }
  html.js :is(
    .hero .lede, .hero .btn-row, .reels, .brands, .section-head,
    .numbers > div, .case-card, .services li, .about > *, .foot-grid > *,
    .page-head .lede, .page-head .btn-row, .back, .case-top .lede, .facts, .case-cover,
    .split, .work-item, .next-case, .contact > *, .cv-side > section, .cv-summary,
    .cv-main > section > h2, .cv-main .chips, .job
  ).in { opacity: 1; transform: none; }

  /* Photos settle in with a slow zoom-out (uses `scale`, so it never fights hover transforms) */
  html.js .shot img { scale: 1.14; transition: scale 1.6s cubic-bezier(.2, .7, .2, 1); }
  html.js .work-item.in .shot img { scale: 1; }

  /* Coming from a page transition, the shared cover must already be in place */
  html.vt-nav :is(.case-card, .case-cover) { opacity: 1; transform: none; transition: none; }

  /* Hero reels drift at different speeds as you scroll past (where the browser supports it) */
  @supports (animation-timeline: scroll()) {
    .reel { animation: reel-drift linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
    .reel:nth-child(1) { --drift: -26px; }
    .reel:nth-child(2) { --drift: -64px; }
    .reel:nth-child(3) { --drift: -38px; }
  }
}
@keyframes reel-drift { to { translate: 0 var(--drift, 0px); } }

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out .22s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: vt-in .38s cubic-bezier(0, 0, .2, 1) .08s both; }
  ::view-transition-group(case-darkside),
  ::view-transition-group(case-razer) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }

  /* Browsers without cross-document view transitions get a JS-driven fade. */
  html.no-vt main { animation: vt-in .38s cubic-bezier(0, 0, .2, 1) both; }
  html.no-vt.leaving main { animation: vt-out .2s cubic-bezier(.4, 0, 1, 1) both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Print (résumé) ---------- */
@media print {
  :root { --bg: #fff; }
  body { font-size: 10.5pt; }
  .site-header, .site-footer, .no-print, .skip { display: none !important; }
  .page-head { padding-block: 0 12pt; }
  .h-xl, .h-lg { font-size: 26pt; }
  .cv { grid-template-columns: 180pt 1fr; gap: 24pt; }
  .cv-side { position: static; gap: 14pt; }
  .chips li { padding: 0; background: none; }
  .chips li:not(:last-child)::after { content: ","; }
  .job { padding-block: 10pt; break-inside: avoid; grid-template-columns: 90pt 1fr; }
  .section { padding-block: 0; }
}


/* ---------- First-visit intro: dark page + RGB wave outline on the main image ---------- */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #ececec; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #141414; }
@property --mute { syntax: "<color>"; inherits: true; initial-value: #595959; }
@property --paper { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --rgb-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@media (prefers-reduced-motion: no-preference) {
  :root { transition: --bg 1.1s ease, --ink 1.1s ease, --mute 1.1s ease, --paper 1.1s ease; }
}
html.intro { --bg: #0b0b0c; --paper: #1a1a1b; --ink: #f1f1f1; --mute: #a6a6a6; --line: rgba(255, 255, 255, .16); color-scheme: dark; }
html.intro .btn:not(.ghost), html.intro .nav a[aria-current="page"] { color: #0b0b0c; }
html.intro .btn.pop:hover { color: #0b0b0c; }
html.intro .site-footer { background: #1a1a1b; }
html.intro .brand-mark { background: #f1f1f1; }
html.intro .brand-mark img { filter: invert(1); }

.ring .reels, .ring .case-cover { position: relative; overflow: visible; }
.ring .reels::before, .ring .reels::after, .ring .case-cover::before, .ring .case-cover::after {
  content: ""; position: absolute; inset: -9px; border-radius: calc(var(--radius) + 8px); pointer-events: none;
  background: conic-gradient(from var(--rgb-a), #ff2d55, #ffd60a, #30d158, #0ad1ff, #5e5ce6, #ff2dd4, #ff2d55);
  animation: rgb-spin 2.2s linear infinite, rgb-fade 4.1s ease-in forwards;
}
.ring .reels::before, .ring .case-cover::before { padding: 3px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude; z-index: 2; }
.ring .reels::after, .ring .case-cover::after { filter: blur(22px); opacity: .55; z-index: -1; }
.ring .case-cover { border-radius: var(--radius); }
@keyframes rgb-spin { to { --rgb-a: 360deg; } }
@keyframes rgb-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.ring .reels::after, .ring .case-cover::after { animation-name: rgb-spin, rgb-fade-glow; }
@keyframes rgb-fade-glow { 0%, 70% { opacity: .55; } 100% { opacity: 0; } }

html.intro .marquee li img { filter: invert(1); }
html.intro .reel { box-shadow: none; }
