/* ═══════════════════════════════════════════════════════════
   Muhammad Haris Amer: Portfolio
   Tokens → base → components → sections → responsive

   Shape system (applied everywhere):
     interactive controls (buttons, chips, inputs) → full pill
     containers (cards, bento cells, dialog)       → --r (14px)
     images inside containers                      → --r-sm (10px)

   One accent (signal orange). Neutral greys, no warm/cool mixing.
   Motion only on transform/opacity, all of it gated behind
   prefers-reduced-motion: no-preference.
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- 1. TOKENS ---------- */
:root {
  --bg:          #f3f3f1;
  --bg-alt:      #eaeae7;
  --surface:     #fbfbfa;
  --surface-2:   #e2e2de;
  --line:        rgba(22, 22, 24, 0.11);
  --line-strong: rgba(22, 22, 24, 0.22);

  --ink:         #151517;
  --ink-2:       #4d4e54;
  --ink-3:       #66676d;

  --accent:      #e4521b;   /* fills: buttons, marks */
  --accent-ink:  #b43d0e;   /* accent used as text on --bg (5.4:1) */
  --accent-soft: rgba(228, 82, 27, 0.10);
  --on-accent:   #17110d;   /* text on accent fills (4.9:1) */

  --shadow:      0 1px 2px rgba(40, 30, 20, 0.06), 0 12px 32px -16px rgba(40, 30, 20, 0.22);
  --scrim:       rgba(20, 20, 22, 0.5);

  --r:     14px;
  --r-sm:  10px;
  --shell: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:          #0f0f11;
  --bg-alt:      #141417;
  --surface:     #19191c;
  --surface-2:   #232327;
  --line:        rgba(237, 237, 240, 0.10);
  --line-strong: rgba(237, 237, 240, 0.2);

  --ink:         #ededf0;
  --ink-2:       #a9a9b0;
  --ink-3:       #8b8b93;

  --accent:      #ff6a2b;
  --accent-ink:  #ff8a57;
  --accent-soft: rgba(255, 106, 43, 0.12);
  --on-accent:   #16110e;

  --shadow:      0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -18px rgba(0, 0, 0, 0.6);
  --scrim:       rgba(5, 5, 7, 0.7);

  color-scheme: dark;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 500;
}
.skip-link:focus { top: 12px; }

