/* ==========================================================================
   Theoria Center — one page, four movements
   1. Full-screen ice video          3. Mission  (parallax)
   2. About Us      (parallax)       4. Projects (parallax)
   ========================================================================== */

:root {
  --ink: #08131F;
  --gold: #F5B841;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --grotesk: var(--sans);
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  overflow-x: hidden;
}

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

::selection { background: rgba(245, 184, 65, 0.35); }

/* ==========================================================================
   Menu — floating glass capsule with a sliding active indicator
   ========================================================================== */
.site-nav {
  position: fixed;
  top: clamp(0.85rem, 2.4vh, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 1.25rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem 0.35rem 0.4rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045));
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow:
    0 22px 45px -26px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.site-nav.scrolled {
  background: linear-gradient(180deg, rgba(8, 19, 31, 0.74), rgba(8, 19, 31, 0.6));
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow:
    0 26px 55px -30px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Brand */
.nav-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.15rem 0.6rem 0.15rem 0.15rem;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
}
.nav-brand img {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  max-width: none;
  border-radius: 12px;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.95);
  transition: transform 0.3s ease;
}
.nav-brand:hover img { transform: translateY(-1px); }
.nav-brand-name {
  font-family: var(--grotesk);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.nav-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
}

/* Links + sliding pill */
.nav-menu {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.1rem;
  padding: 0.12rem;
  border-radius: 999px;
}

.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateX(0);
  transition:
    transform 0.5s cubic-bezier(0.22, 0.85, 0.25, 1),
    width 0.5s cubic-bezier(0.22, 0.85, 0.25, 1),
    opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.nav-pill.ready { opacity: 1; }

.nav-link {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: var(--ink); }
.nav-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Mobile menu button ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  height: 44px;
  padding: 0 0.85rem 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 11px;
}
.nav-toggle-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.32s cubic-bezier(0.22, 0.85, 0.25, 1);
}
.nav-toggle-icon span:first-child { top: 1px; }
.nav-toggle-icon span:last-child { bottom: 1px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Mobile menu sheet ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5.75rem clamp(1.35rem, 7vw, 2.5rem) 2rem;
  background: linear-gradient(180deg, rgba(6, 14, 24, 0.96), rgba(6, 14, 24, 0.99));
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s;
}

.mobile-menu-nav { display: flex; flex-direction: column; }

.mobile-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.55rem, 7.5vw, 2.1rem);
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease, color 0.25s ease;
}
.mobile-menu.open .mobile-link { opacity: 1; transform: none; }
.mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.06s; }
.mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.11s; }
.mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.16s; }
.mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.21s; }
.mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.26s; }

.mobile-link.active { color: var(--gold); }
.mobile-link:active { color: var(--gold); }

.mobile-num {
  font-family: var(--grotesk);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.42);
}
.mobile-link.active .mobile-num { color: var(--gold); }

.mobile-menu-mail {
  align-self: flex-start;
  font-family: var(--grotesk);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 184, 65, 0.45);
  padding-bottom: 0.35rem;
  margin-top: 2rem;
}
.mobile-menu-mail:hover { color: var(--gold); }

body.menu-open { overflow: hidden; }

/* Tablet: wordmark steps out, links stay */
@media (max-width: 860px) {
  .nav-brand-name { display: none; }
  .nav-brand { padding-right: 0.2rem; }
}

/* Phone: brand + Menu button, links move into the sheet */
@media (max-width: 719px) {
  .site-nav {
    left: 0.8rem;
    right: 0.8rem;
    transform: none;
    max-width: none;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.35rem 0.35rem 0.45rem;
  }
  .nav-menu, .nav-divider { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-brand { padding: 0; gap: 0.6rem; }
  .nav-brand-name {
    display: block;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
  }
  .nav-brand img { width: 42px; height: 42px; border-radius: 11px; }
}

@media (min-width: 720px) {
  .mobile-menu { display: none; }
}

/* Very narrow phones: keep the logo, drop the wordmark */
@media (max-width: 340px) {
  .nav-brand-name { display: none; }
}

/* ==========================================================================
   Hero — video fills the whole screen
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #06101B;
  isolation: isolate;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02); /* hides sub-pixel edges on HiDPI screens */
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(62% 44% at 50% 50%, rgba(6, 16, 27, 0.42) 0%, rgba(6, 16, 27, 0.18) 55%, rgba(6, 16, 27, 0) 78%),
    radial-gradient(115% 85% at 50% 42%, rgba(6, 16, 27, 0.04) 0%, rgba(6, 16, 27, 0.4) 72%, rgba(6, 16, 27, 0.72) 100%),
    linear-gradient(180deg, rgba(6, 16, 27, 0.5) 0%, rgba(6, 16, 27, 0.12) 38%, rgba(6, 16, 27, 0.6) 100%);
}

.hero-title {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.35rem, 7vw, 7rem);
  line-height: 1.03;
  letter-spacing: -0.028em;
  color: #fff;
  text-wrap: balance;
  text-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

/* Headline is hidden until the video has played for 6s (see script.js) */
.hero-line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  filter: blur(14px);
}

