/* ═══════════════════════════════════════════════════════════
   BOOKAESTATE — BASE CSS
   Mobile nav: hamburger + orb + crest. No overlap possible.
   Desktop nav: full layout with text links.
   ═══════════════════════════════════════════════════════════ */

:root {
  --forest: #1B2B26;
  --emerald: #0F3D33;
  --obsidian: #0A0A0A;
  --gold: #C9A96A;
  --gold-warm: #D4B57A;
  --ivory: #F6F3ED;
  --stone: #8A8A8A;
  --charcoal: #1C1C1C;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-slow: cubic-bezier(0.65, 0, 0.35, 1);
  --bg: var(--forest);
  --bg-elevated: #243834;
  --nav-height: 72px;
}
body.day {
  --bg: #24201a;
  --bg-elevated: #2d2820;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 2000ms var(--ease-slow);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
}
::selection { background: var(--gold); color: var(--forest); }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

section, main, footer, header, nav, article { max-width: 100vw; overflow-x: hidden; }

body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
  opacity: 0.04; mix-blend-mode: overlay;
}

/* ─── NAV BAR ───────────────────────────────────────────── */
.nav-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px;
  transition: background 600ms var(--ease), backdrop-filter 600ms var(--ease), padding 400ms var(--ease);
  gap: 20px;
}
.nav-bar.scrolled {
  background: rgba(27,43,38,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 0.5px solid rgba(201,169,106,0.15);
  padding-top: 14px; padding-bottom: 14px;
}
body.day .nav-bar.scrolled { background: rgba(36,32,26,0.92); }

.nav-logo {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
  min-width: 0;
  z-index: 51;
}
.nav-logo img {
  width: 36px; height: 36px; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  transition: transform 600ms var(--ease);
  flex-shrink: 0;
}
.nav-logo:hover img { transform: scale(1.05); }
.nav-logo .wm {
  font-family: var(--serif); font-size: 15px; letter-spacing: 0.38em;
  color: var(--gold); padding-left: 0.38em; font-weight: 400;
  transition: color 2000ms var(--ease-slow);
  white-space: nowrap;
}
body.day .nav-logo .wm { color: var(--gold-warm); }

.nav-right {
  display: flex; align-items: center; gap: 28px;
  flex-shrink: 0;
  z-index: 51;
}
.nav-link {
  font-size: 10px; letter-spacing: 0.42em;
  color: var(--ivory); opacity: 0.85;
  transition: opacity 400ms var(--ease);
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active { opacity: 1; }
.nav-link.active { color: var(--gold); }
body.day .nav-link.active { color: var(--gold-warm); }

/* ─── MODE TOGGLE ─────────────────────────────────────── */
.mode {
  display: flex; align-items: center; gap: 12px;
  user-select: none; color: var(--ivory);
  padding: 0;
}
.mode-label {
  font-size: 10px; letter-spacing: 0.38em;
  transition: opacity 800ms var(--ease);
  color: var(--ivory); font-weight: 400;
  white-space: nowrap;
}
.mode-label.off { opacity: 0.3; }
.mode-orb {
  width: 22px; height: 22px; border-radius: 50%;
  position: relative; transition: all 1200ms var(--ease-slow);
  flex-shrink: 0;
}
.mode-orb::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 0.5px solid rgba(246,243,237,0.6);
  transition: all 1200ms var(--ease-slow);
}
.mode-orb::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%;
  background: rgba(246,243,237,0.9);
  transition: all 1200ms var(--ease-slow);
}
body.day .mode-orb::before { border-color: var(--gold-warm); box-shadow: 0 0 20px rgba(212,181,122,0.45); }
body.day .mode-orb::after { background: var(--gold-warm); box-shadow: 0 0 16px rgba(212,181,122,0.65); }

