/* ==========================================================
   Benedict Taiwo — portfolio
   A quiet grey frame; the work supplies the colour.
   ========================================================== */

:root {
  /* colour */
  --paper: #E8E8E5;      /* page */
  --panel: #F6F6F4;      /* raised surfaces */
  --white: #FFFFFF;
  --ink: #1A1A1A;        /* text, dark buttons */
  --ink-2: #565652;      /* secondary text (7:1 on panel) */
  --line: #D2D2CD;       /* hairlines */
  --live: #1F8F55;       /* availability dot */
  --on-ink: #F6F6F4;
  --on-ink-2: #B9B9B3;

  /* type */
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* space (8pt) */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;

  /* shape */
  --r-panel: 32px;
  --r-media: 16px;
  --r-pill: 999px;

  /* motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --fast: 160ms;
  --mid: 280ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: var(--r-pill);
}
.skip:focus { top: var(--s2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font: 500 15px/1 var(--body); text-decoration: none; white-space: nowrap;
  cursor: pointer; touch-action: manipulation;
  transition: background-color var(--fast) ease, color var(--fast) ease, border-color var(--fast) ease, transform var(--fast) ease;
}
.btn:active { transform: scale(.97); }
.btn--ink { background: var(--ink); color: var(--on-ink); }
.btn--ink:hover { background: #333331; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--white); border-color: var(--ink); }
.btn--paper { background: var(--panel); color: var(--ink); }
.btn--paper:hover { background: var(--white); }
.btn--line { background: transparent; border-color: currentColor; }
.btn--line:hover { background: rgba(127,127,127,.12); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  transition: background-color var(--fast) ease, border-color var(--fast) ease;
}
.icon-btn:hover { background: var(--white); border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s2);
  max-width: var(--max); margin: 0 auto; padding: var(--s2) var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
}
.nav__mark { font: 700 19px/1 var(--display); letter-spacing: -0.02em; text-decoration: none; justify-self: start; }
.nav__links { display: flex; gap: 2px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-pill); }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px;
  border-radius: var(--r-pill); text-decoration: none; font-size: 15px; color: var(--ink-2);
  transition: background-color var(--fast) ease, color var(--fast) ease;
}
.nav__links a:hover, .nav__links a[aria-current="true"], .nav__links a[aria-current="page"] { background: var(--white); color: var(--ink); }
.nav__cta { justify-self: end; }

/* ---------- hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.hero__panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--panel); border-radius: var(--r-panel);
  padding: var(--s5) var(--s5) 0;
  display: grid; grid-template-areas: "stage" "name";
  container-type: inline-size;
}
/* Intro text sits over the top corners of the portrait area */
.hero__top { grid-area: stage; align-self: start; position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); }
.hero__lead { display: grid; gap: var(--s3); justify-items: start; }
.hero__role { font: 600 clamp(20px, 2.1vw, 28px)/1.15 var(--display); letter-spacing: -0.01em; }
.hero__intro { max-width: 300px; display: grid; gap: var(--s3); }
.hero__intro p { color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s1); }

/* Portrait stands on a hairline; the name sits below it, never on top */
.hero__stage {
  grid-area: stage; position: relative; z-index: 1;
  height: clamp(420px, 58vh, 620px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
/* Scaled up and pushed down so the face fills the frame and the shirt is cropped at the line */
.hero__portrait {
  position: absolute; left: 50%; bottom: -35%; translate: -50% 0;
  height: 145%; width: auto; max-width: none;
  filter: grayscale(1) contrast(1.06) brightness(1.02);
}

.hero__name {
  grid-area: name;
  font-size: 16.4cqi; line-height: .8; letter-spacing: -0.055em; font-weight: 750;
  font-variation-settings: "opsz" 96;
  margin: 0 -0.04em; padding: var(--s4) 0 calc(var(--s4) + .04em);
  white-space: nowrap; text-align: center;
  color: var(--ink);
}
.hero__name span { display: inline-block; }

.hero__status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--white); border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(31,143,85,.16); }

