:root {
  --bg: #fdfdfd;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --line: #d9d9d9;
  --accent: #f9d86b;

  --card-yellow: #fdfbd4;
  --card-lavender: #f3f0fd;
  --card-mint: #dcfbee;
  --card-sky: #dcf4fb;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;

  --max: 1080px;
  /* One type and shape scale for every page */
  --fs-h1: clamp(32px, 5vw, 48px);
  --fs-h2: clamp(24px, 3vw, 28px);
  --fs-h3: 20px;
  --fs-card: 15px;
  --fs-label: 12px;
  --radius: 16px;
  --section-gap: 96px;
  --gutter: clamp(16px, 4vw, 40px);
  --surface: #fff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --text: #ececec; --muted: #a0a0a0; --line: #2c2e33;
    --card-yellow: #2d2b17; --card-lavender: #24213a; --card-mint: #15302a; --card-sky: #142b33;
    --surface: #1c1d21; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --text: #ececec; --muted: #a0a0a0; --line: #2c2e33;
  --card-yellow: #2d2b17; --card-lavender: #24213a; --card-mint: #15302a; --card-sky: #142b33;
  --surface: #1c1d21; color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  gap: clamp(20px, 4vw, 36px);
  padding: 24px 0;
  font-size: 15px;
  font-weight: 400;
}
.nav a {
  text-decoration: none;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav sup { font-size: .65em; margin-left: 1px; }

/* ---------- Hero ---------- */
/* Photo and text sit together as one centred group, with a fixed gap
   between them; the photo is sized to roughly match the text column. */
.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 400px);
  justify-content: center;
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
  padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 7vw, 88px);
}
.avatar {
  justify-self: center;
  width: clamp(190px, 24vw, 248px); /* ~80% of the text column height, centred against it */
  top: 6px; /* optical nudge: centred by measurement looks slightly high next to the text */
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 64px;
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), box-shadow .3s ease;
}
.avatar:hover { transform: scale(1.04) rotate(-3deg); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.avatar:active { transform: scale(.96); }
.avatar-hint {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translate(-50%, 6px);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font: 500 12px var(--font-body);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.avatar:hover .avatar-hint,
.avatar:focus-visible .avatar-hint { opacity: 1; transform: translate(-50%, 0); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.roles {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 22px);
  line-height: 1.55;
}
.roles li {
  opacity: 0;
  translate: 0 8px;
  animation: rise .6s ease forwards;
}
.roles li:nth-child(1) { animation-delay: .05s; }
.roles li:nth-child(2) { animation-delay: .2s; }
.roles li:nth-child(3) { animation-delay: .35s; }
.roles li:nth-child(4) { animation-delay: .5s; }
.roles li:nth-child(5) { animation-delay: .65s; }

.tagline {
  margin: 0;
  max-width: 280px;
  font-size: 16px;
}

@keyframes rise { to { opacity: 1; translate: 0 0; } }

.scroll-cue {
  display: block;
  width: max-content;
  margin: 16px auto 0;
  text-decoration: none;
  font-size: 20px;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- Case studies ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h2);
  text-align: center;
  margin: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px;
}

.card {
  display: block;
  text-decoration: none;
}
.card-media {
  position: relative;
  aspect-ratio: 1 / .78;
  /* top band stays white so the device mock-up "pops" out of the colour block */
  background: none;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* Thumbnails floating on the tint: screenshots or phones */
/* the tint is a rounded panel starting 36px down, so screens pop out above it */
.card-media::before {
  content: "";
  position: absolute;
  inset: 36px 0 0;
  border-radius: var(--radius);
  background: var(--tint);
  z-index: -1;
}
.card-media .shot {
  position: relative;
  width: 88%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 5px solid var(--surface);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .3);
  transform: translateZ(30px);
}
.card-media .shot,
.card-media .phones {
  transition: translate .6s cubic-bezier(.22, 1, .36, 1), scale .6s cubic-bezier(.22, 1, .36, 1), box-shadow .6s ease;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  border-radius: 6px;
  transition: object-position 2.4s cubic-bezier(.45, 0, .25, 1), scale 1.2s cubic-bezier(.22, 1, .36, 1);
}
/* Hover slideshow: each screen holds still at full width, top anchored, so no
   edge is cut off; on change it zooms toward the viewer and fades (scale + opacity) as the next
   screen rises into place from slightly smaller underneath it. Only transform,
   scale and opacity animate, so it stays smooth. */
.shot.slides img {
  position: absolute;
  inset: 0;
  opacity: 0;
  scale: .9;
  transform-origin: 50% 0%;
  transition: opacity .9s ease, scale 1.1s cubic-bezier(.22, 1, .36, 1);
  will-change: transform, opacity;
}
.shot.slides img.on { opacity: 1; scale: 1; z-index: 1; }
.shot.slides img.out { opacity: 0; scale: 1.18; z-index: 2; }

.slide-dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  translate: -50% 0;
  display: flex;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .3s ease;
}
.card:hover .slide-dots { opacity: 1; }
.slide-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background .3s ease; }
.slide-dots i.on { background: #fff; }
/* Hover: the frame lifts and grows toward the viewer; screens always show
   at full width so no edge is cut off */
.card:hover .card-media .shot,
.card:hover .card-media .phones {
  translate: 0 -14px;
  scale: 1.07;
}
.card:hover .card-media .shot { box-shadow: 0 44px 70px -30px rgba(0, 0, 0, .42); }
/* the tile rises to meet the screen and its tint deepens a step */
.card-media::before { transition: top .6s cubic-bezier(.22, 1, .36, 1), background-color .4s ease; }
.card:hover .card-media::before,
.card:hover .card-media::after { top: 18px; }
.card:hover .card-media::before { background-color: color-mix(in srgb, var(--tint) 90%, var(--text)); }

/* Car ADAS: two phones; the long screens scroll on hover */
.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6%;
  width: 78%;
  aspect-ratio: 16 / 10;
  transform: translateZ(30px);
}
.phone {
  width: 30%;
  height: 112%;
  border-radius: 20px;
  border: 5px solid #1d1f22;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .35);
}
.phone:nth-child(1) { translate: 0 -8%; }
.phone:nth-child(2) { translate: 0 4%; }
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  transition: object-position 3s cubic-bezier(.45, 0, .25, 1);
}
.card:hover .phone img { object-position: 50% 100%; }

