/* Google Sans Flex (OFL), self-hosted: Latin + Latin Extended only */
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/google-sans-flex-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/google-sans-flex-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fff;
  --fg: #000;
  --ink: #111827;
  --ink-2: #374151;
  --rule: #e5e7eb;
  --blue: #0064e8;
  --green: #34c759;
  --yellow: #ffcc00;
  --divider: rgba(0, 0, 0, .14);
  --glass-bg: rgba(255, 255, 255, .58);
  --glass-border: rgba(255, 255, 255, .55);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, .08);
  --head-ink: #000;
  --head-face: #fff;

  --font: "Google Sans Flex", "Google Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 6.25vw, 120px);
  --radius: 16px;
  --pad: 8px;                                    /* page padding around case rows */
  --tc: clamp(340px, 27vw, 520px);               /* case text column */
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);
  color-scheme: light;
}

:root[data-mode="dark"] {
  --bg: #0b0b0c;
  --fg: #f5f5f7;
  --ink: #f3f4f6;
  --ink-2: #a1a1aa;
  --rule: #27272a;
  --blue: #3d8bff;
  --glass-bg: rgba(28, 28, 30, .6);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  --head-ink: #f5f5f7;
  --head-face: #0b0b0c;
  --divider: rgba(255, 255, 255, .7);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-gutter: stable; }