/* Load sequence: portrait rises, then the name, once */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__portrait { animation: rise 900ms var(--ease-out) both; }
  .js .hero__name span { animation: rise 900ms var(--ease-out) both; animation-delay: 220ms; }
  .js .hero__name span + span { animation-delay: 300ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }

/* ---------- clients ---------- */
.clients { padding: var(--s6) 0 0; overflow: hidden; }
.clients__head {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
}
.clients__title { font: 500 15px/1.4 var(--body); color: var(--ink-2); letter-spacing: 0; }

/* Static list: shown when JS or motion is off, otherwise kept for screen readers only */
.clients__list {
  max-width: var(--max); margin: var(--s3) auto 0; padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
}
.clients__list li { font: 600 clamp(20px, 2.2vw, 28px)/1.2 var(--display); letter-spacing: -0.02em; color: #6F6F6A; }
.clients.is-live .clients__list {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Two rows drifting in opposite directions; page scroll speeds them up or reverses them */
.marquee { display: none; }
.clients.is-live .marquee {
  display: grid; gap: clamp(4px, .6vw, 8px); padding: var(--s3) 0 var(--s1);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee__row { display: flex; width: max-content; will-change: transform; animation: marquee var(--dur, 60s) linear infinite; }
.marquee__row--rev { animation-direction: reverse; }
.marquee__group { display: flex; align-items: center; flex-shrink: 0; }
.marquee__item {
  font: 700 clamp(24px, 3vw, 42px)/1.1 var(--display); letter-spacing: -0.035em;
  font-variation-settings: "opsz" 48;
  padding: 0 clamp(14px, 1.6vw, 24px); white-space: nowrap; color: var(--ink);
  transition: color var(--mid) ease;
}
.marquee__row--rev .marquee__item { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.marquee__row--rev .marquee__item:hover { color: var(--ink); }
.marquee__row:not(.marquee__row--rev) .marquee__item:hover { color: #8A8A85; }
.marquee__star { width: clamp(10px, 1vw, 14px); height: auto; flex: none; fill: var(--ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .clients.is-live .marquee { display: none; }
  .clients.is-live .clients__list { position: static; width: auto; height: auto; margin: var(--s3) auto 0; padding: 0 var(--gutter); overflow: visible; clip: auto; white-space: normal; }
}

/* ---------- statement ---------- */
.statement { max-width: 1000px; margin: 0 auto; padding: var(--s8) var(--gutter); }
.statement p {
  font: 600 clamp(28px, 4vw, 52px)/1.12 var(--display); letter-spacing: -0.025em;
  text-align: center; text-wrap: balance;
}

/* ---------- section heads ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: var(--s3); flex-wrap: wrap;
  padding-bottom: var(--s4); border-bottom: 1px solid var(--ink);
}
.section-head h2, .section-head h1 { font-size: clamp(44px, 7vw, 104px); letter-spacing: -0.045em; line-height: .9; }
.section-head p { color: var(--ink-2); font-size: 15px; }

/* ---------- visual work index ---------- */
.work, .product { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) var(--s8); }
.row {
  display: grid; grid-template-columns: minmax(240px, 4fr) 8fr; gap: var(--s5);
  padding: var(--s5) 0; border-bottom: 1px solid var(--line);
}
.row__text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.row__text h3 { font-size: clamp(26px, 2.6vw, 34px); }
.row__text > p { color: var(--ink-2); max-width: 36ch; }
.row__text .btn { margin-top: auto; }

.row__media { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); align-items: start; }
.thumb {
  position: relative; display: block; padding: 0; border: 0; cursor: zoom-in;
  border-radius: var(--r-media); overflow: hidden; background: var(--line);
  aspect-ratio: 4 / 5;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 600ms var(--ease-out); }
.thumb:hover img { transform: scale(1.03); }

.decks { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.deck {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s4);
  min-height: 200px; padding: var(--s3); border-radius: var(--r-media);
  background: var(--panel); text-decoration: none; border: 1px solid var(--line);
  transition: background-color var(--fast) ease, border-color var(--fast) ease;
}
.deck:hover { background: var(--white); border-color: var(--ink); }
.deck__title { font: 600 22px/1.15 var(--display); letter-spacing: -0.015em; }
.deck__meta { font-size: 14px; color: var(--ink-2); }

/* ---------- product ---------- */
.cases { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s4); padding-top: var(--s5); }
/* Each case study sits in its own card; outer radius = screen radius + padding so the corners nest */
.case {
  display: grid; gap: var(--s3); align-content: start;
  padding: var(--s2) var(--s2) var(--s4); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-panel);
}
.case .case__text { padding: 0 var(--s2); }
.screen {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); cursor: zoom-in; text-align: left;
  border-radius: var(--r-media); overflow: hidden; background: var(--white);
}
.screen__bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.screen__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.screen__view { display: block; aspect-ratio: 4 / 3.3; overflow: hidden; }
.screen__view img { width: 100%; height: auto; transform: translateY(0); transition: transform 1200ms var(--ease-out); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .screen:hover .screen__view img, .screen:focus-visible .screen__view img {
    transform: translateY(calc(-100% + var(--view-h, 400px)));
    transition-duration: var(--pan-ms, 8000ms); transition-timing-function: linear;
  }
}
/* A landscape cover zoomed to fill the frame, centred on the phones; it doesn't scroll */
.screen--fill .screen__view img { width: 100%; height: 100%; object-fit: cover; object-position: 69% center; }
.screen.screen--fill:hover .screen__view img, .screen.screen--fill:focus-visible .screen__view img { transform: scale(1.03); transition: transform 600ms var(--ease-out); }
.case__text { display: grid; gap: var(--s1); max-width: 52ch; }
.case__text h3 { font-size: clamp(26px, 2.6vw, 34px); }
.case__text p { color: var(--ink-2); }
.case__text .case__tag {
  justify-self: start; order: -1; padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--ink);
}