/* ─── HAMBURGER (mobile only, hidden on desktop) ─── */
.nav-hamburger {
  display: none;
  position: relative;
  width: 28px; height: 18px;
  padding: 8px 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transition: transform 400ms var(--ease), opacity 300ms var(--ease), background 2000ms var(--ease-slow), top 400ms var(--ease);
  transform-origin: center;
}
body.day .nav-hamburger span { background: var(--gold-warm); }
.nav-hamburger span:nth-child(1) { top: 8px; }
.nav-hamburger span:nth-child(2) { top: 13px; width: 70%; }
.nav-hamburger span:nth-child(3) { top: 18px; }
.nav-hamburger.open span:nth-child(1) { top: 13px; transform: rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { top: 13px; transform: rotate(-45deg); }

/* Desktop-only nav links — hidden on mobile */
.nav-link.desktop-only,
.mode.desktop-mode,
.nav-link.menu-button-desktop {
  display: flex;
}

/* Mobile-only menu button (the hamburger parent) */
.nav-hamburger,
.mode.mobile-mode {
  display: none;
}

/* ─── MENU OVERLAY ─────────────────────────────────── */
.menu-overlay {
  position: fixed; inset: 0; z-index: 48;
  background: rgba(27,43,38,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 28px; padding: 60px 40px;
  transition: opacity 500ms var(--ease);
}
body.day .menu-overlay { background: rgba(36,32,26,0.97); }
.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.menu-overlay a {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(28px, 5vw, 44px);
  color: var(--ivory);
  transition: color 400ms var(--ease), transform 500ms var(--ease);
  text-align: center;
  line-height: 1.1;
  transform: translateY(12px);
  opacity: 0;
}
.menu-overlay.open a {
  transform: translateY(0);
  opacity: 1;
}
.menu-overlay.open a:nth-child(1) { transition-delay: 100ms; }
.menu-overlay.open a:nth-child(2) { transition-delay: 180ms; }
.menu-overlay.open a:nth-child(3) { transition-delay: 260ms; }
.menu-overlay.open a:nth-child(4) { transition-delay: 340ms; }
.menu-overlay.open a:nth-child(5) { transition-delay: 420ms; }
.menu-overlay.open a:nth-child(6) { transition-delay: 500ms; }
.menu-overlay.open a:nth-child(7) { transition-delay: 580ms; }
.menu-overlay a:hover { color: var(--gold); }

/* Decorative menu footer */
.menu-footer {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--gold);
  opacity: 0;
  transition: opacity 600ms var(--ease) 800ms;
  font-weight: 400;
  text-align: center;
}
.menu-overlay.open .menu-footer { opacity: 0.6; }
body.day .menu-footer { color: var(--gold-warm); }

/* ─── SHARED PRIMITIVES ──────────────────────────────── */
.label {
  text-align: center;
  font-size: 10px; letter-spacing: 0.42em;
  color: var(--gold); margin-bottom: 20px; opacity: 0.9;
  transition: color 2000ms var(--ease-slow);
  font-weight: 400;
}
body.day .label { color: var(--gold-warm); }

.section-h {
  text-align: center; font-family: var(--serif); font-weight: 300;
  font-style: italic; font-size: clamp(30px, 4vw, 48px);
  color: var(--ivory); margin: 0 0 80px;
  letter-spacing: 0.015em; padding: 0 20px; line-height: 1.2;
}

/* ─── FOOTER ─────────────────────────────────────────── */
.footer {
  background: var(--obsidian);
  padding: 100px 40px 36px;
  text-align: center;
  position: relative; overflow: hidden;
  border-top: 0.5px solid rgba(201,169,106,0.15);
}
.footer-top {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 60px;
  text-align: left;
  padding-bottom: 70px;
  border-bottom: 0.5px solid rgba(201,169,106,0.15);
}
.footer-col h4 {
  font-size: 10px; letter-spacing: 0.42em;
  color: var(--gold); margin-bottom: 24px; font-weight: 400;
}
.footer-col a {
  display: block; font-family: var(--serif); font-style: italic;
  font-size: 17px; color: var(--ivory); opacity: 0.75;
  margin-bottom: 10px;
  transition: opacity 300ms var(--ease), color 300ms var(--ease);
  word-wrap: break-word;
}
.footer-col a:hover { opacity: 1; color: var(--gold); }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.footer-brand img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.footer-brand .wm {
  font-family: var(--serif); font-size: 20px; letter-spacing: 0.38em;
  color: var(--gold); padding-left: 0.38em; font-weight: 400;
}
.footer-tag {
  font-family: var(--serif); font-style: italic; font-size: 15px;
  color: var(--ivory); opacity: 0.65;
  letter-spacing: 0.06em; line-height: 1.6;
}
.footer-bottom {
  max-width: 1200px; margin: 30px auto 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; letter-spacing: 0.3em;
  color: var(--gold); opacity: 0.5; font-weight: 400;
  gap: 20px; flex-wrap: wrap;
}

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(24px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes breathe1 { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }
@keyframes breathe2 { 0%, 100% { opacity: 0.68; } 50% { opacity: 0.92; } }
@keyframes breathe3 { 0%, 100% { opacity: 0.72; } 50% { opacity: 0.95; } }
@keyframes scrollPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.7; } }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — mobile nav redesign
   ═══════════════════════════════════════════════════════════ */