/* While the intro plays the page is exactly one viewport: no scroll, nothing below the hero */
html.is-intro-running { overflow: hidden; }
html.is-intro-running .dock,
html.js-intro .dock { pointer-events: none; }
/* While the intro animates, skip the glass blur (recomputed every frame) and promote the moving layers */
html.is-intro-running .dock__bg { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.is-intro-running .hero__intro,
html.is-intro-running .dock,
html.is-intro-running .dock > li { will-change: transform, opacity; }
html.js-intro .view--home > main,
html.js-intro .view--home > .page-foot,
html.is-intro-running .view--home > main,
html.is-intro-running .view--home > .page-foot { visibility: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.accent { color: var(--blue); }

/* Icons are masks so they follow the text colour (and dark mode) */
.icon {
  display: block;
  width: 40px;
  height: 40px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}
.icon--back     { --i: url(assets/icon-back.svg); }
.icon--down     { --i: url(assets/icon-arrow-down.svg); }
.icon--email    { --i: url(assets/icon-email.svg); width: 46px; height: 46px; }
.icon--linkedin { --i: url(assets/icon-linkedin.svg); width: 46px; height: 46px; }
.icon--behance  { --i: url(assets/icon-behance.svg); width: 46px; height: 46px; }
.icon--theme {
  width: 22px; height: 22px;
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E");
}
[data-mode="dark"] .icon--theme {
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cg stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 1.5v2.5M12 20v2.5M1.5 12H4M20 12h2.5M4.6 4.6l1.8 1.8M17.6 17.6l1.8 1.8M4.6 19.4l1.8-1.8M17.6 6.4l1.8-1.8'/%3E%3C/g%3E%3C/svg%3E");
}

cursor-head { display: block; }

/* Figma "Glass" effect, rebuilt in CSS: backdrop blur + specular rim lit from the
   top-left (light angle −45°) + inner depth glow + faint dispersion fringe */
:root {
  --glass-hi: rgba(255, 255, 255, .9);
  --glass-lo: rgba(255, 255, 255, .4);
  --glass-depth: rgba(255, 255, 255, .35);
  --glass-fringe-a: rgba(255, 60, 160, .10);
  --glass-fringe-b: rgba(0, 170, 255, .10);
}
:root[data-mode="dark"] {
  --glass-hi: rgba(255, 255, 255, .38);
  --glass-lo: rgba(255, 255, 255, .12);
  --glass-depth: rgba(255, 255, 255, .06);
  --glass-fringe-a: rgba(255, 60, 160, .14);
  --glass-fringe-b: rgba(0, 170, 255, .14);
}
.figma-glass {
  -webkit-backdrop-filter: blur(var(--glass-blur, 32px)) saturate(1.8) brightness(1.04);
  backdrop-filter: blur(var(--glass-blur, 32px)) saturate(1.8) brightness(1.04);
  box-shadow:
    inset 1.5px 1.5px 1px -.5px var(--glass-hi),
    inset -1px -1px 1px -.5px var(--glass-lo),
    inset 0 0 22px var(--glass-depth),
    inset 3px 0 3px -2px var(--glass-fringe-a),
    inset -3px 0 3px -2px var(--glass-fringe-b),
    0 10px 30px -18px rgba(0, 0, 0, .25);
}

.glass {
  --glass-blur: 18px;
  background: rgba(202, 202, 202, .1);
  -webkit-backdrop-filter: blur(18px) saturate(1.8) brightness(1.04);
  backdrop-filter: blur(18px) saturate(1.8) brightness(1.04);
  box-shadow:
    inset 0 1.5px 1px -.5px var(--glass-hi),
    inset 0 -1px 1px -.5px var(--glass-lo),
    inset 0 0 14px var(--glass-depth),
    inset 2px 0 2px -1px var(--glass-fringe-a),
    inset -2px 0 2px -1px var(--glass-fringe-b),
    0 8px 24px -14px rgba(0, 0, 0, .3);
}

/* Small, natural "grow" on hover for interactive bits */
.grow { transition: transform .45s var(--ease); }
.grow:hover, .grow:focus-visible { transform: scale(1.1); }
.grow:active { transform: scale(.96); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.theme-toggle--home {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 30;
  transition: opacity .5s ease, transform .45s var(--ease);
}
.theme-toggle--home:hover { transform: scale(1.08); }
body.is-case .theme-toggle--home { display: none; }

/* Home top-right: Behance + LinkedIn reuse the theme toggle's glass circle */
.home-actions { position: fixed; top: 20px; right: 20px; z-index: 30; display: flex; gap: 8px; }
.home-actions .theme-toggle--home { position: static; }
body.is-case .home-actions { display: none; }
.social-btn { color: var(--fg); transition: transform .45s var(--ease); }
.social-btn:hover { transform: scale(1.08); }
/* Hover / press: the button flips to the opposite of the current theme (dark ↔ light) */
.social-btn { transition: transform .45s var(--ease), background-color .25s ease, color .25s ease; }
.social-btn:hover, .social-btn:focus-visible, .social-btn:active { background: var(--fg); color: var(--bg); }
.social-btn__glyph { font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }

/* ======================================================= Home */
.hero, .about, .history, .clients, .contact {
  min-height: min(59.375vw, 1140px);
  display: flex;
  align-items: center;
  padding: 60px var(--gutter);
}
.hero { position: relative; height: 100svh; min-height: 480px; justify-content: center; overflow: hidden; }

.hero__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--glow, transparent) 100%);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.hero.is-glowing .hero__glow { opacity: 1; }

/* Lava lamp: soft blobs in the hovered case's colour drift and morph near the bottom */
@property --lava { syntax: '<color>'; inherits: true; initial-value: transparent; }
.hero { transition: --lava .9s ease; }
.blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
  background: radial-gradient(circle at 50% 50%, var(--lava) 0%, color-mix(in srgb, var(--lava) 45%, transparent) 30%, transparent 70%);
  opacity: .34;
  will-change: transform;
  animation: lava-a 16s ease-in-out infinite alternate, lava-morph 9s ease-in-out infinite alternate;
  animation-play-state: paused;
}
[data-mode="dark"] .blob { opacity: .42; }
.hero.is-glowing .blob { animation-play-state: running; }
.blob--1 { left: -10vmax; bottom: -22vmax; }
.blob--2 { left: 30%; bottom: -30vmax; width: 54vmax; height: 54vmax; animation-name: lava-b, lava-morph; animation-duration: 21s, 11s; }
.blob--3 { right: -14vmax; bottom: -18vmax; animation-name: lava-c, lava-morph; animation-duration: 18s, 8s; animation-delay: -6s, -3s; }
.blob--4 { left: 18%; bottom: 8vh; width: 30vmax; height: 30vmax; opacity: .22; animation-name: lava-d, lava-morph; animation-duration: 13s, 7s; animation-delay: -4s, -2s; }

@keyframes lava-a {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(14vw, -12vh) scale(1.15); }
  100% { transform: translate(6vw, -26vh) scale(.92); }
}
@keyframes lava-b {
  0%   { transform: translate(0, 0) scale(1.05); }
  50%  { transform: translate(-12vw, -18vh) scale(.9); }
  100% { transform: translate(10vw, -8vh) scale(1.2); }
}
@keyframes lava-c {
  0%   { transform: translate(0, 0) scale(.95); }
  50%  { transform: translate(-16vw, -22vh) scale(1.18); }
  100% { transform: translate(-4vw, -10vh) scale(1); }
}
@keyframes lava-d {
  0%   { transform: translate(0, 0) scale(.9); }
  50%  { transform: translate(18vw, -30vh) scale(1.25); }
  100% { transform: translate(-8vw, -40vh) scale(.85); }
}
@keyframes lava-morph {
  0%   { border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; }
  50%  { border-radius: 63% 37% 41% 59% / 58% 62% 38% 42%; }
  100% { border-radius: 38% 62% 55% 45% / 40% 55% 45% 60%; }
}

