/* Portfolio — page styles built on the Organic design system (tokens.css).
   Spacing and type scale fluidly with clamp(), mirroring the design file —
   there are no width breakpoints. */

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-600); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--color-accent-200); }

/* Clips the hero/contact blobs that sit outside the page edge. On the wrapper,
   not on body — on body it would propagate to the viewport instead of clipping,
   leaving the blobs in the document's scroll width. */
.shell { min-height: 100vh; overflow-x: hidden; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 32px); }

/* ── header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  border-bottom: 1px solid var(--color-divider);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px clamp(12px, 2vw, 24px);
  padding-block: 12px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  margin-right: auto; flex: 0 0 auto;
  font-family: var(--font-heading); font-size: clamp(18px, 4.6vw, 20px);
  color: var(--color-text); letter-spacing: -0.01em;
}
.brand:hover { color: var(--color-text); }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand-tld { color: var(--color-accent-700); }

.site-nav {
  display: flex; flex-wrap: nowrap; gap: clamp(14px, 2.4vw, 22px);
  font-size: 15px; font-weight: 500;
  flex: 1 1 auto; min-width: 0; white-space: nowrap;
}
.site-nav a { color: var(--color-neutral-700); }
.site-nav a:hover { color: var(--color-accent-700); }

.header-resume { font-size: 14px; padding: 8px 18px; flex: 0 0 auto; }

/* The in-menu Résumé link: only on the phone layout, where .header-resume hides. */
.nav-resume { display: none; }

/* ── hamburger ──────────────────────────────────────────────────────── */

.nav-toggle {
  display: none; flex: 0 0 auto;
  width: 42px; height: 42px; padding: 0; border: 0; cursor: pointer;
  border-radius: 999px; place-items: center;
  background: var(--color-surface); color: var(--color-neutral-800);
  transition: background 180ms ease, color 180ms ease;
}
.nav-toggle:hover { background: var(--color-accent-200); color: var(--color-accent-800); }
.nav-toggle-bars { position: relative; display: block; width: 18px; height: 12px; }
.nav-toggle-bars i {
  position: absolute; left: 0; right: 0; height: 2px;
  border-radius: 2px; background: currentColor;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 140ms ease;
}
.nav-toggle-bars i:nth-child(1) { top: 0; }
.nav-toggle-bars i:nth-child(2) { top: 5px; }
.nav-toggle-bars i:nth-child(3) { top: 10px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ── phone layout: nav collapses into the hamburger ───────────── */

@media (max-width: 800px) {
  .header-inner { position: relative; }
  .nav-toggle { display: grid; }
  .header-resume { display: none; }
  .nav-toggle[aria-expanded="true"] {
    background: var(--color-accent-200); color: var(--color-accent-800);
  }

  /* A sheet that lifts off the warm page: lighter ground, hairline edge. */
  .site-nav {
    position: absolute; top: calc(100% + 12px);
    inset-inline: clamp(16px, 4vw, 32px);
    display: none; flex-direction: column; align-items: stretch;
    gap: 2px; white-space: normal; padding: 12px;
    background: var(--color-neutral-100);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    /* a short screen (landscape phone) scrolls the sheet, not the page */
    max-height: calc(100vh - 88px); overflow-y: auto; overscroll-behavior: contain;
  }
  .site-nav[data-open] { display: flex; animation: om-menu 220ms cubic-bezier(0.22, 1, 0.36, 1) both; }

  /* Each row is a tappable pill in the heading face, with an arrow that
     leans right when you touch it. */
  .site-nav a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 16px; border-radius: var(--radius-md);
    font-family: var(--font-heading); font-weight: var(--font-heading-weight);
    font-size: 20px; letter-spacing: -0.01em; color: var(--color-text);
    transition: background 180ms ease, color 180ms ease;
  }
  .site-nav a::after {
    content: "\2192"; font-family: var(--font-body); font-size: 17px; line-height: 1;
    color: var(--color-accent-400);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), color 180ms ease;
  }
  .site-nav a:hover, .site-nav a:active {
    background: var(--color-accent-100); color: var(--color-accent-800);
  }
  .site-nav a:hover::after, .site-nav a:active::after {
    transform: translateX(5px); color: var(--color-accent-700);
  }

  /* rows arrive one after the other as the sheet drops */
  .site-nav[data-open] a { animation: om-menu-item 280ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  .site-nav[data-open] a:nth-child(1) { animation-delay: 40ms; }
  .site-nav[data-open] a:nth-child(2) { animation-delay: 75ms; }
  .site-nav[data-open] a:nth-child(3) { animation-delay: 110ms; }
  .site-nav[data-open] a:nth-child(4) { animation-delay: 145ms; }
  .site-nav[data-open] a:nth-child(5) { animation-delay: 180ms; }
  .site-nav[data-open] a:nth-child(6) { animation-delay: 215ms; }

  .site-nav a.nav-resume {
    justify-content: center; gap: 9px;
    margin-top: 10px; padding: 13px 20px; border-radius: 999px;
    font-size: 15px; color: var(--color-bg);
  }
  .site-nav a.nav-resume::after { content: none; }
  .site-nav a.nav-resume:hover, .site-nav a.nav-resume:active {
    background: var(--color-accent-600); color: var(--color-bg);
  }
}

