/* ============================================================
   PORTFOLIO STYLESHEET — redesigned
   Design system (Sections 14–17):
     · Light theme default, dark theme preserved via toggle
     · Single font: Inter · one accent blue (#2563EB)
     · Spacing scale: 4 8 12 16 24 32 48 64
     · Moderate radii, subtle borders, restrained shadows
     · No gradients, glow, blobs, glassmorphism or decorative shapes
   Structure:
     1  Tokens (light + dark)
     2  Reset & base
     3  Utilities (container, section headers, tags, buttons)
     4  Accessibility (skip link, focus, selection, reduced motion)
     5  Navbar + mobile drawer
     6  Hero
     7  Stats bar
     8  About + capability card
     9  Skills
     10 Education
     11 Projects
     12 Design work
     13 Services
     14 Process (How I Work)
     15 CTA banner
     16 Contact
     17 Footer
     18 Scroll-to-top
     19 Modal + lightbox
     20 Sub-pages (projects.html, designs.html)
     21 Responsive (layout-only overrides)
   ============================================================ */

/* ---------- 1. TOKENS (Section 14: light palette default) ---------- */
:root,
[data-theme="light"] {
  --bg-primary: #f8fafc;      /* page background (light gray) */
  --bg-alt: #ffffff;          /* alternating sections */
  --bg-card: #ffffff;         /* cards, form, stats band */
  --text-primary: #0f172a;    /* dark navy/slate */
  --text-secondary: #64748b;  /* medium gray */
  --border: #e2e8f0;          /* light gray borders */
  --border-strong: #cbd5e1;   /* hover borders, outline buttons */
  --accent: #2563eb;          /* primary blue: CTAs, links, labels */
  --accent-hover: #1d4ed8;
  --highlight: #1d4ed8;       /* inline emphasis (hero name) */
  --accent-soft: #eff6ff;     /* icon tiles, step circles */
  --tag-bg: #f1f5f9;          /* tech tag pills */
  --tag-text: #475569;
  --nav-bg: rgba(248, 250, 252, 0.92);
  --input-bg: #f8fafc;
  --on-accent: #ffffff;       /* text/icons on blue */
  --on-dark: #ffffff;         /* headings on navy banner */
  --on-dark-muted: #cbd5e1;   /* body on navy banner */
  --success: #15803d;
  --success-soft: rgba(22, 163, 74, 0.08);
  --success-border: rgba(22, 163, 74, 0.25);
  --ring: rgba(37, 99, 235, 0.22);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.1);

  /* Fonts: body in Inter, headings/display in IBM Plex Sans so the page
     is not set end to end in a single typeface. */
  --font-display: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

  /* Type scale (Section 16) */
  --fs-hero: clamp(2.1rem, 1.2rem + 3.6vw, 3.5rem);   /* ~34 → 56px */
  --fs-section: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); /* ~28 → 40px */
  --fs-card-title: 1.125rem; /* 18px */
  --fs-body: 1rem;           /* 16px */
  --fs-sm: 0.9375rem;        /* 15px */
  --fs-xs: 0.875rem;         /* 14px */
  --fs-tag: 0.8125rem;       /* 13px */

  /* Layout tokens */
  --nav-h: 64px;
  --section-y: 64px;
  --card-pad: 24px;

  /* Radii (moderate) */
  --r-sm: 6px;
  --r: 8px;
  --r-md: 10px;
  --r-lg: 12px;

  --ease: 0.18s ease;
}

