/* ==========================================================
   Bold, soft & monochrome portfolio — tokens
   Rounded and borderless: tone, not lines, separates things.
   Page = --bg, cards = --surface, tiles inside cards = --tile,
   emphasis = solid --ink, key actions = --cta.
   ========================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #ffffff;
  --surface: #f5f5f5;
  --tile: #f5f5f5;
  --tile-strong: #e2e2e2;
  --ink: #0d0d0d;
  --ink-soft: #555555;
  --line: #e2e2e2;
  --accent: #0d0d0d;
  --accent-text: #0d0d0d;
  --accent-ink: #ffffff;

  /* Raised cards: white with a soft shadow, instead of a grey fill */
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 30px 70px -36px rgba(0, 0, 0, .28);
  --card-panel: #f5f5f5;

  /* One popping colour, kept for the key calls to action. Black text keeps it readable. */
  --cta: #ff5a1f; --cta-hover: #ff7442; --cta-ink: #0b0b0b;

  /* Project cover tints: light, so the screenshots do the talking */
  --peach: #e6e6e6;  --peach-ink: #0d0d0d;
  --sage: #e9e9e9;   --sage-ink: #0d0d0d;
  --butter: #e3e3e3; --butter-ink: #0d0d0d;
  --glow: transparent;
  --dots: rgba(0, 0, 0, .1);

  --shadow: none;
  --radius: 20px;
  --radius-sm: 12px;

  --font-display: "Rubik", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0c; --bg-soft: #242424; --surface: #181818;
    --tile: #181818; --tile-strong: #303030; --card: #161616; --card-shadow: none; --card-panel: #1f1f1f;
    --ink: #f4f4f4; --ink-soft: #aaaaaa; --line: #303030;
    --accent: #f4f4f4; --accent-text: #f4f4f4; --accent-ink: #0c0c0c;
    --peach: #171717; --peach-ink: #f4f4f4; --dots: rgba(255, 255, 255, .07);
    --sage: #1a1a1a;  --sage-ink: #f4f4f4;
    --butter: #1d1d1d; --butter-ink: #f4f4f4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0c; --bg-soft: #242424; --surface: #181818;
  --tile: #181818; --tile-strong: #303030; --card: #161616; --card-shadow: none; --card-panel: #1f1f1f;
  --ink: #f4f4f4; --ink-soft: #aaaaaa; --line: #303030;
  --accent: #f4f4f4; --accent-text: #f4f4f4; --accent-ink: #0c0c0c;
  --peach: #171717; --peach-ink: #f4f4f4; --dots: rgba(255, 255, 255, .07);
  --sage: #1a1a1a;  --sage-ink: #f4f4f4;
  --butter: #1d1d1d; --butter-ink: #f4f4f4;
  color-scheme: dark;
}

/* ==========================================================
   Base
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
/* Land each section's content (not its top padding) just below the header */
section[id] { scroll-margin-top: calc(-1 * clamp(56px, 8vw, 104px)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
::selection { background: var(--ink); color: var(--bg); }
html { scrollbar-color: var(--line) var(--bg); accent-color: var(--accent); caret-color: var(--accent); }
.i { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
/* Only the big headlines get the heaviest weight */
h3, h4 { font-weight: 700; letter-spacing: -0.02em; }
/* Emphasised words sit in a black pill */
em {
  font-style: normal; color: var(--bg); background: var(--ink);
  padding: 0 .26em .03em; border-radius: 999px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 100; }
.skip:focus { left: 16px; }

/* ==========================================================
   Nav
   ========================================================== */
/* A full-width bar that never moves or resizes; on scroll it only gains a frosted background */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  background: transparent;
  transition: background-color .25s ease;
}
.nav.is-scrolled, .nav.menu-open {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
}
main { padding-top: 72px; }
/* Name only, in the CTA colour */
.brand { text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--cta); }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
/* Phone only: opens the section links */
.nav-menu { display: none; padding: 10px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 600 15px/1 var(--font-body); cursor: pointer; }
/* Sun in light mode, moon in dark mode */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; color: var(--ink); cursor: pointer;
  display: grid; place-items: center;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), background-color .2s;
}
.theme-toggle:hover { transform: rotate(-15deg); background: var(--surface); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon .star { fill: currentColor; stroke: none; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* ==========================================================
   Buttons & chips
   ========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 28px; border-radius: 999px;
  font: 700 16px/1 var(--font-body); text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--cta); color: var(--cta-ink); box-shadow: 0 10px 24px -12px rgba(255, 90, 31, .7); }