.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ic { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

.muted { color: var(--ink-3); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
}

/* ---------- 3. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  height: 48px; padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.975rem; font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.btn:active { transform: scale(0.98) translateY(1px); }
.btn .ic { transition: transform 0.3s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }

.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 0.9rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .ic { width: 18px; height: 18px; }

/* ---------- 4. NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;   /* z-scale: nav 40, toast 60, skip-link 100 */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.nav-inner { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }

.brand {
  font-family: var(--f-mono); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.04em;
  padding: 6px 0;
}

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative;
  padding: 8px 12px; border-radius: 999px;
  font-size: 0.925rem; color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.ic-sun { display: none; }
[data-theme="dark"] .ic-sun { display: block; }
[data-theme="dark"] .ic-moon { display: none; }

.menu-btn { display: none; }

.mobile-menu {
  position: absolute; left: 0; right: 0; top: 100%;
  border-block: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg);
  padding-block: 8px 20px;
}
.mobile-menu nav { display: grid; }
.mobile-menu a {
  padding: 14px 0;
  font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ---------- 5. HERO ---------- */
.hero { padding-block: clamp(32px, 6vw, 80px) clamp(48px, 7vw, 96px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.hero-eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  font-size: 0.95rem; color: var(--ink-2);
  margin-bottom: 32px;
}
.hero-eyebrow .sep { width: 24px; height: 1px; background: var(--line-strong); }

.hero-title {
  font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 500;
  max-width: 17ch;
}

.hero-sub {
  margin-top: 24px;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  color: var(--ink-2);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Portrait: a head-and-shoulders circle inside a thin ring, with the
   location pill sitting on the ring's bottom edge. The photo is a tall
   full-length shot, so it is scaled up and offset to frame the face. */
.hero-visual {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1;
  justify-self: center;
  margin: 0 0 22px;
  padding: 12px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.hero-frame {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
}
.hero-portrait {
  position: absolute;
  left: -16%; top: -3%;
  width: 132%; max-width: none; height: auto;
}
.hero-badge {
  position: absolute; left: 50%; bottom: -18px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.35);
  font-size: 0.875rem; color: var(--ink);
  white-space: nowrap;
}
.hero-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

/* Load-in: a short stagger so the eye lands on the headline first. */
@media (prefers-reduced-motion: no-preference) {
  .js .load {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.8s var(--ease) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- 6. PROOF ---------- */
.proof { border-block: 1px solid var(--line); }
.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.proof-grid > div {
  display: flex; flex-direction: column-reverse; gap: 6px;
  padding: 28px 24px;
  border-left: 1px solid var(--line);
}
.proof-grid > div:first-child { border-left: 0; padding-left: 0; }
.proof-grid dt { color: var(--ink-3); font-size: 0.9rem; }
.proof-grid dd {
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  font-weight: 500; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- 7. SECTIONS (shared) ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-alt { background: var(--bg-alt); }

.head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.head .eyebrow { margin-bottom: 14px; }
.head h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -0.035em; }
.head p { margin-top: 16px; max-width: 60ch; color: var(--ink-2); font-size: 1.075rem; }

/* Scroll reveal */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: var(--d, 0ms);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- 8. ABOUT ---------- */
.about-lead {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 28ch;
}

.about-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(40px, 5vw, 64px);
}
.about-copy { display: grid; gap: 18px; color: var(--ink-2); max-width: 65ch; font-size: 1.05rem; }

.about-side h3 { font-size: 1rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.9rem;
}

/* ---------- 9. SKILLS BENTO ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.cell {
  position: relative;
  padding: 28px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.cell h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.cell ul { margin-top: 18px; display: grid; gap: 8px; color: var(--ink-2); font-size: 0.95rem; }
.cell-note { margin-top: 8px; color: var(--ink-2); }

.cell-mark { position: absolute; top: 24px; right: 24px; width: 22px; height: 22px; fill: var(--ink-3); }

.cell-flutter { grid-column: span 4; background: var(--surface-2); border-color: transparent; }
.cell-flutter h3 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); letter-spacing: -0.035em; }
.cell-flutter .cell-note { color: var(--accent-ink); font-weight: 500; }
.cell-flutter ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; font-size: 1rem; color: var(--ink); }

.cell-ios     { grid-column: span 2; }
.cell-android { grid-column: span 2; }
.cell-rn      { grid-column: span 2; }

.cell-maps    { grid-column: span 2; }

.cell-backend { grid-column: span 3; background: var(--surface-2); border-color: transparent; }
.cell-ai      { grid-column: span 3; }
.cell-backend ul, .cell-ai ul {
  grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px;
  font-family: var(--f-mono); font-size: 0.875rem;
}

/* Evidence under each skill: the projects that back the claim up */
.cell { display: flex; flex-direction: column; }
.cell ul { margin-bottom: 24px; }
.cell-proof {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  font-size: 0.85rem; color: var(--ink-3);
}
.cell-proof-n { font-family: var(--f-mono); font-size: 0.8rem; color: var(--accent-ink); }
.cell-proof a {
  color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.cell-proof a:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- 10. WORK: FEATURED ---------- */
.featured {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.feat { grid-column: span 7; }
.feat:nth-child(4n + 2), .feat:nth-child(4n + 3) { grid-column: span 5; }
/* An odd card out takes the whole row instead of leaving a gap */
.feat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.feat:last-child:nth-child(odd) .phones { padding-top: 40px; }
.feat:last-child:nth-child(odd) .phones img { width: auto; height: 100%; }
.feat:last-child:nth-child(odd) .site-desktop { width: 68%; margin-left: 7%; }
.feat:last-child:nth-child(odd) .site-phone { right: 12%; width: 15%; }

.feat-link {
  display: block; width: 100%;
  text-align: left; background: none; border: 0; padding: 0;
}
.feat-media {
  position: relative;
  height: clamp(300px, 32vw, 440px);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
}
.feat-media > * { transition: transform 0.8s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .feat-link:hover .feat-media > * { transform: scale(1.025); }
}

/* Store screenshots: a row of phones rising from the bottom edge */
.phones {
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: flex-end; gap: 4%;
  padding: 10% 8% 0;
}
.phones img {
  width: 27%; aspect-ratio: 9 / 18;
  object-fit: cover; object-position: top;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid var(--line-strong); border-bottom: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Live-site capture: desktop shot with the phone view overlapping */
.site { position: absolute; inset: 0; padding: 7% 7% 0; }
.site-desktop {
  width: 88%;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid var(--line-strong); border-bottom: 0;
  box-shadow: var(--shadow);
}
.site-phone {
  position: absolute; right: 6%; bottom: 0;
  width: 24%;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid var(--line-strong); border-bottom: 0;
  box-shadow: var(--shadow);
}

.feat-body { padding: 18px 2px 0; }
.feat-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-3);
}
.feat-body h3 {
  margin-top: 8px;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem); letter-spacing: -0.03em;
  display: flex; align-items: center; gap: 10px;
}
.feat-body h3 .ic { width: 20px; height: 20px; color: var(--ink-3); transition: transform 0.3s var(--ease), color 0.2s; }
.feat-link:hover h3 .ic { transform: translate(3px, -3px); color: var(--accent-ink); }
.feat-body p { margin-top: 6px; color: var(--ink-2); max-width: 52ch; }

/* ---------- 11. WORK: ARCHIVE ---------- */
.archive { margin-top: clamp(80px, 10vw, 128px); }
.archive-head h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.03em; }
.archive-head p { margin-top: 10px; color: var(--ink-2); }

.archive-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 28px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font-size: 0.875rem; color: var(--ink-2);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.filter:hover { color: var(--ink); border-color: var(--ink-3); }
.filter:active { transform: scale(0.97); }
.filter i { font-style: normal; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-3); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter[aria-pressed="true"] i { color: color-mix(in srgb, var(--bg) 65%, var(--ink)); }

.search {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 16px; min-width: 260px;
  border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-3);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 0.925rem; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); opacity: 1; }

.archive-count { margin-top: 24px; font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-3); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 12px;
  margin-top: 14px;
}
.arc {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start;
  width: 100%; height: 100%;
  padding: 16px;
  text-align: left;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.arc:hover { border-color: var(--line-strong); }
.arc:active { transform: scale(0.99); }

.arc-icon {
  position: relative;
  width: 52px; height: 52px; border-radius: var(--r-sm);
  background: var(--surface-2);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-weight: 600; font-size: 0.9rem; color: var(--ink-2);
  overflow: hidden;
}
.arc-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.arc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.arc h4 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.arc-year { font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-3); }
.arc p { margin-top: 3px; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
.arc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.tag {
  display: inline-block;
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--ink-2);
}
.tag-live { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }

.arc[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .arc.entering { animation: arcIn 0.45s var(--ease) both; animation-delay: var(--cd, 0ms); }
}
@keyframes arcIn { from { opacity: 0; transform: translateY(8px); } }

.archive-empty[hidden] { display: none; }
.archive-empty {
  display: grid; justify-items: start; gap: 14px;
  margin-top: 14px; padding: 32px;
  border-radius: var(--r); border: 1px dashed var(--line-strong);
  color: var(--ink-2);
}

/* ---------- 12. PROCESS ---------- */
.process {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.process-head { position: sticky; top: calc(var(--nav-h) + 32px); }
.process-head h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -0.035em; }
.process-head p { margin-top: 16px; color: var(--ink-2); max-width: 40ch; }

.steps { display: grid; gap: 0; counter-reset: none; }
.step {
  padding: 28px 0 28px 28px;
  border-left: 2px solid var(--line);
  transition: border-color 0.5s var(--ease);
}
.step h3 { font-size: 1.35rem; letter-spacing: -0.025em; transition: color 0.5s var(--ease); }
.step p { margin-top: 8px; color: var(--ink-2); max-width: 56ch; }

/* As each step scrolls into the reading zone its rule lights up,
   so the sequence reads in order. */
.js .step { border-left-color: var(--line); }
.js .step h3 { color: var(--ink-3); }
.js .step.is-on { border-left-color: var(--accent); }
.js .step.is-on h3 { color: var(--ink); }

/* ---------- 13. CONTACT ---------- */
.contact-title {
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.5rem);
  letter-spacing: -0.045em; line-height: 1.02;
  max-width: 14ch;
}
.contact-lede { margin-top: 20px; max-width: 54ch; color: var(--ink-2); font-size: 1.1rem; }

.contact-email {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin-top: clamp(36px, 5vw, 56px);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.email-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: clamp(1.4rem, 0.9rem + 2.6vw, 2.75rem);
  font-weight: 500; letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease), color 0.2s;
}
.email-link:hover { background-size: 100% 2px; }
.email-link .ic { width: 0.8em; height: 0.8em; color: var(--accent-ink); }