/* TABLET — 1024px and below */
@media (max-width: 1024px) {
  .nav-bar { padding: 18px 28px; gap: 16px; }
  .nav-right { gap: 22px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 48px; }
  .footer-col:first-child { grid-column: 1 / -1; }
}

/* PHONE — 768px and below — mobile nav kicks in */
@media (max-width: 768px) {
  :root { --nav-height: 60px; }
  
  .nav-bar { padding: 16px 20px; gap: 12px; }
  .nav-logo img { width: 32px; height: 32px; }
  .nav-logo .wm { font-size: 12px; letter-spacing: 0.32em; padding-left: 0.32em; }
  
  /* Hide all desktop nav elements */
  .nav-link.desktop-only,
  .mode.desktop-mode,
  .nav-link.menu-button-desktop {
    display: none !important;
  }
  
  /* Show mobile nav elements: mode toggle (compact) + hamburger */
  .nav-hamburger {
    display: block;
  }
  .mode.mobile-mode {
    display: flex;
    gap: 0;
  }
  .mode.mobile-mode .mode-label {
    display: none;
  }
  .mode.mobile-mode .mode-orb {
    width: 22px; height: 22px;
  }
  
  .nav-right {
    gap: 20px;
  }
  
  /* Footer stacks */
  .footer { padding: 80px 24px 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 48px; padding-bottom: 48px; }
  .footer-bottom { flex-direction: column; gap: 14px; text-align: center; font-size: 9px; letter-spacing: 0.25em; }
  .footer-tag { font-size: 14px; }
  
  .section-h { margin-bottom: 60px; padding: 0 16px; }
  .label { font-size: 9px; letter-spacing: 0.38em; }
}

/* SMALL PHONE — 480px and below — tighter spacing */
@media (max-width: 480px) {
  .nav-bar { padding: 14px 18px; gap: 12px; }
  .nav-logo img { width: 28px; height: 28px; }
  .nav-logo .wm { font-size: 11px; letter-spacing: 0.28em; padding-left: 0.28em; }
  .nav-right { gap: 18px; }
  .nav-hamburger { width: 26px; height: 16px; padding: 7px 0; }
  .nav-hamburger span:nth-child(1) { top: 7px; }
  .nav-hamburger span:nth-child(2) { top: 11px; }
  .nav-hamburger span:nth-child(3) { top: 15px; }
  .nav-hamburger.open span:nth-child(1) { top: 11px; }
  .nav-hamburger.open span:nth-child(3) { top: 11px; }
  .mode.mobile-mode .mode-orb { width: 20px; height: 20px; }
  
  .section-h { font-size: clamp(26px, 8vw, 36px); margin-bottom: 48px; }
  .footer { padding: 60px 20px 24px; }
  .footer-brand img { width: 36px; height: 36px; }
  .footer-brand .wm { font-size: 16px; letter-spacing: 0.32em; }
}

/* NO-HOVER / touch devices */
@media (hover: none) and (pointer: coarse) {
  .nav-logo img { transform: none !important; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.3s !important;
  }
}
