/* ========================================
   MO BADAWI — SHARED STYLES
   Used across Figures, About, and Contact
   ======================================== */

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

:root {
  --bg: #0a0a0a;
  --text: #e8e8e8;
  --text-dim: #888;
  --text-faint: #555;
  --accent: #c8c8c8;
  --border: #2a2a2a;
  --border-hover: #555;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* ============ NAVIGATION ============ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0) 100%);
  transition: opacity 0.4s ease;
}

nav.hidden { opacity: 0; pointer-events: none; }

nav .mark {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

nav .mark img {
  width: 13px;
  height: 13px;
  display: block;
  transition: transform 0.3s ease;
}

nav .mark:hover img {
  transform: scale(1.1);
}

nav .links {
  display: flex;
  gap: 32px;
}

nav .links a {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.25s ease;
}

nav .links a:hover, nav .links a.active { color: var(--text); }

/* ============ PAGE CONTAINER ============ */
.page {
  min-height: 100vh;
  padding: 140px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: 80px;
}

.page-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
  font-weight: 400;
}

.page-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: -0.02em;
  line-height: 1;
  font-style: italic;
}

/* ============ RESPONSIVE NAV — TABLET (still horizontal but tighter) ============ */
@media (max-width: 900px) and (min-width: 769px) {
  nav { padding: 18px 24px; }
  nav .links { gap: 18px; }
  nav .links a { font-size: 10px; letter-spacing: 0.2em; }
}

/* ============ MOBILE NAV — HAMBURGER MENU ============
   At 768px and below, the horizontal nav is replaced with a hamburger button
   that opens a full-screen menu overlay.
============================================================== */
@media (max-width: 768px) {
  nav {
    padding: 18px 20px;
    /* Make sure nav stays above the menu overlay's background */
    z-index: 200;
  }

  /* Logo stays the same, just slightly larger for tap accessibility */
  nav .mark { font-size: 11px; gap: 8px; }
  nav .mark img { width: 16px; height: 16px; }

  /* Hide the horizontal links - they move to the overlay menu */
  nav .links { display: none; }

  /* Show the hamburger button */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    /* Push to right side of nav */
    margin-left: auto;
    position: relative;
    z-index: 201;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    margin: 3px 0;
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.3s ease,
                background 0.3s ease;
    transform-origin: center;
  }

  /* Animate hamburger into an X when menu is open */
  body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
  }
  body.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
  }
  body.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-4.5px) rotate(-45deg);
  }

  /* Full-screen menu overlay */
  .menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 199;  /* below nav (200) but above page content */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 24px 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  body.menu-open .menu-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* Menu links - large, generous tap targets */
  .menu-overlay .menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .menu-overlay .menu-links li {
    /* Stagger fade-in when menu opens */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
  }

  body.menu-open .menu-overlay .menu-links li {
    opacity: 1;
    transform: translateY(0);
  }

  body.menu-open .menu-overlay .menu-links li:nth-child(1) { transition-delay: 0.10s; }
  body.menu-open .menu-overlay .menu-links li:nth-child(2) { transition-delay: 0.16s; }
  body.menu-open .menu-overlay .menu-links li:nth-child(3) { transition-delay: 0.22s; }
  body.menu-open .menu-overlay .menu-links li:nth-child(4) { transition-delay: 0.28s; }

  .menu-overlay .menu-links a {
    font-family: var(--serif);
    font-style: italic;
    font-size: 38px;
    color: var(--text);
    text-decoration: none;
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.4;
    padding: 14px 24px;
    display: inline-block;
    transition: opacity 0.3s ease;
  }

  .menu-overlay .menu-links a.active {
    opacity: 0.45;  /* current page is dimmed since you're already there */
  }

  .menu-overlay .menu-links a:active {
    opacity: 0.6;
  }

  /* Footer in menu - the wordmark and a small line */
  .menu-overlay .menu-footer {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-faint);
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
  }

  body.menu-open .menu-overlay .menu-footer {
    opacity: 1;
  }

  /* Lock body scroll while menu is open */
  body.menu-open {
    overflow: hidden;
  }

  /* Adjust page padding since nav is more compact now */
  .page { padding: 100px 20px 60px; }
  .page-header { margin-bottom: 56px; }
  .page-eyebrow { font-size: 9px; letter-spacing: 0.35em; margin-bottom: 18px; }
  .page-title { font-size: clamp(40px, 9vw, 72px); }
}

/* Hide hamburger and overlay on desktop */
@media (min-width: 769px) {
  .menu-toggle, .menu-overlay { display: none; }
}

/* ============ PHONE — tighter ============ */
@media (max-width: 500px) {
  .menu-overlay .menu-links a { font-size: 34px; }
  .page { padding: 90px 18px 48px; }
  .page-header { margin-bottom: 40px; }
  .page-title { font-size: clamp(36px, 12vw, 60px); }
}
