/* 
   Ali Nasr Portfolio
   /impeccable animate + /impeccable polish pass applied.
   OKLCH color system, restrained purposeful motion, brand-register layout.
   Anti-references honored: no glass, no blobs, no dark-navy-Inter default.
*/

/* ─── Custom Properties ───────────────────────────────────────────────────── */
:root {
  /* Base palette — warm charcoal tinted toward copper */
  --bg:          oklch(13.5% 0.009 36);
  --bg-muted:    oklch(17.5% 0.012 36);
  --bg-raised:   oklch(19.5% 0.015 36);

  /* Text */
  --text:        oklch(93% 0.012 40);
  --text-muted:  oklch(65% 0.012 40);
  --text-faint:  oklch(40% 0.01 40);

  /* Accent — copper */
  --accent:          oklch(68% 0.16 36);
  --accent-hover:    oklch(73% 0.165 36);
  --accent-muted:    oklch(30% 0.05 36);
  --accent-glow:     oklch(68% 0.16 36 / 0.15);

  /* Structure */
  --border:          oklch(22% 0.015 36);
  --border-strong:   oklch(35% 0.04 36);

  /* Typography */
  --font-display: 'Sora', sans-serif;
  --font-body:    'Geologica', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Easing */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ─── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; line-height: 1.65; }

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

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-muted); }

/* ─── Scroll Progress Bar ───────────────────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ─── Skip Link ─────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 24px;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 0 0 4px 4px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ─── Navigation ─────────────────────────────────────────────────────────────── */
.nav-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: oklch(13.5% 0.009 36 / 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s var(--ease-out-quart),
              background 0.3s var(--ease-out-quart);
}

.nav-container.scrolled {
  border-color: var(--border-strong);
  background: oklch(13.5% 0.009 36 / 0.97);
}

.nav-content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav-logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease-out;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.nav-cta {
  color: var(--bg) !important;
  background: var(--accent);
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600 !important;
  transition: background 0.15s ease-out, transform 0.15s ease-out !important;
}
.nav-cta:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

/* Mobile burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s var(--ease-out-expo), opacity 0.2s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  padding: 16px 28px 24px;
}
.mobile-menu a {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu.open { display: flex; }

/* ─── Hero Section ───────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 28px 80px;
  overflow: hidden;
}

/* Committed copper gradient — brand register, no blobs */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% -10%, oklch(28% 0.06 36 / 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 95% 80%, oklch(22% 0.04 36 / 0.3) 0%, transparent 60%);
  pointer-events: none;
}

/* Subtle grid texture */
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.2;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
}

/* ── Hero entrance animations (staggered) ─── */
.hero-eyebrow,
.hero-title,
.hero-subtitle,
.hero-actions {
  opacity: 0;
  transform: translateY(24px);
}

.hero-eyebrow  { animation: fadeUp 0.7s var(--ease-out-expo) 0.1s forwards; }
.hero-title    { animation: fadeUp 0.8s var(--ease-out-expo) 0.2s forwards; }
.hero-subtitle { animation: fadeUp 0.8s var(--ease-out-expo) 0.35s forwards; }
.hero-actions  { animation: fadeUp 0.7s var(--ease-out-expo) 0.5s forwards; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
  max-width: 14ch;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.4rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 55ch;
  margin-bottom: 44px;
}
.hero-subtitle strong {
  color: var(--text);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease-out-quart),
              border-color 0.2s var(--ease-out-quart),
              transform 0.2s var(--ease-out-quart),
              box-shadow 0.2s var(--ease-out-quart);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-out-quart);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  background: oklch(20% 0.01 36 / 0.5);
  transform: translateY(-1px);
}
.btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.btn-text:hover { color: var(--accent); border-color: var(--accent); }

.btn-disabled {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-faint);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 4px;
  cursor: not-allowed;
}