/* ---------- Dark theme (toggled — Section 18 keeps the toggle) ---------- */
[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-alt: #0d1526;
  --bg-card: #111c31;
  --text-primary: #e5eaf3;
  --text-secondary: #94a3b8;
  --border: #1e2b42;
  --border-strong: #33445f;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --highlight: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --tag-bg: rgba(148, 163, 184, 0.12);
  --tag-text: #cbd5e1;
  --nav-bg: rgba(11, 17, 32, 0.92);
  --input-bg: #0d1526;
  --on-dark: #ffffff;
  --on-dark-muted: #cbd5e1;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.08);
  --success-border: rgba(74, 222, 128, 0.25);
  --ring: rgba(96, 165, 250, 0.3);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* ---------- 2. RESET & BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: "Inter", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

/* Display elements that should match the heading face */
.logo-text,
.stat-number,
.step-number {
  font-family: var(--font-display);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}
[hidden] {
  display: none !important;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}
.highlight {
  color: var(--highlight);
}

/* Section rhythm (alternating white / light-gray bands) */
.section {
  padding: var(--section-y) 0;
}
.about,
.education,
.design,
.how-i-work,
.contact {
  background: var(--bg-alt);
}

/* ---------- 3. UTILITIES ---------- */

/* Section label (Section 16: small uppercase, letter-spaced, blue) */
.section-label {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  text-align: center;
  font-size: var(--fs-section);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 48px;
  font-size: 1.0625rem;
}

/* Header row for left-aligned sections with a top-right link */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.section-head .section-title {
  text-align: left;
  margin-bottom: 8px;
}
.section-head .section-subtitle {
  text-align: left;
  margin: 0;
  max-width: 640px;
}
.section-link {
  flex-shrink: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  transition: color var(--ease);
}
.section-link:hover {
  color: var(--accent-hover);
}
.section-link span {
  display: inline-block;
  transition: transform var(--ease);
}
.section-link:hover span {
  transform: translateX(3px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  transition: color var(--ease);
}
.text-link:hover {
  color: var(--accent-hover);
}
.text-link span {
  transition: transform var(--ease);
}
.text-link:hover span {
  transform: translateX(3px);
}

/* Tech tag pills (Section 16: 12–13px, light background) */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--tag-text);
  font-size: var(--fs-tag);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-sm);
}

/* Buttons (Section 15: one consistent button style) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r);
  font-weight: 500;
  font-size: var(--fs-sm);
  line-height: 1.2;
  border: 1px solid transparent;
  transition:
    background var(--ease),
    border-color var(--ease),
    color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.btn-primary {
  /* Fixed deep blue: white text reaches AA (5.17:1) in BOTH themes
     (the dark-theme accent #3b82f6 only reaches 3.68:1 with white). */
  background: #2563eb;
  color: var(--on-accent);
}
.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-sm {
  padding: 9px 14px;
  font-size: var(--fs-xs);
}
.btn-full {
  width: 100%;
}
/* Primary button on the dark navy CTA banner */
.btn-cta {
  background: var(--on-dark);
  color: #0f172a;
}
.btn-cta:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* ---------- 4. ACCESSIBILITY (Section 26) ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 1100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: 0 0 var(--r) var(--r);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: top var(--ease);
}
.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
main:focus {
  outline: none;
}

::selection {
  background: #dbeafe;
  color: #0f172a;
}
[data-theme="dark"] ::selection {
  background: rgba(59, 130, 246, 0.35);
  color: #e5eaf3;
}

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

/* ---------- 5. NAVBAR (Section 18) ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.3s ease;
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.nav-container {
  width: min(1200px, 92%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--nav-h);
}

/* Logo: JB monogram + uppercase wordmark */
.logo,
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}
.logo-text {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.logo-accent {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-radius: var(--r);
  transition: color var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--ease);
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-icon {
  display: none;
}

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

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.95rem;
  transition:
    border-color var(--ease),
    background var(--ease);
}
.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-toggle--desktop {
  display: grid;
}
.nav-theme-item {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  padding: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  background: var(--text-primary);
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay behind mobile drawer: dims + blurs the page behind the open drawer.
   Kept outside the navbar in the markup so `position: fixed` resolves against
   the viewport (an ancestor with backdrop-filter becomes the containing block). */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px) saturate(115%);
  -webkit-backdrop-filter: blur(6px) saturate(115%);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}
