/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

/* ── REACTIVE LAYOUT VARIABLES ──────────────────────────────────────
   --header-h  : actual header height in px, set live by script.js via
                 ResizeObserver so it automatically tracks safe-area
                 insets, orientation changes, and any future resize.
   --col-count : grid columns for service/project grids, also set live.
──────────────────────────────────────────────────────────────────── */
:root {
  --header-h: 68px;   /* JS will overwrite this immediately on load */
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #07080d;
  color: #c8c8d8;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle dot grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(7, 8, 13, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
  height: calc(68px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: flex-end;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 68px;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  text-decoration: none;
  user-select: none;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: max-content;
}

/* Logo wrapped in <a> on inner pages */
nav > a {
  display: flex;
  align-items: center;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo-dot { color: #6366f1; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: #7070a0;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: #fff; }

/* Status link with pulsing dot */
.nav-links a.status-link {
  color: #22d3ee;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-links a.status-link::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22d3ee;
  border-radius: 50%;
  flex-shrink: 0;
  animation: blink 2.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

a:focus-visible, button:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 6px;
  z-index: 101;
  border-radius: 6px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  width: 44px;
  height: 44px;
  position: relative;
}

.hamburger::after {
  content: '';
  position: absolute;
  inset: -6px;
}

.hamburger:hover { background: rgba(255,255,255,0.06); }

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #c8c8d8;
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.2s ease, background 0.2s;
  transform-origin: center;
}

.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── NAV OVERLAY ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 98;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}

.nav-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.nav-open { overflow: hidden; }

/* ── HERO ─ */
.hero {
  min-height: 92vh;
  min-height: 92dvh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -180px;
  width: 580px; height: 580px;
  background: radial-gradient(circle, rgba(99,102,241,0.13) 0%, transparent 68%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34,211,238,0.07) 0%, transparent 68%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-eyebrow::before {
  content: '';
  width: 28px; height: 1.5px;
  background: #6366f1;
}

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3.8rem, 10vw, 7.5rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin-bottom: 1.8rem;
  color: #fff;
}

.hero h1 .name-grad {
  background: linear-gradient(140deg, #818cf8 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead {
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  color: #7070a0;
  margin-bottom: 2.8rem;
  max-width: 46ch;
  line-height: 1.7;
}

.buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  padding: 0.78rem 1.75rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  transition: all 0.22s ease;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}

.btn.primary {
  background: #6366f1;
  color: #fff;
}

.btn.primary:hover {
  background: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}

.btn.outline {
  border: 1.5px solid rgba(255,255,255,0.1);
  color: #9090b8;
  background: transparent;
}

.btn.outline:hover {
  border-color: rgba(99,102,241,0.6);
  color: #fff;
  background: rgba(99,102,241,0.08);
}

/* ── SECTIONS ── */
.section { padding: 110px 0; }

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.7rem;
}

h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 3rem;
  line-height: 1.1;
}

/* ── SERVICE CARDS ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent, #6366f1) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 45%, transparent);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 0 0 1px color-mix(in srgb, var(--accent, #6366f1) 20%, transparent);
}

.service-card:hover::before { opacity: 1; }

.card-header { display: flex; align-items: flex-start; gap: 1rem; }

.card-icon {
  font-size: 1.9rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.card-info { flex: 1; }

.card-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.card-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #6366f1);
  opacity: 0.9;
}

.card-description {
  font-size: 0.875rem;
  color: #6060a0;
  line-height: 1.65;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  gap: 0.5rem;
}

.card-cta {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent, #6366f1);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.2s ease;
}

.service-card:hover .card-cta { gap: 0.6rem; }

.live-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #22d3ee);
  background: color-mix(in srgb, var(--accent, #22d3ee) 12%, transparent);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent, #22d3ee) 25%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}

.service-card.no-link { cursor: default; }
.service-card.no-link:hover {
  transform: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.mc-address {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.83rem;
  color: #8888b0;
  background: rgba(0,0,0,0.35);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.07);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.copy-btn {
  font-size: 0.8rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: #9090b8;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.38rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.copy-btn:hover {
  background: var(--accent, #5dbb63);
  border-color: var(--accent, #5dbb63);
  color: #fff;
}

/* ── GITHUB REPOS ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 { margin-bottom: 0; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

.project-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.project-img {
  height: 90px;
  background: linear-gradient(135deg, #0e0e18, #14142a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333350;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: 100%;
}

.project-content {
  padding: 1.4rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.project-content h3 a { color: inherit; text-decoration: none; }
.project-content h3 a:hover { color: #818cf8; }

.project-content p.description {
  font-size: 0.855rem;
  color: #6060a0;
  line-height: 1.6;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.65rem 0;
  font-size: 0.83rem;
  flex-wrap: wrap;
}

.stars { color: #f4a261; font-weight: 600; }
.project-meta a { color: #818cf8; text-decoration: none; }
.project-meta a:hover { text-decoration: underline; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.tag {
  background: rgba(99,102,241,0.1);
  color: #818cf8;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.77rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(99,102,241,0.15);
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.tag:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* ── CONTACT ── */
.contact-section { text-align: center; }

