/* Malk — tokens from Malk/design-tokens.json */
:root {
  --canvas: #FBFBFA;
  --card: #F3F3F1;
  --ink: #1A1A1A;
  --body: #5C5C59;
  --muted: #A2A29E;
  --line: #E6E6E3;
  --white: #FFFFFF;
  --m: 32px;
  --gap: 12px;
  --r: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --fs-display: clamp(56px, 8.4vw, 120px);
  --fs-h: clamp(30px, 3.4vw, 48px);
  --fs-lead: clamp(19px, 1.55vw, 22px);
}
@media (max-width: 760px) { :root { --m: 16px; --gap: 10px; --r: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--white); }

/* Page transitions (cross-document View Transitions, soft fade like Porto Rocha) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .45s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in .7s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
.nav { view-transition-name: nav; }

.wrap { padding: var(--m); padding-bottom: 0; }
.card { background: var(--card); border-radius: var(--r); position: relative; overflow: hidden; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--white); color: var(--ink); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; white-space: nowrap;
}
.pill--soft { background: var(--card); }
.muted { color: var(--muted); }
.two-tone .tone { color: var(--muted); }
.label-row { margin: 72px 0 16px; }

/* ——— Hero ——— */
.hero { height: calc(100svh - var(--m) * 2); min-height: 560px; max-height: 900px; display: grid; place-items: center; }
.hero__logo { width: min(78%, 1100px); position: relative; aspect-ratio: 587 / 289; }
.hero__logo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__corner { position: absolute; font-size: 15px; line-height: 1.3; }
.hero__corner--tl { top: 28px; left: 32px; } .hero__corner--tr { top: 28px; right: 32px; text-align: right; }
.hero__corner--bl { bottom: 28px; left: 32px; color: var(--body); } .hero__corner--br { bottom: 28px; right: 32px; color: var(--body); }
@media (max-width: 760px) { .hero__corner { font-size: 13px; } .hero__corner--tl, .hero__corner--bl { left: 18px; } .hero__corner--tr, .hero__corner--br { right: 18px; } }
.logo-half { transition: transform 1.6s var(--ease), opacity 1.2s var(--ease); }
.is-loading .hero__corner { opacity: 0; transform: translateY(8px); }
.hero__corner { transition: opacity 1s var(--ease) .7s, transform 1s var(--ease) .7s; }

.statement { font-size: var(--fs-h); line-height: 1.1; letter-spacing: -.03em; max-width: 1150px; margin: 64px 0 0; font-weight: 400; }

/* ——— Grids ——— */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-5 { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(var(--m) * -1); padding-right: var(--m); scrollbar-width: none; }
  .grid-5 > * { scroll-snap-align: start; }
}

/* Project card */
.project { display: block; position: relative; aspect-ratio: 682 / 480; border-radius: var(--r); overflow: hidden; background: var(--card); }
.project .media, .tile .media { position: absolute; inset: 0; }
.project .pill { position: absolute; left: 16px; bottom: 16px; z-index: 2; transition: padding .6s var(--ease); }
.project .pill .arrow { display: inline-block; width: 0; overflow: hidden; transition: width .6s var(--ease); }
.project:hover .pill .arrow { width: 14px; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }

.tile { display: block; }
.tile .frame { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--card); }
.tile h3 { font-size: 15px; font-weight: 400; margin: 12px 0 0; }
.tile p { font-size: 13px; margin: 2px 0 0; color: var(--muted); }

/* Services / AI */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 72px; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }
.duo .card { padding: 32px; min-height: 420px; display: flex; flex-direction: column; }
.list { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; font-size: 17px; line-height: 1.9; }
.list li::before { content: "→ "; }
.list .muted { color: var(--muted); }
@media (max-width: 560px) { .list { grid-template-columns: 1fr; } }
.card--ink { background: var(--ink); color: var(--white); }
.card--ink .tone { color: #8a8a86; }
.ai-line { margin-top: auto; font-size: clamp(22px, 2vw, 28px); line-height: 1.18; letter-spacing: -.015em; max-width: 600px; }
.link-arrow { display: inline-flex; gap: 8px; margin-top: 24px; font-size: 15px; }
.link-arrow span { transition: transform .5s var(--ease); } .link-arrow:hover span { transform: translateX(4px); }

/* Contact */
.contact { margin-top: var(--gap); padding: 32px; min-height: 520px; display: flex; flex-direction: column; }
.contact__title { font-size: clamp(54px, 6.7vw, 96px); line-height: 1; letter-spacing: -.04em; margin: auto 0 0; font-weight: 400; max-width: 1100px; }
.contact__row { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-top: 40px; flex-wrap: wrap; }
.contact__mail { font-size: 24px; letter-spacing: -.01em; position: relative; }
.contact__mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .7s var(--ease); }
.contact__mail:hover::after { transform: scaleX(1); transform-origin: left; }
.contact__social { display: flex; gap: 20px; color: var(--muted); font-size: 16px; }
.contact__social a:hover { color: var(--ink); }
.foot { padding: 28px var(--m) 140px; font-size: 14px; color: var(--muted); }