.product__more { display: flex; justify-content: center; padding-top: var(--s5); }

/* ---------- product page ---------- */
.product--page { padding-top: var(--s5); }
/* Two equal columns; every frame is the same shape so cards line up */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7) var(--s4); padding-top: var(--s5); }
.project { display: grid; grid-template-rows: auto 1fr; gap: var(--s3); align-content: start; }
.project .screen__view { aspect-ratio: 4 / 3.3; }
/* Landscape covers sit whole inside the same frame instead of scrolling */
.screen--still .screen__view { display: grid; place-items: center; }
.screen--still .screen__view img { width: 100%; height: 100%; object-fit: contain; }
.screen.screen--still:hover .screen__view img, .screen.screen--still:focus-visible .screen__view img { transform: scale(1.02); transition: transform 600ms var(--ease-out); }
.project__text { display: grid; gap: var(--s2); justify-items: start; max-width: 48ch; }
.project__text h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.035em; }
.project__text > p:not(.project__tags) { color: var(--ink-2); }
.project__tags { display: flex; flex-wrap: wrap; gap: var(--s1); }
.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
}
.tag--live { background: var(--white); border-color: var(--white); }
.tag .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(31,143,85,.16); }
.facts { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin: 0; padding-top: var(--s1); }
.facts div { display: grid; gap: 2px; }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; font-size: 15px; }
.project__actions { display: flex; flex-wrap: wrap; gap: var(--s1); padding-top: var(--s1); }
.product--page + .contact { margin-top: 0; }

