/* ═══════════════════════════════════════════
   Muaz Portfolio — minimal, plain CSS
   No build step. Works on GitHub Pages.
═══════════════════════════════════════════ */

:root {
  --grid-line: rgba(255, 255, 255, 0.028);
  --header-bg: rgba(10, 10, 11, 0.8);
  --card-bg: rgba(17, 17, 20, 0.85);
  --code-bg: #07070a;
  --code-text: #c4c4cc;
  --bg: #0a0a0b;
  --surface: #111114;
  --surface-2: #17171b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --radius: 14px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5.5rem 0; border-top: 1px solid var(--border); }

/* ── HEADER ─────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em;
  text-decoration: none;
}
.brand span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 1.8rem; }
.nav a {
  font-size: 0.9rem; color: var(--muted); text-decoration: none;
  transition: color 0.2s;
}
.nav a:hover { color: var(--text); }
.nav .nav-cta {
  color: var(--text);
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.nav .nav-cta:hover { border-color: var(--accent); color: var(--accent-hover); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border-strong); border-radius: 10px;
  cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── TYPOGRAPHY ─────────────────────────── */
.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 1.2rem;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.03em;
  max-width: 820px;
}
h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.2;
}
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.lead {
  margin-top: 1.4rem; max-width: 680px;
  font-size: 1.1rem; color: var(--muted); line-height: 1.7;
}

/* ── HERO ───────────────────────────────── */
.hero { padding-top: 7rem; padding-bottom: 5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.availability {
  margin-top: 1.4rem; font-size: 0.9rem; color: var(--subtle);
}
.availability::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; margin-right: 0.5rem; vertical-align: middle;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.4rem; border-radius: 999px;
  font-size: 0.92rem; font-weight: 600; text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #ffffff; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-top: 4rem;
}
.stats li { background: var(--surface); padding: 1.6rem 1.5rem; }
.stats strong {
  display: block; font-size: 2rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.1;
}
.stats span { font-size: 0.88rem; color: var(--muted); }

/* ── SECTION HEAD ───────────────────────── */
.section-head {
  display: flex; flex-direction: column; gap: 0.6rem;
  margin-bottom: 2.8rem; max-width: 640px;
}
.section-head p { color: var(--muted); font-size: 1rem; }

/* ── PROJECT GRID ───────────────────────── */
.project-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.project {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.project:hover { border-color: var(--border-strong); transform: translateY(-3px); background: var(--surface-2); }
.project h3 { font-size: 1.15rem; margin-top: 0.4rem; }
.project p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; flex-grow: 1; }

.project-tag {
  align-self: flex-start;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); padding: 0.25rem 0.6rem;
  border: 1px solid var(--border); border-radius: 999px;
}
.project-link {
  font-size: 0.88rem; font-weight: 600; color: var(--accent);
  margin-top: 0.6rem;
}

.subhead {
  margin: 3.5rem 0 1.2rem;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--subtle);
}
.list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.2rem 1.5rem;
  padding: 0.95rem 0; border-bottom: 1px solid var(--border);
}
.list li:first-child { border-top: 1px solid var(--border); }
.list a { font-weight: 600; text-decoration: none; transition: color 0.2s; }
.list a:hover { color: var(--accent-hover); }
.list span { color: var(--muted); font-size: 0.92rem; }

