/* ==========================================================================
   GLOBAL DESIGN TOKENS & RESET (Ethereal Glass + Academic Accents)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg-oled: #04111d;
  --bg-card-outer: #102b3d;
  --bg-card-inner: #091d2c;
  --accent-slate: #31d1ed;
  --accent-charcoal: #237ff0;
  --accent-glow: rgba(49, 209, 237, 0.18);
  
  --text-main: #f8fafc;
  --text-muted: #9db8c8;
  
  --hairline: rgba(117, 211, 235, 0.16);
  --hairline-subtle: rgba(117, 211, 235, 0.07);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Layout */
  --page-header-offset: clamp(10rem, 20vh, 13rem);

  /* Motion */
  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-snappy: cubic-bezier(0.68, -0.55, 0.26, 1.55);
}

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

body {
  background-color: var(--bg-oled);
  background-image: 
    linear-gradient(var(--hairline-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline-subtle) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center center;
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: rgba(49, 209, 237, 0.3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-slate);
  outline-offset: 3px;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22noiseFilter%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.65%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23noiseFilter)%22 opacity=%220.03%22/%3E%3C/svg%3E');
}

/* Background Mesh Glow */
body::before {
  content: '';
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 60vh;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.text-massive {
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.04em;
}

.text-h2 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.text-h3 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.eyebrow {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.625rem; /* 10px */
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  background: var(--bg-card-outer);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   LAYOUT & SPACING
   ========================================================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-spacing {
  padding-top: clamp(6rem, 15vh, 10rem);
  padding-bottom: clamp(6rem, 15vh, 10rem);
}

/* Keep every page heading clear of the floating navigation island. */
body > header.section-spacing {
  padding-top: var(--page-header-offset);
}

/* ==========================================================================
   COMPONENTS: DOUBLE BEZEL CARDS
   ========================================================================== */
.doppel-shell {
  background: linear-gradient(145deg, #12364b, #0b2232);
  border: 1px solid var(--hairline);
  padding: 0.375rem; /* ~6px */
  border-radius: 2rem;
  position: relative;
  overflow: hidden;
}

.doppel-core {
  background: var(--bg-card-inner);
  border-radius: calc(2rem - 0.375rem);
  box-shadow: inset 0 1px 1px rgba(181, 238, 252, 0.12);
  padding: 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   COMPONENTS: NESTED CTA BUTTONS
   ========================================================================== */
.btn-nested {
  display: inline-flex;
  align-items: center;
  background: var(--text-main);
  color: var(--bg-oled);
  border-radius: 9999px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.4s var(--ease-fluid);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-nested:active {
  transform: scale(0.98);
}

.btn-nested .btn-text {
  margin-right: 1rem;
}

.btn-nested .btn-icon-wrapper {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-fluid);
}

.btn-nested:hover .btn-icon-wrapper {
  transform: translate(4px, -1px) scale(1.05);
}

/* Secondary CTA */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-main);
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--hairline);
  transition: all 0.4s var(--ease-fluid);
}
.btn-secondary:hover {
  background: var(--bg-card-outer);
  border-color: rgba(255,255,255,0.3);
}

/* ==========================================================================
   NAVIGATION (FLUID ISLAND)
   ========================================================================== */
.nav-island {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: linear-gradient(135deg, rgba(5, 28, 48, 0.9), rgba(7, 55, 91, 0.82));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(48, 207, 239, 0.28);
  box-shadow: 0 14px 40px rgba(0, 126, 214, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.6s var(--ease-fluid);
  will-change: transform, opacity;
}

.nav-island.nav-hidden {
  transform: translate(-50%, calc(-100% - 2rem));
  opacity: 0;
  pointer-events: none;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-brand img {
  display: block;
  width: 132px;
  height: auto;
}

.nav-brand .nav-logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: #b8d7e6;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.8rem;
  border-radius: 9999px;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #35d5f2;
  background: rgba(49, 209, 237, 0.1);
}

.about-nav-item { position: relative; }
.about-menu-toggle,
.mobile-about-toggle {
  color: #b8d7e6;
  background: transparent;
  border: 0;
  font: 500 0.875rem/1 var(--font-sans);
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.about-menu-toggle:hover,
.about-menu-toggle[aria-expanded="true"],
.about-menu-toggle.active { color: #fff; background: rgba(49, 209, 237, 0.12); }
.about-menu-toggle svg,
.mobile-about-toggle svg { transition: transform .25s ease; }
.about-menu-toggle[aria-expanded="true"] svg,
.mobile-about-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.about-menu {
  position: absolute;
  top: calc(100% + 1.15rem);
  left: 50%;
  width: min(42rem, calc(100vw - 2rem));
  transform: translate(-50%, .65rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
  padding: .45rem;
  border: 1px solid rgba(49, 209, 237, .34);
  border-radius: 1.6rem;
  background: linear-gradient(145deg, #12364b, #071b2a);
  box-shadow: 0 22px 60px rgba(0, 8, 18, .55), 0 0 28px rgba(49, 209, 237, .1);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
  z-index: 120;
}
.about-menu[hidden] { display: grid; }
.about-menu.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; }
.about-menu-item {
  min-height: 5.7rem;
  display: grid !important;
  grid-template-columns: 2rem 1fr auto;
  gap: .7rem;
  align-items: start;
  padding: .9rem !important;
  border: 1px solid transparent;
  border-radius: 1.15rem !important;
  background: rgba(4, 17, 29, .68);
}
.about-menu-item:hover { border-color: var(--hairline); }
.about-menu-item[aria-disabled="true"] { opacity: .58; cursor: not-allowed; }
.about-menu-icon {
  color: var(--accent-slate);
  font-size: 1.65rem;
  line-height: 1;
}
.about-menu-item:last-child > .about-menu-icon,
.about-menu-item:last-child > span:first-child {
  width: 1rem;
  height: 1rem;
  margin-top: .05rem;
  font-size: 0;
  background-color: var(--accent-slate);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center / contain no-repeat;
}
.about-menu-copy strong { display: block; color: #fff; font-size: .86rem; }
.about-menu-copy span { display: block; margin-top: .2rem; color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
.menu-indicator { color: var(--accent-slate); font-size: .66rem; white-space: nowrap; }
.menu-badge { padding: .12rem .42rem; border: 1px solid var(--hairline); border-radius: 999px; }

.mobile-about-toggle,
.mobile-about-menu { display: none; }

.nav-links a.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(49, 209, 237, 0.2), rgba(35, 127, 240, 0.2));
}

.nav-island .btn-nested {
  background: linear-gradient(135deg, #31d1ed, #237ff0);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(35, 127, 240, 0.28);
}

.nav-island .btn-icon-wrapper {
  background: rgba(0, 45, 83, 0.22);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--hairline);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--text-main);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(3, 22, 38, 0.97), rgba(5, 54, 90, 0.96));
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-fluid);
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-overlay .nav-links {
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.mobile-nav-overlay .nav-links a {
  font-size: 2rem;
  font-weight: 600;
  transform: translateY(3rem);
  opacity: 0;
  transition: all 0.8s var(--ease-fluid);
}

.mobile-nav-overlay.open .nav-links a {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-overlay.open .nav-links li:nth-child(1) a { transition-delay: 0.1s; }
.mobile-nav-overlay.open .nav-links li:nth-child(2) a { transition-delay: 0.15s; }
.mobile-nav-overlay.open .nav-links li:nth-child(3) a { transition-delay: 0.2s; }
.mobile-nav-overlay.open .nav-links li:nth-child(4) a { transition-delay: 0.25s; }
.mobile-nav-overlay.open .nav-links li:nth-child(5) a { transition-delay: 0.3s; }

/* Hamburger */
.hamburger {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: rgba(48, 207, 239, 0.12);
  border: 1px solid rgba(48, 207, 239, 0.3);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  z-index: 100;
}

.hamburger span {
  width: 18px;
  height: 1px;
  background: var(--text-main);
  transition: transform 0.6s var(--ease-fluid), opacity 0.6s var(--ease-fluid);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 768px) {
  :root {
    --page-header-offset: 8rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .text-massive {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }
  .section-spacing {
    padding-top: 6rem;
    padding-bottom: 5rem;
  }
  .nav-island .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .nav-island {
    top: max(0.75rem, env(safe-area-inset-top));
    width: calc(100% - 1.5rem);
    max-width: 30rem;
    justify-content: space-between;
    padding: 0.5rem;
    gap: 0.75rem;
  }
  .nav-brand img {
    width: 112px;
  }
  .nav-brand .nav-logo-icon {
    width: 36px;
    height: 36px;
  }
  .nav-island > .btn-nested {
    padding-left: 1rem;
  }
  .nav-island > .btn-nested .btn-text {
    margin-right: 0.5rem;
  }
  .nav-island > .btn-nested .btn-icon-wrapper {
    width: 2.25rem;
    height: 2.25rem;
  }
  .mobile-nav-overlay {
    padding: calc(5.5rem + env(safe-area-inset-top)) 1.25rem calc(2rem + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .mobile-nav-overlay .nav-links {
    gap: clamp(1rem, 4vh, 2rem);
  }
  .mobile-nav-overlay .nav-links a {
    display: block;
    font-size: clamp(1.35rem, 7vw, 2rem);
    text-align: center;
  }
  .mobile-nav-overlay .nav-links { width: min(100%, 30rem); align-items: stretch; }
  .mobile-nav-overlay .nav-links > li { width: 100%; text-align: center; }
  .mobile-about-toggle {
    display: inline-flex;
    min-height: 44px;
    margin: 0 auto;
    color: var(--text-main);
    font-size: clamp(1.35rem, 7vw, 2rem);
    font-weight: 600;
  }
  .mobile-about-menu { list-style: none; margin-top: .5rem; padding: .35rem; border: 1px solid var(--hairline); border-radius: 1.25rem; background: rgba(4,17,29,.72); }
  .mobile-about-menu[hidden] { display: none; }
  .mobile-about-menu.open { display: grid; gap: .2rem; }
  .mobile-nav-overlay .mobile-about-menu a,
  .mobile-nav-overlay .mobile-about-menu [aria-disabled="true"] { display: flex; min-height: 44px; align-items: center; justify-content: space-between; padding: .65rem .8rem; font-size: .88rem; text-align: left; transform: none; opacity: 1; }
  .mobile-nav-overlay .mobile-about-menu [aria-disabled="true"] { color: var(--text-muted); }
  .doppel-core {
    padding: 1.5rem;
  }
  .global-footer {
    padding: 3rem 1rem;
    margin-top: 3rem;
  }
}

@media (max-width: 360px) {
  .nav-island > .btn-nested .btn-text {
    display: none;
  }
  .nav-island > .btn-nested {
    padding: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.global-footer {
  border-top: 1px solid var(--hairline);
  padding: 4rem 2rem;
  margin-top: 6rem;
  text-align: center;
}

.global-footer .footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.global-footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   MOTION: SCROLL INTERPOLATION
   ========================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(4rem);
  filter: blur(8px);
  transition: opacity 1s var(--ease-fluid), transform 1s var(--ease-fluid), filter 1s var(--ease-fluid);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