.container { width: 100%; max-width: 1520px; margin: 0 auto; }

.section-title {
  font-size: clamp(32px, 2.5vw + 12px, 48px);
  font-weight: 600;
  color: var(--fg);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 2.6vw, 44px);
  width: 100%;
}
/* Sit slightly above true centre (desktop) */
@media (min-width: 601px) { .hero__inner { translate: 0 -5vh; } }
.hero__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.hero__title { font-size: clamp(26px, 1.8vw, 34px); font-weight: 600; }
.hero__title .tm { font-weight: 400; }
.hero__dot, .hero__credits, .dock > .dock__item--social { display: none; }
.hero__tagline { font-size: clamp(14px, .9vw, 17px); font-weight: 400; }
.accent-y { color: var(--yellow); }

.hero__sig {
  position: absolute;
  z-index: 1;
  left: clamp(20px, 2.9vw, 56px);
  top: clamp(20px, 2.65vw, 51px);
  font-size: clamp(14px, .95vw, 18px);
}
.hero__os {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(24px, 6vh, 72px);
  translate: -50% 0;
  font-size: clamp(14px, .95vw, 18px);
  font-weight: 600;
  white-space: nowrap;
}
.hero__os span { margin-left: 4px; }

/* Language switcher (EN / ES / PT): centred just above "tonOS 1.72"; the current one is bold */
.lang {
  position: absolute;   /* desktop copy sits in the hero, just above tonOS */
  z-index: 1;
  left: 50%;
  bottom: calc(clamp(24px, 6vh, 72px) + 2.6em);
  translate: -50% 0;
  display: flex;
  gap: 8px;
  font-size: clamp(12px, .75vw, 14px);
}
.lang button {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-weight: 400;
  letter-spacing: .02em;
  cursor: pointer;
  opacity: .8;
  transition: opacity .2s ease;
}
.lang button:hover, .lang button:focus-visible { opacity: 1; }
.lang--inline { display: none; }   /* phones use the copy inside the column */
.lang button[aria-pressed="true"] { font-weight: 700; opacity: 1; }

/* Before the intro script takes over, keep the staged elements out of sight */
.js-intro .hero__title,
.js-intro .hero__tagline,
.js-intro .dock,
.js-intro .hero__sig,
.js-intro .hero__os,
.js-intro .hero__credits,
.js-intro .lang,
.js-intro .theme-toggle--home,
.js-intro .home-actions { opacity: 0; }

/* Dock: the four cases + About, 1920 frame = 202.6px tiles in a 1386px bar */
.dock {
  --tile: min(clamp(52px, 7.4vw, 146px), calc((100svh - 380px) / 1.25));
  display: flex;
  align-items: center;
  gap: calc(var(--tile) * .232);
  padding: calc(var(--tile) * .212) calc(var(--tile) * .338);
  border-radius: calc(var(--tile) * .267);
  background: rgba(202, 202, 202, .2);
}
.dock__item { position: relative; display: flex; flex-direction: column; align-items: center; }

/* Glass bar is its own layer so it can stretch with the magnification without moving layout */
.dock { position: relative; isolation: isolate; background: none; }
.dock__bg {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: inherit;
  background: rgba(202, 202, 202, .2);
  will-change: left, right;
}
.is-live li,
.is-live .client__tile,
.is-live .social-tile { transition: none; will-change: transform; }
.is-live .client__tile,
.is-live .social-tile { transform-origin: 50% 100%; }

.dock__divider { width: 1px; height: calc(var(--tile) * .99); background: var(--divider); }

.client { display: block; color: var(--fg); border-radius: calc(var(--tile) * .237); }
.client:focus-visible { outline-offset: 6px; }

.client__tile {
  position: relative;
  display: block;
  width: var(--tile);
  height: calc(var(--tile) * 1.056);
  border-radius: calc(var(--tile) * .237);
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
  will-change: transform;
}
/* Logo artwork is drawn at the 202.6×214 design size and scaled to the tile (--s set by JS) */
.tile__art {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 202.6px;
  height: 214px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  pointer-events: none;
}
.wipe .tile__art { position: static; transform: none; }
.client:hover .client__tile,
.client:focus-visible .client__tile {
  transform: scale(1.097);
  box-shadow: 0 18px 40px -18px var(--glow);
}
.client:active .client__tile { transform: scale(1.04); }