/* ── EXPERTISE ──────────────────────────── */
.skills {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.skill-card {
  padding: 1.8rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.skill-card.primary { border-color: rgba(59, 130, 246, 0.35); }
.skill-card h3 { font-size: 1.25rem; margin: 0.8rem 0 0.6rem; }
.skill-card p { color: var(--muted); font-size: 0.93rem; line-height: 1.65; }
.skill-level {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.note { margin-top: 1.8rem; color: var(--subtle); font-size: 0.92rem; }

/* ── WRITING ────────────────────────────── */
.writing-card {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 2rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none;
  transition: border-color 0.25s;
}
.writing-card:hover { border-color: var(--border-strong); }
.writing-card p { color: var(--muted); margin-top: 0.4rem; font-size: 0.95rem; }
.writing-card .project-link { white-space: nowrap; margin-top: 0; }

/* ── QUOTES ─────────────────────────────── */
.quotes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.quote {
  padding: 1.8rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 1.2rem;
}
.quote blockquote { color: var(--muted); font-size: 0.98rem; line-height: 1.7; }
.quote figcaption { font-size: 0.85rem; color: var(--subtle); }
.quote figcaption strong { color: var(--text); font-weight: 600; }

/* ── TIMELINE ───────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline li {
  display: grid; grid-template-columns: 180px 1fr; gap: 2rem;
  padding: 1.6rem 0; border-bottom: 1px solid var(--border);
}
.timeline li:first-child { border-top: 1px solid var(--border); }
.timeline .when { font-size: 0.88rem; color: var(--subtle); padding-top: 0.15rem; }
.timeline h3 { margin-bottom: 0.4rem; }
.timeline p { color: var(--muted); font-size: 0.93rem; line-height: 1.65; }

/* ── CONTACT ────────────────────────────── */
.contact {
  text-align: center; padding: 7rem 1.5rem;
  border-top: 1px solid var(--border);
}
.contact h2 { max-width: 680px; margin: 0 auto; }
.contact p {
  color: var(--muted); max-width: 520px; margin: 1.2rem auto 0;
  font-size: 1.05rem;
}
.contact .actions { justify-content: center; }

/* ── FOOTER ─────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
}
.footer-inner p { color: var(--subtle); font-size: 0.88rem; }
.socials { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.socials a {
  font-size: 0.88rem; color: var(--muted); text-decoration: none; transition: color 0.2s;
}
.socials a:hover { color: var(--text); }

/* focus visibility for keyboard users */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 960px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute; top: 64px; left: 1rem; right: 1rem;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    padding: 0.8rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0.8rem; border-radius: 8px; }
  .nav .nav-cta { text-align: center; margin-top: 0.4rem; }

  .section { padding: 4rem 0; }
  .hero { padding-top: 5.5rem; }
  .stats { grid-template-columns: 1fr; }
  .project-grid, .quotes { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 0.5rem; }
  .writing-card { flex-direction: column; align-items: flex-start; }
  .list li { flex-direction: column; }
}

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


/* ── BACKGROUND GRID + GLOW ─────────────── */
/* The grid sits only behind the top of the page and fades out, so it never
   runs behind cards or sections further down. */
body { position: relative; }
.bg-grid {
  position: absolute; top: 0; left: 0; right: 0; height: 760px; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
}
.glow {
  position: absolute; top: -180px; right: 0; z-index: -1;
  width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14), transparent 70%);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-70px, 50px); } }

/* ── HERO ENTRANCE + LAYOUT ─────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 380px);
  gap: 4rem; align-items: center;
}
.hero-text > * { animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-text > *:nth-child(2) { animation-delay: 0.08s; }
.hero-text > *:nth-child(3) { animation-delay: 0.16s; }
.hero-text > *:nth-child(4) { animation-delay: 0.24s; }
.hero-text > *:nth-child(5) { animation-delay: 0.32s; }
.hero-text > *:nth-child(6) { animation-delay: 0.40s; }

.hero-card {
  position: relative;
  padding: 1.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  animation: rise 0.9s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hc-top { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.2rem; }
.hc-top strong { display: block; font-size: 1rem; }
.hc-top span { font-size: 0.85rem; color: var(--muted); }
.hc-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border-strong);
}
.hc-code {
  margin: 0 0 1.2rem; padding: 1rem 1.1rem;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.7; color: var(--code-text);
  overflow-x: auto; white-space: pre;
}
.hc-row {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem;
}
.hc-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
.hc-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.hc-chips span {
  font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.7rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted);
}
.hc-badge {
  position: absolute; bottom: -18px; left: -24px;
  padding: 0.6rem 1rem; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  animation: float 5s ease-in-out infinite;
}

/* ── SCROLL REVEAL ──────────────────────── */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }
/* keep the card hover lift working after reveal */
.project.reveal.in:hover { transform: translateY(-3px); }

/* ── RESPONSIVE ADDITIONS ───────────────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-card { max-width: 420px; }
  .hc-badge { left: 12px; }
}

/* ═══════════════════════════════════════════
   CASE STUDY PAGES
═══════════════════════════════════════════ */
.chip {
  font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.7rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.8rem; }
.back {
  display: inline-block; margin-bottom: 2rem;
  font-size: 0.88rem; color: var(--muted); text-decoration: none; transition: color 0.2s;
}
.back:hover { color: var(--text); }
.case-hero { padding-top: 7rem; padding-bottom: 4rem; }
.case-hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.case-hero .title-sub { color: var(--muted); font-size: 1.25rem; font-weight: 500; margin-top: 0.5rem; }
.case-hero .btn { margin-right: 0.4rem; }
.case-hero .hero-card { margin-top: 0; }
.case-hero .hc-row { margin-bottom: 0; }
.glance dl { display: flex; flex-direction: column; gap: 1rem; }
.glance dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); }
.glance dd { margin: 0.2rem 0 0; font-size: 0.95rem; color: var(--text); }