.card-info {
  padding: 16px 4px 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tag {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--text);
}
.card-info h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
}
.card-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-card);
}

.tint-yellow   { --tint: var(--card-yellow); }
.tint-lavender { --tint: var(--card-lavender); }
.tint-mint     { --tint: var(--card-mint); }
.tint-sky      { --tint: var(--card-sky); }

/* ---------- Logos ---------- */
.orgs { padding: var(--section-gap) 0; } /* equal space above the heading and below the band */
.orgs h2 {
  /* same style and spacing as the "Case Studies" heading */
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h2);
  text-align: center;
  margin: 0 0 36px;
}
/* Logos: one still, evenly spaced row. Heights are set per logo so each
   reads with about the same visual weight (wide wordmarks shorter, compact
   marks taller); widths follow each logo's own proportions. */
.logo-row {
  list-style: none;
  margin: 0;
  /* thin lines above and below frame the row without boxing it in */
  padding: 32px 8px;
  border-block: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px 40px;
}
.logo-row img { display: block; width: auto; }
/* Sheen: every few seconds a soft band of light passes across the row, left to
   right, like light catching glass. It's masked to each logo's own shape (--m, set per logo below)
   and staggered by position (--i), so it reads as one sweep. Decorative only. */
.logo-row li {
  position: relative;
  /* a slow, slight zoom-out under the cursor: no lift, no snap, so it reads as
     a quiet response rather than a link */
  transition: scale .8s cubic-bezier(.22, 1, .36, 1);
}
.logo-row li:hover { scale: .92; }
.logo-row li::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .85) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 150% 0;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
  animation: sheen 7s cubic-bezier(.45, 0, .55, 1) infinite;
  animation-delay: calc(1.2s + var(--i, 0) * .16s);
}
.logo-row li:has(> .logo-redseal) { --m: url(../images/logos/redseal.svg?v=3); }
.logo-row li:has(> .logo-amex) { --m: url(../images/logos/amex.svg?v=3); }
.logo-row li:has(> .logo-vmware) { --m: url(../images/logos/vmware.svg?v=3); }
.logo-row li:has(> .logo-cdw) { --m: url(../images/logos/cdw.svg?v=3); }
.logo-row li:has(> .logo-nokia) { --m: url(../images/logos/nokia.svg?v=3); }
@keyframes sheen {
  0% { background-position: 150% 0; }
  16%, 100% { background-position: -50% 0; }
}
.logo-redseal { height: 24px; }
.logo-amex { height: 33px; }
.logo-vmware { height: 34px; }
.logo-cdw { height: 42px; }
.logo-nokia { height: 19px; }
/* Dark mode: RedSeal and VMware swap to light-text versions of their wordmarks */
.logo-row .on-dark { display: none; }
:root[data-theme="dark"] .logo-row .on-light { display: none; }
:root[data-theme="dark"] .logo-row .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-row .on-light { display: none; }
  :root:not([data-theme="light"]) .logo-row .on-dark { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-row li::after { animation: none; display: none; }
  .logo-row li:hover { scale: none; }
}
@media (max-width: 720px) {
  .logo-row { justify-content: center; gap: 28px 36px; padding: 28px 0; }
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding-bottom: 48px;
}
/* Closing band on the home page */
.closer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: 48px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius);
  background: var(--card-yellow);
  text-align: left;
}
.closer h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h2); }
.closer p { margin: 0; color: var(--muted); }
.closer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.closer-actions a,
.pill-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--text);
  text-decoration: none;
  font-weight: 400;
  transition: translate .3s cubic-bezier(.3, 1.6, .5, 1), background .25s ease, color .25s ease;
}
.closer-actions a:hover, .pill-btn:hover { translate: 0 -2px; }
.closer-actions a.primary, .pill-btn.primary { background: var(--text); color: var(--bg); }
.pill-btn { gap: 8px; color: var(--text); }
.pill-btn span { transition: translate .25s ease; }
.pill-btn:hover span { translate: 4px 0; }