.contact-links {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-top: 28px;
}
.contact-links a {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.contact-links a:hover { border-color: var(--line-strong); }
.contact-links a:active { transform: scale(0.99); }
.contact-links .ic { width: 20px; height: 20px; color: var(--ink-2); }
.contact-links span { display: grid; line-height: 1.35; }
.contact-links small { font-size: 0.8rem; color: var(--ink-3); }

/* ---------- 14. FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 0.9rem; color: var(--ink-3); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer a { transition: color 0.2s; }
.footer a:hover { color: var(--ink); }
.to-top { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- 15. DIALOG ---------- */
.modal {
  width: min(880px, calc(100% - 32px));
  max-height: min(88dvh, 920px);
  padding: 0; border: 0;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.modal::backdrop { background: var(--scrim); }
.modal-card { position: relative; max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
.modal-close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 1; background: var(--surface); }

@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: modalIn 0.45s var(--ease); }
  .modal[open]::backdrop { animation: fadeIn 0.3s ease; }
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.985); } }
@keyframes fadeIn  { from { opacity: 0; } }

.m-head { padding: 36px 36px 0; }
.m-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-3); }
.m-head h2 { margin-top: 10px; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); letter-spacing: -0.035em; padding-right: 48px; }
.m-tagline { margin-top: 6px; color: var(--ink-2); font-size: 1.1rem; }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.m-shots {
  display: flex; gap: 12px;
  margin-top: 28px; padding: 0 36px 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 36px;
  scrollbar-width: thin;
}
.m-shots img {
  flex: none; height: 380px; width: auto;
  scroll-snap-align: start;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.m-shots .shot-desktop { height: 300px; margin-block: auto; }

.m-body { padding: 28px 36px 36px; display: grid; gap: 18px; }
.m-problem {
  font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.45;
  padding-left: 16px; border-left: 2px solid var(--accent);
  max-width: 60ch;
}
.m-body > p { color: var(--ink-2); max-width: 68ch; }
.m-note { font-size: 0.9rem; color: var(--ink-3); }
.m-body h3 { font-size: 0.95rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-top: 6px; }
.m-hl { display: grid; gap: 10px; }
.m-hl li { display: flex; gap: 10px; }
.m-hl .ic { margin-top: 0.25em; color: var(--accent-ink); }
.m-stack { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--f-mono); }
.m-stack .tag { font-size: 0.78rem; }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.m-actions .btn .ic { transform: none; }

/* ---------- 16. TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 0.9rem; font-weight: 500;
  opacity: 0; transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 17. RESPONSIVE ---------- */
@media (max-width: 1023px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-grid; }
  .nav-actions { margin-left: auto; }

  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-flutter, .cell-backend, .cell-ai { grid-column: span 2; }
  .cell-ios, .cell-android, .cell-rn { grid-column: span 1; }
  .cell-maps { grid-column: span 1; }
}

@media (max-width: 767px) {
  .nav-cta { display: none; }

  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-eyebrow { margin-bottom: 20px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .hero-eyebrow .sep { display: none; }
  .hero-visual { width: min(100%, 320px); justify-self: center; }

  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-grid > div { padding: 22px 0 22px 16px; }
  .proof-grid > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .proof-grid > div:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .about-body { grid-template-columns: 1fr; }

  .bento { grid-template-columns: 1fr; }
  .cell-flutter, .cell-backend, .cell-ai, .cell-ios, .cell-android, .cell-rn, .cell-maps { grid-column: auto; grid-row: auto; }
  .cell { padding: 22px; }
  .cell-flutter ul, .cell-backend ul, .cell-ai ul { grid-template-columns: 1fr; }

  .featured { grid-template-columns: 1fr; gap: 40px; }
  .feat, .feat:nth-child(4n + 2), .feat:nth-child(4n + 3) { grid-column: auto; }

  .archive-controls { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filters {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { scroll-snap-align: start; }
  .search { min-width: 0; }

  .process { grid-template-columns: 1fr; }
  .process-head { position: static; }
  .step { padding: 22px 0 22px 20px; }

  .contact-links { grid-template-columns: 1fr; }

  .modal { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r) var(--r) 0 0; }
  .m-head { padding: 28px 20px 0; }
  .m-shots { padding-inline: 20px; scroll-padding-inline: 20px; }
  .m-shots img { height: 300px; }
  .m-shots .shot-desktop { height: 200px; }
  .m-body { padding: 24px 20px 28px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}