.btn-primary:hover { background: var(--cta-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--tile-strong); }

/* Tags read as one quiet line of text, separated by dots */
.chips { display: flex; flex-wrap: wrap; gap: 2px 0; list-style: none; padding: 0; margin: 0; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.chips li + li::before { content: "·"; margin: 0 8px; }

.card { background: var(--surface); border-radius: var(--radius); }

/* ==========================================================
   Hero
   ========================================================== */
.hero {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: 24px var(--gutter) clamp(24px, 4vw, 40px);
  display: flex; flex-direction: column;
  /* Fill one screen below the header, with headline, intro and buttons as one centred stack */
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
}
.hero-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: clamp(24px, 3vw, 36px); padding: 24px 0 48px; }
.hero h1 { font-size: clamp(46px, 7vw, 96px); line-height: 1.02; max-width: 14em; }
.underline { white-space: nowrap; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .1em; }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-soft); max-width: 32em; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ==========================================================
   Sections
   ========================================================== */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2, .contact h2 { font-size: clamp(38px, 5.4vw, 68px); }
.section-sub { color: var(--ink-soft); font-size: 18px; margin-top: 12px; }

/* About */
/* One profile card: a tinted panel with the round portrait, name and role; the story beside it */
.about-card {
  display: grid; grid-template-columns: minmax(260px, 0.85fr) 1.6fr;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--card-shadow);
}
.about-profile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: clamp(32px, 4vw, 48px) 28px; background: var(--card-panel);
}
.about-photo { width: min(200px, 72%); height: auto; aspect-ratio: 1; border-radius: 50%; }
.about-name { margin: 20px 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.about-role { margin: 0; font-size: 15px; font-weight: 600; }
.about-place { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.about-copy { padding: clamp(28px, 4.5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.about-copy p { color: var(--ink-soft); }
.about-copy .big { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.38; color: var(--ink); }
.about-copy strong { color: var(--accent-text); font-weight: 600; }
/* Quick facts: small label-over-value pairs in two columns */
.facts { margin: clamp(20px, 3vw, 32px) 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; }
.facts dt { color: var(--ink-soft); font-size: 13px; margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; }

/* ==========================================================
   Projects
   ========================================================== */
/* No card behind each project: the tinted cover is the card */
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 6vw, 72px); }
.project summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(8px, 2vw, 24px);
}
.project summary::-webkit-details-marker { display: none; }
.project summary:focus-visible { outline-offset: 6px; border-radius: var(--radius); }

/* A quiet dot grid, like a design canvas, behind each cover */
.project-cover {
  position: relative; min-height: 320px; aspect-ratio: 16 / 11; border-radius: var(--radius);
  background:
    radial-gradient(circle, var(--dots) 1px, transparent 1.4px) 0 0 / 16px 16px,
    var(--tint);
  overflow: hidden;
}
/* Placeholder shapes for projects without screenshots yet: white panels, no heavy black */
.mock { position: absolute; background: var(--bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 16px 36px -20px rgba(0, 0, 0, .25); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.mock-phone { height: 78%; aspect-ratio: 9/18; left: 20%; top: 11%; border-radius: 22px; border: 5px solid var(--tile-strong); }
.mock-card { width: 38%; height: 30%; right: 12%; bottom: 14%; border-radius: 12px; }
.mock-browser { width: 70%; height: 60%; left: 12%; top: 18%; border-radius: 10px; border-top: 16px solid var(--tile-strong); }
.mock-pill { width: 32%; height: 14%; right: 8%; bottom: 12%; border-radius: 999px; background: var(--tile-strong); }
.mock-tablet { width: 56%; height: 66%; left: 14%; top: 16%; border-radius: 16px; border: 6px solid var(--tile-strong); }
.mock-circle { width: 26%; aspect-ratio: 1; right: 10%; top: 12%; border-radius: 50%; background: var(--tile-strong); }
.project:hover .mock:nth-child(1) { transform: translateY(-6px) rotate(-2deg); }
.project:hover .mock:nth-child(2) { transform: translateY(6px) rotate(3deg); }
.cover-shot {
  /* Fit the whole screenshot inside the cover at any size, never cropped */
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: auto; height: auto; max-width: 78%; max-height: 76%;
  border-radius: 8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .04), 0 24px 48px -24px rgba(0, 0, 0, .35);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.project:hover .cover-shot { transform: translateY(-6px); }
/* Project 1 cover: collaborators' cursors drift around the canvas while the card is hovered */
.cover-live { height: 76%; width: auto; max-width: 78%; aspect-ratio: 2880 / 2048; overflow: hidden; container-type: inline-size; }
.cover-live img { display: block; width: 100%; height: 100%; }
.live-cursor {
  position: absolute; left: var(--x); top: var(--y); display: flex; align-items: flex-start; pointer-events: none;
  animation: cursor-drift-a 3.4s ease-in-out infinite paused;
}
.live-cursor-2 { animation-name: cursor-drift-b; animation-duration: 4.2s; }
.project:hover .live-cursor { animation-play-state: running; }
/* Platform cover: the AI builder's prompt types itself out on hover, then the send button catches the light */
/* Full screen with the Zoom header, trimmed below the templates; spans more of the frame so the prompt is readable */
.cover-describe { aspect-ratio: 2874 / 1780; height: 79.27%; max-width: 88%; max-height: none; }
.describe-type {
  position: absolute; left: 23.208%; top: 27.135%; width: 53.55%; pointer-events: none;
  font: 400 .8302cqw/1.2526cqw "Inter", system-ui, sans-serif; color: #323539; white-space: pre-line;
}
.describe-caret {
  display: inline-block; width: .072cqw; height: .94cqw; margin-left: .036cqw; vertical-align: -.18cqw;
  background: #0b5cff; opacity: 0;
}
.project:hover .describe-caret { opacity: 1; animation: caret-blink 1s steps(1) infinite; }
.cover-describe.is-typing .describe-caret { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }
/* The template chip only appears once typing starts, as if the builder recognised the request */
.cover-describe .describe-chip {
  position: absolute; left: 25.574%; top: 33.146%; width: 12.457%; height: auto; pointer-events: none;
  opacity: 0; transform: scale(.92); transform-origin: left center; transition: opacity .35s ease, transform .35s ease;
}
.cover-describe.is-typing .describe-chip, .cover-describe.is-typed .describe-chip { opacity: 1; transform: none; }
.describe-send { position: absolute; left: 74.913%; top: 33.258%; width: 2.227%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; pointer-events: none; }
.describe-send::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .8) 50%, transparent 75%);
}
.cover-describe.is-typed .describe-send::after { animation: send-sheen 5s ease-in-out .3s infinite; }
/* A slow sweep (about 1.75s), then a long rest before the next one */
@keyframes send-sheen { 0% { transform: translateX(-130%); } 35%, 100% { transform: translateX(130%); } }
.live-cursor svg { width: 1.35cqw; height: 1.35cqw; margin: -0.1cqw 0 0 -0.1cqw; fill: var(--c); stroke: var(--c); stroke-width: 1.2; stroke-linejoin: round; }
.live-cursor span {
  margin: 0.95cqw 0 0 -0.2cqw; padding: 0.4cqw 0.55cqw; border-radius: 999px;
  background: var(--c); color: #fff; font: 500 0.98cqw/1 "Inter", system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 0.2cqw 0.5cqw rgba(0, 0, 0, .15);
}
@keyframes cursor-drift-a { 0%, 100% { translate: 0 0; } 30% { translate: -5cqw 4cqw; } 65% { translate: 3cqw 2cqw; } }
@keyframes cursor-drift-b { 0%, 100% { translate: 0 0; } 35% { translate: 6cqw -4cqw; } 70% { translate: -3cqw 3cqw; } }

