/* ═══ Editorial Data Engineer Portfolio — Premium Visual System ═══ */
:root {
  /* Palette */
  --ivory: #faf8f4;
  --cream: #f5f0e8;
  --sand: #e8e0d4;
  --warm-glow: rgba(210, 180, 120, 0.22);
  --bg: var(--ivory);
  --bg-warm: var(--cream);
  --bg-muted: #f0ebe3;
  --surface: #ffffff;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a5650;
  --text-dim: #8a847a;
  --bronze: #7a6b55;
  --charcoal: #1a1a1a;
  --accent: var(--charcoal);
  --accent-rgb: 26, 26, 26;
  --accent-04: rgba(var(--accent-rgb), 0.04);
  --accent-06: rgba(var(--accent-rgb), 0.06);
  --accent-08: rgba(var(--accent-rgb), 0.08);
  --accent-10: rgba(var(--accent-rgb), 0.1);
  --accent-12: rgba(var(--accent-rgb), 0.12);
  --accent-14: rgba(var(--accent-rgb), 0.14);
  --accent-20: rgba(var(--accent-rgb), 0.2);
  --border: rgba(26, 26, 26, 0.08);
  --border-strong: rgba(26, 26, 26, 0.14);
  --gold: var(--charcoal);
  --gold-bright: var(--charcoal);
  --gold-dim: #4a4a4a;
  --sandstone: #5a5650;
  --cyan: #5a5650;
  --cyan-dim: #8a847a;
  --emerald: #5c6b52;
  --emerald-glow: rgba(92, 107, 82, 0.2);
  --status: #22c55e;

  /* Typography */
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-ui: "DM Sans", system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: clamp(5rem, 10vw, 7.5rem);
  --section-pad: var(--space-2xl);
  --content-max: 1180px;
  --prose-max: 42rem;

  /* Shape & motion */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-soft: 0 1px 0 rgba(26, 26, 26, 0.04), 0 12px 40px rgba(26, 26, 26, 0.05);
  --shadow-lift: 0 2px 0 rgba(26, 26, 26, 0.03), 0 20px 48px rgba(26, 26, 26, 0.07);
  --glow-accent: var(--shadow-soft);
  --glow-gold: var(--shadow-soft);
  --glow-cyan: var(--shadow-soft);
  --void: var(--charcoal);
  --obsidian: var(--bg-muted);
  --deep-blue: var(--ivory);
  --font-mono: var(--font-ui);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: clip;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: rgba(122, 107, 85, 0.18);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 3px;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(26, 26, 26, 0.18);
  border-radius: 3px;
}

.site-wrap { position: relative; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

section { position: relative; }

/* ─── Navigation ─── */
.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.85rem clamp(1.25rem, 4vw, 2.5rem);
  pointer-events: none;
  transition:
    padding 0.4s var(--ease),
    background 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
}

.nav-header.is-scrolled {
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

.navbar {
  position: relative;
  pointer-events: auto;
}

.navbar__shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: calc(var(--nav-h) - 0.5rem);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.4rem 0;
}

.nav-logo {
  justify-self: start;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo__brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: opacity 0.25s ease;
}

.nav-logo:hover { opacity: 0.7; }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  list-style: none;
  justify-self: center;
  margin: 0;
  padding: 0.2rem;
  background: rgba(26, 26, 26, 0.035);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.nav-link {
  position: relative;
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  transition:
    color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.nav-link::after { display: none; }

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.nav-link.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
}

.nav-cta {
  justify-self: end;
  flex-shrink: 0;
  padding: 0.6rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ivory);
  background: var(--charcoal);
  border-radius: 999px;
  white-space: nowrap;
  transition:
    transform 0.3s var(--ease),
    background 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.nav-cta:hover {
  transform: translateY(-1px);
  background: #2a2a2a;
  box-shadow: 0 6px 18px rgba(26, 26, 26, 0.12);
}

.nav-links__cta { display: none; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  justify-self: end;
}

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 18px;
}