/* Prototype window: phone-shaped for apps, wide for websites */
.proto {
  width: min(520px, calc(100vw - 32px)); height: min(94dvh, 1000px); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 24px; background: #111; color: var(--on-ink); overflow: hidden;
}
.proto--web { width: min(1320px, calc(100vw - 32px)); }
.proto[open] { display: flex; flex-direction: column; }
.proto::backdrop { background: rgba(20,20,20,.7); backdrop-filter: blur(6px); }
@media (prefers-reduced-motion: no-preference) {
  .proto[open] { animation: pop 260ms var(--ease-out); }
}
.proto__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: 12px 12px 12px 20px; }
.proto__bar h2 { font-size: 18px; letter-spacing: -0.01em; }
.proto__actions { display: flex; align-items: center; gap: var(--s2); }
.proto__out { font-size: 14px; color: var(--on-ink-2); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; min-height: 44px; align-items: center; }
.proto__out:hover { color: var(--on-ink); }
.proto .icon-btn { background: #222; border-color: #333; color: var(--on-ink); }
.proto .icon-btn:hover { background: #2c2c2c; border-color: var(--on-ink-2); }
.proto :focus-visible { outline-color: var(--on-ink); }
.proto__stage { position: relative; flex: 1; min-height: 0; }
.proto__stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.proto__loading {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  background: #111; color: var(--on-ink-2); font-size: 14px; text-align: center; padding: var(--s3);
}
.proto__loading[hidden] { display: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #333; border-top-color: var(--on-ink); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.proto__hint { padding: 10px 20px 14px; font-size: 13px; color: var(--on-ink-2); text-align: center; }

/* ---------- experience (same frame as About) ---------- */
.experience {
  max-width: var(--max); margin: 0 auto; padding: var(--s7) var(--gutter);
  display: grid; grid-template-columns: 4fr 8fr; gap: var(--s5);
  border-top: 1px solid var(--ink);
}
.experience h2 { font-size: clamp(44px, 7vw, 104px); letter-spacing: -0.045em; line-height: .9; }
.experience__body { display: grid; gap: var(--s6); }
.jobs { display: grid; }
.job {
  display: grid; grid-template-columns: 170px 1fr; gap: var(--s3);
  padding: var(--s3) 0; border-top: 1px solid var(--line);
}
.job:last-child { border-bottom: 1px solid var(--line); }
.job__when { display: flex; align-items: center; gap: 10px; align-self: start; font-size: 14px; color: var(--ink-2); padding-top: 4px; font-variant-numeric: tabular-nums; }
.job__when .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(31,143,85,.16); flex: none; }
.job h3 { font-size: 20px; letter-spacing: -0.015em; line-height: 1.2; }
.job__where { font-weight: 500; margin-top: 2px; }
.job__where span { font-weight: 400; color: var(--ink-2); }
.job__where span::before { content: ", "; }
.job p:last-child { color: var(--ink-2); margin-top: var(--s1); max-width: 60ch; }
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.extras h3 { font-size: 18px; letter-spacing: -0.01em; margin-bottom: var(--s2); }
.extras p, .extras li { color: var(--ink-2); font-size: 16px; }
.extras p + p, .extras p + .tools { margin-top: var(--s3); }
/* Tool logos on small white tiles */
/* Four per row: Figma, Framer, Photoshop, Illustrator on top; Canva, InDesign, CorelDRAW below */
.extras .tools { display: grid; grid-template-columns: repeat(4, max-content); gap: var(--s1); }
.extras .tools li { margin: 0; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); }
.extras .tools img { width: 26px; height: 26px; }
.extras li + li { margin-top: var(--s1); }
/* Section rule inset to the content width, matching the other section lines */
.experience, .about { position: relative; border-top: 0; }
.experience::before, .about::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--ink);
}