.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- 6. HERO (Section 3) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.hero-wrapper {
  position: relative;
  z-index: 2;
  width: min(1200px, 92%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  padding: calc(var(--nav-h) + 56px) 0 72px;
}

.hero-content {
  flex: 1;
  max-width: 640px;
}

.hero-greeting {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.hero-greeting .highlight {
  font-weight: 700;
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--accent);
  min-height: 1.6em;
  margin-bottom: 16px;
}
.cursor {
  animation: blink 0.8s infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-subtext {
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 0 32px;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-socials {
  display: flex;
  gap: 12px;
  margin-top: 36px;
}
.hero-socials a {
  width: 40px;
  height: 40px;
  border-radius: 50%; /* Section 22: circular icon buttons */
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition:
    color var(--ease),
    background var(--ease),
    border-color var(--ease),
    transform var(--ease);
}
.hero-socials a:hover {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Hero photo (right column, ~4:5 portrait) */
.hero-photo {
  flex: 0 0 380px;
  display: flex;
  justify-content: center;
}
.hero-photo-inner {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 4 / 5;
}
.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Scroll indicator */
.scroll-down {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color var(--ease);
}
.scroll-down:hover {
  color: var(--accent);
}

/* ---------- 7. STATS BAR (Sections 4 & 17) ---------- */
.stats-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  text-align: center;
  padding: 28px 16px;
}
.stat + .stat {
  border-left: 1px solid var(--border);
}
.stat-number,
.stat-plus {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- 8. ABOUT (Section 5) ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text .section-label {
  text-align: left;
}
.about-heading {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 20px;
}
.about-text p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.7;
}

/* Capability card (right column) */
.capability-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px var(--card-pad);
  box-shadow: var(--shadow-xs);
}
.capability-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0;
}
.capability-item + .capability-item {
  border-top: 1px solid var(--border);
}
.cap-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.cap-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.cap-body p {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* ---------- 9. SKILLS (Section 11) ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.skill-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.skill-col:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.skill-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 14px;
}

.skill-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.skill-list {
  list-style: disc;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
}
.skill-list li {
  margin-bottom: 8px;
}
.skill-list li:last-child {
  margin-bottom: 0;
}
.skill-list li::marker {
  color: var(--accent);
}

/* ---------- 10. EDUCATION (kept from existing site) ---------- */
.education-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}
.education-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.edu-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--r);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: var(--accent);
}
/* College crest replaces the generic icon: fills the tile without cropping
   and keeps the transparent PNG readable on both themes. */
.edu-icon img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  border-radius: calc(var(--r) - 2px);
}

.edu-content {
  flex: 1;
}

.edu-badge {
  display: inline-block;
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.edu-content h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.edu-school,
.edu-date {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.edu-school i,
.edu-date i {
  color: var(--accent);
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
}

.edu-coursework {
  margin-top: 14px;
}
.edu-coursework-label {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
}
.coursework-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- 11. PROJECTS (Sections 6–9 — centerpiece) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.project-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10; /* Section 20: consistent landscape screenshots */
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  overflow: hidden;
  cursor: pointer;
}
.project-image:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.25s ease;
}
.project-card:hover .project-image img {
  transform: scale(1.02); /* slight hover scale only (Section 10) */
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--card-pad);
}
.project-body h3 {
  font-size: var(--fs-card-title);
  font-weight: 600;
  margin-bottom: 8px;
}
.project-desc {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.55;
  margin-bottom: 16px;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* ---------- 12. DESIGN WORK (Section 10 — secondary) ---------- */
/* Image-only gallery: the card IS the poster frame, so the artwork fills it
   edge to edge (no text block under it). The grid is self-justifying — every
   column is as wide as its artwork's native ratio demands, so all four
   designs share one height and none of them is cropped or letterboxed.
   Keep the fr values below in sync with the cards' aspect-ratios. */
.design-grid {
  display: grid;
  grid-template-columns: 0.7071fr 0.7071fr 0.7071fr 0.3966fr;
  gap: 24px;
  align-items: start;
}

/* A-series portrait posters (1587×2245, 2480×3508, 598×843) */
.design-card--poster {
  aspect-ratio: 0.7071;
}
/* Tall event infographic (804×2027) */
.design-card--tall {
  aspect-ratio: 0.3966;
}

.design-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-primary);
  overflow: hidden;
  cursor: zoom-in;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.design-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.design-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.design-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* never crops the artwork */
  transition: transform 0.25s ease;
}
.design-card:hover .design-image {
  transform: scale(1.02);
}

/* Shared media badge: hints that a project screenshot or design opens
   something bigger (case study modal / lightbox). */
.media-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity var(--ease);
}
.project-image:hover .media-zoom,
.project-image:focus-visible .media-zoom,
.design-card:hover .media-zoom,
.design-card:focus-visible .media-zoom {
  opacity: 1;
}