/* ——— Project page ——— */
.intro { display: grid; grid-template-columns: 900fr 468fr; gap: var(--gap); }
.intro__hero { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 900 / 750; background: var(--card); }
.intro__hero .pill { position: absolute; top: 18px; left: 18px; z-index: 2; }
.intro__side { display: grid; grid-template-rows: 1fr auto auto; gap: var(--gap); }
.intro__info { padding: 24px; display: flex; flex-direction: column; }
.intro__info h1 { font-size: clamp(40px, 3.8vw, 54px); line-height: 1; letter-spacing: -.04em; font-weight: 400; margin: 28px 0 0; }
.intro__info .lede { margin-top: auto; padding-top: 32px; font-size: clamp(22px, 1.9vw, 27px); line-height: 1.12; letter-spacing: -.02em; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.meta .card { padding: 16px 18px; min-height: 129px; display: flex; flex-direction: column; justify-content: space-between; }
.meta .card--wide { grid-column: span 2; }
.meta small { font-size: 11px; color: var(--muted); }
.meta b { font-weight: 400; font-size: 15px; line-height: 1.2; }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; } .intro__hero { aspect-ratio: 4 / 3; } .intro__info { min-height: 320px; } }

.story { display: grid; grid-template-columns: 675fr 693fr; gap: var(--gap); margin-top: var(--gap); }
.story__text { padding: 30px; }
.story__text p { font-size: var(--fs-lead); line-height: 1.28; letter-spacing: -.015em; margin: 16px 0 0; max-width: 600px; }
.story__text .approach p { color: var(--muted); }
.story__text hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0 24px; }
.story__media { display: grid; gap: var(--gap); }
.story__media .m { position: relative; border-radius: var(--r); overflow: hidden; background: var(--card); min-height: 300px; }
@media (max-width: 900px) { .story { grid-template-columns: 1fr; } .story__media .m { aspect-ratio: 16/10; min-height: 0; } }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.gallery .m { position: relative; border-radius: var(--r); overflow: hidden; background: var(--card); aspect-ratio: 687 / 560; }
.gallery .m--wide { grid-column: span 2; aspect-ratio: 16 / 8; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } .gallery .m--wide { grid-column: auto; aspect-ratio: 687 / 560; } }
.m img, .m video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.next { display: block; position: relative; margin-top: 72px; border-radius: var(--r); overflow: hidden; background: var(--card); padding: 32px; min-height: 360px; }
.next .media { position: absolute; inset: 0; opacity: 0; transition: opacity .8s var(--ease); }
.next .media img { width: 100%; height: 100%; object-fit: cover; }
.next:hover .media { opacity: 1; }
.next__in { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; min-height: 296px; }
.next__title { font-size: clamp(48px, 6vw, 96px); letter-spacing: -.04em; line-height: 1; }
.next:hover .next__title { color: var(--white); text-shadow: 0 2px 30px rgba(0,0,0,.25); }

/* About / AI */
.page-head { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -.03em; font-weight: 400; max-width: 1200px; margin: 24px 0 0; }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 48px; }
.about .card { padding: 32px; }
.about .bio p { font-size: 18px; line-height: 1.55; color: var(--body); max-width: 560px; margin: 0 0 16px; }
.about .portrait { position: relative; aspect-ratio: 16/9; padding: 0; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); margin-top: 64px; }
.steps .card { padding: 24px; min-height: 380px; display: flex; flex-direction: column; }
.steps small { font-size: 13px; color: var(--muted); }
.steps h3 { margin: 120px 0 12px; font-size: 32px; font-weight: 400; letter-spacing: -.03em; }
.steps p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--body); }
@media (max-width: 1100px) { .steps { grid-template-columns: 1fr 1fr; } } @media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .steps .card { min-height: 280px; } }