.project-summary { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.project-summary h3 { font-size: clamp(28px, 3.2vw, 40px); }
.project-summary p { color: var(--ink-soft); margin: 0; }
.read-more { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 800; color: var(--accent-text); }
.plus { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--cta); }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; background: var(--cta-ink); border-radius: 2px; translate: -50% -50%; transition: rotate .3s ease; }
.plus::after { rotate: 90deg; }
.project[open] .plus::after { rotate: 0deg; }
.when-open { display: none; }
.project[open] .when-open { display: inline; }
.project[open] .when-closed { display: none; }

.project-body { padding: 8px 0 0; animation: reveal .5s cubic-bezier(.16, 1, .3, 1); }
@keyframes reveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
/* Info blocks share the full row like the metrics below; longer entries get more room */
.meta { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 36px; }
.meta div { flex: 1 1 auto; background: var(--tile); border-radius: var(--radius-sm); padding: 14px 16px; }
.meta dt { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.meta dd { margin: 2px 0 0; font-weight: 700; }
.story { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-bottom: 36px; }
.story h4 { font-size: 22px; margin-bottom: 10px; }
.story p { color: var(--ink-soft); }
/* Any number of stats share the row equally */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; margin-bottom: 36px; }
.stat { color: var(--ink); background: var(--tile); border-radius: var(--radius-sm); padding: 18px 20px; }
.stat strong { display: block; font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); font-weight: 700; line-height: 1.1; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.stat span { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gallery figure { margin: 0; }
.shot {
  aspect-ratio: 4 / 3; border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(0,0,0,.035) 14px 28px),
    var(--tile);
}
.gallery .wide { grid-column: 1 / -1; }
.shot-img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--bg-soft); }
.gallery img { cursor: zoom-in; transition: transform .25s ease; }
/* Paired screenshots share one shape so rows line up; the lightbox shows each in full */
.gallery figure:not(.wide) .shot-img { aspect-ratio: 2000 / 1422; object-fit: cover; object-position: top; }
.gallery img:hover { transform: scale(1.01); }
.gallery figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }

/* Phone screens (concept projects): two labelled sets of phones on a tinted canvas */
.phone-set-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.phone-set-title { font-size: 18px; margin: 0; }
.gallery ~ .phone-gallery { margin-top: clamp(36px, 5vw, 56px); }
/* "All N screens" link beside each set title */
.view-all { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; cursor: pointer; font: 600 15px/1 var(--font-body); color: var(--ink-soft); }
.view-all:hover { color: var(--ink); }
.view-all .i { transition: transform .2s; }
.view-all:hover .i { transform: translateX(3px); }
/* The full-sequence button below both sets reuses the ghost button look */
.view-all-btn { display: flex; margin: 0 auto; padding: 14px 24px; color: var(--ink); }
/* Phones are always a quarter of the row wide, so a set of three stays the same size and sits centred */
.phone-set {
  --phone-gap: clamp(14px, 2.5vw, 28px);
  display: flex; justify-content: center; gap: var(--phone-gap);
  padding: clamp(18px, 3vw, 36px); margin-bottom: clamp(28px, 4vw, 44px); border-radius: var(--radius-sm);
  background: radial-gradient(circle, var(--dots) 1px, transparent 1.4px) 0 0 / 16px 16px, var(--peach);
}
.phone-set figure { margin: 0; flex: 0 0 calc((100% - 3 * var(--phone-gap)) / 4); }
.phone-set img { display: block; width: 100%; height: auto; cursor: zoom-in; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .16)); transition: transform .25s ease; }
.phone-set img:hover { transform: translateY(-4px); }
.phone-set figcaption { margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); font-weight: 600; }
@media (max-width: 680px) {
  /* Phones swipe sideways instead of shrinking to thumbnails */
  .phone-set { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .phone-set::-webkit-scrollbar { display: none; }
  .phone-set figure { flex: 0 0 62%; scroll-snap-align: center; }
}

/* Cover with three phones grouped together, the middle one in front */
.cover-phones { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; }
.cover-phones > * { height: 74%; width: auto; margin: 0 -3%; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.cover-phones img { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .18)); }
.cover-phones > :nth-child(2) { height: 86%; position: relative; z-index: 1; }
.project:hover .cover-phones > :nth-child(1) { transform: translateX(-6px) rotate(-2deg); }
.project:hover .cover-phones > :nth-child(3) { transform: translateX(6px) rotate(2deg); }
/* A phone that carries a hover animation on top of its screen */
.cover-phone { position: relative; display: block; }
.cover-phone > img { display: block; height: 100%; width: auto; margin: 0; }

