@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Outfit:wght@100..900&display=swap');

/* ---------- CSS Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  color: var(--color-white);
  background: var(--color-black);
  overflow-x: hidden;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ---------- CSS Variables ---------- */
:root {
  --color-navy: #1a2e5a;
  --color-navy-dark: #0f1d3d;
  --color-cream: #fdf6ed;
  --color-cream-dark: #f5ece0;
  --color-cyan: #7dd3e8;
  --color-cyan-light: #a8e6f0;
  --color-white: #ffffff;
  --color-black: #0a0a0a;
  --color-gray: #888888;
  --color-red: #e63946;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --navbar-height: 60px;
  --z-navbar: 1000;
  --z-modal: 2000;
  --z-overlay: 1500;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
}

.scroll-container {
  position: relative;
  width: 100%;
}

.scroll-track {
  position: relative;
  width: 100%;
}

.page-section {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: sticky !important;
  top: 0;
  left: 0;
  overflow: hidden;
  /* Add smooth transition for the brightness filter if we update it via JS */
  transition: filter 0.1s ease-out;
}

#page-1 { z-index: 1; }
#page-2 { z-index: 2; }
#page-3 { z-index: 3; }
#page-4 { z-index: 4; }
#page-5 { z-index: 5; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 40px;
  z-index: calc(var(--z-navbar) + 10);
  transition: background 0.4s ease;
}

.navbar__logo {
  position: absolute;
  top: 50%;
  right: 100px;
  transform: translateY(-50%);
  height: 22px;
  width: 100px;
  opacity: 0.95;
}

.navbar__logo-img {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: auto;
  object-fit: contain;
  transition: opacity 0.45s ease;
}

.navbar__logo-img--white {
  opacity: 1;
}

.navbar__logo-img--black {
  opacity: 0;
}

/* Light background state (Page 2 & Page 5 when menu is CLOSED) */
.navbar.navbar--dark-text .navbar__logo-img--white {
  opacity: 0;
}

.navbar.navbar--dark-text .navbar__logo-img--black {
  opacity: 1;
}

/* When Menu is open or on dark page */
.navbar.navbar--white .navbar__logo-img--white {
  opacity: 1;
}

.navbar.navbar--white .navbar__logo-img--black {
  opacity: 0;
}

.burger {
  width: 36px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: calc(var(--z-navbar) + 10);
  position: relative;
}

.burger__line {
  width: 100%;
  height: 3px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.4s var(--transition-smooth),
              opacity 0.4s var(--transition-smooth),
              background 0.45s ease;
  transform-origin: center;
}

.burger.active .burger__line:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.burger.active .burger__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger.active .burger__line:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* ---------- Slide-in Menu ---------- */
.nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 300px;
  height: 100vh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 40px 60px;
  text-align: right;
  z-index: var(--z-navbar);
  transition: right 0.5s var(--transition-smooth);
}

.nav-menu.open {
  right: 0;
}

.nav-menu__link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 15px;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
  letter-spacing: 2px;
}

.nav-menu.open .nav-menu__link {
  opacity: 1;
  transform: translateX(0);
}

.nav-menu.open .nav-menu__link:nth-child(1) { transition-delay: 0.15s; }
.nav-menu.open .nav-menu__link:nth-child(2) { transition-delay: 0.25s; }
.nav-menu.open .nav-menu__link:nth-child(3) { transition-delay: 0.35s; }

.nav-menu__link:hover {
  color: var(--color-cyan);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: calc(var(--z-navbar) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ---------- Modal Base ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-back {
  position: fixed;
  bottom: 40px;
  left: 40px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 2px;
  cursor: pointer;
  z-index: calc(var(--z-modal) + 1);
  transition: color 0.3s ease;
  background: none;
  border: none;
}

.modal-back:hover {
  color: var(--color-cyan);
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 50px;
  }

  .navbar {
    padding: 0 20px;
  }

  .navbar__logo {
    right: 70px;
    height: 18px;
  }

  .burger {
    width: 30px;
    height: 20px;
  }

  .burger__line {
    height: 2px;
  }

  .burger.active .burger__line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .burger.active .burger__line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .nav-menu {
    width: 60vw;
    max-width: none;
    padding: 30px 40px;
  }

  .nav-menu__link {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  .modal-overlay {
    padding: 20px;
  }

  .modal-back {
    bottom: 20px;
    left: 20px;
  }
}
