/* ═══════════════════════════════════════════════════════
   THE SANCTUARY — Design System
   Hypnotherapy Network
   ═══════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  /* Chromatic System */
  --ink:        #111111;
  --charcoal:   #1a1a1a;
  --graphite:   #2a2a2a;
  --stone:      #4a4a4a;
  --mist:       #8a8a8a;
  --cloud:      #c5c0b8;
  --ivory:      #f5f0e8;
  --cream:      #faf7f2;
  --white:      #ffffff;

  --sage:       #8b9e82;
  --sage-deep:  #6b7d63;
  --sage-light: #d4ddd0;
  --sage-glow:  rgba(139, 158, 130, 0.12);

  --gold:       #c9a84c;
  --gold-soft:  #d4b86a;
  --gold-glow:  rgba(201, 168, 76, 0.10);

  --error:      #c45050;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Inter', -apple-system, sans-serif;

  /* Spacing Scale */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* Radii */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-2xl: 2rem;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.08);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.10);
  --shadow-glow: 0 0 40px rgba(139, 158, 130, 0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
  --duration-glacial: 800ms;
}

/* ── Base Reset & Defaults ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--sage-light);
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Typography ── */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
}

.display-sm {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--stone);
}

.body-md {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--stone);
}

.label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}

.label-sage {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
}

/* ── Navigation ── */
.nav-glass {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 5rem;
  background: rgba(250, 247, 242, 0.8);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: all var(--duration-normal) var(--ease-out);
}

.nav-glass.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--stone);
  letter-spacing: 0.01em;
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--sage);
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.nav-link.active::after,
.nav-link:hover::after {
  width: 100%;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-pill);
}

.btn-primary:hover {
  background: var(--charcoal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-sage {
  background: var(--sage);
  color: var(--white);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-pill);
}

.btn-sage:hover {
  background: var(--sage-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--cloud);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(0,0,0,0.02);
}

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: 0.875rem;
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.04);
  padding: var(--space-xl);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
}

/* ── Section Utilities ── */
.section {
  padding: var(--space-5xl) var(--space-xl);
}

.section-dark {
  background: var(--ink);
  color: var(--ivory);
}

.section-warm {
  background: var(--ivory);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Divider ── */
.divider {
  width: 3rem;
  height: 2px;
  background: var(--sage);
  border: none;
  margin: var(--space-lg) 0;
  border-radius: 1px;
}

/* ── Grain Overlay ── */
.grain::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── Scroll Reveal Animation ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-glacial) var(--ease-out),
              transform var(--duration-glacial) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* ── Footer ── */
.footer {
  padding: var(--space-3xl) var(--space-xl);
  border-top: 1px solid rgba(0,0,0,0.06);
  background: var(--cream);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-copy {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--mist);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-link {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
  transition: color var(--duration-fast);
}

.footer-link:hover {
  color: var(--ink);
}

/* ── Form Elements ── */
.input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink);
  transition: all var(--duration-fast);
  outline: none;
}

.input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-glow);
}

.input::placeholder {
  color: var(--cloud);
}

.input-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stone);
  margin-bottom: 0.5rem;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a4a4a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ── Toast / Notification ── */
.toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--sage);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: toastIn 0.4s var(--ease-spring);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Loading Spinner ── */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 2.5px solid var(--cloud);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile Hamburger Menu ── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 110;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  transition: all var(--duration-normal) var(--ease-out);
  border-radius: 1px;
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(3px, 4px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(3px, -4px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99;
  background: rgba(250, 247, 242, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 7rem 2rem 2rem;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--sage);
}

.mobile-menu .btn {
  margin-top: 1rem;
  width: 100%;
  text-align: center;
  min-height: 48px;
}

/* ── Safari & iOS Fixes ── */
@supports (-webkit-touch-callout: none) {
  /* Fix 100vh on iOS Safari */
  .hero, .auth-page, .dash-login {
    min-height: -webkit-fill-available;
  }
}

/* Prevent iOS Safari from auto-zooming on input focus */
input, select, textarea {
  font-size: 16px !important;
}

@media (min-width: 769px) {
  input, select, textarea {
    font-size: 0.9375rem !important;
  }
}

/* Remove tap highlight on all interactive elements */
a, button, input, select, textarea, label {
  -webkit-tap-highlight-color: transparent;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .nav-inner > .btn { display: none; }

  .section { padding: var(--space-3xl) var(--space-md); }
  .container { padding: 0 1.25rem; }

  .footer-inner { flex-direction: column; gap: 1.5rem; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }

  .display-xl { font-size: 2.5rem; }

  /* Touch-friendly targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: 0.5rem 1rem; }
  .nav-link { padding: 0.5rem 0; }
  .footer-link { padding: 0.5rem; }

  /* Toast mobile position */
  .toast { top: 1rem; right: 1rem; left: 1rem; text-align: center; }
}

@media (max-width: 380px) {
  .display-xl { font-size: 2rem; }
  .display-lg { font-size: 1.75rem; }
  .nav-logo { font-size: 1.125rem; }
}