.case-card {
  padding: 1.8rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.case-card h3 { font-size: 1.2rem; margin: 0.9rem 0 0.6rem; }
.case-card > p { color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.case-card ul { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.case-card li { position: relative; padding-left: 1.2rem; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.case-card li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 6px; height: 6px; border-radius: 50%; background: #f87171;
}
.case-card.solution li::before { background: #22c55e; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.case-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}

.ms {
  display: grid; grid-template-columns: 170px 1fr; gap: 2rem;
  padding: 1.6rem 0; border-bottom: 1px solid var(--border);
}
.ms:first-child { border-top: 1px solid var(--border); }
.ms .when { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); padding-top: 0.2rem; }
.ms h3 { margin-bottom: 0.4rem; }
.ms p { color: var(--muted); font-size: 0.93rem; line-height: 1.65; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.tags span {
  font-size: 0.72rem; font-weight: 600; padding: 0.22rem 0.6rem;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted);
}

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feat {
  padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.25s;
}
.feat:hover { border-color: var(--border-strong); }
.feat .icon { font-size: 1.3rem; margin-bottom: 0.8rem; }
.feat h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.feat p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.shot {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.shot img { width: 100%; height: auto; display: block; }
.shot figcaption { padding: 0.9rem 1.1rem; font-size: 0.88rem; color: var(--muted); }

.stack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.stack-card {
  padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stack-card h3 { font-size: 0.95rem; margin-bottom: 0.2rem; }

.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.role {
  padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.role .num { font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.role h3 { margin: 0.5rem 0 0.4rem; font-size: 1rem; }
.role p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; }

.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.team-card {
  padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.team-card h3 { font-size: 0.98rem; margin-bottom: 0.4rem; }
.team-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

.stats.four { grid-template-columns: repeat(4, 1fr); }
.highlight {
  padding: 2.2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid rgba(59, 130, 246, 0.3);
}
.highlight h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.highlight p { color: var(--muted); line-height: 1.7; max-width: 760px; }

.case-section { padding: 5.5rem 0; border-top: 1px solid var(--border); }
.case-section .section-head { margin-bottom: 2.4rem; }
.app-divider {
  padding: 4rem 0 0; border-top: 1px solid var(--border);
}
.app-divider h2 { margin-bottom: 0.5rem; }
.app-divider p { color: var(--muted); }
.app-divider .app-sub { margin-top: 0.4rem; margin-bottom: 0; }

.cta-block { text-align: center; padding: 6.5rem 0; border-top: 1px solid var(--border); }
.cta-block h2 { max-width: 680px; margin: 0 auto; }
.cta-block p { color: var(--muted); max-width: 540px; margin: 1.2rem auto 0; font-size: 1.05rem; }
.cta-block .actions { justify-content: center; }

@media (max-width: 960px) {
  .feat-grid, .shots { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: repeat(2, 1fr); }
  .stats.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .two-col, .stack-grid, .roles, .feat-grid, .shots, .team { grid-template-columns: 1fr; }
  .ms { grid-template-columns: 1fr; gap: 0.4rem; }
  .case-hero { padding-top: 5.5rem; }
  .highlight { padding: 1.5rem; }
}

/* ═══════════════════════════════════════════
   LEANER CASE STUDIES: bold features + character animation
═══════════════════════════════════════════ */
.js .ch {
  display: inline-block; opacity: 0; transform: translateY(0.55em);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .split.in .ch { opacity: 1; transform: none; }

.bold-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--border);
}
.bold-feat {
  padding: 2.2rem 1.6rem 2.2rem 0; border-bottom: 1px solid var(--border);
}
.bold-feat:nth-child(odd) { border-right: 1px solid var(--border); }
.bold-feat:nth-child(even) { padding-left: 2rem; }
.bold-feat h3 {
  font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 0.7rem;
}
.bold-feat p { color: var(--muted); font-size: 0.95rem; max-width: 380px; }

.build-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem;
  padding: 1.3rem 0; border-bottom: 1px solid var(--border);
}
.build-row .when { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.build-row p { color: var(--muted); font-size: 0.95rem; }

.tech-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tech-row span {
  font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
  padding: 0.6rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
}

.lean-hl { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; max-width: 720px; }

@media (max-width: 720px) {
  .bold-grid { grid-template-columns: 1fr; }
  .bold-feat:nth-child(odd) { border-right: none; }
  .bold-feat:nth-child(even) { padding-left: 0; }
  .build-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* chip fix: style only the chip itself, not the per-letter spans inside it */
.tech-row > span {
  font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
  padding: 0.6rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: inline-block;
}
.tech-row .ch { border: none; background: none; padding: 0; }

/* open source */
.repo-group { margin-top: 2.6rem; }
.repo-group:first-of-type { margin-top: 0; }
.repo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.repo-card {
  display: flex; flex-direction: column; gap: 0.7rem; padding: 1.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.repo-card:hover { border-color: var(--border-strong); transform: translateY(-3px); background: var(--surface-2); }
.repo-card.reveal.in:hover { transform: translateY(-3px); }
.repo-card h3 { font-size: 1.05rem; font-weight: 700; }
.repo-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.repo-card .tags span { font-size: 0.7rem; }
@media (max-width: 960px) { .repo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .repo-grid { grid-template-columns: 1fr; } }

/* word-safe split text and app icon */
.split .w { display: inline-block; white-space: nowrap; }
.app-icon {
  width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--border-strong); margin-bottom: 1.2rem; display: block;
}

/* keep section content aligned with the hero (section padding should not drop side padding) */
.case-section { padding-top: 5.5rem; padding-bottom: 5.5rem; padding-left: 0; padding-right: 0; }
.case-section.container { padding-left: 1.5rem; padding-right: 1.5rem; }
.cta-block.container { padding-left: 1.5rem; padding-right: 1.5rem; }
@media (max-width: 720px) {
  .case-section { padding-top: 4rem; padding-bottom: 4rem; }
}

/* client logos and tech logos (from the GitHub profile README) */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.logo-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  min-height: 130px; padding: 1.3rem 1rem; text-align: center; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.logo-tile:hover { border-color: var(--border-strong); transform: translateY(-3px); background: var(--surface-2); }
.logo-tile img { height: 44px; max-width: 100%; object-fit: contain; }
.logo-tile span { font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.tech-logos { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0 1rem; }
.tech-logo {
  display: flex; align-items: center; justify-content: center; width: 58px; height: 58px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.tech-logo img { width: 30px; height: 30px; object-fit: contain; }
@media (max-width: 720px) {
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-tile { min-height: 110px; }
}

/* chips: word spans must not inherit the chip border (fixes the nested pill look) */
.tech-row .w { display: inline-block; white-space: nowrap; border: none; background: none; padding: 0; }
.tech-row .ch { border: none; background: none; padding: 0; }
/* odd stat counts: let the last stat span the full row on phones */
@media (max-width: 720px) {
  .stats.four { grid-template-columns: 1fr 1fr; }
  .stats li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ── FIX: sections with .container must keep side padding (.section sets padding: X 0) ── */
.section.container { padding-left: 1.5rem; padding-right: 1.5rem; }
@media (min-width: 721px) {
  .section.container { padding-left: 2.5rem; padding-right: 2.5rem; }
}

/* ── SCREENSHOT CAROUSEL ───────────────── */
.shots { position: relative; }
.car-controls { display: none; }

@media (max-width: 720px) {
  /* bleed the carousel to the screen edges; one full-width screenshot per view */
  .carousel { margin: 0 -1.5rem; }
  .shots {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    gap: 0; margin: 0; padding: 0;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shot {
    flex: 0 0 100%; max-width: 100%; margin: 0;
    scroll-snap-align: start;
    background: none; border: none; border-radius: 0; overflow: visible;
  }
  .shot img { width: 100%; height: auto; display: block; border-radius: 0; }
  .shot figcaption { padding: 0.8rem 1.5rem 0; }
  .car-controls {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem 0;
  }
  .car-btn {
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    color: var(--text); cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
  }
  .car-btn:disabled { opacity: 0.3; cursor: default; }
  .car-btn:not(:disabled):active { background: var(--surface); }
  .car-count {
    font-size: 0.9rem; font-weight: 600; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
}

/* keep the decorative glow inside the page width (no sideways scroll) */
body { overflow-x: clip; }


/* ── LIGHT THEME ───────────────────────── */
:root[data-theme="light"] {
  --grid-line: rgba(30, 30, 40, 0.035);
  --header-bg: rgba(238, 238, 241, 0.92);
  --card-bg: rgba(248, 248, 250, 0.94);
  --code-bg: #e9e9ee;
  --code-text: #33333d;
  --bg: #eeeef2;
  --surface: #f7f7f9;
  --surface-2: #e8e8ee;
  --border: rgba(30, 30, 40, 0.09);
  --border-strong: rgba(30, 30, 40, 0.18);
  --text: #1f1f26;
  --muted: #5a5a66;
  --subtle: #76767f;
  --accent: #3568d4;
  --accent-hover: #2d5bbd;
}
:root[data-theme="light"] .glow { background: radial-gradient(circle, rgba(53, 104, 212, 0.07), transparent 70%); }
:root[data-theme="light"] .hero-card { box-shadow: 0 18px 40px rgba(30, 30, 40, 0.06); }
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* ── THEME TOGGLE + NAV END ───────────── */
.nav-end { display: flex; align-items: center; gap: 0.6rem; }
.nav { order: 2; }
.nav-end { order: 3; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.nav-toggle { background: var(--surface); color: var(--text); }
.nav-toggle span { background: var(--text); }
@media (min-width: 721px) { .nav-toggle { display: none; } }

/* ── MONOGRAM STAND-IN FOR A MISSING LOGO ── */
.app-mark {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--accent); color: #ffffff;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em;
  border: none;
}