.nav-toggle__bars span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(26, 26, 26, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

body.nav-open { overflow: hidden; }

body.nav-open .nav-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ─── Hero ─── */
#hero {
  position: relative;
  height: 100svh;
  min-height: 680px;
  max-height: 980px;
  overflow: hidden;
  padding: calc(var(--nav-h) + 1.5rem) clamp(1.25rem, 4vw, 3rem) 1.5rem;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 38% at 52% 34%, var(--warm-glow) 0%, transparent 72%),
    linear-gradient(180deg, var(--cream) 0%, var(--ivory) 65%);
}

.hero-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 26, 26, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 26, 26, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 10%, transparent 75%);
  opacity: 0.5;
}

.hero-stage {
  position: relative;
  width: 100%;
  max-width: 1140px;
  height: 100%;
  margin: 0 auto;
}

.hero-greeting {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
  text-align: center;
}

.hero-greeting__text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.025em;
  opacity: 0.82;
  white-space: nowrap;
}

#hero.is-ready .hero-greeting__text {
  animation: heroFadeUp 1s var(--ease-out) 0.1s both;
}

.hero-portrait-center {
  position: absolute;
  top: 46%;
  left: 52%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: clamp(180px, 26vw, 320px);
  pointer-events: none;
}

.hero-portrait-center img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(54svh, 500px);
  object-fit: contain;
  object-position: center bottom;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, rgba(0, 0, 0, 0.9) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, rgba(0, 0, 0, 0.9) 75%, transparent 100%);
  transition: transform 1.2s var(--ease-out);
}

#hero.is-ready .hero-portrait-center img {
  animation: heroPortraitIn 1.2s var(--ease-out) 0.2s both;
}

.hero-meta {
  position: absolute;
  z-index: 3;
  max-width: min(240px, 30vw);
}

.hero-meta--left {
  left: 0;
  top: 38%;
}

.hero-meta--right {
  right: 0;
  top: 40%;
  text-align: right;
}

.hero-meta--right p {
  font-size: clamp(0.8125rem, 1.1vw, 0.9375rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 16rem;
  margin-left: auto;
}

#hero.is-ready .hero-meta--left { animation: heroFadeUp 0.9s var(--ease-out) 0.45s both; }
#hero.is-ready .hero-meta--right { animation: heroFadeUp 0.9s var(--ease-out) 0.55s both; }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: clamp(0.6875rem, 0.95vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

.hero-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.hero-title {
  position: absolute;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 4.5vw, 4rem);
  line-height: 0.92;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--text);
}

.hero-title__line { display: block; white-space: nowrap; }

.hero-title--left {
  left: -0.5%;
  bottom: 24%;
}

.hero-title--right {
  right: 0;
  bottom: 24%;
  text-align: right;
}

#hero.is-ready .hero-title--left { animation: heroFadeUp 0.9s var(--ease-out) 0.35s both; }
#hero.is-ready .hero-title--right { animation: heroFadeUp 0.9s var(--ease-out) 0.42s both; }

.hero-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 1.5rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

#hero.is-ready .hero-bottom { animation: heroFadeUp 0.9s var(--ease-out) 0.6s both; }

.hero-cert {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-cert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-06);
  font-size: 0.75rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.hero-stats > div {
  text-align: center;
  min-width: 4.5rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text);
}

.stat-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.hero-socials {
  display: flex;
  gap: 1.25rem;
  justify-content: flex-end;
}

.hero-socials a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.hero-socials a:hover { color: var(--text); }

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroPortraitIn {
  from { opacity: 0; transform: scale(0.97) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Section system ─── */
.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--space-md);
  max-width: 14ch;
}

.section-title .gold,
.section-title .cyan { color: var(--text-muted); }

.section-desc {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: var(--prose-max);
  line-height: 1.75;
}

.section-intro {
  margin-bottom: var(--space-xl);
  max-width: 36rem;
}

/* ─── About ─── */
#about {
  padding: var(--section-pad) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(3rem, 8vw, 6rem);
  align-items: start;
}

.about-story p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: var(--prose-max);
}

.about-story strong { color: var(--text); font-weight: 600; }

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
}

.tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.35rem;
}

.tl-rail::after {
  content: "";
  flex: 1;
  width: 1px;
  background: var(--border);
  margin-top: 0.85rem;
}

.tl-gem {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--charcoal);
  box-shadow: 0 0 0 4px var(--accent-06);
}

.tl-date {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.tl-role {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.tl-company {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.tl-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tl-items li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 1.1rem;
  position: relative;
}

.tl-items li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sand);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.tl-items strong { color: var(--text); font-weight: 600; }

/* ─── Skills ─── */
#skills {
  padding: var(--section-pad) 0;
  background: var(--bg);
}

.skills-header {
  margin-bottom: var(--space-xl);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 769px) {
  .skills-header {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
  }

  .skills-header .section-desc { margin: 0; }
}

.skills-grid,
.skills-grid--full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.power-card {
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}

.power-card:hover {
  background: var(--ivory);
  border-color: var(--border-strong);
}

/* Center lone item on the last row (10 cards → 3+3+3+1) */
.power-card:last-child:nth-child(3n + 1):not(:only-child) {
  grid-column: 2;
}

.skill-icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--bronze);
  opacity: 0.85;
}

.skill-icon svg { width: 100%; height: 100%; stroke-width: 1.5; }

.power-title {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.power-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.power-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  line-height: 1.8;
}

.power-tag {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

.power-tag:not(:last-child)::after {
  content: " · ";
  color: var(--sand);
  font-weight: 400;
}

.power-tag.hl {
  color: var(--text);
  font-weight: 500;
}

.power-tag.cyan,
.power-tag.emerald { color: var(--text-muted); font-weight: 500; }

/* ─── Projects ─── */
#projects {
  padding: var(--section-pad) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.archive-card {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
  cursor: pointer;
  transition: background 0.45s var(--ease);
  overflow: hidden;
}

.archive-card:last-child { border-bottom: 1px solid var(--border); }

.archive-card:hover { background: var(--ivory); }

.archive-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  gap: 1.5rem 2rem;
  padding: clamp(1.75rem, 4vw, 2.5rem) 0;
}

.archive-num {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.65rem;
}

.archive-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.05;
  max-width: 28rem;
  transition: letter-spacing 0.45s var(--ease);
}

.archive-card:hover .archive-title { letter-spacing: 0.04em; }

.archive-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 32rem;
  line-height: 1.6;
}

.archive-metrics {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  text-align: right;
  align-self: center;
}

.archive-metrics > div {
  min-width: 3.5rem;
}

.metric-val {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--text);
}

.metric-lbl {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.archive-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.45s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  flex-shrink: 0;
  align-self: center;
}

.archive-card:hover .archive-toggle {
  border-color: var(--border-strong);
}

.archive-card.open .archive-toggle {
  transform: rotate(180deg);
  background: var(--accent-06);
}

.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0 0 1.5rem;
}

.archive-tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

.archive-tag:not(:last-child)::after {
  content: " /";
  margin-left: 0.35rem;
  color: var(--sand);
}

.archive-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.65s var(--ease);
}

.archive-card.open .archive-body { max-height: 4000px; }

.archive-inner {
  padding: 0 0 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.flow-diagram {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  margin-bottom: 2rem;
}

.flow-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 1.5rem;
}

.flow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.flow-node {
  min-width: 88px;
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.flow-node .fn-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.flow-node .fn-sub {
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.flow-arrow {
  color: var(--text-dim);
  font-size: 0.85rem;
  opacity: 0.6;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.story-block h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.75rem;
}

.story-block p,
.story-block li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.story-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.story-block li {
  padding-left: 1rem;
  position: relative;
}

.story-block li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.story-block strong { color: var(--text); font-weight: 600; }

.impact-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 0.75rem;
}

.impact-cell {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
}

.impact-cell .iv {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text);
}

