/* ============================================
   MagicDay Glass Edition — Shared Design Tokens
   All tool pages on magicday.today import this.
   ============================================ */
:root {
    /* Backgrounds — pearl / cream palette */
    --bg-primary: #F4EEDF;
    --bg-secondary: #E8DFC9;
    --bg-card: #FFFCF4;
    --bg-deep: #2A1F17;

    /* Gold — champagne 4-stop */
    --gold1: #F0DCA0;
    --gold2: #D4B36A;
    --gold3: #B89548;
    --gold4: #8B6E29;

    /* Kingdom blue */
    --sky1: #DCE7F0;
    --sky2: #B8CEDF;
    --sky3: #7E9DB6;

    /* Iridescent accents */
    --iris-pink: #E8C7CC;
    --iris-lilac: #C9C2DC;

    /* Accents */
    --accent-gold: #B89548;
    --accent-orange: #D8632A;
    --accent-teal: #1F6B6E;

    /* Semantic */
    --success: #7A9A6A;
    --warning: #D4A02E;
    --error: #A23E2A;

    /* Wait time levels (shared with crowd calendar) */
    --crowd-low: #7A9A6A;
    --crowd-moderate: #D4A02E;
    --crowd-busy: #D8632A;
    --crowd-peak: #A23E2A;

    /* Text — ink hierarchy */
    --text-primary: #2A3142;
    --text-secondary: #4F5868;
    --text-tertiary: #6B7385;
    --text-on-accent: #FFFCF4;

    /* Dividers */
    --divider: rgba(42, 49, 66, 0.10);

    /* Glass */
    --glass: rgba(255, 252, 244, 0.72);
    --glass-stroke: rgba(255, 255, 255, 0.60);
    --glass-shadow: 0 1px 0 0 rgba(255,255,255,0.60) inset, 0 4px 16px rgba(42,49,66,0.08), 0 1px 3px rgba(42,49,66,0.06);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;

    /* Radii */
    --radius-small: 8px;
    --radius-button: 12px;
    --radius-card: 16px;
    --radius-pill: 999px;

    /* Typography */
    --font-display: 'Yeseva One', serif;
    --font-body: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Animation */
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::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);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-lg); }

/* ============================================
   Grain Texture Overlay (matches iOS .dsGrain())
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    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");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ============================================
   Iridescent Hero Wash
   ============================================ */
.hero-wash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(175deg, var(--sky1) 0%, var(--bg-primary) 30%, var(--iris-pink) 65%, var(--iris-lilac) 100%);
    opacity: 0.35;
}

/* ============================================
   Glass Sparkle Dots (ambient floating particles)
   ============================================ */