/* ---------- about ---------- */
.about {
  max-width: var(--max); margin: 0 auto; padding: var(--s7) var(--gutter) var(--s8);
  display: grid; grid-template-columns: 4fr 8fr; gap: var(--s5);
  border-top: 1px solid var(--ink);
}
.about h2 { font-size: clamp(44px, 7vw, 104px); letter-spacing: -0.045em; line-height: .9; }
.about__body { display: grid; gap: var(--s3); max-width: 62ch; }
.about__lead { font: 500 clamp(22px, 2.2vw, 28px)/1.3 var(--display); letter-spacing: -0.015em; }
.about__body > p:not(.about__lead) { color: var(--ink-2); }
.about__sub { font-size: 22px; margin-top: var(--s4); }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s5); }
.steps li { counter-increment: step; display: grid; gap: 6px; padding-top: var(--s2); border-top: 1px solid var(--line); }
.steps li::before { content: counter(step); font: 600 14px/1 var(--body); color: var(--ink-2); }
.steps strong { font: 600 19px/1.2 var(--display); }
.steps span { color: var(--ink-2); font-size: 16px; }

/* ---------- contact ---------- */
.contact {
  max-width: calc(var(--max) - 2 * var(--gutter)); margin: 0 auto var(--s5); padding: var(--s8) var(--s5);
  background: var(--ink); color: var(--on-ink); border-radius: var(--r-panel);
  display: grid; justify-items: center; gap: var(--s4); text-align: center;
  width: calc(100% - 2 * var(--gutter));
}
.contact h2 { font-size: clamp(36px, 5.5vw, 76px); letter-spacing: -0.04em; max-width: 14ch; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1); }
.contact .btn--line { color: var(--on-ink); }
.contact__social { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1) var(--s4); margin-top: var(--s2); }
.contact__social a { display: inline-flex; min-height: 44px; align-items: center; color: var(--on-ink-2); text-decoration: none; }
.contact__social a:hover { color: var(--on-ink); text-decoration: underline; text-underline-offset: 4px; }
.contact :focus-visible { outline-color: var(--on-ink); }

/* ---------- footer ---------- */
.footer { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); overflow: hidden; container-type: inline-size; }
.footer__row { display: flex; justify-content: space-between; gap: var(--s2); font-size: 14px; color: var(--ink-2); padding-bottom: var(--s3); }
.footer__row a { display: inline-flex; min-height: 44px; align-items: center; margin-top: -12px; }
.footer__name {
  font: 750 16.6cqi/.78 var(--display); letter-spacing: -0.055em; white-space: nowrap; text-align: center;
  margin: 0 -0.04em -0.1em; color: #D6D6D2; user-select: none;
}

/* ---------- gallery dialog ---------- */
.gallery {
  width: min(1240px, calc(100vw - 32px)); height: min(92dvh, 1000px); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 24px; background: var(--panel); color: var(--ink);
  overflow: hidden;
}
.gallery[open] { display: flex; flex-direction: column; }
.gallery::backdrop { background: rgba(20,20,20,.55); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) {
  .gallery[open] { animation: pop 260ms var(--ease-out); }
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.gallery__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.gallery__head h2 { font-size: clamp(24px, 3vw, 34px); }
.gallery__head p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.gallery__filters { display: flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s2) var(--s4) 0; }
.gallery__filters:empty { display: none; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 14px;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.gallery__grid { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3) var(--s4) var(--s4); }
.gallery__cols { columns: 4 220px; column-gap: var(--s2); }
.gallery__grid .thumb { aspect-ratio: auto; width: 100%; margin-bottom: var(--s2); break-inside: avoid; }
.gallery__grid .thumb img { height: auto; }