.impact-cell .il {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* ─── Certifications ─── */
#certifications {
  padding: var(--section-pad) 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.certs-intro { margin-bottom: var(--space-xl); max-width: 36rem; }

.cert-showcase {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
  padding: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cert-showcase-badge {
  width: 88px;
  height: 88px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  background: #232f3e;
  border: 1px solid rgba(255, 153, 0, 0.25);
  flex-shrink: 0;
}

.cert-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.85rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.cert-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cert-logo--showcase {
  width: 56px;
  height: 56px;
}

.cert-logo-wrap--astronomer {
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.95);
}

.cert-logo-wrap--incorta {
  padding: 0.3rem;
  background: #0078d4;
  border-color: rgba(0, 120, 212, 0.3);
}

.cert-showcase-tier {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.5rem;
}

.cert-showcase-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.05;
}

.cert-showcase-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 36rem;
  margin-bottom: 1.25rem;
}

.cert-showcase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.cert-meta-pill {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
}

.cert-meta-pill--gold {
  background: var(--charcoal);
  color: var(--ivory);
  border-color: var(--charcoal);
  font-weight: 600;
}

.cert-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cert-tile {
  position: relative;
  padding: 1.5rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.cert-tile:hover {
  background: var(--ivory);
  border-color: var(--border-strong);
}

/* Center lone item on the last row (7 certs → 3+3+1) */
.cert-tile:last-child:nth-child(3n + 1):not(:only-child) {
  grid-column: 2;
}

.cert-tile-year {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.cert-tile-name {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.35rem;
  padding-right: 2rem;
}

.cert-tile-org {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ─── Contact ─── */
#contact {
  padding: var(--section-pad) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-header {
  margin-bottom: var(--space-xl);
  max-width: 36rem;
}

.contact-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.05;
}

.contact-headline .headline-accent { color: var(--text-muted); }

.contact-lead {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: var(--prose-max);
  margin-top: var(--space-md);
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(260px, 34%) 1px 1fr;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.contact-panel__direct,
.contact-panel__form {
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.contact-panel__divider {
  background: var(--border);
  width: 1px;
}

.contact-panel__title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 1.25rem;
}

.contact-panel__hint {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin: -0.5rem 0 1.25rem;
}

.contact-panel__meta {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.contact-panel__meta-sep { opacity: 0.35; }

.contact-cards--stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  text-decoration: none;
  color: var(--text);
  transition: padding-left 0.35s var(--ease), border-color 0.35s var(--ease);
}

.contact-card:last-child { border-bottom: none; }

.contact-card:hover {
  padding-left: 0.35rem;
  border-color: var(--border-strong);
}

.contact-card--primary { border-color: var(--border); }

.contact-card__icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 600;
}

.contact-card__body { flex: 1; min-width: 0; }

.contact-card__label {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.contact-card__value {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
}

.contact-card__arrow {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.contact-card:hover .contact-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.contact-field__label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-field__input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.contact-field__input--area {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.contact-field__input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--accent-06);
}

.contact-field__input::placeholder { color: var(--text-dim); }

.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 1rem 1.5rem;
  background: var(--charcoal);
  color: var(--ivory);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.contact-submit:hover {
  transform: translateY(-1px);
  background: #2a2a2a;
}

/* ─── Footer ─── */
footer {
  padding: var(--space-lg) clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg);
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer-text span { color: var(--text); font-weight: 600; }

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.footer-nav a:hover { color: var(--text); }

/* ─── Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .skills-grid,
  .skills-grid--full { grid-template-columns: repeat(2, 1fr); }
  .cert-gallery { grid-template-columns: repeat(2, 1fr); }

  .power-card:last-child:nth-child(3n + 1):not(:only-child),
  .cert-tile:last-child:nth-child(3n + 1):not(:only-child) {
    grid-column: auto;
  }

  /* 7 certs at 2 cols → last orphan centered */
  .cert-tile:last-child:nth-child(2n + 1):not(:only-child) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.5rem);
    justify-self: center;
  }

  /* 10 skills at 2 cols → last orphan centered */
  .power-card:last-child:nth-child(2n + 1):not(:only-child) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.5rem);
    justify-self: center;
  }

  .about-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .contact-panel { grid-template-columns: 1fr; }
  .contact-panel__divider { height: 1px; width: 100%; }
  .archive-header {
    grid-template-columns: 1fr auto;
  }
  .archive-metrics {
    grid-column: 1 / -1;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 900px) {
  .navbar__shell {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }

  .nav-logo,
  .nav-cta,
  .nav-toggle {
    justify-self: auto;
  }

  #hero {
    height: auto;
    min-height: 100svh;
    max-height: none;
    padding-bottom: 2rem;
  }

  .hero-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: calc(100svh - var(--nav-h) - 2rem);
    padding-bottom: 1rem;
  }

  .hero-greeting,
  .hero-portrait-center,
  .hero-meta,
  .hero-title,
  .hero-bottom {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
  }

  .hero-greeting { order: 1; margin-bottom: 0.5rem; }
  .hero-greeting__text { font-size: clamp(2.25rem, 12vw, 3.5rem); }

  .hero-portrait-center {
    order: 2;
    width: min(240px, 65vw);
    margin: 0 auto;
    left: auto;
  }

  .hero-portrait-center img { max-height: 40svh; }

  .hero-meta--left { order: 3; max-width: 100%; margin-top: 1rem; }
  .hero-meta--right { order: 4; max-width: 100%; text-align: left; margin-top: 0.75rem; }
  .hero-meta--right p { margin-left: 0; max-width: none; }

  .hero-title--left { order: 5; margin-top: 1.5rem; }
  .hero-title--right { order: 6; text-align: left; margin-top: 0.25rem; }
  .hero-title { font-size: clamp(1.65rem, 8vw, 2.5rem); }

  .hero-bottom {
    order: 7;
    margin-top: 2rem;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-stats { justify-content: space-between; width: 100%; }
  .hero-socials { justify-content: flex-start; }

  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + 0.5rem);
    right: clamp(1rem, 4vw, 2.5rem);
    left: clamp(1rem, 4vw, 2.5rem);
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
    pointer-events: none;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-link {
    padding: 0.85rem 0.9rem;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
  }

  .nav-link.is-active {
    background: var(--accent-06);
    box-shadow: none;
  }

  .nav-cta--bar { display: none; }

  .nav-links__cta {
    display: block;
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }

  .nav-cta--in-menu {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .nav-toggle { display: flex; }

  .section-title { max-width: none; }
}