/* ——— Glass pill menu ——— */
.nav {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 0);
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: rgba(250, 250, 248, .52);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 10px 40px rgba(20, 20, 20, .14), 0 1px 2px rgba(20, 20, 20, .06), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(0, 0, 0, .04);
  transition: transform .8s var(--ease), opacity .6s var(--ease);
}
.nav.is-hidden { transform: translate(-50%, 160%); }
.is-loading .nav { transform: translate(-50%, 160%); opacity: 0; }
.nav__thumb {
  position: absolute; top: 6px; left: 0; height: calc(100% - 12px); width: 0; border-radius: 999px;
  background: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: transform .6s var(--ease-io), width .6s var(--ease-io), opacity .3s;
}
.nav a { position: relative; z-index: 1; padding: 10px 18px; border-radius: 999px; font-size: 15px; line-height: 1.2; color: var(--ink); transition: color .45s var(--ease-io); }
.nav a.is-on { color: var(--white); }
@media (max-width: 480px) { .nav a { padding: 9px 13px; font-size: 14px; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nav { background: rgba(250, 250, 248, .94); } }

/* ——— Reveal animations ——— */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-media] { opacity: 0; transform: translateY(24px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-media].is-in { opacity: 1; transform: none; }
.js [data-split] .w { display: inline-block; opacity: 0; transform: translateY(.45em); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i) * 28ms + var(--d, 0s)); }
.js [data-split].is-in .w { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js [data-split] .w { opacity: 1; transform: none; }
  .js [data-media] { opacity: 1; transform: none; }
}

/* fixes */
.intro__hero > img, .intro__hero > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nav a { white-space: nowrap; }
@media (max-width: 760px) { .hero__logo { width: 86%; } }

