/* =========================================================================
   Hamza Ouzouhou — shared chassis stylesheet
   Contains: design tokens, reset, type, and components shared across pages.
   Page-specific layout still lives inline in each HTML file for now.
   ========================================================================= */


/* =========================================================================
   1. DESIGN TOKENS
   Palette: Off-White Studio (selected from swatch test).
   Off-white background, near-black type, burnt orange as the loud accent.
   ========================================================================= */
:root {
  /* Color */
  --bg: #faf8f4;
  --text: #111111;
  --accent: #c84c1f;
  --anchor: #111111;                 /* secondary structural color */
  --border: rgba(0, 0, 0, 0.1);
  --muted: rgba(0, 0, 0, 0.55);
  --on-accent: #ffffff;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap: cubic-bezier(0.76, 0, 0.24, 1);

  /* Layout */
  --pad-x-desktop: 3rem;
  --pad-x-mobile: 1.5rem;
}


/* =========================================================================
   2. RESET + BASE
   ========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }


/* =========================================================================
   3. FOCUS — visible for keyboard users only
   ========================================================================= */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


/* =========================================================================
   4. NAV
   ========================================================================= */
nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  padding: 1.25rem var(--pad-x-desktop);
  display: flex; justify-content: space-between; align-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease;
}
nav.scrolled { border-bottom-color: var(--border); }

.nav-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.nav-name a { text-decoration: none; color: var(--text); }

.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  color: var(--text); text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.02em; position: relative;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1.5px; background: var(--accent);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { font-weight: 600; }

.nav-menu-btn {
  display: none; background: none; border: none;
  cursor: pointer; padding: 0.5rem; z-index: 200;
}
.nav-menu-btn span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text); margin: 5px 0;
  transition: all 0.3s ease;
}


/* =========================================================================
   5. AVAILABLE PILL
   ========================================================================= */
.available-pill {
  position: fixed;
  right: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  background: var(--accent);
  padding: 1rem 0.6rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  transition: padding 0.3s ease;
}
.available-pill:hover { padding: 1rem 0.85rem; }
.available-pill-dot {
  width: 6px; height: 6px;
  background: var(--on-accent); border-radius: 50%;
  animation: pulse 2s ease infinite;
}
.available-pill-text {
  font-family: var(--font-body);
  font-size: 0.58rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--on-accent);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }


/* =========================================================================
   6. PAGE TRANSITION
   ========================================================================= */
.page-transition {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--accent);
  transform: scaleY(1);
  transform-origin: top;
  animation: revealWipe 0.8s var(--ease-snap) 0.1s forwards;
  pointer-events: none;
}
@keyframes revealWipe {
  0% { transform: scaleY(1); transform-origin: top; }
  50% { transform: scaleY(0); transform-origin: top; }
  50.01% { transform: scaleY(0); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}


/* =========================================================================
   7. UTILITY: section labels
   ========================================================================= */
.label {
  font-family: var(--font-body);
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}


/* =========================================================================
   8. SCROLL REVEAL
   .reveal is VISIBLE by default. The hide-then-fade-in pattern only
   activates when JS adds .js-reveal-ready to <html>, which it only
   does when IntersectionObserver is available. This guarantees content
   is visible to: JS-disabled browsers, broken JS, search-engine
   crawlers that don't run scripts, and Chrome's print-to-PDF path
   (where IO doesn't reliably fire for elements far down the page).
   ========================================================================= */
.js-reveal-ready .reveal {
  opacity: 0; transform: translateY(45px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.js-reveal-ready .reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.35s; }

/* Force .reveal visible for print, regardless of JS state */
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
}


/* =========================================================================
   9. IMAGE HOVER POP
   ========================================================================= */
.img-link { display: block; overflow: hidden; text-decoration: none; }
.img-link img { transition: transform 0.5s var(--ease-out); }
.img-link:hover img { transform: scale(1.04); }


/* =========================================================================
   10. FOOTER
   ========================================================================= */
footer p, footer a {
  font-family: var(--font-body);
  font-size: 0.68rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
}
footer a:hover { color: var(--accent); }


/* =========================================================================
   11. RESPONSIVE — chassis only
   ========================================================================= */
@media (max-width: 900px) {
  nav { padding: 1rem var(--pad-x-mobile); }
  .nav-links {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100vh; background: var(--bg);
    flex-direction: column; align-items: center;
    justify-content: center; gap: 2rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.1rem; }
  .nav-menu-btn { display: block; }

  .available-pill { padding: 0.7rem 0.45rem; }
  .available-pill-text { font-size: 0.5rem; }
}


/* =========================================================================
   12. REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .page-transition { display: none; }
  /* Force .reveal visible — don't leave content hidden behind a disabled animation */
  .reveal { opacity: 1 !important; transform: none !important; }
}