.client__tile--banrural { background: var(--green); }
.client__tile--pixto { background: radial-gradient(circle at 0 0, #8925db 0%, #6518c0 30%, #410ba5 60%); }
.client__tile--osigu { background: linear-gradient(141.5deg, #0088ff 3%, #006fd1 99%); }
.client__tile--hsbc  { background: linear-gradient(138.3deg, #4c0093 2.8%, #200a36 95.4%); }
.client__tile--about { background: var(--yellow); }
.tile__art img { width: auto; }
.client__tile--banrural .tile__art img { width: 164px; height: auto; }
.tile__head { width: 123.5px; --head-ink: #000; --head-face: #fff; }

/* Hover label under the active tile */
.dock__label {
  position: absolute;
  top: calc(100% + var(--tile) * .212 + 14px);
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  opacity: 0;
  translate: -50% 10px;
  pointer-events: none;
  transition: opacity .35s ease, translate .5s var(--ease);
}
.dock__item:hover .dock__label,
.dock__item:focus-within .dock__label { opacity: 1; translate: -50% 0; }
.dock__pill {
  display: grid;
  place-items: center;
  min-width: calc(var(--tile) * 1.18);
  height: clamp(32px, 2.1vw, 40px);
  padding: 0 20px;
  border-radius: 54px;
  background: rgba(150, 150, 150, .2);
  font-size: clamp(14px, .95vw, 18px);
  font-weight: 600;
}
.dock__years { font-size: clamp(14px, .95vw, 18px); }
[data-mode="dark"] .dock__years { font-weight: 600; }

/* HSBC / YA mark: two pills + glyph, composed like the design */
.hsbc-mark { position: relative; display: block; width: 118.3px; height: 97.9px; }
.hsbc-mark__glyph { position: absolute; left: 0; top: .1px; }
.hsbc-mark__pill {
  position: absolute;
  top: 0;
  width: 61.59px;
  height: 27.02px;
  margin: 20.07px 0 0 -4.86px;
  border-radius: 75px;
  background: #fff;
}
.hsbc-mark__pill--a { left: 50.63px; rotate: 116.78deg; scale: 1 -1; }
.hsbc-mark__pill--b { left: 66.43px; rotate: 63.22deg; }

/* About */
.about__inner { display: flex; flex-direction: column; gap: 104px; }
.about__body { display: flex; align-items: center; justify-content: center; gap: 128px; }
.about__photo {
  position: relative;
  width: 369px; height: 472px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.about__text { max-width: 527px; font-size: 16px; }
.about__text p + p { margin-top: 1.25em; }
.about__text strong { font-weight: 700; }

/* Experience & education */
.history .container { display: flex; flex-direction: column; gap: 96px; }

/* Clients: logo wall, each logo grows a little on hover */
.clients .container { display: flex; flex-direction: column; align-items: center; gap: 96px; }
.clients__grid {
  --k: .8;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 48px 24px;
  width: 100%;
  max-width: 1100px;
}
.clients__grid li { display: flex; align-items: center; justify-content: center; height: 72px; }
/* Solid black (white in dark mode) by default; on hover it grows and cross-fades to the
   brand colours. In dark mode the colours sit on a small white card so they stay true. */
.logo {
  position: relative;
  display: block;
  width: calc(var(--w) * var(--k));
  transition: transform .45s var(--ease);
}
.logo::before {
  content: '';
  position: absolute;
  inset: -12px -16px;
  border-radius: 14px;
  background: #fff;
  opacity: 0;
  transition: opacity .35s ease;
}
.logo img { position: relative; display: block; width: 100%; height: auto; transition: opacity .35s ease; }
.logo .logo__c { position: absolute; inset: 0; height: 100%; opacity: 0; }
.clients__grid li:hover .logo { transform: scale(1.18); }
.clients__grid li:hover .logo__g { opacity: 0; }
.clients__grid li:hover .logo__c { opacity: 1; }
[data-mode="dark"] .logo__g { filter: invert(1); }
[data-mode="dark"] .clients__grid li:hover .logo::before { opacity: 1; }
.history__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; width: 100%; max-width: 1400px; margin: 0 auto; }
.history__col { display: flex; flex-direction: column; gap: 24px; padding: 0 60px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .96px; text-transform: uppercase; color: var(--blue); }
.entries { display: flex; flex-direction: column; }
.entry { display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.entry + .entry { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }
.entry__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.entry__role { flex: 1 1 auto; min-width: 0; max-width: 360px; font-weight: 700; color: var(--ink); }
.entry__role--wide { width: auto; }
.entry__date { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.entry__org { font-weight: 500; color: var(--ink-2); }

/* Contact */
.contact__inner { display: flex; flex-direction: column; gap: 48px; max-width: 1160px; }
.contact__title {
  font-size: clamp(56px, 6.67vw, 128px);
  font-weight: 600;
  line-height: .88;
}
.contact__who { display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.contact__who strong { font-weight: 700; color: var(--blue); }
.contact__who span { font-weight: 500; }
.contact__links { display: flex; gap: 8px; }
.contact__links a { display: block; border-radius: 6px; transition: transform .45s var(--ease), opacity .2s; }
.contact__links a:hover { transform: scale(1.08); }

/* ======================================================= Case */
.view--case { position: relative; }
body.is-case .view--home { display: none; }

.case { padding: var(--pad); }

.case__grid {
  display: grid;
  grid-template-columns: var(--tc) minmax(0, 1fr);
}

/* Sticky text column: panels cross-fade while the images scroll past */
.case__aside {
  position: sticky;
  top: var(--pad);
  height: calc(100svh - var(--pad) * 2);
}
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 32px clamp(24px, 4.2vw, 80px) 32px clamp(24px, 3.75vw, 72px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .35s ease, transform .5s var(--ease), visibility 0s linear .5s;
}
.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .45s ease, transform .55s var(--ease), visibility 0s;
}
.panel__inner {
  width: 100%;
  max-width: 368px;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}
.panel__inner::-webkit-scrollbar { display: none; }
/* Long copy on short screens: scrolls inside the panel, with a soft fade as a hint */
.panel__inner.is-overflow { -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.panel__inner.is-overflow.is-end { -webkit-mask-image: none; mask-image: none; }

.case__rows { display: flex; flex-direction: column; gap: var(--pad); }

.row__media {
  position: relative;
  height: calc(100svh - var(--pad) * 2);
  min-height: 520px;
}
.slot {
  position: absolute;
  overflow: hidden;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}
.slot img { width: 100%; height: 100%; object-fit: cover; }
.row__text { display: none; }

/* Case copy */
.copy { display: flex; flex-direction: column; gap: 24px; color: var(--fg); }
.copy__name { font-size: 64px; font-weight: 600; line-height: 1.1; }
.copy__tagline { font-size: 16px; }
.copy__years { font-size: 16px; font-weight: 600; color: var(--blue); }
.copy--hero { gap: 16px; }
.copy h2 { font-size: 20px; font-weight: 600; line-height: 1.25; white-space: pre-line; }
.copy__meta { font-size: 12px; font-weight: 600; }
.copy__meta + .copy__meta { margin-top: -16px; }
.copy__stat { font-size: 16px; font-weight: 600; }
.copy__stat + .copy__stat { margin-top: -16px; }
.copy__sub { font-size: 16px; font-weight: 600; margin-bottom: -12px; }
.copy__lead { font-size: 12px; font-weight: 500; color: var(--blue); line-height: 1.5; white-space: pre-line; }
.copy__p { font-size: 12px; line-height: 1.5; }
.copy__p p + p { margin-top: 1em; }
.copy b { font-weight: 700; }

/* Case footer */
.case-foot {
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--pad) * 2);
  margin-top: var(--pad);
  padding: 60px clamp(24px, 3vw, 60px);
}
.case-foot .contact__title { white-space: pre-line; max-width: 1400px; }

/* Nav: aligned with the media column, plain at the top, glass once scrolling */
.case-nav {
  position: fixed;
  z-index: 20;
  top: var(--pad);
  left: var(--pad);
  right: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--fg);
  transition: background-color .45s ease, border-color .45s ease, box-shadow .45s ease,
              -webkit-backdrop-filter .45s ease, backdrop-filter .45s ease, opacity .5s ease, color .4s ease;
}
.case-nav__back { display: block; }
.case-nav__back .icon { width: 28px; height: 28px; }
.case-nav__right { display: flex; align-items: center; gap: 12px; }
.case-nav__logo { display: block; width: 46px; }
.case-nav__logo cursor-head { width: 46px; }
.case-nav .theme-toggle { width: 32px; height: 32px; }
.case-nav .icon--theme { width: 18px; height: 18px; }

/* Auto contrast: set from what's actually behind each item (see updateNavContrast) */
@property --head-ink { syntax: '<color>'; inherits: true; initial-value: #000; }
@property --head-face { syntax: '<color>'; inherits: true; initial-value: #fff; }
.case-nav__back, .case-nav .theme-toggle, .case-nav__logo {
  transition: transform .45s var(--ease), color .35s ease, --head-ink .35s ease, --head-face .35s ease;
}
.case-nav .on-light { color: #000; --head-ink: #000; --head-face: #fff; }
.case-nav .on-dark  { color: #fff; --head-ink: #fff; --head-face: #000; }
.case-nav.is-hidden { opacity: 0; pointer-events: none; }

/* Hero entry: image flies from full screen into its slot, then the name fades in */
.hero-fly { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius); }
.hero-fly img { width: 100%; height: 100%; object-fit: cover; }
.is-entering .panel[data-i="0"],
.is-entering .row__text--hero { opacity: 0; transform: translateY(24px); transition: none; }

/* About page (opened from the yellow tile) */
/* "About me" frame: centred section titles, 338px photo; each section fills one screen, centred */
.about-page .about,
.about-page .history,
.about-page .clients { min-height: 100svh; padding-top: 96px; padding-bottom: 72px; }
.about-page .about__inner { gap: 64px; }
.about-page.is-entering .history,
.about-page.is-entering .clients,
.about-page.is-entering .page-foot { visibility: hidden; }
.about-page .about__inner { align-items: center; }
.about-page .section-title { text-align: center; align-self: center; }
@media (min-width: 821px) { .about-page .about__photo { width: 338px; } }
.about-page .about__photo,
.about-page .about__text { transition: opacity .8s ease .15s, transform .9s var(--ease) .15s; }
.about-page.is-entering .about__photo,
.about-page.is-entering .about__text { opacity: 0; transform: translateY(32px); transition: none; }
body.is-about .scroll-cue { left: 50%; }

/* ======================================================= Footer (cases + About) */
.site-foot {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--pad) * 2);
  margin-top: var(--pad);
  padding: 80px clamp(24px, 6.25vw, 120px) 120px;
}
.site-foot__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 48px; width: 100%; }
.site-foot__title {
  max-width: 1400px;
  font-size: clamp(40px, 4.8vw, 92px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.site-foot__line { display: block; text-wrap: balance; }
.foot-docks {
  --tile: clamp(56px, 5.2vw, 100px);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: calc(var(--tile) * .57);
  padding: calc(var(--tile) * .25) calc(var(--tile) * .34);
  border-radius: calc(var(--tile) * .266);
}
/* Footer bar: small name pill right above the (magnified) tile, no years */
.foot-docks .dock__label { top: auto; bottom: calc(100% + var(--tile) * 1.056 * .5 + 6px); }
.foot-docks .dock__years { display: none; }
.foot-docks .dock__pill { min-width: 0; height: 24px; padding: 0 10px; font-size: 12px; }
.mini-dock { display: flex; align-items: center; gap: calc(var(--tile) * .57); }
.foot-docks > .mini-dock.figma-glass { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.social-tile {
  display: block;
  width: var(--tile);
  height: calc(var(--tile) * 1.056);
  border-radius: calc(var(--tile) * .237);
  overflow: hidden;
  transition: transform .55s var(--ease);
}
.social-tile img { width: 100%; height: 100%; }
.social-tile:hover, .social-tile:focus-visible { transform: scale(1.097); }
.site-foot__who { font-size: clamp(16px, 1.05vw, 20px); }
.site-foot__who b { font-weight: 700; }
.site-foot__os {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 6vh, 72px);
  translate: -50% 0;
  font-size: clamp(14px, 1.05vw, 20px);
  font-weight: 600;
  white-space: nowrap;
}
.site-foot__os span { margin-left: 4px; }

/* Phone footer: "Footer mobile update" — one centred, full-screen column:
   headline / name + role / one glass bar of app tiles (incl. LinkedIn + Behance) / tonOS */
@media (max-width: 600px) {
  .site-foot {
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100lvh;
    margin-top: 0;
    padding: 60px 16px;
    text-align: center;
  }
  .site-foot__inner { align-items: center; gap: 16px; }
  .site-foot__title { order: 0; margin-bottom: 48px; font-size: 36px; line-height: 1.05; }
  .site-foot__who { order: 1; font-size: 12px; line-height: 1.25; }
  .site-foot__who .sep { display: none; }
  .site-foot__who b { display: block; }
  .foot-docks { order: 2; }
  .foot-docks > .dock__bg, .foot-docks .dock__label { display: none; }
  .foot-docks {
    --tile: 38px;
    flex-direction: row;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(202, 202, 202, .2);
    -webkit-backdrop-filter: blur(32px) saturate(1.8);
    backdrop-filter: blur(32px) saturate(1.8);
    box-shadow: inset 1.5px 1.5px 1px -.5px var(--glass-hi), inset -1px -1px 1px -.5px var(--glass-lo), inset 0 0 12px var(--glass-depth);
  }
  .mini-dock { gap: 8px; }
  .mini-dock .client, .mini-dock .client__tile, .social-tile { height: calc(var(--tile) * 1.056); border-radius: 9px; }
  .site-foot__os { position: static; translate: none; display: flex; justify-content: center; gap: 4px; margin-top: 16px; font-size: 12px; font-weight: 400; }
  .site-foot__os span { margin-left: 0; }
  .home-actions { top: 12px; right: 12px; }
}

/* ======================================================= Scroll cue */
.scroll-cue {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--fg);
  pointer-events: none;           /* never clickable */
  user-select: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .5s ease, transform .6s var(--ease);
}
.scroll-cue .icon { width: 24px; height: 24px; }
.scroll-cue.is-visible { opacity: 1; transform: translate(-50%, 0); }
body.is-case .scroll-cue { left: 50%; }

/* ======================================================= Transition overlay */
.wipe {
  position: fixed;
  z-index: 50;
  display: none;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}
.wipe.is-on { display: grid; }
.wipe__logo { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; }   /* always dead centre, even while the card is smaller than the logo box */
/* Load bar (Figma: 250×8, 32px under the logo, glass track + white fill) */
.wipe__bar {
  --glass-blur: 12px;
  position: absolute;
  left: 50%;
  top: calc(50% - 20px + var(--logo-h, 110px) / 2 + 32px);
  width: 250px;
  height: 8px;
  margin-left: -125px;
  border-radius: 80px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  opacity: 0;
}
.wipe__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: #fff; }

/* ======================================================= No-JS / search-engine fallback */
html.js .nojs { display: none; }
/* Without JS the tile-art scale (normally measured by app.js) falls back to an approximation */
html:not(.js) .dock { --s: .45; }
.nojs { max-width: 760px; margin: 0 auto; padding: 64px 24px 120px; line-height: 1.6; color: var(--fg); }
.nojs__note { padding: 12px 16px; border-radius: var(--radius); background: rgba(202, 202, 202, .2); }
.nojs nav ul { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0 48px; }
.nojs nav a { color: var(--blue); font-weight: 600; }
.nojs article { margin-bottom: 96px; }
.nojs h2 { font-size: 40px; font-weight: 600; margin-bottom: 8px; }
.nojs h3 { font-size: 20px; font-weight: 600; margin: 40px 0 12px; }
.nojs p { margin: 0 0 12px; }
.nojs__stat { font-size: 16px; font-weight: 600; }
.nojs__sub { font-size: 16px; font-weight: 600; }
.nojs__meta { font-weight: 600; }
.nojs__lead { color: var(--blue); font-weight: 500; }
.nojs .about, .nojs .history, .nojs .clients { min-height: 0; display: block; padding: 0; }
.nojs .about__body { display: block; }
.nojs .about__photo { width: 100%; max-width: 338px; height: auto; margin: 24px 0; }
.nojs .about__photo img { border-radius: var(--radius); }
.nojs .history__cols { display: block; }
.nojs .history__col { padding: 0; margin-top: 32px; }

/* ======================================================= Responsive */
@media (max-width: 1100px) {
  .about__body { gap: 64px; }
  .history__col { padding: 0; }
}

@media (max-width: 820px) {
  :root { --tc: 0px; }

  .about__inner { gap: 48px; }
  .about__body { flex-direction: column; align-items: flex-start; gap: 40px; }
  .about__photo { width: 100%; max-width: 369px; height: auto; aspect-ratio: 369 / 472; }
  .history .container { gap: 48px; }
  .clients .container { gap: 48px; }
  .clients__grid { --k: .6; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; max-width: 320px; }
  .clients__grid li { height: 56px; }
  .clients__grid li:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* lone last logo sits in the middle */
  .history__cols { grid-template-columns: 1fr; gap: 56px; }
  .entry__role { width: auto; }

  /* Case: one readable column, each row = text then its images */
  .case__grid { display: block; }
  .case__aside { display: none; }
  .case__rows { gap: 0; }
  .case-row { padding-bottom: 56px; }
  .row__text { display: block; padding: 0 16px 32px; }
  .row__text--hero { padding: 120px 16px 40px; transition: opacity .7s ease .1s, transform .8s var(--ease) .1s; }
  /* Opening screen fills the viewport (like the About page) so "My role…" stays below the fold
     until you scroll; everything after it is hidden while the case is entering */
  .case-row--hero { display: flex; flex-direction: column; justify-content: center; min-height: 100svh; padding: 72px 0 24px; }
  .case-row--hero .row__text--hero { padding-top: 0; }
  .is-entering .case-row:not(.case-row--hero),
  .is-entering .page-foot { visibility: hidden; }
  .row__media {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--pad);
  }
  .slot { position: relative; inset: auto !important; width: 100% !important; height: auto !important; }
  .slot img { height: auto; aspect-ratio: var(--ar); }
  .case-row--hero .row__media { aspect-ratio: 1376 / 1140; }
  .case-row--hero .slot { position: absolute; inset: 0 !important; height: 100% !important; }
  .case-row--hero .slot img { height: 100%; }
  .copy { gap: 20px; }
  .copy__name { font-size: 48px; }
  .copy__p, .copy__meta, .copy__lead { font-size: 15px; line-height: 1.55; }
  .copy__meta + .copy__meta, .copy__stat + .copy__stat { margin-top: -12px; }
  .copy__sub { margin-bottom: -8px; }

  .case-nav { padding: 8px 16px; }
  .case-nav__back .icon { width: 26px; height: 26px; }
  .case-nav__logo, .case-nav__logo cursor-head { width: 42px; }
  .case-foot { min-height: 80svh; padding: 48px 16px; }
  .scroll-cue, body.is-case .scroll-cue { left: 50%; }
}

/* Phone + tablet: the nav turns to frosted glass once scrolling so it stays readable over images */
@media (max-width: 820px) {
  .case-nav.is-glass {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    backdrop-filter: blur(24px) saturate(1.6);
    border-color: color-mix(in srgb, var(--fg) 8%, transparent);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
  }
  .case-nav.is-glass .on-light,
  .case-nav.is-glass .on-dark { color: var(--fg); --head-ink: var(--fg); --head-face: var(--bg); }
}

/* Phone: About page per "PF-HOME MOBILE update" (clients section keeps its own layout) */
@media (max-width: 600px) {
  .about-page .section-title { font-size: 24px; }
  .about-page .about__inner { gap: 88px; }
  .about-page .about__body { align-items: center; gap: 88px; }
  .about-page .about__photo { width: 160px; max-width: none; aspect-ratio: 160 / 263; }
  .about-page .about__text { max-width: 262px; font-size: 12px; line-height: 1.3; }
  .about-page .history .container { gap: 84px; }
  .about-page .history__cols { gap: 72px; }
  .about-page .history__col { gap: 40px; padding: 0 max(0px, calc(32px - var(--gutter))); }   /* rows sit 32px from the screen edge */
  .about-page .eyebrow { text-align: center; }
  .about-page .entry { font-size: 12px; }
}

/* Phone: the "Mobile update" frame — 2-column dock, credits at the bottom */
@media (max-width: 600px) {
  /* "Mobile update": one centred column — title, dock, credits */
  .hero { height: 100svh; min-height: 0; padding: 68px 16px 24px; }   /* top band clears the corner button */
  .hero__inner { gap: 28px; }
  .hero__dot { display: inline; }
  .hero__sig, .hero__os { display: none; }
  .hero__credits { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; }
  /* LinkedIn joins the dock as one more tile (replaces the top-corner buttons on phones) */
  .dock > .dock__item--social { display: block; }
  .dock .social-tile { width: var(--tile); height: calc(var(--tile) * 1.056); border-radius: calc(var(--tile) * .237); }
  .home-actions .social-btn { display: none; }
  .lang--bottom { display: none; }
  .lang--inline { display: flex; position: static; translate: none; gap: 12px; font-size: 16px; }   /* phones: in the column, between dock and credits */
  .hero__credits b { font-weight: 700; }
  .hero__credits p:last-child { display: flex; justify-content: center; gap: 4px; }   /* exactly 4px between tonOS and 1.72 */
  .hero__credits span { margin-left: 0; }
  .hero__intro { gap: 2px; }
  .hero__title { font-size: 20px; }
  .hero__tagline { font-size: 12px; max-width: 219px; }
  .hero__sig { left: 50%; top: auto; bottom: 74px; translate: -50% 0; font-size: 12px; font-weight: 700; white-space: nowrap; }
  .hero__os { bottom: 52px; font-size: 12px; font-weight: 400; }
  .hero__os span { margin-left: 7px; }
  .dock {
    /* as wide as the column allows (~106px), shrinking only as far as the visible height needs */
    --tile: max(64px, min(calc((min(304px, 100vw - 64px) - 56px - 35px) / 2), calc((100svh - 370px) / 3.17)));
    display: grid;
    grid-template-columns: repeat(2, var(--tile));
    gap: min(34px, 3svh) 35px;
    padding: min(43px, 3svh) 28px;
    border-radius: 24px;
  }
  .dock .client, .dock .client__tile { border-radius: calc(var(--tile) * .237); }
  .dock > .dock__bg { background: rgba(0, 0, 0, .045); }
  [data-mode="dark"] .dock > .dock__bg { background: rgba(255, 255, 255, .07); }
  .dock__divider, .dock__label { display: none; }
  .theme-toggle--home { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