@keyframes om-menu {
  from { opacity: 0; transform: translateY(-8px) }
  to   { opacity: 1; transform: translateY(0) }
}

@keyframes om-menu-item {
  from { opacity: 0; transform: translateY(-6px) }
  to   { opacity: 1; transform: none }
}

.avatar-wrap { position: relative; display: flex; align-items: center; }
.avatar-btn {
  flex: 0 0 auto; width: 42px; height: 42px; padding: 0; border: 0; cursor: pointer;
  border-radius: 999px; overflow: hidden; background: var(--color-neutral-200);
  box-shadow: 0 0 0 2px var(--color-accent-2-200);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.avatar-btn:hover { box-shadow: 0 0 0 3px var(--color-accent-400); transform: scale(1.06); }
.avatar-btn:active { transform: scale(0.97); }
.avatar-btn img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  transform: scale(1.55); transform-origin: 50% 56%;
}

/* the "that's me — click" nudge, shown by scripts/site.js */
.hint-ring {
  position: absolute; inset: 0; border-radius: 999px;
  border: 2px solid var(--color-accent);
  animation: om-ping 1100ms ease-out 2 both;
  pointer-events: none;
}
.hint-label {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 30;
  white-space: nowrap; font-size: 13px; font-weight: 600;
  color: var(--color-accent-800); background: var(--color-accent-200);
  padding: 4px 11px; border-radius: 999px; box-shadow: var(--shadow-sm);
  animation: om-nudge 900ms ease-in-out 2 both;
  pointer-events: none;
}

/* ── sections ───────────────────────────────────────────────────────── */

.section { padding-block: clamp(40px, 7vw, 56px); }
.section-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(30px, 4vw, 44px); margin: 0 0 8px; letter-spacing: -0.01em;
}
.section-lede { font-size: 17px; color: var(--color-neutral-700); margin: 0 0 40px; }

/* ── hero ───────────────────────────────────────────────────────────── */

.hero {
  position: relative; display: flex; flex-wrap: wrap; gap: 48px; align-items: start;
  padding-block: clamp(48px, 8vw, 88px) clamp(40px, 6vw, 64px);
}
.hero-blob {
  position: absolute; top: -60px; right: -120px; width: 420px; height: 420px;
  border-radius: 999px; background: var(--color-accent-200);
  opacity: 0.55; filter: blur(2px);
}
.hero-main { position: relative; flex: 1 1 520px; min-width: 0; max-width: 700px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.eyebrow-dot {
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--color-accent-2-600); display: inline-block;
}
.eyebrow-text {
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-neutral-700);
}
.hero-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(44px, 7vw, 78px); line-height: 1.02;
  letter-spacing: -0.02em; margin: 0 0 26px;
}
.hero-title em { font-style: normal; color: var(--color-accent-700); }
.hero-lede {
  font-size: clamp(17px, 3.4vw, 21px); line-height: 1.55; max-width: 620px;
  margin: 0 0 34px; color: var(--color-neutral-800); text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 14px; max-width: 640px;
}
.stat { background: var(--color-surface); border-radius: var(--radius-lg); padding: 20px 22px; }
.stat-num { font-family: var(--font-heading); font-size: 30px; line-height: 1; }
.stat-label { font-size: 14px; color: var(--color-neutral-700); margin-top: 4px; }