/* ---------- 13. SERVICES (Section 12) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.service-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 14px;
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
}

.service-card p {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

/* ---------- 14. PROCESS / HOW I WORK (Section 13) ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.process-step {
  position: relative;
  text-align: center;
  padding: 0 8px;
}
/* Connecting arrows between steps on desktop */
.process-step:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  top: 24px;
  right: -16px;
  color: var(--border-strong);
  font-size: 1rem;
  line-height: 1;
}

.step-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.process-step p {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

/* ---------- 15. CTA BANNER (Section 21) ---------- */
.cta-section {
  padding: 48px 0;
}
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: #0f172a; /* dark navy, both themes */
  border-radius: var(--r-lg);
  padding: 40px 48px;
}
.cta-text {
  display: flex;
  align-items: center;
  gap: 20px;
}
.cta-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.cta-text h2 {
  color: var(--on-dark);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 6px;
}
.cta-text p {
  color: var(--on-dark-muted);
  font-size: var(--fs-sm);
  max-width: 520px;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
}
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
/* WhatsApp: brand green so clients recognise the channel instantly */
.btn-whatsapp {
  background: #25d366;
  color: #052e16;
}
.btn-whatsapp:hover {
  background: #1fbe59;
  transform: translateY(-1px);
}
.cta-links {
  display: flex;
  gap: 18px;
}
.cta-links a {
  color: var(--on-dark-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 4px 0; /* ≥24px tap target (WCAG 2.5.8) */
  transition: color var(--ease);
}
.cta-links a:hover {
  color: var(--on-dark);
}

/* ---------- 16. CONTACT (Section 21: form preserved) ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 32px;
  box-shadow: var(--shadow-xs);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  resize: vertical;
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.75;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.form-success {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-weight: 500;
  text-align: center;
  font-size: var(--fs-xs);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}
.info-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.info-item > i {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--r);
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.info-item h4 {
  font-size: var(--fs-xs);
  margin-bottom: 2px;
  font-weight: 600;
}
.info-item a,
.info-item p {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  word-break: break-word;
}
.info-item a {
  display: inline-block;
  padding: 5px 0; /* email/phone links: ≥24px tap target (WCAG 2.5.8) */
}
.info-item a:hover {
  color: var(--accent);
}

.contact-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}
.contact-socials h4 {
  margin-bottom: 0;
  white-space: nowrap;
}
.social-icons {
  display: flex;
  gap: 10px;
}
.social-icons a {
  width: 38px;
  height: 38px;
  border-radius: 50%; /* Section 22: simple circular icons */
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition:
    color var(--ease),
    background var(--ease),
    border-color var(--ease),
    transform var(--ease);
}
.social-icons a:hover {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- 17. FOOTER (Section 17: logo · copyright · nav) ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-primary);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.footer-logo .logo-icon {
  width: 26px;
  height: 26px;
}
.footer-logo .logo-text {
  font-size: 0.8125rem;
}

.copyright {
  justify-self: center;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  text-align: center;
}

.footer-nav {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-nav a {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 4px 0; /* ≥24px tap target (WCAG 2.5.8) */
  transition: color var(--ease);
}
.footer-nav a:hover {
  color: var(--accent);
}

/* ---------- 18. SCROLL-TO-TOP ---------- */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease,
    background var(--ease);
  display: grid;
  place-items: center;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ---------- 19. CASE STUDY MODAL + LIGHTBOX ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  place-items: center;
  padding: 16px;
}
.modal.open {
  display: grid;
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition:
    background var(--ease),
    color var(--ease),
    border-color var(--ease),
    transform var(--ease);
  z-index: 5;
}
.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: rotate(90deg);
}

.modal-image {
  margin: -28px -28px 16px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow: hidden;
  line-height: 0;
  position: relative;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.modal-image img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.modal-image-zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity var(--ease);
}
.modal-image:hover .modal-image-zoom {
  opacity: 1;
}

.modal-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
}
.modal-content h3 {
  font-size: 1.3rem;
  margin: 6px 0 12px;
}
#modal-body h4 {
  color: var(--text-primary);
  margin: 16px 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}