/* ─── Section Shell ───────────────────────────────────────────────────────────── */
section {
  padding: 108px 0;
  border-top: 1px solid var(--border);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 20px;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 72px;
  line-height: 1.65;
}

/* ─── Shipped Systems / Work ──────────────────────────────────────────────────── */
.section-work { background: var(--bg); }

.project-card {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.project-card:first-of-type { padding-top: 0; }
.project-card:last-of-type { border-bottom: none; padding-bottom: 0; }

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.project-card:nth-of-type(even) .project-grid { direction: rtl; }
.project-card:nth-of-type(even) .project-info,
.project-card:nth-of-type(even) .project-visual { direction: ltr; }

.project-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  line-height: 1.15;
}

.project-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 54ch;
}

.project-specs {
  width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  font-size: 0.9rem;
}

.spec-label {
  font-family: var(--font-mono);
  color: var(--text-faint);
  flex-shrink: 0;
  padding-top: 1px;
}

.spec-val {
  color: var(--text);
  font-weight: 450;
  text-align: right;
  max-width: 60%;
  line-height: 1.4;
}

.project-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Device Mockups (Pure CSS) ──────────────────────────────────────────────── */
.project-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.device-mockup {
  position: relative;
  transition: transform 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo);
}

.project-card:hover .device-mockup {
  transform: translateY(-10px);
  box-shadow: 0 40px 80px oklch(0% 0 0 / 0.5);
}

/* Desktop mockup: minimal framed window */
.desktop-mockup {
  width: 100%;
  max-width: 500px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  box-shadow: 0 20px 60px oklch(0% 0 0 / 0.4);
  overflow: hidden;
}

.mockup-titlebar {
  height: 30px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  flex-shrink: 0;
}

.titlebar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.titlebar-dot:nth-child(1) { background: #ff5f56; }
.titlebar-dot:nth-child(2) { background: #ffbd2e; }
.titlebar-dot:nth-child(3) { background: #27c93f; }

.screen-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: oklch(10% 0.005 36);
}
.screen-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.45s var(--ease-out-expo);
}
.project-card:hover .screen-frame img { transform: scale(1.03); }

/* Mobile mockup */
.mobile-mockup-wrapper {
  position: relative;
  width: 240px;
}

.mobile-mockup {
  width: 240px;
  height: auto;
  border-radius: 34px;
  border: 7px solid var(--border-strong);
  background: var(--bg-raised);
  box-shadow: 
    0 0 0 1px var(--border),
    0 24px 60px oklch(0% 0 0 / 0.5),
    inset 0 1px 0 oklch(100% 0 0 / 0.06);
  overflow: hidden;
  position: relative;
}

.mobile-mockup .notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background: var(--border-strong);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 2;
}

.mobile-mockup .screen-frame {
  aspect-ratio: 9 / 19;
}

/* ─── About ───────────────────────────────────────────────────────────────────── */
.section-about { background: var(--bg-muted); }

.about-grid {
  display: grid;
  grid-template-columns: 5fr 3fr;
  gap: 72px;
  align-items: start;
}

.about-body { display: flex; flex-direction: column; gap: 24px; }