.contact-text {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: #6060a0;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-links h3 a {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #818cf8;
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

.contact-links h3 a:hover { color: #fff; }

/* ── FOOTER ─ */
footer {
  padding: 2.5rem 0;
  text-align: center;
  color: #333360;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 0.88rem;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

/* ─ ABOUT PAGE ── */
.about-section {
  padding-top: calc(var(--header-h) + 3rem);
}

/* ── INNER PAGE TOP SPACING ── */
.section--page-top {
  padding-top: calc(var(--header-h) + 3rem) !important;
}

@media (max-width: 768px) {
  .section--page-top {
    padding-top: calc(var(--header-h) + 2rem) !important;
  }
}

.about-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 5rem;
  align-items: center;
  padding-bottom: 2rem;
}

.about-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.about-photo-wrap::before {
  content: '';
  position: absolute;
  inset: -28px;
  background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.about-profile-photo {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 32px 64px rgba(0,0,0,0.65);
  position: relative;
  z-index: 1;
}

.about-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 1.25rem;
}

.about-name .name-grad {
  background: linear-gradient(140deg, #818cf8 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-bio {
  font-size: 1.05rem;
  color: #7070a0;
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 52ch;
}

.about-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 4rem 0;
}

/* Skills grid — 3 columns */
.skills-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.skill-group {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.skill-group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--g, #6366f1) 50%, transparent 100%);
}

.skill-group:hover {
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.skill-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 1rem;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.83rem;
  color: #9090b8;
  white-space: nowrap;
}

/* About page CTA */
.about-cta {
  text-align: center;
  padding: 3.5rem 0 1rem;
  position: relative;
}

.about-cta-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.75rem;
}

.about-cta h2 { margin-bottom: 1rem; }
.about-cta p {
  color: #6060a0;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* OLD about grid */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.profile-photo { width: 100%; height: auto; border-radius: 12px; }
.skills-list { list-style: none; }
.skills-list li { padding: 0.4rem 0; color: #7070a0; }
.skills-list li::before { content: '→  '; color: #6366f1; }

/* ── MINECRAFT PLUGINS (Modrinth) ── */
.plugin-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent, #1bd96a);
  background: color-mix(in srgb, var(--accent, #1bd96a) 12%, transparent);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent, #1bd96a) 25%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}

.modrinth-cta {
  text-align: center;
  margin-top: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════════════ */

/* ── 1024px — Tablet ── */
@media (max-width: 1024px) {
  .section { padding: 80px 0; }
  .about-hero { grid-template-columns: 210px 1fr; gap: 3.5rem; }
  .skills-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ── 900px — Narrow tablet ── */
@media (max-width: 900px) {
  .about-hero { grid-template-columns: 180px 1fr; gap: 2.5rem; }
}

/* ── TOUCH DEVICE INTERACTIONS ── */
@media (hover: none) and (pointer: coarse) {
  .service-card:active {
    border-color: color-mix(in srgb, var(--accent, #6366f1) 45%, transparent);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  }
  .service-card:active::before { opacity: 1; }
  .service-card:active .card-cta { gap: 0.6rem; }
  
  .project-card:active {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }
  
  .btn.primary:active {
    background: #818cf8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99,102,241,0.35);
  }
  
  .btn.outline:active {
    border-color: rgba(99,102,241,0.6);
    color: #fff;
    background: rgba(99,102,241,0.08);
  }
  
  .tag:active { background: #6366f1; color: #fff; border-color: #6366f1; }
  .copy-btn:active { background: var(--accent, #5dbb63); border-color: var(--accent, #5dbb63); color: #fff; }
  .nav-links a:active { color: #fff; }
  .contact-links h3 a:active { color: #fff; }
}

/* ── 768px — MOBILE FIXES ── */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger { display: flex; }

  /* ✅ FIX 1: Header alignment & remove bottom line */
  header {
    height: auto;
    min-height: calc(3.8rem + env(safe-area-inset-top, 0px));
    align-items: center;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 0;
    border-bottom: none; /* Removes the line under header */
  }

  nav {
    height: 3.8rem;
    position: relative;
    z-index: 101;
  }

  /* Ensure logo/nav links stay visible & properly stacked */
  .logo, nav > a {
    z-index: 102;
    position: relative;
    color: #fff;
    opacity: 1;
    visibility: visible;
  }

  /* Mobile Navigation Dropdown */
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: rgba(7,8,13,0.97);
    flex-direction: column;
    padding: 0.5rem 1.5rem 2rem;
    gap: 0;
    transform: translateY(-110%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 16px 40px rgba(0,0,0,0.7);
    z-index: 99;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    align-items: flex-start;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links.show { transform: translateY(0); }

  .nav-links a {
    font-size: 1.05rem;
    padding: 0.75rem 0;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.status-link { padding: 0.75rem 0; }

  /* ✅ FIX 2: Remove forced 92dvh height to eliminate empty space */
  .hero {
    min-height: auto;
    padding: calc(var(--header-h) + 2.5rem) 0 3.5rem;
  }

  .hero-eyebrow { margin-bottom: 1rem; }
  .section { padding: 60px 0; }

  /* ✅ FIX 3: Center align section headers & text on mobile */
  .section-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .section-header h2 {
    margin-bottom: 0;
    text-align: center;
  }

  /* Single-column grids */
  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  /* Buttons stack */
  .buttons { flex-direction: column; }
  .btn { width: 100%; max-width: 320px; }

  /* Card improvements */
  .service-card { padding: 1.4rem; }
  .card-footer { flex-wrap: nowrap; gap: 0.5rem; align-items: center; }
  .mc-address {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 100px);
  }

  /* Contact */
  .contact-links { flex-direction: column; align-items: center; gap: 1.25rem; }
  .contact-text { font-size: 0.95rem; }

  /* Modrinth CTA */
  .modrinth-cta .btn { width: 100%; max-width: 320px; }

  /* ✅ FIX 4: About page padding & profile pic visibility */
  .about-section {
    padding-top: 110px; /* Solid fallback + JS variable override */
  }

  .about-hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .about-photo-wrap {
    max-width: 180px;
    margin: 0 auto;
  }

  .about-bio {
    text-align: left;
    font-size: 0.97rem;
    margin: 0 auto 2rem;
    max-width: 100%;
  }

  .about-name { text-align: left; }
  .section-label { text-align: left; }

  /* About skills — single column on mobile */
  .skills-grid-3 { grid-template-columns: 1fr; gap: 0.85rem; }

  /* Old about grid */
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .profile-photo { max-width: 260px; margin: 0 auto; }

  .about-cta .buttons { align-items: center; }
  .about-divider { margin: 2.5rem 0; }
}

/* ── 480px — Small phones ── */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  h2 { font-size: 1.75rem; }
  .hero h1 { font-size: clamp(3.2rem, 12vw, 4.5rem); }
  .service-card { padding: 1.2rem; }
  .project-content { padding: 1.1rem; }
  .card-description { font-size: 0.84rem; }
  .card-name { font-size: 1rem; }
  .hero { padding-bottom: 3rem; }
  .lead { font-size: 0.97rem; margin-bottom: 2rem; }
  .section { padding: 50px 0; }
  footer { padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom, 0px)); }
  .about-name { font-size: 2rem; }
  .skill-group { padding: 1.25rem; }
  .card-footer { gap: 0.4rem; }
  .copy-btn { padding: 0.38rem 0.7rem; font-size: 0.75rem; }
  .mc-address { font-size: 0.78rem; padding: 0.4rem 0.65rem; }
}

/* ── 360px — Very small Android ── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .hero h1 { font-size: 2.8rem; }
  .btn { font-size: 0.88rem; padding: 0.7rem 1.4rem; }
  .logo { font-size: 1.3rem; }
  .nav-links a { font-size: 0.97rem; }
}

/* ── Landscape phone ── */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: 2.5rem;
  }
  .hero h1 { font-size: clamp(2.4rem, 7vw, 3.5rem); margin-bottom: 1rem; }
  .lead { margin-bottom: 1.5rem; }
  .hero-eyebrow { margin-bottom: 0.75rem; }
  .section { padding: 40px 0; }
}
