/* ---------------------------------------------------------------
   Additions: profile popover, contact section, highlights band.
   Uses the site's existing design tokens so every preset / light-dark
   mode keeps working.
---------------------------------------------------------------- */

/* ---- Brand button (opens profile) ---- */
button.nav-brand {
  background: none;
  border: 0;
  margin: 0;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  margin-left: -0.25rem;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background-color var(--speed) var(--ease-out);
}
button.nav-brand:hover { background: var(--accent-soft); }
.nav-brand-mark { transition: box-shadow var(--speed) var(--ease-out); }
.nav-brand:hover .nav-brand-mark,
.nav-brand[aria-expanded="true"] .nav-brand-mark { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--line-strong); }
.nav-brand-caret {
  color: var(--text-3);
  transition: rotate 0.35s var(--ease-out), color var(--speed) var(--ease-out);
}
.nav-brand:hover .nav-brand-caret { color: var(--accent); }
.nav-brand[aria-expanded="true"] .nav-brand-caret { rotate: 180deg; color: var(--accent); }

/* ---- Profile popover ---- */
.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  padding: calc(var(--nav-h) - 8px) 0 1rem;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}
.profile-overlay[hidden] { display: none; }
.profile-overlay.is-open { opacity: 1; }

.profile {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100svh - var(--nav-h) - 1.25rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  border: var(--bw) solid var(--line-strong);
  background: var(--bg-raised);
  box-shadow: var(--float-shadow);
  transform-origin: 24px 0;
  opacity: 0;
  translate: 0 -8px;
  scale: 0.97;
  transition: opacity 0.28s var(--ease-out), translate 0.4s var(--ease-out), scale 0.4s var(--ease-out);
}
.profile:focus { outline: none; }
.profile-overlay.is-open .profile { opacity: 1; translate: 0 0; scale: 1; }

.profile-close { position: absolute; top: 0.85rem; right: 0.85rem; width: 32px; height: 32px; }

.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.profile-head img {
  width: 72px;
  height: 72px;
  flex: none;
  object-fit: cover;
  border-radius: var(--r-md);
  border: var(--bw) solid var(--line-strong);
}
.profile-name { padding-right: 2.4rem; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 0.2rem; }
.profile-role { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); margin-bottom: 0.55rem; }
.profile-head .status { font-size: 0.72rem; padding: 0.25rem 0.65rem; }

.profile-bio { color: var(--text-2); font-size: 0.93rem; line-height: 1.6; margin-bottom: 1.1rem; }

.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 1.1rem; }
.profile-stat { padding: 0.65rem 0.75rem; border-radius: var(--r-md); border: var(--bw) solid var(--line); background: var(--surface); }
.profile-stat b { display: block; font-family: var(--font-mono); font-size: 1rem; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-stat span { display: block; font-size: 0.7rem; line-height: 1.3; color: var(--text-3); margin-top: 0.15rem; }

.profile-facts { display: grid; gap: 0.55rem; padding-block: 1rem; border-block: var(--bw) solid var(--line); margin-bottom: 1.1rem; }
.profile-facts > div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.86rem; }
.profile-facts dt { color: var(--text-3); font-family: var(--font-mono); font-size: 0.74rem; flex: none; padding-top: 0.08rem; }
.profile-facts dd { color: var(--text); text-align: right; }

.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.profile-more { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); }
.profile-more:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 640px) {
  .profile { width: 100%; padding: 1.25rem; transform-origin: 20px 0; }
  .profile-more { margin-left: 0; width: 100%; }
}

/* ---- Hero email link ---- */
.hero-socials a svg { flex: none; }

/* ---- Highlights band ---- */
.proof { padding-top: clamp(1.5rem, 4vw, 3rem); }
.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: var(--bw) solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.proof-item { padding: 1.4rem 1.5rem; border-left: var(--bw) solid var(--line); }
.proof-item:first-child { border-left: 0; }
.proof-value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2.7vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.proof-value i { font-style: normal; color: var(--accent); }
.proof-label { margin-top: 0.45rem; font-size: 0.82rem; line-height: 1.4; color: var(--text-3); max-width: 24ch; }
@media (max-width: 900px) {
  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-item:nth-child(3) { border-left: 0; }
  .proof-item:nth-child(n + 3) { border-top: var(--bw) solid var(--line); }
}
@media (max-width: 420px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-item { border-left: 0; }
  .proof-item:nth-child(n + 2) { border-top: var(--bw) solid var(--line); }
}

/* ---- Contact ---- */
.contact { padding-top: 0; }
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(1.75rem, 4.5vw, 3.5rem);
  border-radius: var(--r-lg);
  border: var(--bw) solid var(--line-strong);
  background:
    radial-gradient(60% 90% at 100% 0%, var(--accent-glow), transparent 70%),
    var(--surface);
}
.contact-copy .section-title { margin-bottom: 0.9rem; }
.contact-copy .section-lede { max-width: 44ch; }

.contact-actions { display: grid; gap: 1rem; }
.contact-email {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.3rem;
  border-radius: var(--r-md);
  border: var(--bw) solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(0.92rem, 1.8vw, 1.12rem);
  overflow-wrap: anywhere;
  transition: border-color var(--speed) var(--ease-out), background-color var(--speed) var(--ease-out);
}
.contact-email:hover { border-color: var(--accent); text-decoration: none; }
.contact-email-arrow { flex: none; color: var(--accent); transition: translate 0.35s var(--ease-out); }
.contact-email:hover .contact-email-arrow { translate: 3px -3px; }
.contact-btns { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.contact-note { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); }

@media (max-width: 900px) {
  .contact-card { grid-template-columns: 1fr; }
}

/* ---- Footer email ---- */
.footer-note a { color: var(--text-2); }
.footer-note a:hover { color: var(--accent); }
.footer-sep { opacity: 0.5; padding-inline: 0.15rem; }

/* ---- Mobile menu footer email ---- */
.mobile-menu-foot a { color: var(--text-2); }

/* ---- Fixed nav shouldn't hide anchored sections ---- */
#contact { scroll-margin-top: calc(var(--nav-h) - 1rem); }

/* ---- Mobile fix: featured-project columns were allowed to grow wider than
        the phone (1fr = minmax(auto,1fr)), causing sideways page scroll. ---- */
@media (max-width: 900px) {
  .feat { grid-template-columns: minmax(0, 1fr); }
}

/* Reveal animations start 24px off to the side; clip so they can't widen the page. */
main { overflow-x: clip; }

/* Keep year tags on one line even when a card title is long. */
.card-top .tag { flex: none; white-space: nowrap; }

/* Contact sits directly above the footer; less dead space below it. */
.contact { padding-bottom: clamp(3rem, 7vw, 5.5rem); }

.profile-facts dd { text-wrap: balance; }

/* Small phones: keep the email on one line instead of splitting mid-address. */
@media (max-width: 480px) {
  .contact-card { padding: 1.35rem; }
  .contact-email { padding: 0.9rem 1rem; gap: 0.6rem; font-size: clamp(0.66rem, 3.4vw, 0.95rem); }
}