.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.about-body p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 65ch;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.stat-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 24px 20px;
  background: var(--bg);
  transition: border-color 0.2s, transform 0.3s var(--ease-out-quart);
}
.stat-box:hover {
  border-color: var(--border-strong);
  border-left-color: var(--accent-hover);
  transform: translateX(4px);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ─── Skills ──────────────────────────────────────────────────────────────────── */
.section-skills { background: var(--bg); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
}

.skills-column {
  background: var(--bg);
  padding: 36px 32px;
  transition: background 0.2s;
}
.skills-column:hover { background: var(--bg-muted); }

.skills-col-head {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.skills-col-head::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.skills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.skills-list li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.skills-list li strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

/* ─── Process ─────────────────────────────────────────────────────────────────── */
.section-process { background: var(--bg-muted); }

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.process-step {
  background: var(--bg-muted);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background 0.2s;
}
.process-step:hover { background: var(--bg-raised); }

.step-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  background: var(--accent-muted);
  border: 1px solid oklch(35% 0.06 36);
  padding: 4px 10px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.process-step p {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Contact ─────────────────────────────────────────────────────────────────── */
.section-contact { background: var(--bg-muted); }

.contact-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.contact-panel {
  background: var(--bg);
  padding: 60px 52px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 24px;
}

.contact-panel-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  width: 100%;
}

.contact-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.contact-panel p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 42ch;
}

/* ─── Footer ──────────────────────────────────────────────────────────────────── */
.footer-container {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

.footer-content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-content p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.footer-socials a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-socials a:hover { color: var(--accent); }

/* ─── Scroll Reveal (JS-set initial states) ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Stagger delays for child groups */
.reveal-group > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.reveal-group.in-view > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
.reveal-group.in-view > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 80ms; }
.reveal-group.in-view > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 160ms; }
.reveal-group.in-view > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 240ms; }

/* ─── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .project-grid { grid-template-columns: 1fr; gap: 48px; }
  .project-card:nth-of-type(even) .project-grid { direction: ltr; }
  .project-visual { justify-content: flex-start; }
  .desktop-mockup { max-width: 100%; }
  .mobile-mockup-wrapper { margin: 0; }

  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .skills-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-block { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  section { padding: 72px 0; }
  .section-lead { margin-bottom: 48px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .hero-section { padding: 120px 28px 64px; }
  .process-grid { grid-template-columns: 1fr; }
  .contact-panel { padding: 40px 28px; }
  .project-actions { flex-direction: column; align-items: flex-start; gap: 16px; }
  .project-actions .btn-primary { width: 100%; text-align: center; justify-content: center; }
  .footer-content { flex-direction: column; align-items: center; text-align: center; }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-eyebrow, .hero-title, .hero-subtitle, .hero-actions {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .reveal, .reveal-group > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── /impeccable harden ─────────────────────────────────────────────────────── */

/* @supports fallback for browsers without OKLCH */
@supports not (color: oklch(0% 0 0)) {
  :root {
    --bg: #1a1714;
    --bg-muted: #211e1a;
    --bg-raised: #272320;
    --text: #f0ece6;
    --text-muted: #9e9690;
    --text-faint: #5a5550;
    --accent: #b86f3a;
    --accent-hover: #cc7f48;
    --accent-muted: #3d2515;
    --accent-glow: rgba(184, 111, 58, 0.15);
    --border: #302c28;
    --border-strong: #4a4440;
  }
}

/* Text overflow guards — no title or spec value should break the layout */
.project-title {
  overflow-wrap: break-word;
  word-break: break-word;
}

.spec-val {
  overflow-wrap: break-word;
  word-break: break-word;
}

.stat-num {
  overflow-wrap: break-word;
}

/* Screen frames get explicit min-height to prevent CLS before images load */
.screen-frame {
  min-height: 160px;
  background: oklch(10% 0.005 36);
}

/* Broken image placeholder state */
.screen-frame img {
  /* If image fails to load, the dark background shows cleanly */
  background: var(--bg-raised);
}

.screen-frame img[alt]::after {
  content: attr(alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-align: center;
  padding: 20px;
  background: var(--bg-raised);
}

/* Touch targets — 44px minimum on interactive elements */
@media (pointer: coarse) {
  .btn-primary,
  .btn-secondary,
  .btn-text,
  .nav-links a,
  .mobile-menu a {
    min-height: 44px;
  }
  
  .nav-burger {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
  }
  
  .footer-socials a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Flex/grid items must not overflow their container */
.project-info,
.time-content,
.contact-panel,
.skills-column,
.process-step {
  min-width: 0;
}

/* Force wrapping on stat numbers that might overflow */
.stat-num {
  white-space: nowrap;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
}

/* Prevent very small screen hero overflow */
@media (max-width: 360px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