/* Connect cover: the app icon gently grows and shrinks */
.cover-phone > .icon-pulse {
  position: absolute; left: 45.02%; top: 19.28%; width: 11.94%; aspect-ratio: 1; margin: 0;
  border-radius: 31%; overflow: hidden; display: block;
}
.icon-pulse img { display: block; width: 100%; height: 100%; filter: none; }
/* A light sweep across the icon */
.icon-pulse::after {
  content: ""; position: absolute; inset: -30%;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .7) 50%, transparent 62%);
  transform: translateX(-110%);
}
.project:hover .cover-phone > .icon-pulse { animation: icon-pulse 1.8s ease-in-out infinite; }
.project:hover .icon-pulse::after { animation: icon-sheen 1.8s ease-in-out infinite; }
@keyframes icon-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(11, 92, 255, 0); }
  50% { transform: scale(1.15); box-shadow: 0 4px 14px rgba(11, 92, 255, .45); }
}
@keyframes icon-sheen { 0%, 15% { transform: translateX(-110%); } 65%, 100% { transform: translateX(110%); } }

/* VCOIN cover: the big coin spins, rests, then spins again */
.cover-phone > .coin-spin { position: absolute; left: 42.87%; top: 20.97%; width: 14.48%; height: auto; margin: 0; filter: none; }
.project:hover .cover-phone > .coin-spin { animation: coin-spin 2.8s cubic-bezier(.3,.1,.2,1) infinite; }
@keyframes coin-spin { 0% { transform: perspective(300px) rotateY(0deg); } 40%, 100% { transform: perspective(300px) rotateY(720deg); } }

/* Small label for concept work */
.badge { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--tile); color: var(--ink-soft); font-size: 13px; font-weight: 700; letter-spacing: .02em; }

