@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Warm Neutral Palette */
  --background: 40 33% 97%;
  --foreground: 0 0% 17%;

  --card: 40 40% 98%;
  --card-foreground: 0 0% 17%;

  --popover: 40 40% 98%;
  --popover-foreground: 0 0% 17%;

  --primary: 0 0% 17%;
  --primary-foreground: 40 33% 97%;

  --secondary: 35 30% 92%;
  --secondary-foreground: 0 0% 17%;

  --muted: 35 20% 93%;
  --muted-foreground: 0 0% 45%;

  --accent: 38 35% 61%;
  --accent-foreground: 0 0% 17%;

  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 40 33% 97%;

  --border: 35 20% 88%;
  --input: 35 20% 88%;
  --ring: 38 35% 61%;

  --radius: 0.25rem;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;

  --section-padding: clamp(4rem, 10vw, 8rem);
  --container-max: 1400px;

  --shadow-soft: 0 4px 20px -4px hsl(0 0% 0% / 0.08);
  --shadow-elevated: 0 12px 40px -8px hsl(0 0% 0% / 0.12);
  --shadow-card: 0 2px 12px -2px hsl(0 0% 0% / 0.06);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-reveal: 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure custom background helpers work even if Tailwind fails to emit them */
.bg-background { background: hsl(var(--background)); }
.bg-secondary { background: hsl(var(--secondary)); }
.bg-card { background: hsl(var(--card)); }

/* Header + mobile menu (avoid Tailwind classes that are added dynamically via JS) */
#site-header.is-scrolled {
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px -18px hsl(0 0% 0% / 0.25);
}

.mobile-menu {
  max-height: 0;
  opacity: 0;
  transition: max-height var(--transition-slow), opacity var(--transition-slow);
  will-change: max-height, opacity;
}

.mobile-menu.open {
  max-height: 420px;
  opacity: 1;
}

#mobile-menu-toggle.is-open .menu-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#mobile-menu-toggle.is-open .menu-bar:nth-child(2) {
  opacity: 0;
}

#mobile-menu-toggle.is-open .menu-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

#mobile-menu-toggle .menu-bar {
  transform-origin: center;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Layout helpers */
.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: clamp(1.5rem, 5vw, 4rem);
  padding-right: clamp(1.5rem, 5vw, 4rem);
}

.section-padding {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

/* Typography helpers */
.heading-display {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
}

.heading-section {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

.heading-subsection {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
}

.text-body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: hsl(var(--muted-foreground));
}

.text-small {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.text-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: hsl(var(--accent));
  font-weight: 500;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: hsl(var(--accent));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

.btn-primary:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border: 1px solid hsl(var(--primary));
  background: transparent;
  color: hsl(var(--primary));
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-base);
  cursor: pointer;
}

.btn-outline:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Link underline animation */
.link-underline {
  position: relative;
  color: hsl(var(--foreground));
  text-decoration: none;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: hsl(var(--accent));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Cards */
.card-elevated {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
  transition: var(--transition-base);
}

.card-elevated:hover {
  box-shadow: var(--shadow-elevated);
  transform: translateY(-4px);
}

/* Inputs */
.input-premium {
  width: 100%;
  padding: 0.75rem 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  transition: var(--transition-fast);
}

.input-premium:focus {
  outline: none;
  border-color: hsl(var(--accent));
  box-shadow: 0 0 0 3px hsl(var(--accent) / 0.1);
}

.input-premium::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Modal scroll lock */
body.modal-open {
  overflow: hidden;
}

/* ==============================
   Mobile menu toggle (FINAL)
   ============================== */

/* Hidden by default (desktop) */
#mobile-menu-toggle {
  display: none;
}

/* Visible only on mobile */
@media (max-width: 1024px) {
  #mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #1a1a1a;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
  }

  #mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }
}

#mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1a1a1a;
  margin: 5px 0;
}