/* ── experience ─────────────────────────────────────────────────────── */

.roles { display: flex; flex-direction: column; gap: 18px; }
.role {
  display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: start;
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 30px) clamp(20px, 4vw, 32px); color: var(--color-text);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease;
}
.role:hover { transform: translateY(-4px) scale(1.012); box-shadow: var(--shadow-md); color: var(--color-text); }
.role--muted { background: var(--color-neutral-200); }
.role-side { flex: 1 1 160px; max-width: 220px; }
.role-kind { font-size: 14px; color: var(--color-neutral-700); margin-top: 10px; }
.role-body { flex: 1 1 320px; min-width: 0; }
.role-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(22px, 4.4vw, 26px); margin: 0 0 6px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
}
.role-domain {
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  color: var(--color-accent-2-700);
}
.role-sub { font-size: 16px; font-weight: 600; color: var(--color-accent-700); margin-bottom: 14px; }
.role-sub--alt { color: var(--color-accent-2-700); }
.role-text {
  margin: 0; font-size: 17px; line-height: 1.6;
  color: var(--color-neutral-800); max-width: 640px; text-wrap: pretty;
}

/* ── projects ───────────────────────────────────────────────────────── */

.projects-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 36px;
}
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px;
}
.project {
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 26px) clamp(18px, 4vw, 28px);
  gap: clamp(14px, 3vw, 18px); align-items: start;
  transition: box-shadow 200ms ease;
}
.project:hover { box-shadow: var(--shadow-md); }
.project > div { min-width: 0; }
.project-badge {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 999px;
  font-family: var(--font-heading); font-size: 17px;
  display: grid; place-items: center;
  background: var(--color-accent-200); color: var(--color-accent-800);
}
.project-badge--alt { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }
.project-badge--neutral { background: var(--color-neutral-300); color: var(--color-neutral-900); }
.project-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 21px; margin: 0 0 6px;
}
.project-text {
  margin: 0 0 12px; font-size: 16px; line-height: 1.55; color: var(--color-neutral-800);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── stack ──────────────────────────────────────────────────────────── */

.stack-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px;
}
.stack-lede {
  font-size: 17px; line-height: 1.6; color: var(--color-neutral-700);
  margin: 0 0 22px; max-width: 420px;
}
.panel {
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 30px) clamp(20px, 4vw, 32px);
}
.panel--alt { background: var(--color-accent-2-200); }
.panel--alt p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--color-accent-2-900); }
.panel-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-neutral-700); margin-bottom: 16px;
}
.panel-kicker--alt { color: var(--color-accent-2-800); margin-bottom: 12px; }
.lang-list { display: flex; flex-direction: column; gap: 12px; }
.lang-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--color-divider); padding-bottom: 10px;
}
.lang-row:last-child { border-bottom: 0; padding-bottom: 0; }
.lang-name { font-size: 17px; font-weight: 600; }
.lang-level { font-size: 15px; color: var(--color-neutral-700); }

/* ── education ──────────────────────────────────────────────────────── */

.cert-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px;
}
.cert {
  display: block; border-radius: var(--radius-lg); padding: 26px 28px;
  color: var(--color-text); transition: box-shadow 200ms ease;
}
.cert:hover { box-shadow: var(--shadow-md); color: var(--color-text); }
.cert-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent-700); margin-bottom: 10px;
}
.cert-kicker--alt { color: var(--color-accent-2-700); }
.cert-title { font-family: var(--font-heading); font-size: 21px; margin-bottom: 8px; }
.cert-cta { font-size: 15px; color: var(--color-neutral-700); }

