:root {
  --bg: #08111f;
  --bg-2: #0d1a2e;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --text: #f5f7fb;
  --muted: #b9c4d6;
  --faint: #8795ad;
  --accent: #ffb454;
  --accent-2: #ff7a59;
  --line: rgba(255, 255, 255, 0.12);
  --radius: 22px;
  --max: 1160px;
  --header-h: 72px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  font-family: Inter, ui-sans-system, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 180, 84, 0.22), transparent 32rem),
    radial-gradient(circle at 88% 4%, rgba(64, 132, 255, 0.18), transparent 30rem),
    linear-gradient(180deg, var(--bg) 0%, #0a1425 52%, #07101d 100%);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 0;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: -10rem; z-index: 50;
  background: var(--accent); color: #231303; padding: 0.7rem 1rem;
  border-radius: 999px; font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(8, 17, 31, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav {
  max-width: var(--max); min-height: var(--header-h); margin: 0 auto;
  padding: 0.75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.8rem; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #231303; font-weight: 900; letter-spacing: -0.04em;
}
.brand-text { font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 650; font-size: 0.98rem; }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  color: #231303; background: var(--text); padding: 0.55rem 0.9rem; border-radius: 999px;
}
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,0.06); cursor: pointer;
}
.nav-toggle span:not(.sr-only) { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--text); border-radius: 99px; }

.section-shell { max-width: var(--max); margin: 0 auto; padding: 5.2rem 1.25rem; }
.hero {
  min-height: calc(100svh - var(--header-h));
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
  gap: 2rem; align-items: center; padding-top: 4.2rem;
}
.eyebrow {
  margin: 0 0 1rem; color: var(--accent); text-transform: uppercase;
  font-size: 0.78rem; letter-spacing: 0.16em; font-weight: 900;
}
h1, h2, h3 { line-height: 1.05; letter-spacing: -0.035em; margin: 0; }
h1 { font-size: clamp(3rem, 9vw, 6.8rem); max-width: 9ch; }
h2 { font-size: clamp(2.1rem, 5vw, 3.8rem); max-width: 12ch; }
h3 { font-size: 1.35rem; }
.hero-role { font-size: clamp(1.35rem, 3.4vw, 2.25rem); line-height: 1.16; font-weight: 800; margin: 1.2rem 0 1rem; max-width: 18ch; }
.hero-summary { color: var(--muted); font-size: 1.1rem; max-width: 65ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.7rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0.78rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text); background: rgba(255,255,255,0.06); text-decoration: none; font-weight: 800;
}
.button:hover { background: rgba(255,255,255,0.11); }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #231303; border: 0; }
.proof-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 0; margin: 1.4rem 0 0; }
.proof-chips li { border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--muted); border-radius: 999px; padding: 0.42rem 0.75rem; font-size: 0.9rem; font-weight: 700; }

.hero-card, .mini-card, .project-card, .education-card, .research-card {
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-card { padding: 1.5rem; }
.portrait { margin: 0 0 1.15rem; }
.portrait img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: center 18%; border-radius: 1rem; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28); }
.portrait figcaption { margin-top: 0.65rem; color: var(--muted); font-size: 0.88rem; text-align: center; }
.card-kicker { margin: 0 0 1rem; color: var(--accent); font-weight: 900; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; }
.hero-card dl { margin: 0; display: grid; gap: 1.15rem; }
.hero-card dt { color: var(--faint); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.13em; }
.hero-card dd { margin: 0.22rem 0 0; color: var(--text); font-weight: 650; }

.metrics { padding-top: 1rem; padding-bottom: 1rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.metrics article { border-top: 1px solid var(--line); padding-top: 1.1rem; color: var(--muted); }
.metrics strong { display: block; color: var(--text); font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; letter-spacing: -0.04em; }

.split { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 3rem; }
.section-heading { align-self: start; }
.section-heading h2 { overflow-wrap: break-word; }
.section-body p { color: var(--muted); font-size: 1.06rem; max-width: 70ch; }
.focus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.6rem; }
.mini-card { padding: 1.15rem; box-shadow: none; }
.mini-card p { margin: 0.45rem 0 0; font-size: 0.98rem; }