#modal-body p,
#modal-body li {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.55;
}
#modal-body ul {
  list-style: disc;
  padding-left: 18px;
}
#modal-body li {
  margin-bottom: 4px;
}
#modal-body li::marker {
  color: var(--accent);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(2, 6, 23, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  animation: lightboxIn 0.2s ease;
}
.lightbox.open {
  display: flex;
}
@keyframes lightboxIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  font-size: 1.3rem;
  display: grid;
  place-items: center;
  transition:
    background var(--ease),
    transform var(--ease);
  z-index: 1;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}
.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  cursor: default;
  animation: lightboxImgIn 0.25s ease;
}
@keyframes lightboxImgIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- 20. SUB-PAGES (projects.html, designs.html) ---------- */
/* Both pages reuse the home sections, so only the page header and the
   wider grids below are new. Top padding keeps content clear of the
   fixed navbar. */
.page-section {
  padding-top: calc(var(--nav-h) + 56px);
}
.page-head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}
.page-title {
  font-size: var(--fs-section);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 48px;
}

/* All-projects page: two wider cards per row (the 1-column rules in the
   responsive section still apply below 641px). */
.projects-grid--wide {
  grid-template-columns: repeat(2, 1fr);
}

/* All-designs page: three posters per row, the tall infographic centred
   across the full width underneath. */
.design-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.design-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.design-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
/* The card already draws the frame; drop its own border inside the item. */
.design-item .design-card {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.design-item-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--card-pad);
}
.design-item-body h3 {
  font-size: var(--fs-card-title);
  font-weight: 600;
  margin-bottom: 8px;
}
.design-item-body p {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.55;
  margin-bottom: 16px;
}
.design-item-actions {
  margin-top: auto;
}
.design-item--feature {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(380px, 100%);
}

/* Business card pair: front and back shown side by side on one row so the
   two sides read as a single piece of work. */
.design-item--pair {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(860px, 100%);
}
.design-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: var(--card-pad);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}
.design-item .design-card--brand {
  aspect-ratio: 1062 / 600; /* native card size */
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

/* Fixed back button on the sub-pages: sits in the page's top padding, so it
   never affects the layout of the content underneath it. */
.page-back {
  position: fixed;
  top: calc(var(--nav-h) + 10px);
  left: max(16px, calc((100% - 1200px) / 2 - 60px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    color var(--ease),
    border-color var(--ease),
    background var(--ease);
}
.page-back:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card);
}
.page-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   21. RESPONSIVE (Section 19) — layout-only overrides.
   Typography scales via clamp(); token overrides handle density,
   so no per-breakpoint font-size duplication.
   ============================================================ */

/* --- Laptop / small desktop --- */
@media (max-width: 1024px) {
  .hero-photo {
    flex: 0 0 320px;
  }
  .cta-banner {
    padding: 32px;
  }
}

/* --- Tablet --- */
@media (max-width: 992px) {
  .hero-wrapper {
    flex-direction: column;
    text-align: center;
    gap: 32px;
    padding-top: calc(var(--nav-h) + 40px);
    padding-bottom: 56px;
  }
  .hero-content {
    max-width: 640px;
  }
  .hero-subtext {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-buttons,
  .hero-socials {
    justify-content: center;
  }
  .hero-photo {
    flex: 0 0 auto;
    order: -1; /* photo first when stacked */
  }
  .hero-photo-inner {
    width: min(280px, 70vw);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr); /* tablet: 2-column projects */
  }

  .design-grid {
    grid-template-columns: repeat(2, 1fr); /* tablet: 2-column design */
  }
  .design-gallery {
    grid-template-columns: repeat(2, 1fr); /* tablet: 2-column gallery */
  }
  /* Match the poster frame so the 2×2 grid stays even */
  .design-card--tall {
    aspect-ratio: 0.7071;
  }

  .skills-grid,
  .services-grid {
    grid-template-columns: repeat(3, 1fr); /* tablet: 3-column */
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 32px;
  }
  .section-head .section-subtitle {
    margin-bottom: 0;
  }
}

/* --- Mobile navigation switch --- */
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }
  .theme-toggle--desktop {
    display: none;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    right: -100%;
    width: min(300px, 85vw);
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 12px 0;
    overflow-y: auto;
    transition: right 0.25s ease;
    z-index: 1000;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.open {
    right: 0;
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 0;
    font-size: var(--fs-sm);
  }
  .nav-link::after {
    display: none;
  }
  .nav-icon {
    display: inline-block;
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.9rem;
  }
  .nav-theme-item {
    display: block;
    margin-top: auto;
    padding: 16px 24px 8px;
    border-top: 1px solid var(--border);
  }
  .nav-theme-item .theme-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 11px 14px;
    color: var(--text-primary);
  }
  .nav-theme-item .theme-toggle:hover {
    transform: none;
  }
  .theme-label {
    font-weight: 500;
    font-size: var(--fs-sm);
  }
  .nav-overlay {
    top: var(--nav-h);
    bottom: 0;
  }
}