/* home reel */
.reel { position: relative; margin-top: var(--gap); border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; background: var(--ink); }
.reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ——— Dark chapter on scroll (Darkroom-style) ——— */
:root { --pill-bg: var(--white); --pill-fg: var(--ink); --glass: rgba(250, 250, 248, .52); --glass-line: rgba(255, 255, 255, .7); --thumb: #1A1A1A; --thumb-fg: #FFFFFF; --tint: background-color 1s var(--ease-io), color 1s var(--ease-io), border-color 1s var(--ease-io); }
html.is-dark { --canvas: #0E0E0D; --card: #1B1B1A; --ink: #F2F2EF; --body: #B4B4AF; --muted: #74746F; --line: #2B2B29;
  --pill-bg: #262624; --pill-fg: #F2F2EF; --glass: rgba(28, 28, 27, .55); --glass-line: rgba(255, 255, 255, .12); --thumb: #F2F2EF; --thumb-fg: #111110; }
html, body { transition: var(--tint); background-color: var(--canvas); }
.card, .pill, .project, .tile .frame, .reel, .statement, .two-tone .tone, .label-row .pill { transition: var(--tint); }
.pill { background: var(--pill-bg); color: var(--pill-fg); }
.pill--soft { background: var(--card); color: var(--ink); }
.project .pill, .intro__hero .pill, .m .pill { background: #FFFFFF; color: #1A1A1A; }
.nav { background: var(--glass); border-color: var(--glass-line); transition: transform .8s var(--ease), opacity .6s var(--ease), background-color 1s var(--ease-io), border-color 1s var(--ease-io); }
html.is-dark .nav { box-shadow: 0 10px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08); }
.nav__thumb { background: var(--thumb); }
.nav a { color: var(--ink); }
.nav a.is-on { color: var(--thumb-fg); }
.zone { padding-bottom: 8px; }

/* dark stays to the end: keep the AI card dark and readable */
html.is-dark .card--ink { background: #262624; color: #F2F2EF; }
html.is-dark .card--ink .tone { color: #8a8a86; }
html.is-dark .card--ink .pill { background: #F2F2EF; color: #111110; }

/* Hero = full-screen reel with the logo on top; logo fades out on scroll */
.hero--video { background: #111110; color: #FFFFFF; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__overlay { position: absolute; inset: 0; display: grid; place-items: center; mix-blend-mode: difference; color: #FFFFFF; will-change: opacity, transform; }
.hero--video .hero__corner--bl, .hero--video .hero__corner--br { color: #FFFFFF; }

/* mobile review fixes */
@media (max-width: 760px) {
  .hero--video .hero__corner--bl, .hero--video .hero__corner--br { bottom: auto; top: 54px; }
  .steps h3 { margin-top: 40px; }
  .steps .card { min-height: 0; }
  .duo .card { min-height: 0; }
  .duo .card .ai-line { margin-top: 40px; }
  .contact { min-height: 0; padding: 24px; }
  .contact__title { margin-top: 96px; }
}
.contact__social a { padding: 12px 4px; margin: -12px -4px; }

/* No-crop media: rows sized by each item's real aspect ratio */
.gallery { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.jrow { display: flex; gap: var(--gap); }
.jrow .m { flex: var(--a) 1 0; aspect-ratio: var(--a); min-height: 0; }
@media (max-width: 760px) { .jrow { flex-direction: column; } .jrow .m { flex: none; width: 100%; } }
.story { align-items: start; }
.story__media .m { aspect-ratio: var(--a); min-height: 0; }
.intro__hero { aspect-ratio: var(--a, 1.2); }
.intro { align-items: stretch; }
.tile .frame { aspect-ratio: 4 / 3; }

/* Result card */
.result { padding: 32px; margin-top: var(--gap); display: flex; flex-direction: column; gap: 56px; }
.result__line { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.05; letter-spacing: -.03em; margin: 0; }
/* Work index */
.wlist { margin-top: 48px; border-top: 1px solid var(--line); }
.wrow { position: relative; display: grid; grid-template-columns: 56px 1.1fr 1.6fr 1.2fr; gap: 16px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding .6s var(--ease); }
.wrow__n { font-size: 13px; color: var(--muted); }
.wrow__name { font-size: clamp(24px, 2.4vw, 34px); letter-spacing: -.02em; }
.wrow__lead { color: var(--body); font-size: 16px; }
.wrow__meta { color: var(--muted); font-size: 14px; text-align: right; }
.wrow__thumb { position: absolute; right: 0; top: 50%; width: 220px; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; opacity: 0; transform: translate(-24px, -50%) scale(.96); transition: opacity .5s var(--ease), transform .7s var(--ease); pointer-events: none; z-index: 2; }
.wrow__thumb img { width: 100%; height: 100%; object-fit: cover; }
.wrow:hover { padding-left: 12px; }
.wrow:hover .wrow__thumb { opacity: 1; transform: translate(0, -50%) scale(1); }
@media (max-width: 900px) { .wrow { grid-template-columns: 36px 1fr; } .wrow__lead { grid-column: 2; } .wrow__meta { grid-column: 2; text-align: left; } .wrow__thumb { display: none; } }
.result .pill { align-self: flex-start; }

/* Project hero fills its column and never runs under the info cards */
.intro__hero { aspect-ratio: auto; width: 100%; min-width: 0; height: 100%; min-height: min(72vh, 720px); }
.intro > * { min-width: 0; }
@media (max-width: 900px) { .intro__hero { height: auto; min-height: 0; aspect-ratio: 4 / 3; } }

/* Collins-style timed fade for the theme switch */
:root { --tint: background-color .6s ease-in-out, color .6s ease-in-out, border-color .6s ease-in-out; }

/* ——— Work grid options with glass captions (same glass as the menu) ——— */
.wgrid { display: grid; gap: var(--gap); margin-top: 48px; }
.wgrid--a, .wgrid--b { grid-template-columns: repeat(3, 1fr); }
.wgrid--c { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .wgrid--a, .wgrid--b { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .wgrid { grid-template-columns: 1fr !important; } }
.wcard { position: relative; display: block; border-radius: var(--r); overflow: hidden; background: var(--card); aspect-ratio: 4 / 3; }
.wgrid--c .wcard { aspect-ratio: 3 / 2; }
.wcard .media { position: absolute; inset: 0; }
.wcard .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.wcard:hover .media img { transform: scale(1.03); }
.glass { position: absolute; z-index: 2; color: #1A1A1A;
  background: rgba(250, 250, 248, .55); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 10px 40px rgba(20, 20, 20, .14), inset 0 1px 0 rgba(255, 255, 255, .9); }
.glass b { font-weight: 500; }
.glass--pill { left: 14px; bottom: 14px; padding: 9px 16px; border-radius: 999px; font-size: 14px; white-space: nowrap; transition: transform .6s var(--ease); }
.wcard:hover .glass--pill { transform: translateY(-4px); }
.glass--panel { left: 12px; right: 12px; bottom: 12px; padding: 16px 18px; border-radius: 16px; display: grid; gap: 6px;
  transform: translateY(calc(100% - 52px)); transition: transform .7s var(--ease); }
.glass--panel b { font-size: 17px; }
.glass--panel span { font-size: 15px; color: #3a3a38; }
.glass--panel small { font-size: 12px; color: #6a6a66; }
.wcard:hover .glass--panel { transform: none; }
@media (hover: none) { .glass--panel { transform: none; } }
.glass--bar { left: 12px; right: 12px; bottom: 12px; padding: 14px 18px; border-radius: 999px; display: flex; gap: 16px; align-items: center; font-size: 15px; }
.glass--bar span { color: #3a3a38; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glass--bar small { color: #6a6a66; font-size: 13px; white-space: nowrap; }
@media (max-width: 640px) { .glass--bar span { display: none; } }
.glass--panel { transform: translateY(calc(100% - 50px)); }
.glass--panel span, .glass--panel small { opacity: 0; transition: opacity .5s var(--ease); }
.wcard:hover .glass--panel span, .wcard:hover .glass--panel small { opacity: 1; transition-delay: .12s; }
@media (hover: none) { .glass--panel span, .glass--panel small { opacity: 1; } }

/* Option C chosen: smaller, balanced copy in the glass bar */
.glass--bar { padding: 11px 18px; gap: 14px; font-size: 13px; }
.glass--bar b { font-size: 14px; white-space: nowrap; }
.glass--bar span { font-size: 13px; }
.glass--bar small { font-size: 12px; }

/* AI Lab teaser as in Figma: copy sits under the pill */
.ai-line--top { margin-top: 40px; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.18; letter-spacing: -.02em; max-width: 540px; }
@media (max-width: 760px) { .ai-line--top { margin-top: 28px; } }
/* Pills on images: glass, medium weight */
.project .pill, .intro__hero .pill, .m .pill, .next .pill {
  background: rgba(250, 250, 248, .55); color: #1A1A1A; font-weight: 500;
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 8px 30px rgba(20, 20, 20, .14), inset 0 1px 0 rgba(255, 255, 255, .9); }
html.is-dark .next .pill { background: rgba(40, 40, 38, .55); color: #F2F2EF; border-color: rgba(255, 255, 255, .12); }
.glass--bar { padding: 9px 16px; gap: 12px; }
.glass--bar b { font-size: 13px; font-weight: 500; }
.glass--bar span { font-size: 12px; }
.glass--bar small { font-size: 11px; }

/* Round 12: tighter corners, lighter strokes, flat menu, AI card like Services */
:root { --r: 12px; }
@media (max-width: 760px) { :root { --r: 10px; } }
.grid-2 { position: relative; }
.zone-mark { position: absolute; left: 0; top: 50%; width: 1px; height: 1px; pointer-events: none; }
.nav, html.is-dark .nav { box-shadow: none; }
.glass, .project .pill, .intro__hero .pill, .m .pill, .next .pill {
  border-color: rgba(255, 255, 255, .3); box-shadow: 0 8px 30px rgba(20, 20, 20, .1), inset 0 1px 0 rgba(255, 255, 255, .35); }
html.is-dark .next .pill { border-color: rgba(255, 255, 255, .08); }
/* Story: text card fills the row, Approach sits at the bottom */
.story__text { align-self: stretch; display: flex; flex-direction: column; }
.story__text hr { margin-top: auto; } .story__text > :first-child { padding-bottom: 40px; }
/* Work page: the glass bar only shows on hover (always on touch) */
@media (hover: hover) {
  .wcard .glass--bar { opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .6s var(--ease); }
  .wcard:hover .glass--bar, .wcard:focus-visible .glass--bar { opacity: 1; transform: none; }
}
/* Menu: a light black tint so the glass reads on white */
:root:not(.is-dark) { --glass: rgba(228, 228, 225, .72); --glass-line: rgba(26, 26, 26, .06); }
/* Work bar: name left, arrow right */
.glass--bar { justify-content: space-between; padding: 10px 18px; }
.glass--bar b { font-size: 14px; }
.bar-arrow { font-style: normal; font-size: 15px; line-height: 1; transition: transform .5s var(--ease); }
.wcard:hover .bar-arrow { transform: translateX(3px); }
/* Next project: soft dark scrim under the title so white text works on any image */
.next .media::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .18) 45%, rgba(0, 0, 0, 0) 70%); }
.next:hover .next__title { text-shadow: 0 2px 24px rgba(0, 0, 0, .3); }

/* Mobile fixes */
@media (max-width: 900px) {
  /* More work: swipe sideways only */
  .grid-5 { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
  /* Project hero: show the whole first image at its own shape */
  .intro__hero { aspect-ratio: var(--ar, 4 / 3); }
}

/* Round 14 */
/* Project facts: client, sector and scope in one card */
.facts { padding: 18px 20px; }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dl > div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: baseline; }
.facts dl > div + div { border-top: 1px solid var(--line); padding-top: 14px; }
.facts dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.3; }
/* Ciclo: three photos in one row */
.trio { margin-top: var(--gap); }
.trio .m { position: relative; border-radius: var(--r); overflow: hidden; background: var(--card); }
/* About: dark page */
html.is-dark-page .card--ink { background: var(--card); }
/* Contact pop-up */
.contact__mail { cursor: pointer; }
.mailbox { border: 0; padding: 0; border-radius: var(--r); background: var(--card); color: var(--ink); width: min(420px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.mailbox::backdrop { background: rgba(10, 10, 10, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mailbox[open] { animation: mailIn .45s var(--ease); }
@keyframes mailIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.mailbox__in { position: relative; padding: 28px; display: grid; gap: 14px; }
.mailbox__t { margin: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mailbox__addr { font-size: 22px; letter-spacing: -.01em; }
.mailbox__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.mailbox__opts a, .mailbox__opts button { font: inherit; font-size: 14px; padding: 12px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); text-align: center; cursor: pointer; transition: background-color .3s, color .3s; }
.mailbox__opts a:hover, .mailbox__opts button:hover { background: var(--ink); color: var(--canvas); }
.mailbox__x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.mailbox__x:hover { color: var(--ink); }
/* Mobile: show the whole home reel (no crop) */
@media (max-width: 760px) {
  .hero.hero--video { height: auto; min-height: 0; max-height: none; aspect-ratio: 16 / 9; }
  .hero--video .hero__video { object-fit: cover; }
}
/* Space between the statement and the first project (the Selected work pill is gone) */
#work.grid-2 { margin-top: clamp(40px, 6vw, 88px); }

/* Next project: split card, text left, the whole image or loop right (no crop) */
.next.next--split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: 12px; min-height: 0; }
.next--split .next__in { padding: 20px; min-height: 0; }
.next--split .next__media { position: relative; aspect-ratio: var(--a); border-radius: calc(var(--r) - 4px); overflow: hidden; background: var(--canvas); }
.next--split .media { position: absolute; inset: 0; opacity: 1; }
.next--split .media::after { content: none; }
.next--split .media img, .next--split .media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.next--split:hover .media img, .next--split:hover .media video { transform: scale(1.03); }
.next--split:hover .next__title { color: inherit; text-shadow: none; }
.next__arrow { display: inline-block; transition: transform .6s var(--ease); }
.next--split:hover .next__arrow { transform: translateX(10px); }
@media (max-width: 900px) {
  .next.next--split { grid-template-columns: 1fr; }
  .next--split .next__in { min-height: 180px; }
}
/* Draggable hero logo (desktop) */
.hero__logo.is-draggable { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.hero__logo.is-dragging { cursor: grabbing; }
.hero--video { overflow: hidden; }
/* Smaller hero logo */
.hero__logo { width: min(52%, 760px); }
@media (max-width: 760px) { .hero__logo { width: 62%; } }

/* Story: Context and Approach side by side in one card (no empty space) */
.story.story--text { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 30px; margin-top: var(--gap); align-items: start; }
.story--text p { font-size: var(--fs-lead); line-height: 1.28; letter-spacing: -.015em; margin: 16px 0 0; max-width: 600px; }
.story--text .approach p { color: var(--muted); }
@media (max-width: 900px) { .story.story--text { grid-template-columns: 1fr; gap: 32px; padding: 24px; } }
/* Gallery grid: full-width wide images, equal pairs, aligned gutters */
.gallery { display: block; margin-top: 0; }
.g-row { display: grid; gap: var(--gap); margin-top: var(--gap); }
.g-row--pair { grid-template-columns: 1fr 1fr; }
.gallery .g-row .m { position: relative; border-radius: var(--r); overflow: hidden; background: var(--card); aspect-ratio: var(--a); min-height: 0; }
.g-row--solo .m { background: var(--bg); }
.g-row--solo .m img, .g-row--solo .m video { object-fit: contain; }