/* Featured case study call-to-action, inside the hero's text column */
.hero-cta { display: flex; margin-top: 28px; }
/* Text link CTA: starts on the same left edge as the text above it; the
   highlight underline echoes the tagline's and thickens on hover */
.text-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(color-mix(in srgb, var(--accent) 75%, transparent), color-mix(in srgb, var(--accent) 75%, transparent)) 0 88% / 100% 4px no-repeat;
  transition: background-size .3s ease;
}
.text-link:hover { background-size: 100% 10px; }
.text-link span { transition: translate .25s ease; }
.text-link:hover span { translate: 4px 0; }
.text-link:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 4px; }
@media (max-width: 720px) { .hero-cta { justify-content: center; } }
.footer p { margin: 0 0 16px; font-size: 15px; }
.footer p a { font-weight: 600; }
.footer hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 32px;
}
.footer .nav {
  justify-content: center;
  padding: 0;
  color: var(--muted);
}

/* ---------- Inner pages ---------- */
.page { padding: 48px 0 96px; }
.page h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  margin: 0 0 16px;
}
.page .lede { font-size: 19px; max-width: 640px; color: var(--muted); }
.page h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h2);
  margin: 56px 0 12px;
}
.prose { max-width: 680px; }
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  margin: 40px 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.eyebrow, .card-label, .fact-label, .hmw { font-size: var(--fs-label) !important; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow { margin: 0 0 8px; }
.page h3 { font-family: var(--font-display); font-weight: 500; font-size: 20px; margin: 0 0 8px; }
.page figure { margin: 32px 0; }
.page figure img,
.page figure video.anim { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.walkthroughs { margin-bottom: 32px; }
.walkthroughs figure { margin: 0 !important; }
.page figcaption, .caption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.split.rev > :first-child { order: 2; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
figure.narrow { max-width: 380px; justify-self: center; }

/* Case study */
.cs section { padding-top: var(--section-gap); scroll-margin-top: 64px; }
.cs section > .eyebrow + h2, .cs .eyebrow + .split, .cs .eyebrow + .bigstat { margin-top: 0; }
.cs .split { align-items: start; }
.cs .split figure { margin: 0; }
.cs section figure { margin: 32px 0 0; }
.cs .split > figure { margin: 0; }
.cs .prose > h2:first-child { margin-top: 0; }
.cs section > h2 { margin-top: 0; }
.cs-hero .cover { width: 100%; border-radius: 10px; background: var(--card-sky); margin-top: 0; }
.bigstat { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); margin: 0 0 24px; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.bigstat s { color: var(--muted); text-decoration-thickness: 2px; }
.bigstat span { color: var(--muted); }
blockquote { margin: 24px 0 0; padding-left: 20px; border-left: 3px solid var(--accent); font-family: var(--font-display); font-size: 20px; }
blockquote cite { display: block; margin-top: 6px; font: 400 14px var(--font-body); color: var(--muted); font-style: normal; }
.note-card { padding: 24px; border-radius: 10px; background: var(--card-yellow); }
/* Role / teammate / timeline: one row of equal-height cards under the intro */
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; margin: 36px 0 40px; }
.role-cards .note-card { display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); padding: 24px 26px; }
.role-cards .note-card p { margin: 0; font-size: var(--fs-card); }
.role-cards h3 { margin: 0; font-size: var(--fs-h3); }
.role-cards .note-card.mate { background: var(--card-lavender); }
.role-cards .note-card.time { background: var(--card-mint); }
.mini-tags { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tags li { font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.time h3 b { font-weight: 500; font-variant-numeric: tabular-nums; }
/* one tick per week, filling in once the card is revealed */
.weeks { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; margin-top: auto; padding-top: 8px; }
.weeks i { height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.time.in .weeks i { background: #3fbf8a; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1) backwards; }
@media (max-width: 900px) { .role-cards { grid-template-columns: minmax(0, 1fr); } }
.note-card + .note-card { background: var(--card-lavender); }
.note-card p:last-child { margin-bottom: 0; }
.problems { margin-top: 40px; }
.problems dl { margin: 16px 0 0; }
.problem-art { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.problems dt { font-weight: 600; margin-top: 12px; }
.problems dd { margin: 2px 0 0; color: var(--muted); }
.hmw { margin: 48px 0 6px; color: #8a6d00 !important; }
:root[data-theme="dark"] .hmw { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hmw { color: var(--accent); } }
.usp { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.usp li { padding: 16px; border: 1px solid var(--line); border-radius: 10px; font-weight: 400; }
.usp li::before { content: "✓"; display: block; color: #3fbf8a; font-weight: 700; margin-bottom: 4px; }

/* Feature tabs */
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.tab-list button {
  font: 400 15px var(--font-body);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.tab-list button:hover { border-color: var(--text); }
.tab-list button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-panel p { margin: 0 0 16px; color: var(--muted); }
.tab-panel img { width: 100%; border-radius: 10px; border: 1px solid var(--line); animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; translate: 0 8px; } }

/* Before / after slider */
.compare { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; margin-top: 24px; user-select: none; }
.compare { aspect-ratio: 4 / 3; width: 100%; max-width: 880px; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.compare .after { clip-path: inset(0 0 0 var(--pos)); background: #fff; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: var(--text); pointer-events: none; }
.compare .handle::after { content: "⇆"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.compare:has(input:focus-visible) .handle::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.compare .tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; pointer-events: none; }
.compare .tag.l { left: 12px; } .compare .tag.r { right: 12px; }

/* Gallery + lightbox */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; margin-top: 24px; }
.gallery button, figure.wide button { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); background: #fff; transition: translate .4s cubic-bezier(.22, 1, .36, 1), box-shadow .4s ease; }
.gallery button:hover img { translate: 0 -4px; box-shadow: 0 16px 32px -20px rgba(0, 0, 0, .4); }
.gallery span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); max-height: 92vh; color: #fff; }
.lightbox::backdrop { background: rgba(10, 12, 14, .82); }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; border-radius: 8px; background: #fff; margin: 0 auto; }
.lightbox p { text-align: center; margin: 12px 0 8px; }
.lightbox button { display: block; margin: 0 auto; padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; font: inherit; cursor: pointer; }

.stats { display: flex; flex-wrap: wrap; gap: 48px; margin: 24px 0 32px; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: clamp(40px, 6vw, 56px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--muted); margin-top: 6px; }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.next a { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .25s ease, translate .4s cubic-bezier(.22, 1, .36, 1); }
.next a:hover { border-color: var(--text); translate: 0 -3px; }
.next b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.next span { color: var(--muted); font-size: 14px; }

/* About */
.about { padding-top: 24px; }
.about-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.about-hero h1 .typed { font-weight: 500; }
.deck { position: relative; aspect-ratio: 4 / 5; max-width: 340px; width: 100%; justify-self: center; margin-bottom: 44px; touch-action: pan-y; }
.deck-card {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 10px 10px 44px;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .45);
  cursor: grab;
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg)) scale(var(--s, 1));
  transition: transform .55s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
}
.deck-card.dragging { transition: none; cursor: grabbing; }
.deck-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; pointer-events: none; }
.deck-card figcaption { position: absolute; left: 14px; right: 14px; bottom: 12px; font-family: var(--font-display); font-size: 15px; text-align: center; }
/* Dots under the stack: one per photo, the active one stretches into a pill */
.deck-dots { position: absolute; left: 50%; bottom: -40px; translate: -50% 0; display: flex; gap: 4px; }
.deck-dots button { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.deck-dots button::before { content: ""; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width .35s cubic-bezier(.22, 1, .36, 1), background-color .3s ease; }
.deck-dots button:hover::before { background: var(--muted); }
.deck-dots button[aria-current="true"]::before { width: 22px; background: var(--text); }
.deck-dots button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 999px; }
/* Experience + education: tinted cards with a bouncy icon */
.fun-facts { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; scroll-margin-top: 24px; }
.fact-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--card-yellow);
  overflow: hidden;
  transition: translate .4s cubic-bezier(.3, 1.6, .5, 1), box-shadow .4s ease;
}
.fact-card.edu { background: var(--card-lavender); }
.fact-card:hover { translate: 0 -4px; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .35); }
.fact-card p { margin: 0; font-size: var(--fs-card); }

.fact-card .fact-big { font-family: var(--font-display); font-size: clamp(32px, 4vw, 44px); font-weight: 500; line-height: 1.1; margin: 6px 0 4px !important; }
.fact-big b { font-weight: 500; font-variant-numeric: tabular-nums; }
.fact-icon {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 40px;
  transition: rotate .5s cubic-bezier(.3, 1.6, .5, 1), translate .5s cubic-bezier(.3, 1.6, .5, 1);
}
.exp:hover .fact-icon { rotate: -25deg; }
.edu:hover .fact-icon { translate: 0 -14px; rotate: 12deg; } /* cap toss */
/* one dot per year, lighting up in sequence once the card is revealed */
.years { display: flex; gap: 6px; margin-top: 18px; }
.years i { width: 14px; height: 14px; border-radius: 50%; background: color-mix(in srgb, var(--text) 12%, transparent); transition: background .3s ease, scale .3s cubic-bezier(.3, 1.6, .5, 1); }
.exp.in .years i { background: #f2b705; scale: 1; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.years i:nth-child(1) { animation-delay: .2s !important; } .years i:nth-child(2) { animation-delay: .3s !important; }
.years i:nth-child(3) { animation-delay: .4s !important; } .years i:nth-child(4) { animation-delay: .5s !important; }
.years i:nth-child(5) { animation-delay: .6s !important; } .years i:nth-child(6) { animation-delay: .7s !important; }
.years i:nth-child(7) { animation-delay: .8s !important; } .years i:nth-child(8) { animation-delay: .9s !important; }
@keyframes pop { from { scale: 0; } }

/* Domains: pills pop in one by one; icons wiggle on hover, burst on click */
.domains { padding-top: 48px; }
.domains h2 { margin: 0 0 20px; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h2); }
.domains h2 b { font-weight: 500; color: #c99700; font-variant-numeric: tabular-nums; }
.domains ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.domains.in li { animation: pill-in .5s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 60ms + .15s); }
@keyframes pill-in { from { opacity: 0; scale: .6; translate: 0 12px; } }
.domains button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  font: inherit;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .25s ease, translate .3s cubic-bezier(.3, 1.6, .5, 1), box-shadow .3s ease;
}
.domains button:hover { border-color: var(--text); translate: 0 -3px; box-shadow: 0 10px 20px -14px rgba(0, 0, 0, .4); }
.pill-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card-yellow);
  font-size: 15px;
}
.domains li:nth-child(3n + 2) .pill-icon { background: var(--card-lavender); }
.domains li:nth-child(3n + 3) .pill-icon { background: var(--card-mint); }
.domains button:hover .pill-icon { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { rotate: -14deg; scale: 1.15; } 60% { rotate: 10deg; scale: 1.15; } }