/* --- Small tablet / large phone --- */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
    --section-y: 48px;
    --card-pad: 18px;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 36px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr); /* statistics adapt (Section 19) */
  }
  .stat {
    padding: 20px 12px;
  }
  .stat + .stat {
    border-left: 1px solid var(--border);
  }
  .stat:nth-child(odd) {
    border-left: none;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .skills-grid,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 24px;
  }
  .cta-actions {
    align-items: flex-start;
    width: 100%;
  }
  .cta-buttons {
    width: 100%;
  }

  .contact-form {
    padding: 24px;
  }

  /* Process: stack vertically from tablet portrait down (readability) */
  .process-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .process-step {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 0;
  }
  .process-step::after {
    display: none !important; /* no arrows when stacked */
  }
  .step-number {
    margin: 0;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 14px;
  }
  .footer-logo,
  .copyright,
  .footer-nav {
    justify-self: center;
    align-items: center;
  }

  .scroll-down {
    display: none;
  }

  .modal-content {
    padding: 20px 16px;
    max-height: 90vh;
  }
  .modal-image {
    margin: -20px -16px 14px;
  }
}

/* --- Mobile: 1-column for all grids --- */
@media (max-width: 640px) {
  .hero-title {
    font-size: clamp(1.75rem, 1.4rem + 4vw, 2.25rem);
  }
  .hero-subtext {
    font-size: var(--fs-sm);
    margin-bottom: 24px;
  }
  .hero-buttons .btn {
    flex: 1 1 auto;
    min-width: 200px;
  }
  .hero-photo-inner {
    width: min(260px, 78vw);
  }

  .projects-grid,
  .design-grid,
  .design-gallery,
  .skills-grid,
  .services-grid {
    grid-template-columns: 1fr; /* mobile: 1-column everywhere */
  }
  /* Stack the two card sides so each stays legible on a narrow screen */
  .design-pair {
    grid-template-columns: 1fr;
  }
  .page-back {
    padding: 8px 12px;
  }
  /* Back to the artwork's own proportions so nothing is letterboxed */
  .design-card--tall {
    aspect-ratio: 0.3966;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .education-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }
  .edu-school,
  .edu-date {
    justify-content: center;
  }
  .coursework-tags {
    justify-content: center;
  }

  .project-links .btn {
    flex: 1 1 auto;
  }

  .contact-socials {
    flex-wrap: wrap;
  }

  .cta-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .scroll-top {
    width: 38px;
    height: 38px;
    bottom: 16px;
    right: 16px;
  }
}

/* --- Very small phones (≤400px) --- */
@media (max-width: 400px) {
  :root {
    --section-y: 40px;
    --card-pad: 14px;
  }

  .hero-wrapper {
    padding-top: calc(var(--nav-h) + 28px);
    padding-bottom: 40px;
    gap: 24px;
  }
  .hero-buttons .btn {
    min-width: 0;
    width: 100%;
  }

  .stat {
    padding: 16px 8px;
  }
  .stat-label {
    font-size: 0.7rem;
  }

  .logo-text {
    font-size: 0.8125rem;
  }
  .logo-icon {
    width: 26px;
    height: 26px;
  }

  .cta-banner {
    padding: 24px 18px;
  }
  .cta-links {
    gap: 14px;
  }
  .cta-buttons .btn {
    width: 100%;
  }

  .info-item {
    padding: 14px;
  }

  .modal-content {
    padding: 16px 12px;
  }
  .modal-image {
    margin: -16px -12px 12px;
  }
}