@media (max-width: 768px) {
  :root { --section-pad: clamp(4rem, 12vw, 5.5rem); }

  .story-grid { grid-template-columns: 1fr; }

  .skills-grid,
  .skills-grid--full,
  .cert-gallery { grid-template-columns: 1fr; }

  .power-card:last-child:nth-child(2n + 1):not(:only-child),
  .power-card:last-child:nth-child(3n + 1):not(:only-child),
  .cert-tile:last-child:nth-child(2n + 1):not(:only-child),
  .cert-tile:last-child:nth-child(3n + 1):not(:only-child) {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
  }

  .impact-row { grid-template-columns: repeat(2, 1fr); }

  .archive-header {
    grid-template-columns: 1fr;
    padding: 1.75rem 0;
  }

  .archive-metrics {
    width: 100%;
    justify-content: space-between;
    text-align: center;
  }

  .archive-toggle { position: absolute; top: 1.75rem; right: 0; }
  .archive-header { position: relative; padding-right: 3rem; }

  .cert-showcase {
    grid-template-columns: 1fr;
    padding: 1.75rem;
    text-align: left;
  }

  .cert-showcase-badge { margin: 0; }

  .contact-panel__direct,
  .contact-panel__form { padding: 1.5rem; }

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

  .hero-stats > div { min-width: auto; flex: 1; }
}

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

  .reveal { opacity: 1; transform: none; }

  #hero.is-ready .hero-greeting__text,
  #hero.is-ready .hero-portrait-center img,
  #hero.is-ready .hero-title--left,
  #hero.is-ready .hero-title--right,
  #hero.is-ready .hero-meta--left,
  #hero.is-ready .hero-meta--right,
  #hero.is-ready .hero-bottom {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