.timeline { display: grid; gap: 0; margin-top: 2.2rem; border-top: 1px solid var(--line); }
.timeline-item { display: grid; grid-template-columns: 210px 1fr; gap: 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.timeline-date { color: var(--accent); font-weight: 900; }
.timeline-item p { color: var(--muted); margin: 0.45rem 0 0; max-width: 72ch; }

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2.2rem; }
.project-card { padding: 1.45rem; display: flex; flex-direction: column; gap: 0.85rem; }
.project-card.featured { border-color: rgba(255, 180, 84, 0.35); }
.project-type { margin: 0; color: var(--accent); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 900; }
.project-card p:not(.project-type) { color: var(--muted); margin: 0; }
.project-card a { margin-top: auto; color: var(--text); font-weight: 900; text-decoration: none; }
.project-card a:hover { color: var(--accent); }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0; }
.tag-list li { color: var(--muted); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); padding: 0.28rem 0.58rem; border-radius: 999px; font-size: 0.83rem; font-weight: 700; }

.research-card { margin-top: 2rem; padding: clamp(1.4rem, 4vw, 2.4rem); }
.research-card p { color: var(--muted); font-size: 1.12rem; max-width: 78ch; }
.research-card strong { color: var(--text); }
.research-meta { color: var(--accent) !important; font-weight: 800; font-size: 0.98rem !important; }
.education-card { padding: 1.2rem; margin-bottom: 1rem; box-shadow: none; }
.education-card p { margin: 0.35rem 0 0; }
.skills-block { margin-top: 1.5rem; }
.skill-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.7rem; color: var(--muted); }
.skill-list strong { color: var(--text); }

.contact { text-align: left; }
.contact p { color: var(--muted); font-size: 1.12rem; max-width: 62ch; }
.site-footer {
  max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem 6.5rem;
  display: flex; justify-content: space-between; gap: 1rem; color: var(--faint); border-top: 1px solid var(--line);
}
.nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.text-link { color: var(--accent); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.site-footer a { color: var(--muted); }
.mobile-cta { display: none; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero, .split { grid-template-columns: 1fr; }
  .section-heading { position: static; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.4rem; }
}

@media (max-width: 680px) {
  body { padding-bottom: 68px; }
  .section-shell { padding: 3.4rem 1rem; }
  .nav { padding: 0.6rem 1rem; }
  .brand-text { font-size: 0.94rem; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; left: 1rem; right: 1rem; top: calc(var(--header-h) - 6px);
    display: none; flex-direction: column; align-items: stretch; gap: 0.3rem;
    background: #0d1a2e; border: 1px solid var(--line); border-radius: 18px; padding: 0.7rem;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 0.85rem; border-radius: 12px; }
  .nav-links .nav-cta { text-align: center; }
  h1 { font-size: clamp(2.65rem, 15vw, 4.2rem); max-width: 8ch; }
  .hero { min-height: auto; padding-top: 2.5rem; gap: 1.2rem; }
  .portrait img { aspect-ratio: 4 / 3; }
  .hero-actions .button { flex: 1 1 100%; }
  .metrics { grid-template-columns: 1fr; gap: 0.5rem; }
  .focus-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; padding-bottom: 2rem; }
  .mobile-cta {
    position: fixed; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; z-index: 45;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    background: rgba(13, 26, 46, 0.92); border: 1px solid var(--line); border-radius: 999px;
    padding: 0.45rem; backdrop-filter: blur(16px); box-shadow: var(--shadow);
  }
  .mobile-cta a {
    text-align: center; text-decoration: none; font-weight: 900; color: var(--text);
    padding: 0.72rem 0.4rem; border-radius: 999px; background: rgba(255,255,255,0.06);
  }
  .mobile-cta a:first-child { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #231303; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- v2 motion & depth layer ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(55rem 34rem at 85% -10%, rgba(255, 180, 84, 0.13), transparent 60%),
    radial-gradient(48rem 30rem at -10% 30%, rgba(64, 132, 255, 0.12), transparent 60%),
    radial-gradient(40rem 26rem at 60% 110%, rgba(255, 122, 89, 0.08), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 75%);
}
::selection { background: rgba(255, 180, 84, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; }
.scroll-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 80ms linear; }

.code-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #9fd0ff; font-size: clamp(0.85rem, 2.4vw, 1rem); margin: 0 0 0.9rem; min-height: 1.4em;
}
.code-prompt { color: var(--accent); font-weight: 700; }
.cursor { display: inline-block; width: 0.55em; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--accent); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.h1-letter { display: inline-block; opacity: 0; transform: translateY(0.38em); animation: letterIn 650ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes letterIn { to { opacity: 1; transform: none; } }

.status-pill {
  display: inline-flex; align-items: center; gap: 0.55rem; margin: 1.1rem 0 0;
  border: 1px solid var(--line); background: rgba(255,255,255,0.05); border-radius: 999px;
  padding: 0.45rem 0.9rem; font-weight: 700; font-size: 0.92rem; color: var(--text);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

.ticker { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.9rem 0; mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); }
.ticker-track { display: flex; gap: 2.6rem; width: max-content; animation: tickerMove 30s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.ticker-track span::after { content: "·"; margin-left: 2.6rem; color: var(--accent); }
@keyframes tickerMove { to { transform: translateX(-50%); } }

.metrics strong { font-variant-numeric: tabular-nums; }

.project-card { position: relative; overflow: hidden; transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease; }
.project-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0; transition: opacity 260ms ease; }
.project-card:hover { transform: translateY(-5px); border-color: rgba(255, 180, 84, 0.45); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42); }
.project-card:hover::before { opacity: 1; }
.project-card .text-link { display: inline-block; transition: transform 200ms ease; }
.project-card:hover .text-link { transform: translateX(4px); }
.project-grid .project-card:nth-child(2) { transition-delay: 60ms; }
.project-grid .project-card:nth-child(3) { transition-delay: 120ms; }
.project-grid .project-card:nth-child(4) { transition-delay: 180ms; }
.project-grid .project-card:nth-child(5) { transition-delay: 240ms; }

.section-heading h2::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 999px; margin-top: 1rem; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.hero-card { transition: transform 300ms ease, box-shadow 300ms ease; }
.hero-card:hover { transform: translateY(-4px); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); }