/* Each screenshot sits on a tinted dot-grid canvas (added by script.js) so white screens keep an edge */
.shot-frame {
  padding: clamp(14px, 3vw, 36px); border-radius: var(--radius-sm);
  background: radial-gradient(circle, var(--dots) 1px, transparent 1.4px) 0 0 / 16px 16px, var(--peach);
}
.shot-frame .shot-img { border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 18px 40px -22px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .shot-frame .shot-img { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shot-frame .shot-img { filter: brightness(.9); } }

/* Layout: Carousel, one large framed image at a time */
.gallery-nav { display: none; }
:root[data-gallery="carousel"] .gallery {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
:root[data-gallery="carousel"] .gallery::-webkit-scrollbar { display: none; }
:root[data-gallery="carousel"] .gallery figure { flex: 0 0 100%; scroll-snap-align: start; }
/* Keep each slide short enough that the image, caption and arrows fit on screen together */
:root[data-gallery="carousel"] .gallery .shot-frame { display: flex; justify-content: center; }
:root[data-gallery="carousel"] .gallery figure .shot-img { width: auto; max-width: 100%; max-height: min(520px, 58vh); aspect-ratio: auto; object-fit: contain; }
:root[data-gallery="carousel"] .gallery figcaption { text-align: center; }
:root[data-gallery="carousel"] .gallery-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 18px; }
.gallery-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--tile); color: var(--ink); transition: background .2s;
}
.gallery-btn:hover { background: var(--tile-strong); }
.gallery-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gallery-prev svg { scale: -1 1; }
.gallery-count { min-width: 56px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Layout: Rows, each framed image beside its caption, alternating sides */
:root[data-gallery="rows"] .gallery { grid-template-columns: 1fr; gap: clamp(32px, 5vw, 56px); }
:root[data-gallery="rows"] .gallery figure { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; }
:root[data-gallery="rows"] .gallery figure:nth-child(even) { grid-template-columns: 1fr 1.7fr; }
:root[data-gallery="rows"] .gallery figure:nth-child(even) .shot-frame { order: 2; }
:root[data-gallery="rows"] .gallery figure .shot-img { aspect-ratio: auto; }
:root[data-gallery="rows"] .gallery figcaption { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 500; color: var(--ink); }
@media (max-width: 680px) {
  :root[data-gallery="rows"] .gallery figure,
  :root[data-gallery="rows"] .gallery figure:nth-child(even) { grid-template-columns: 1fr; gap: 12px; }
  :root[data-gallery="rows"] .gallery figure:nth-child(even) .shot-frame { order: 0; }
  :root[data-gallery="rows"] .gallery figcaption { font-size: 16px; }
}

/* Lightbox for case-study images (built in script.js); always dark so screenshots stand out */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: lb-in .25s ease; }
.lightbox::backdrop { background: rgba(10, 10, 10, .9); backdrop-filter: blur(6px); }
@keyframes lb-in { from { opacity: 0; } }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(1240px, calc(100vw - 168px)); }
.lightbox-img { max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); width: auto; height: auto; border-radius: var(--radius-sm); background: #fff; box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .7); }
.lightbox.is-phone .lightbox-img { background: transparent; box-shadow: none; border-radius: 0; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .5)); }
.lightbox-caption { max-width: 62ch; text-align: center; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .82); }
.lightbox-caption:empty { display: none; }
.lightbox-count { position: absolute; top: 26px; left: 24px; font: 700 14px/1 var(--font-body); color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.lightbox-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; transition: background .2s;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .26); }
.lightbox-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 50%; }
.lightbox-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox-close { top: 14px; right: 14px; }
.lightbox-prev { left: 24px; top: 50%; translate: 0 -50%; }
.lightbox-next { right: 24px; top: 50%; translate: 0 -50%; }
.lightbox-prev svg { scale: -1 1; }
.lightbox.single .lightbox-prev, .lightbox.single .lightbox-next { display: none; }
html.lightbox-open { overflow: hidden; }
@media (max-width: 680px) {
  .lightbox-figure { max-width: calc(100vw - 24px); }
  .lightbox-img { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); border-radius: 10px; }
  .lightbox-caption { font-size: 14px; padding: 0 8px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 22px; translate: none; }
  .lightbox-prev { left: calc(50% - 60px); }
  .lightbox-next { right: calc(50% - 60px); }
}

/* ==========================================================
   Experience
   ========================================================== */