@media (max-width: 720px) {
  .split, .duo, .about-hero { grid-template-columns: 1fr; }
  .split.rev > :first-child { order: 0; }
  .deck { max-width: 300px; }
}

/* Breadcrumb trail */
.crumbs ol { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

/* In-page section bar: sticks to the top, highlights the section in view */
.toc {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  margin: 40px calc(-1 * var(--gutter)) 0;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.toc ol::-webkit-scrollbar { display: none; }
.toc a {
  display: block;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
}
.toc a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.toc a.on { color: var(--bg); background: var(--text); }

/* =================== Interactive layer =================== */

.nav { align-items: center; }
.theme-toggle {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.theme-toggle:hover { transform: rotate(180deg); }
.footer .theme-toggle { display: none; }

/* Hero roles */
.roles li { width: max-content; cursor: default; }
.roles li[data-icon] { cursor: pointer; position: relative; transition: transform .25s ease, color .25s ease; }
.roles li[data-icon]::after {
  content: "";
  top: .32em;
  width: .9em;
  height: .9em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  position: absolute;
  left: calc(100% + 8px);
  opacity: 0;
  transform: translateX(-8px) rotate(-20deg);
  transition: opacity .2s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
/* Line icons for the roles (masked, so they take the text colour) */
.roles li[data-icon="wireframe"], .burst[data-icon="wireframe"] { --icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%222.5%22 y=%223.5%22 width=%2219%22 height=%2217%22 rx=%222.5%22/%3E%3Cpath d=%22M2.5 8h19%22/%3E%3Crect x=%225.5%22 y=%2211%22 width=%226%22 height=%226.5%22 rx=%221%22/%3E%3Cpath d=%22M14 11.5h4.5M14 14.5h4.5M14 17.5h2.5%22/%3E%3C/svg%3E"); }
.roles li[data-icon="puzzle"], .burst[data-icon="puzzle"] { --icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M19.44 7.85c-.05.32.06.65.29.88l1.57 1.57a2.4 2.4 0 0 1 0 3.4l-1.61 1.62a.98.98 0 0 1-.84.27c-.47-.07-.8-.48-.97-.92a2.5 2.5 0 1 0-3.21 3.21c.45.17.86.5.93.97a.98.98 0 0 1-.28.84l-1.61 1.61a2.4 2.4 0 0 1-3.4 0l-1.57-1.57a1.03 1.03 0 0 0-.88-.29c-.49.07-.84.5-1.02.97a2.5 2.5 0 1 1-3.24-3.24c.47-.18.9-.53.97-1.02a1.03 1.03 0 0 0-.29-.88l-1.57-1.57a2.4 2.4 0 0 1 0-3.4L4.23 8.77c.24-.24.58-.35.92-.3.51.08.88.53 1.07 1.01a2.5 2.5 0 1 0 3.26-3.26c-.48-.2-.93-.56-1.01-1.07-.05-.34.06-.68.3-.92l1.53-1.53a2.4 2.4 0 0 1 3.4 0l1.57 1.57c.23.23.56.34.88.29.49-.07.84-.5 1.02-.97a2.5 2.5 0 1 1 3.24 3.24c-.47.18-.9.53-.97 1.02Z%22/%3E%3C/svg%3E"); }
.roles li[data-icon="mountain"], .burst[data-icon="mountain"] { --icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m8 3 4 8 5-5 5 15H2L8 3z%22/%3E%3C/svg%3E"); }
.roles li[data-icon="paddle"], .burst[data-icon="paddle"] { --icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229.5%22 cy=%229.5%22 r=%226.5%22/%3E%3Cpath d=%22m14.2 14.2 5.3 5.3%22/%3E%3Ccircle cx=%2219%22 cy=%225%22 r=%221.6%22/%3E%3C/svg%3E"); }
.roles li[data-icon]:hover { transform: translateX(6px); }
.roles li[data-icon]:hover::after { opacity: 1; transform: none; }
.roles li:first-child { font-weight: 700; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s infinite; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
@media (max-width: 720px) { .roles li { margin: 0 auto; } }

.typed {
  font-weight: 600;
  background: linear-gradient(transparent 60%, color-mix(in srgb, var(--accent) 70%, transparent) 60%);
}
.typed::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1.1em;
  margin-left: 2px;
  vertical-align: -.15em;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.tagline { max-width: 340px; min-height: 3.2em; }

/* Scroll reveal */
[data-reveal] {
  opacity: .35;
  translate: 0 32px;
  transition: opacity .7s ease var(--d, 0ms), translate .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}
[data-reveal].in { opacity: 1; translate: 0 0; }

/* Tilt cards */
.work-grid { perspective: 1200px; }
.card[data-tilt] {
  /* --rx/--ry are eased every frame in JS, so transform needs no CSS transition */
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: opacity .7s ease var(--d, 0ms), translate .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
  will-change: transform;
}
.card-media::after {
  content: "";
  position: absolute;
  inset: 36px 0 0;
  border-radius: var(--radius);
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .4), transparent 50%);
  opacity: 0;
  transition: opacity .5s ease, top .6s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.card:hover .card-media::after { opacity: 1; }
.card-info h3 { display: inline-flex; gap: 6px; }
.card-info h3::after { content: "→"; transition: transform .25s ease; }
.card:hover .card-info h3::after { transform: translateX(6px); }


/* Icon burst: each piece is a small line icon */
.burst svg { width: 100%; height: 100%; display: block; }
.burst[data-icon] { background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.burst {
  position: fixed;
  z-index: 60;
  width: 22px;
  height: 22px;
  color: var(--text);
  pointer-events: none;
  animation: burst .9s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes burst {
  from { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1.1); opacity: 0; }
}

/* Ping-pong */
/* .ball only carries the position (transform); the visible ball is ::before,
   so the squash on a hit can't scale the position and push it sideways. */
.ball {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  pointer-events: none;
  z-index: 70;
  will-change: transform;
}
.ball::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffb347 65%, #e8891c);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25), 0 0 0 10px color-mix(in srgb, #ffb347 18%, transparent);
}
.ball.hit::before { animation: squash .18s ease-out; }
@keyframes squash { 50% { transform: scale(1.25, .8); } }
.rally {
  position: fixed;
  left: 50%; top: 16px;
  translate: -50% 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  z-index: 80;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  translate: -50% 120px;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 400;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: translate .35s cubic-bezier(.3, 1.4, .5, 1), opacity .2s ease;
}
.toast.show { translate: -50% 0; opacity: 1; }

/* Scroll progress */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #f9d86b, #b9a6ff, #7be3bf, #7fd3f0);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 100;
}

/* Konami party mode */
body.party { animation: hue 3s linear infinite; }
body.party .roles li { animation: jiggle .4s ease-in-out infinite alternate; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes jiggle { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; translate: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .avatar { top: 0; }
  .tagline { margin: 0 auto; }
  .work-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .roles li { opacity: 1; translate: none; }
}

/* Line icons (replacing emoji) */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.12em; }
.wave-ico { width: .95em; height: .95em; color: #c99700; }
.pill-icon .ico { width: 16px; height: 16px; color: var(--text); }
.fact-icon .ico { width: 36px; height: 36px; color: var(--text); stroke-width: 1.4; }
.theme-toggle .ico { width: 18px; height: 18px; }

/* Body text is Open Sans Regular; bold text uses the loaded SemiBold rather than a faked Bold */
:where(b, strong) { font-weight: 600; }
/* Text only screen readers hear */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