.back-to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 46; width: 46px; height: 46px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(13, 26, 46, 0.92); color: var(--text);
  font-size: 1.15rem; font-weight: 900; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease; backdrop-filter: blur(10px);
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
@media (max-width: 680px) { .back-to-top { bottom: 5.2rem; } }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .cursor, .status-dot, .h1-letter { animation: none !important; }
  .h1-letter { opacity: 1; transform: none; }
  .project-card, .hero-card { transition: none; }
}

/* ---------- v3 layout fixes (from Luis's screenshot review) ---------- */
.hero { min-height: auto; padding: 4.25rem 0 3.25rem; align-items: start; }
.hero-card { align-self: start; }
h1 { max-width: 16ch; text-wrap: balance; }
.h1-word { display: inline-block; white-space: nowrap; }
.portrait img { aspect-ratio: auto; height: clamp(230px, 28vw, 320px); object-position: center 20%; }
.section-shell { padding: 4.25rem 0; }
.split { gap: 2.5rem; }
.site-footer { justify-content: center; text-align: center; }
@media (max-width: 680px) {
  .hero { padding: 2.25rem 0 2rem; }
  .portrait img { height: 225px; }
  .section-shell { padding: 3rem 1rem; }
}

/* ---------- v4 fixes: name fit + tighter rhythm (Luis screenshot review) ---------- */
h1 { font-size: clamp(2.75rem, 5.6vw, 4.9rem); max-width: 15ch; }
.hero { gap: 3rem; padding: 3.5rem 0 2.5rem; }
.section-shell { padding: 3.4rem 0; }
.contact { padding-bottom: 3rem; }
.site-footer { padding: 1.75rem 0; }
.metrics { padding-top: 0.5rem; padding-bottom: 0.5rem; }
@media (max-width: 680px) {
  h1 { font-size: clamp(2.5rem, 13vw, 3.6rem); }
  .section-shell { padding: 2.6rem 1rem; }
  .contact { padding-bottom: 2.5rem; }
}

/* ---------- v5 mobile polish (Luis iPhone review; desktop untouched) ---------- */
html, body { overflow-x: clip; }
.hero-copy { min-width: 0; }

@media (max-width: 900px) {
  .hero-card { max-width: 560px; }
  .snapshot { gap: 1.1rem 1.5rem; }
}