.timeline { list-style: none; margin: 0 0 40px; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 150px; top: 10px; bottom: 10px; width: 2px; background: repeating-linear-gradient(to bottom, var(--tile-strong) 0 6px, transparent 6px 12px); }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 40px; padding: 18px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 147px; top: 28px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.timeline .when { font-weight: 500; color: var(--ink-soft); font-size: 15px; padding-top: 1px; font-variant-numeric: tabular-nums; }
/* Company is the anchor; the roles under it stay quiet */
.timeline .where { font-weight: 700; font-size: 18px; margin: 0 0 8px; }
.timeline .role + .role { margin-top: 14px; }
.timeline h3 { display: inline; font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: 0; }
.timeline .role-when { margin-left: 10px; white-space: nowrap; color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.timeline .role p { color: var(--ink-soft); margin: 2px 0 0; }
.education { margin: 0 0 40px; color: var(--ink-soft); }
.education strong { color: var(--ink); font-weight: 700; margin-right: 12px; }

/* ==========================================================
   Contact & footer
   ========================================================== */
/* One solid black bubble */
.contact { position: relative; overflow: hidden; padding: clamp(36px, 7vw, 80px); text-align: center; background: var(--ink); color: var(--bg); border: none; border-radius: var(--radius); }
.contact h2 { max-width: 14em; margin: 0 auto 16px; }
.contact p { color: color-mix(in srgb, var(--bg) 70%, var(--ink)); font-size: 19px; max-width: 30em; margin: 0 auto 32px; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.contact .btn-primary { box-shadow: none; }
.contact .btn-ghost { background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); }
.contact .btn-ghost:hover { background: color-mix(in srgb, var(--bg) 26%, transparent); }

.footer { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: 15px; }
.footer p { margin: 0; }
.footer a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px) {
  .about-card { grid-template-columns: 1fr; }
  .about-photo { width: 150px; }
  .project summary { grid-template-columns: 1fr; }
  .project-cover { min-height: 0; aspect-ratio: 16 / 11; }
  /* Short entries pair up two per row; long ones (like Team) take the full row */
  .meta div { min-width: calc(50% - 7px); }
  .story { grid-template-columns: 1fr; gap: 8px; }
  .project summary { gap: 0; }
  .project-summary { padding: 22px 0 0; }
}
@media (max-width: 680px) {
  /* Section links tuck behind the Menu button and drop down below the bar */
  .nav-menu { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 4px var(--gutter) 16px;
    background: var(--bg);
  }
  .nav.menu-open { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav.menu-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 17px; color: var(--ink); }
  .stats { grid-auto-flow: row; grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .timeline::before { left: 7px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 32px; }
  .timeline li::before { left: 4px; top: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Company logos inline with text, in their brand colours */
.logo { display: inline-block; height: 0.78em; width: calc(0.78em * 90.6 / 20.6); vertical-align: -0.04em; fill: #0b5cff; }
:root[data-theme="dark"] .logo-zoom { fill: #6b9bff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-zoom { fill: #6b9bff; } }
/* Wordmarks (Solvvy) stand in for the name, sized like Zoom: cap height ~0.74em on the text baseline.
   The image is cropped to the letters; its baseline sits 111 of 135px down, so the "y" tail hangs below. */
.logo-img { display: inline-block; height: 0.9em; width: auto; vertical-align: -0.153em; }
.org { white-space: nowrap; }
.org-mark { display: inline-block; width: 1.1em; height: 1.1em; margin-right: .3em; vertical-align: -0.2em; object-fit: contain; }
/* Square app-style icons (Eber Health) get rounded corners like an app icon */
.logo-app { border-radius: 24%; }
.orgs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.aside { color: var(--ink-soft); font-weight: 400; }
/* The flask colour comes through a variable so it reaches inside the shared icon */
:root { --tl-flask: #0d2340; }
.tl-flask { fill: var(--tl-flask); }
.tl-bubble { fill: #65c7c7; }
/* Dark mode: lift the darkest brand colours so they stay visible */
:root[data-theme="dark"] { --tl-flask: #e9eef5; }
:root[data-theme="dark"] .logo-imvu { filter: invert(1); }
:root[data-theme="dark"] .logo-solvvy { filter: brightness(1.9) saturate(.85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tl-flask: #e9eef5; }
  :root:not([data-theme="light"]) .logo-imvu { filter: invert(1); }
  :root:not([data-theme="light"]) .logo-solvvy { filter: brightness(1.9) saturate(.85); }
}

/* Dark mode: dim bright screenshots a touch so they don't glare against the charcoal */
:root[data-theme="dark"] .cover-shot { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cover-shot { filter: brightness(.9); } }

/* Gallery images that aren't standard screens (dialogs, tall pages) show whole, never cropped */
.gallery figure.fit .shot-frame { display: flex; align-items: center; justify-content: center; height: calc(100% - 3.6em); }
.gallery figure.fit .shot-img { aspect-ratio: auto; object-fit: contain; width: auto; max-width: 100%; max-height: 520px; }
/* Dialog exports carry their own rounded corners and shadow */
.gallery figure.fit .shot-img[src*="create-"] { background: transparent; box-shadow: none; }

/* Sharper covers: center with layout instead of translate(-50%), which lands on half pixels and softens text */
.cover-live { inset: 0; margin: auto; translate: none; }