.hero-title.is-visible .hero-line {
  animation: heroReveal 2s cubic-bezier(0.16, 0.72, 0.24, 1) forwards;
}
.hero-title.is-visible .hero-line:nth-child(2) { animation-delay: 0.22s; }

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ==========================================================================
   Parallax chapters
   ========================================================================== */
.chapter {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}

/* Layer is oversized by 44% (22% top and bottom) so the parallax can move
   the image without ever exposing an edge. Keep in sync with script.js. */
.chapter-media {
  position: absolute;
  top: -22%;
  bottom: -22%;
  left: 0;
  right: 0;
  z-index: 0;
  will-change: transform;
  backface-visibility: hidden;
}
.chapter-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.chapter-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.chapter-scrim--right {
  background:
    linear-gradient(90deg, rgba(8, 19, 31, 0.16) 0%, rgba(8, 19, 31, 0.26) 42%, rgba(8, 19, 31, 0.76) 100%),
    linear-gradient(180deg, rgba(8, 19, 31, 0.42) 0%, rgba(8, 19, 31, 0.04) 45%, rgba(8, 19, 31, 0.46) 100%);
}
.chapter-scrim--left {
  background:
    linear-gradient(270deg, rgba(8, 19, 31, 0.2) 0%, rgba(8, 19, 31, 0.42) 42%, rgba(8, 19, 31, 0.86) 100%),
    linear-gradient(180deg, rgba(8, 19, 31, 0.42) 0%, rgba(8, 19, 31, 0.04) 45%, rgba(8, 19, 31, 0.48) 100%);
}

.chapter-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) clamp(1.5rem, 6vw, 5.5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.chapter-content { max-width: 34rem; min-width: 0; }

.chapter-index {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.4rem;
  font-family: var(--grotesk);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.chapter-index span { color: var(--gold); letter-spacing: 0.12em; }
.chapter-index::after {
  content: "";
  flex: 1;
  max-width: 3.5rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.chapter-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.9rem, 8.2vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: #fff;
  text-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.chapter-copy {
  margin: 1.6rem 0 0;
  max-width: 42ch;
  font-size: clamp(1rem, 1.45vw, 1.25rem);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.92);
  text-wrap: pretty;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.chapter-link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 184, 65, 0.55);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chapter-link:hover { color: #fff; border-color: #fff; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3rem, 8vh, 5rem);
  padding: clamp(5rem, 12vh, 8rem) clamp(1.5rem, 6vw, 5.5rem) clamp(1.75rem, 4vh, 2.5rem);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}
.contact::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(46rem, 90vw);
  height: min(46rem, 90vw);
  right: -12rem;
  top: -18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 160, 0.18), transparent 65%);
  pointer-events: none;
}
.contact::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(38rem, 80vw);
  height: min(38rem, 80vw);
  left: -14rem;
  bottom: -20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 184, 65, 0.12), transparent 65%);
  pointer-events: none;
}

.contact-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.contact-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.05fr 1fr; }
  .contact-inner { max-width: none; }
}

/* ---------- Form ---------- */
.contact-form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 40px 80px -55px rgba(0, 0, 0, 0.95);
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(8, 19, 31, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field textarea { resize: vertical; min-height: 6.5rem; }
.field input::placeholder,
.field textarea::placeholder { color: rgba(255, 255, 255, 0.32); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(8, 19, 31, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 165, 160, 0.2);
}
.field input.invalid,
.field textarea.invalid {
  border-color: #F87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}

.btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.25rem;
  padding: 0.9rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-send:hover {
  background: #FFC95C;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -16px rgba(245, 184, 65, 0.55);
}
.btn-send:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.form-msg { margin: 0; font-size: 0.85rem; line-height: 1.6; }
.form-msg--error { color: #FCA5A5; }
.form-msg--ok { color: #5EEAD4; }
.form-msg[hidden] { display: none; }

.contact-mail {
  display: inline-block;
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 184, 65, 0.5);
  padding-bottom: 0.25rem;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.contact-mail:hover { color: var(--gold); border-color: var(--gold); }
.contact-mail:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.contact-meta {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.contact-meta a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}
.contact-meta a:hover { color: var(--gold); }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 0.7, 0.3, 1),
    transform 0.9s cubic-bezier(0.22, 0.7, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 900px) {
  .chapter-inner { grid-template-columns: repeat(12, 1fr); }
  .chapter-content { grid-column: 1 / span 6; }
  .chapter--right .chapter-content { grid-column: 7 / span 6; }
}

@media (max-width: 899px) {
  .chapter { min-height: 82vh; min-height: 82svh; }
  .chapter-inner { align-content: center; }
  .chapter-scrim--right,
  .chapter-scrim--left {
    background: linear-gradient(180deg, rgba(8, 19, 31, 0.3) 0%, rgba(8, 19, 31, 0.55) 55%, rgba(8, 19, 31, 0.8) 100%);
  }
  .chapter-copy { max-width: 36ch; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(2.1rem, 10.5vw, 3rem); }
  .chapter-title { font-size: clamp(2.5rem, 15vw, 3.6rem); }
}

@media (max-width: 360px) {
  .hero-title { font-size: clamp(1.7rem, 9.2vw, 2.4rem); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@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;
  }
  .hero-line { opacity: 1; filter: none; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .chapter-media { transform: none !important; }
}
