@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

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

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #3a3f6b;
  --muted: #8b90b8;
  --accent: #6b74c2;
  --silver: #b0b8cc;
  --gold-light: #e8dfa0;
  --rule: #dde0f0;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', sans-serif;
  --nav-h: 72px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(245, 246, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.nav-logo span {
  display: block;
  font-size: 0.7rem;
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--text);
  transition: width 0.25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; background: var(--accent); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a { cursor: default; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 12px 0;
  min-width: 140px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  /* Delay hiding so mouse can travel to menu */
  transition-delay: 0s;
}
/* Invisible bridge fills the gap so mouse doesn't lose hover */
.dropdown-menu::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}
/* Delay the hiding by 150ms so fast mouse movements don't close it */
.nav-dropdown .dropdown-menu {
  transition: opacity 0.2s 0.15s, transform 0.2s 0.15s;
}
.nav-dropdown:hover .dropdown-menu {
  transition: opacity 0.15s 0s, transform 0.15s 0s;
}
.dropdown-menu a {
  display: block;
  padding: 8px 20px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dropdown-menu a:hover { color: var(--text); }
.dropdown-menu a::after { display: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text);
  transition: all 0.3s;
}

/* Mobile nav */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 99;
  padding: 48px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--text); }
.mobile-menu .mobile-sub {
  padding-left: 20px;
  font-size: 0.78rem;
}

/* ── Page wrapper ── */
.page {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--rule);
  padding: 32px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 80px;
}
footer p {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

/* ── Section heading ── */
.section-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Button ── */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 13px 28px;
  border: 1px solid var(--silver);
  color: var(--text);
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.btn:hover {
  background: var(--silver);
  color: #ffffff;
  border-color: var(--silver);
}
.btn-fill {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-fill:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Dark mode ── */
body.dark {
  --bg: #12142a;
  --surface: #1c1f3a;
  --text: #d8daf0;
  --muted: #7a7fa8;
  --accent: #8f96e0;
  --rule: #2a2d4a;
}

body.dark nav {
  background: rgba(18, 20, 42, 0.92);
}

body.dark .dropdown-menu {
  background: var(--surface);
}

body.dark .mobile-menu {
  background: var(--bg);
}

/* ── Dark mode toggle button ── */
.dark-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
  position: relative;
  overflow: visible;
}
.dark-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(107, 116, 194, 0.08);
}

/* Rocket element */
.dark-toggle .rocket {
  position: absolute;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Launch: rocket shoots upward */
@keyframes rocketLaunch {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) rotate(-45deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px) rotate(-45deg); }
}

/* Land: rocket comes down from above */
@keyframes rocketLand {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-60px) rotate(135deg); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(0) rotate(135deg); }
}

.dark-toggle.launching .rocket {
  animation: rocketLaunch 0.5s ease-in forwards;
}

.dark-toggle.landing .rocket {
  animation: rocketLand 0.5s ease-out forwards;
}

/* Hide the icon text during animation */
.dark-toggle.launching .toggle-icon,
.dark-toggle.landing .toggle-icon {
  opacity: 0;
  transition: opacity 0.1s;
}

.dark-toggle .toggle-icon {
  transition: opacity 0.2s;
}

/* ── Fade-in animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  footer { flex-direction: column; gap: 16px; text-align: center; padding: 32px 24px; }
  .footer-links { justify-content: center; }
}