@media (max-width: 680px) {
  /* Fit the name: longest word must fit the phone with room to spare */
  h1 { font-size: clamp(2.3rem, 10.8vw, 3.3rem); letter-spacing: -0.03em; max-width: 100%; line-height: 1.02; }
  .code-line { font-size: 0.78rem; white-space: nowrap; overflow: hidden; max-width: 100%; }
  .hero-intro { font-size: 1.13rem; line-height: 1.55; }
  .hero-subcopy { font-size: 1.02rem; line-height: 1.65; }
  .eyebrow { font-size: 0.82rem; line-height: 1.5; }

  /* Portrait & snapshot card breathe less, crop kinder */
  .portrait img { height: 215px; object-position: center 18%; }
  .portrait figcaption { font-size: 0.92rem; padding-top: 0.75rem; }
  .hero-card { padding: 1.1rem; border-radius: 22px; }
  .snapshot dt { font-size: 0.8rem; }
  .snapshot dd { font-size: 1.04rem; line-height: 1.5; }

  /* Proof metrics: 2x2 grid instead of one long column */
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .metrics article { padding: 1.05rem; border-radius: 18px; }
  .metrics strong { font-size: 1.65rem; }
  .metrics span { font-size: 0.92rem; }

  /* Cards and timeline: tighter padding, calmer type */
  .project-card, .edu-card, .mini-card { padding: 1.25rem; border-radius: 20px; }
  .timeline-item { padding: 1.25rem; border-radius: 20px; }
  .research-card { padding: 1.35rem; }
  .research-card h3 { font-size: 1.45rem; }
  .section-heading h2, .research-card h2 { font-size: 2.05rem; }
  h2 { line-height: 1.12; }
  .lead { font-size: 1.04rem; line-height: 1.65; }
  .focus-grid, .project-grid, .education-grid { gap: 0.9rem; }

  /* Buttons: full-width but less chunky; big-enough touch targets */
  .hero-actions a, .contact-actions a { flex: 1 1 100%; padding: 0.95rem 1rem; font-size: 1.02rem; min-height: 52px; }
  .chip { font-size: 0.9rem; padding: 0.5rem 0.8rem; }
  .ticker-track span { font-size: 0.85rem; }

  /* Bottom bar + floating button respect the iPhone home-indicator area */
  .mobile-cta { left: 0.7rem; right: 0.7rem; bottom: calc(0.6rem + env(safe-area-inset-bottom)); padding: 0.45rem; }
  .mobile-cta a { padding: 0.8rem 0.4rem; font-size: 0.98rem; }
  .back-to-top { bottom: calc(5.6rem + env(safe-area-inset-bottom)); right: 0.9rem; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: 0.5rem; }
}

/* ---------- v6 mobile tightening + portrait treatment (Luis review; desktop untouched) ---------- */
@media (max-width: 680px) {
  .section-shell { padding: 2.15rem 1rem; }
  .section-heading { margin-bottom: 1.5rem; }
  .hero { padding: 1.9rem 1rem 1.6rem; }
  .contact { padding-bottom: 1.6rem; }
  .site-footer { padding: 1.2rem 1rem 0.25rem; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* Portrait: fuller frame with shoulders + soft depth instead of a tight head crop */
  .portrait { margin: -0.2rem -0.2rem 0; }
  .portrait img {
    height: 258px; object-position: center 22%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px rgba(0, 0, 0, 0.35);
  }
  .portrait figcaption { padding-top: 0.65rem; }
  .hero-card { padding: 1rem 1rem 1.15rem; }
  .snapshot { padding-top: 1rem; margin-top: 1rem; }
}

/* ---------- v7 mobile portrait: circular profile treatment (Luis approved; desktop untouched) ---------- */
@media (max-width: 680px) {
  .portrait { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .portrait img {
    width: min(62vw, 236px); height: auto; aspect-ratio: 1 / 1; border-radius: 50%;
    object-position: center 16%;
    box-shadow: 0 0 0 3px rgba(255, 180, 84, 0.55), 0 0 0 9px rgba(255, 180, 84, 0.10), 0 18px 42px rgba(0, 0, 0, 0.42);
  }
  .portrait figcaption { padding-top: 0.85rem; font-size: 0.95rem; }
}

/* ---------- v8 desktop-only rhythm tightening (min-width guard shields approved mobile) ---------- */
@media (min-width: 681px) {
  .section-shell { padding: 2.6rem 0; }
  .section-heading { margin-bottom: 1.6rem; }
  .hero { padding: 3.25rem 0 2.25rem; }
  .contact { padding-bottom: 2.5rem; }
}