/* ── contact ────────────────────────────────────────────────────────── */

.contact { padding-block: clamp(40px, 7vw, 56px) clamp(56px, 9vw, 96px); }
.contact-card {
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 48px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 40px;
  position: relative; overflow: hidden;
}
.contact-blob {
  position: absolute; bottom: -140px; right: -80px; width: 320px; height: 320px;
  border-radius: 999px; background: var(--color-accent-200); opacity: 0.5;
}
.contact-head { position: relative; }
.contact-head h2 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(30px, 4vw, 42px); margin: 0; letter-spacing: -0.01em;
}
.contact-form { position: relative; display: flex; flex-direction: column; gap: 14px; }
.contact-form label {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px;
  color: var(--color-text);
}
.contact-form .input { width: 100%; }
.contact-form textarea.input { resize: vertical; border-radius: var(--radius-md); }
.form-status { font-size: 14px; color: var(--color-accent-2-700); min-height: 20px; }

/* ── lightbox ───────────────────────────────────────────────────────── */

.lightbox {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: clamp(16px, 5vw, 40px) clamp(14px, 5vw, 24px);
  background: color-mix(in srgb, var(--color-neutral-900) 62%, transparent);
  backdrop-filter: blur(8px);
  animation: om-fade 220ms ease both;
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  width: fit-content; transform-style: preserve-3d;
  transition: transform 140ms ease-out;
  animation: om-flip 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform;
}
.lightbox-frame {
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--color-neutral-200); box-shadow: var(--shadow-lg);
}
.lightbox-frame img {
  max-height: min(72vh, 620px); max-width: min(86vw, 460px);
  width: auto; height: auto;
}
.lightbox-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; color: var(--color-neutral-100);
}
.lightbox-name { font-family: var(--font-heading); font-size: 19px; }
.lightbox-close {
  color: var(--color-neutral-100); border-color: var(--color-neutral-400);
  font-size: 14px; padding: 8px 18px;
}
.lightbox-close:hover { color: var(--color-neutral-100); }

/* ── footer ─────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--color-divider); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 20px 24px;
  align-items: center; justify-content: space-between;
  padding-block: clamp(22px, 4vw, 30px);
}
.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social-link {
  width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center;
  background: var(--color-surface); color: var(--color-neutral-800);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background 200ms ease, color 200ms ease;
}
.social-link:hover {
  background: var(--color-accent-200); color: var(--color-accent-800);
  transform: translateY(-3px);
}
.phone-link {
  height: 42px; padding: 0 18px 0 14px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px;
  background: var(--color-accent-2-200); color: var(--color-accent-2-900);
  font-size: 15px; font-weight: 600;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background 200ms ease;
}
.phone-link:hover {
  background: var(--color-accent-2-300); color: var(--color-accent-2-900);
  transform: translateY(-3px);
}
.footer-meta {
  display: flex; flex-direction: column; gap: 4px; font-size: 14px;
  color: var(--color-neutral-700); text-align: right;
  margin-left: auto; flex: 0 1 auto; min-width: 0;
}

/* ── motion ─────────────────────────────────────────────────────────── */

@keyframes om-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes om-ping {
  0%   { transform: scale(1);   opacity: 0.75 }
  70%  { transform: scale(2.1); opacity: 0 }
  100% { transform: scale(2.1); opacity: 0 }
}
@keyframes om-nudge {
  0%, 100% { transform: translateY(0) }
  30%      { transform: translateY(-7px) }
  60%      { transform: translateY(-2px) }
}
@keyframes om-flip {
  from { opacity: 0; transform: perspective(1400px) rotateY(-24deg) rotateX(9deg) translateY(26px) scale(0.9) }
  to   { opacity: 1; transform: perspective(1400px) rotateY(0deg) rotateX(0deg) translateY(0) scale(1) }
}

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