/* ── Design Tokens ── */
:root {
  --bg: #f9f9f9;
  --surface-low: #f3f3f3;
  --primary: #000000;
  --on-surface: #1a1c1c;
  --on-surface-variant: #474747;
  --outline: #777777;
  --outline-variant: #c6c6c6;
  --font-display: 'Newsreader', serif;
  --font-body: 'Barlow', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  cursor: crosshair;
  opacity: 0;
  animation: pageLoad 0.4s ease forwards;
}
@keyframes pageLoad { to { opacity: 1; } }

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  background: rgba(249, 249, 249, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.2em;
  font-size: 1.3rem;
  color: var(--primary);
}
.nav__links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav__links a {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  transition: color 0.3s ease;
}
.nav__links a:hover,
.nav__links a.active { color: var(--primary); }
.nav__links a.active { border-bottom: 1px solid var(--primary); padding-bottom: 2px; }
.nav__links .nav__cta {
  border: 1px solid var(--outline-variant);
  padding: 0.55rem 0.95rem;
  color: var(--on-surface-variant);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.nav__links .nav__cta:hover,
.nav__links .nav__cta.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 0.55rem;
}

/* ── Footer ── */
.site-footer {
  background: var(--surface-low);
  color: var(--on-surface);
  padding: clamp(3rem, 4.5vw, 4.25rem) 3rem 1.75rem;
}
.site-footer__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.6rem, 3vw, 2.25rem);
}
.site-footer__col { padding: 0; }
.site-footer__col--brand { padding-right: 0; }
.site-footer__brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.65rem;
  color: var(--primary);
  margin-bottom: 1.1rem;
}
.site-footer__desc {
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--on-surface-variant);
  max-width: 34ch;
  margin: 0 auto;
}
.site-footer__coltitle {
  font-size: 0.625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--outline);
  margin-bottom: 1.1rem;
}
.site-footer__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.site-footer__links a,
.site-footer__links span {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  transition: color 0.3s ease;
}
.site-footer__links a:hover { color: var(--primary); }
.site-footer__links .muted { color: var(--outline); }
.site-footer__bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}
.site-footer__copy,
.site-footer__top {
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--outline);
}
.site-footer__top { transition: color 0.3s ease; }
.site-footer__top:hover { color: var(--primary); }

/* ── Sans-font pages (CV + Mission): match the footer wordmark to the page font.
   (Nav bar stays Newsreader on every page, same as Home/Portfolio.) ── */
.page-sans .site-footer__brand { font-family: 'Plus Jakarta Sans', sans-serif; font-style: normal; font-weight: 700; }

/* ── Typography utilities ── */
.label {
  font-size: 0.625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--outline);
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Clip reveal (images) ── */
.clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.clip-reveal.visible {
  clip-path: inset(0 0% 0 0);
}

/* ── Word-by-word text reveal ── */
.word-reveal .word {
  display: inline-block;
  vertical-align: bottom;
  padding: 0 0.12em;
  margin: 0 -0.12em;
}
.word-reveal .word .inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.word-reveal.visible .word .inner { opacity: 1; transform: translateY(0); }
.word-reveal .word:nth-child(1) .inner { transition-delay: 0s; }
.word-reveal .word:nth-child(2) .inner { transition-delay: 0.1s; }
.word-reveal .word:nth-child(3) .inner { transition-delay: 0.2s; }
.word-reveal .word:nth-child(4) .inner { transition-delay: 0.3s; }
.word-reveal .word:nth-child(5) .inner { transition-delay: 0.4s; }
.word-reveal .word:nth-child(6) .inner { transition-delay: 0.5s; }


/* ── Mobile menu (hamburger + full-screen overlay) ── */
.nav__burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  margin-right: -11px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-menu__links a {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2.5rem, 12vw, 4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  padding: 0.4rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open .mobile-menu__links a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.open .mobile-menu__links li:nth-child(1) a { transition-delay: 0.1s; }
.mobile-menu.open .mobile-menu__links li:nth-child(2) a { transition-delay: 0.18s; }
.mobile-menu.open .mobile-menu__links li:nth-child(3) a { transition-delay: 0.26s; }
.mobile-menu__links a.active {
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}
body.menu-open { overflow: hidden; }


/* ── Mobile ── */
@media (max-width: 768px) {
  .nav { padding: 1.25rem 1.5rem; }
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .menu-open .nav { z-index: 300; }
  .site-footer { padding: 4rem 1.5rem 2rem; }
  .site-footer__cta { font-size: clamp(1.5rem, 6vw, 2rem); }
  .site-footer__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .site-footer__col { padding: 0 !important; border-left: none !important; }
  .site-footer__col--brand { grid-column: 1 / -1; padding-right: 0; }
}