.glass-sparkle {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.glass-sparkle__dot {
    position: absolute;
    border-radius: 50%;
    animation: sparkleGlass var(--dur, 6s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0;
}
@keyframes sparkleGlass {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    20% { opacity: var(--peak, 0.4); }
    50% { transform: translateY(var(--drift, -40px)) scale(1); opacity: var(--peak, 0.35); }
    100% { opacity: 0; transform: translateY(calc(var(--drift, -40px) * 2)) scale(0.5); }
}

/* ============================================
   Hidden Mickeys
   ============================================ */
.hidden-mickey {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}
.hidden-mickey::before,
.hidden-mickey::after,
.hidden-mickey span {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: currentColor;
}
.hidden-mickey span { width: 100%; height: 100%; top: 0; left: 0; }
.hidden-mickey::before { width: 60%; height: 60%; top: -30%; left: -15%; }
.hidden-mickey::after { width: 60%; height: 60%; top: -30%; right: -15%; left: auto; }

/* ============================================
   Navigation — frosted glass
   ============================================ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: var(--space-md) 0;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled {
    background: rgba(244, 238, 223, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--divider);
    box-shadow: 0 1px 8px rgba(42, 49, 66, 0.06);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav__logo {
    font-family: var(--font-display); font-size: 1.5rem;
    color: var(--text-primary); display: flex; align-items: center; gap: 10px;
}
.nav__logo img { width: 32px; height: 32px; }
.nav__logo b { font-weight: inherit; }
.nav__logo span { color: var(--accent-gold); }

.nav__actions { display: flex; align-items: center; gap: var(--space-sm); }
.nav__link {
    display: inline-flex; align-items: center;
    color: var(--text-secondary); font-weight: 500; font-size: 0.875rem;
    padding: 9px 16px; border-radius: var(--radius-button);
    border: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.nav__link:hover { color: var(--text-primary); border-color: var(--divider); background: rgba(255, 252, 244, 0.5); }
.nav__link--active { color: var(--text-primary); border-color: var(--divider); background: rgba(255, 252, 244, 0.5); }

.nav__cta {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    background: linear-gradient(180deg, var(--gold1), var(--gold2), var(--gold3));
    color: var(--text-primary); font-weight: 600; font-size: 0.875rem;
    padding: 10px 20px; border-radius: var(--radius-button);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; overflow: hidden;
    box-shadow: 0 2px 0 0 var(--gold4), 0 4px 12px rgba(184, 149, 72, 0.25);
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 3px 0 0 var(--gold4), 0 6px 20px rgba(184, 149, 72, 0.35); }
.nav__cta svg { width: 16px; height: 16px; }

/* Mega menu dropdown */
.nav__dropdown { position: relative; }
.nav__dropdown-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); font-weight: 500; font-size: 0.875rem;
    padding: 9px 16px; border-radius: var(--radius-button);
    border: 1px solid transparent; cursor: pointer;
    background: none; font-family: var(--font-body);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.nav__dropdown-trigger:hover,
.nav__dropdown.open .nav__dropdown-trigger {
    color: var(--text-primary); border-color: var(--divider); background: rgba(255, 252, 244, 0.5);
}
.nav__dropdown-trigger svg {
    width: 10px; height: 10px; transition: transform 0.2s var(--easing);
}
.nav__dropdown.open .nav__dropdown-trigger svg { transform: rotate(180deg); }

.nav__mega {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: 420px;
    background: rgba(255, 252, 244, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-stroke);
    border-radius: var(--radius-card);
    box-shadow: 0 12px 40px rgba(42, 49, 66, 0.12), 0 2px 8px rgba(42, 49, 66, 0.06);
    padding: var(--space-md);
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    opacity: 0; visibility: hidden;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.2s var(--easing), visibility 0.2s, transform 0.2s var(--easing);
    z-index: 200;
}
.nav__dropdown.open .nav__mega {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav__mega-item {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 10px 12px; border-radius: var(--radius-small);
    color: var(--text-primary); text-decoration: none;
    transition: background 0.15s ease;
}
.nav__mega-item:hover { background: rgba(184, 149, 72, 0.08); }
.nav__mega-item--active { background: rgba(184, 149, 72, 0.08); }
.nav__mega-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
    background: var(--gold1); color: var(--gold4);
}
.nav__mega-text { display: flex; flex-direction: column; }
.nav__mega-label { font-weight: 600; font-size: 0.8125rem; line-height: 1.3; }
.nav__mega-desc { font-size: 0.6875rem; color: var(--text-tertiary); line-height: 1.3; }

/* Mobile hamburger */
.nav__hamburger {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 8px; color: var(--text-primary);
}
.nav__hamburger svg { width: 24px; height: 24px; }
.nav__mobile-menu {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(244, 238, 223, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99;
    padding: 80px var(--space-lg) var(--space-xl);
    flex-direction: column; gap: var(--space-md);
}
.nav__mobile-menu.open { display: flex; }
.nav__mobile-menu a {
    font-size: 1.1rem; font-weight: 500; padding: var(--space-md) 0;
    border-bottom: 1px solid var(--divider);
    color: var(--text-primary);
}
.nav__mobile-close {
    position: absolute; top: var(--space-md); right: var(--space-lg);
    background: none; border: none; cursor: pointer;
    color: var(--text-primary); padding: 8px;
}
.nav__mobile-close svg { width: 24px; height: 24px; }

/* Shimmer sweep on CTA buttons */
.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shimmerSweep 3s ease-in-out infinite;
}
@keyframes shimmerSweep {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: var(--space-xxl) 0 var(--space-xl);
    border-top: 1px solid var(--divider);
    position: relative; z-index: 1;
}
.footer .container {
    display: flex; justify-content: space-between;
    align-items: flex-start; flex-wrap: wrap; gap: var(--space-xl);
}
.footer__brand { max-width: 280px; }
.footer__logo {
    font-family: var(--font-display); font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    display: flex; align-items: center; gap: 8px;
}
.footer__logo img { width: 28px; height: 28px; }
.footer__logo b { font-weight: inherit; }
.footer__logo span { color: var(--accent-gold); }
.footer__tagline { color: var(--text-tertiary); font-size: 0.85rem; }
.footer__links { display: flex; gap: var(--space-xxl); }
.footer__col h4 {
    font-family: var(--font-mono);
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: var(--space-md);
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); }
.footer__col a { color: var(--text-secondary); font-size: 0.9rem; transition: color 0.2s ease; }
.footer__col a:hover { color: var(--text-primary); }
.footer__bottom {
    margin-top: var(--space-xxl); padding-top: var(--space-lg);
    border-top: 1px solid var(--divider);
    display: flex; justify-content: space-between;
    color: var(--text-tertiary); font-size: 0.8rem;
}

/* ============================================
   Glass Card — reusable component
   ============================================ */
.glass-card {
    background: var(--glass);
    border: 1px solid var(--glass-stroke);
    border-radius: var(--radius-card);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-lg);
}

/* ============================================
   Eyebrow label — mono section headers
   ============================================ */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

/* ============================================
   Tool page hero (smaller than landing hero)
   ============================================ */
.tool-hero {
    padding: 120px 0 var(--space-xxl);
    position: relative; z-index: 1;
    text-align: center;
}
.tool-hero__title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}
.tool-hero__title em { color: var(--accent-gold); font-style: italic; }
.tool-hero__subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================
   Responsive — shared breakpoints
   ============================================ */
@media (max-width: 768px) {
    .nav__link { display: none; }
    .nav__hamburger { display: block; }
    .footer .container { flex-direction: column; }
    .footer__links { flex-direction: column; gap: var(--space-xl); }
    .footer__bottom { flex-direction: column; gap: var(--space-sm); }
    .tool-hero__title { font-size: 1.75rem; }
}

/* ============================================
   Nav scroll behaviour (add via shared.js)
   ============================================ */