.viewer { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); }
.viewer[hidden] { display: none; }
.viewer__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
.viewer__bar p { font-size: 14px; color: var(--ink-2); }
.viewer__nav { display: flex; gap: var(--s1); }
.viewer__scroll { flex: 1; min-height: 0; overflow: auto; padding: var(--s3); background: var(--paper); }
.viewer__scroll img { margin: 0 auto; max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 10px 40px -20px rgba(0,0,0,.4); }
/* Normal-shaped images fit the screen; tall boards and web pages scroll */
.viewer__scroll.is-fit { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viewer__scroll.is-fit img { max-height: 100%; width: auto; object-fit: contain; }
.viewer__scroll[hidden] { display: none; }

/* Carousel badge on gallery tiles: stack icon + slide count */
.thumb__badge {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px 5px 7px; border-radius: var(--r-pill);
  background: rgba(20,20,20,.72); color: #fff; font-size: 12px; font-weight: 600; line-height: 1;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.thumb__badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

/* Carousel viewer: one slide at a time, swipe or scroll sideways */
.carousel { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.carousel[hidden] { display: none; }
.carousel__track {
  flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline-offset: -4px; }
.carousel__slide {
  flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; padding: var(--s3) var(--s7); min-height: 0;
}
/* Whole slide always visible: fit within the frame's height and width */
.carousel__slide img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px -20px rgba(0,0,0,.4); }
.carousel__nav { position: absolute; top: calc(50% - 40px); z-index: 1; }
.carousel__nav--prev { left: var(--s3); }
.carousel__nav--next { right: var(--s3); }
.carousel__nav:disabled { opacity: .35; cursor: default; }
.carousel__meta { display: flex; justify-content: center; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3) var(--s3); }
.carousel__count { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 48px; }
.carousel__dots { display: flex; flex-wrap: wrap; justify-content: center; }
.carousel__dots button {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center;
}
.carousel__dots button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background-color var(--fast) ease, transform var(--fast) ease; }
.carousel__dots button[aria-current="true"]::before { background: var(--ink); transform: scale(1.2); }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .row { grid-template-columns: 1fr; gap: var(--s3); }
  .row__text .btn { margin-top: var(--s1); }
  .about, .experience { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  /* Phones: just the pill nav. The name is already big in the hero, and Contact / "Get in touch" cover the CTA */
  .nav { grid-template-columns: 1fr; padding-top: 12px; padding-bottom: 12px; }
  .nav__mark, .nav__cta { display: none; }
  /* Pill hugs its links and sits centred, so the gaps stay even instead of stretching to the screen edges */
  .nav nav { grid-column: 1; grid-row: 1; justify-self: center; }
  .nav__links { justify-content: center; gap: 2px; }
  .nav__links a { padding: 0 14px; min-height: 40px; }

  .hero__panel { padding: var(--s3) var(--s3) 0; border-radius: 24px; grid-template-areas: "top" "stage" "name"; }
  .hero__top { grid-area: top; flex-direction: column; gap: var(--s3); }
  .hero__lead { gap: var(--s2); }
  .hero__intro { max-width: none; }
  .hero__stage { height: 92cqi; margin: 0 calc(-1 * var(--s3)); }
  .hero__name { font-size: 16.4cqi; padding: var(--s3) 0 calc(var(--s3) + .04em); }
  .hero__status { order: -1; font-size: 13px; }

  .statement { padding: var(--s7) var(--gutter); }
  .row__media { grid-template-columns: repeat(2, 1fr); }
  .row__media .thumb:nth-child(3) { display: none; }
  .decks { grid-template-columns: 1fr; }
  .deck { min-height: 0; }
  .cases { grid-template-columns: 1fr; gap: var(--s5); }
  .projects { grid-template-columns: 1fr; gap: var(--s6); }
  .proto, .proto--web { width: 100vw; height: 100dvh; border-radius: 0; }
  .steps { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: var(--s1); }
  .extras { grid-template-columns: 1fr; gap: var(--s4); }
  .extras .tools li { width: 40px; height: 40px; border-radius: 10px; }
  .extras .tools img { width: 22px; height: 22px; }
  .contact { padding: var(--s7) var(--s3); }
  .footer__name { font-size: 16.6cqi; }

  .gallery { width: 100vw; height: 100dvh; border-radius: 0; }
  .gallery__head, .gallery__filters { padding-left: var(--s2); padding-right: var(--s2); }
  .gallery__grid { padding: var(--s2); }
  .gallery__cols { columns: 2; }
  .carousel__slide { padding: var(--s2); }
  .carousel__nav { display: none; } /* swipe on phones; dots and keyboard still work */
  .viewer__detail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
}
