/*
 * Starwisdom Main Stylesheet
 */

/*
 * Self-hosted fonts (latin subset)
 * Replaces Google Fonts CDN — served locally with long cache + precompression.
 *
 * Source: Google Fonts API, fetched 2026-03-26
 *   Philosopher v21:  https://fonts.google.com/specimen/Philosopher
 *   Work Sans v24:    https://fonts.google.com/specimen/Work+Sans
 *   Cinzel v26:       https://fonts.google.com/specimen/Cinzel
 *   Cormorant Garamond v21: https://fonts.google.com/specimen/Cormorant+Garamond
 *   EB Garamond v32:  https://fonts.google.com/specimen/EB+Garamond
 *
 * To refresh: curl the CSS URLs from fonts.googleapis.com with a Chrome
 * User-Agent to get woff2 links, download latin subsets to static/fonts/.
 */

/* Philosopher — headings, hero text, form titles */
@font-face {
  font-family: 'Philosopher';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/philosopher-regular-latin.cb86bac7dbcf.woff2") format('woff2');
}
@font-face {
  font-family: 'Philosopher';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/philosopher-bold-latin.7b006f203219.woff2") format('woff2');
}

/* Work Sans — vision page, archetypes, magic text */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/work-sans-latin.97b33529e13b.woff2") format('woff2');
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/work-sans-latin.97b33529e13b.woff2") format('woff2');
}

/* Cinzel — reading headers, eyebrows, section titles */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/cinzel-medium-latin.38ed5e8510f6.woff2") format('woff2');
}

/* Cormorant Garamond — reading hub title, report headers */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin.c47ff12887a3.woff2") format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin.c47ff12887a3.woff2") format('woff2');
}

/* EB Garamond — reading prose, thread titles */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin.3268e3c9f19e.woff2") format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin.3268e3c9f19e.woff2") format('woff2');
}

:root {
    /* Spacing System */
    --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;
    
    /* Layout */
    --header-height: 5rem;
    --logo-height: 90px;
    --content-max-width: 640px;
    
    /* Colors - Background */
    --bg-dark: #020314;
    --bg-black: #080808;
    --panel-bg: rgba(2, 3, 20, 0.55);
    --panel-blur: 12px;
    
    /* Colors - Text */
    --text-light: #e0e0e0;
    --text-soft: #e6e1d8;
    --text-muted: #b8b4c2;
    --text-dim: #e0e0e0;
    
    /* Colors - Accent */
    --accent-gold: #ffd875;
    /* Channel form of --accent-gold for rgba(var(--accent-gold-rgb), <a>). Owned by
       structural-cleanup (H-K); --accent-gold-rgb was defined early by the reading/report
       polish plan that shipped first. H-K (this phase) adds --white-rgb, the opacity scale,
       and migrates the brand-channel literals to these tokens. */
    --accent-gold-rgb: 255, 216, 117;
    --white-rgb: 255, 255, 255;
    --accent-gold-soft: #f9dca2;
    --accent-muted: #8a7e6a;
    --accent-gold-gradient: linear-gradient(135deg, #ae8625 0%, #f7ef8a 50%, #d2ac47 100%);
    
    /* Colors - UI Elements */
    --border-subtle: rgba(var(--white-rgb), var(--o-08));
    --border-light: rgba(224, 224, 224, 0.3);
    /* Foundational glass tokens kept at their exact values — these resolve site-wide,
       so snapping them to the opacity scale would shift every glass surface at once. */
    --glass-bg: rgba(var(--white-rgb), 0.03);
    --glass-bg-hover: rgba(var(--white-rgb), 0.1);
    --glow-white: rgba(var(--white-rgb), var(--o-30));

    /* Colors - Reading Environment */
    --reading-bg: #0a0b1a;
    --reading-text-bright: #f5eed9;
    --reading-text: #ede8db;
    --reading-text-em: #ddd5c5;
    --reading-text-secondary: #d8d3c8;
    --reading-text-tertiary: #cec9be;
    --reading-text-dark: #1a1a2e;
    --reading-text-placeholder: #9a9490;

    /* Colors - Semantic */
    --error-red: #ff6b6b;
    --error-red-bg: rgba(239, 68, 68, 0.15);
    --error-red-border: #ef4444;
    --error-red-text: #fca5a5;
    --error-red-asterisk: #fca5a5;

    /* Colors - Messages */
    --message-success-bg: rgba(34, 197, 94, 0.2);
    --message-success-border: #22c55e;
    --message-error-bg: rgba(239, 68, 68, 0.2);
    --message-error-border: #ef4444;
    --message-warning-bg: rgba(251, 191, 36, 0.2);
    --message-warning-border: #fbbf24;
    --message-info-bg: rgba(59, 130, 246, 0.2);
    --message-info-border: #3b82f6;

    /* Colors - Vision Page (Dark Mode) */
    --vision-text: #c4baa8;
    --vision-text-secondary: #a29c8e;
    --vision-heading: #b4ab98;
    --vision-link: #7eb8da;
    --vision-gold: #c7953d;
    --vision-gold-strong: #dfae5a;
    --vision-gold-accent: #b3a272;
    --vision-twilight: #8fa5c4;


    /* Colors - Footer */
    --footer-bg: rgba(15, 13, 11, 0.9);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Touch Targets */
    --touch-min: 44px;

    /* Opacity scale — canonical alpha steps for brand-channel overlays.
       rgba(var(--accent-gold-rgb), var(--o-12)). Ad-hoc alphas within 0.02 of a step are
       snapped to it (imperceptible); alphas farther than 0.02 (e.g. 0.15, 0.25, 0.4) stay
       exact numerics on the channel token, as do a few load-bearing values kept exact by
       hand (the --glass-bg tokens above; the addendum tier in suggestions.css). */
    --o-04: 0.04;
    --o-08: 0.08;
    --o-12: 0.12;
    --o-20: 0.2;
    --o-30: 0.3;
    --o-50: 0.5;
    --o-70: 0.7;

    /* Blur scale — canonical glass-panel backdrop/box blur. --panel-blur (12px) is the
       large step. Drifted one-off blurs (0.4/0.5/2/5/6/10px) are left as literals for a
       separate deliberate consolidation pass (changing them is a visible, discuss-first change). */
    --blur-sm: 4px;
    --blur-md: 8px;

    /* Radius scale — high-reuse corner radii. One-off radii (5/14/16/18px) and multi-value
       border-radius shorthands keep their literals. */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-pill: 999px;

    /* Z-Index Scale — global stacking tiers (local stacking contexts keep small literals). */
    --z-debug-panel: 900;
    --z-overlay: 1000;      /* moon-menu, disclaimer/beta overlay */
    --z-modal: 1100;        /* share-modal */
    --z-modal-high: 1150;
    --z-skip-link: 2000;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-light);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

html { background: var(--bg-black); }
body { background: transparent; }

/* Skip-to-content link: off-screen until keyboard-focused, then visible at top-left. */
.skip-to-content {
    position: absolute;
    left: 0;
    top: 0;
    z-index: var(--z-skip-link);
    transform: translateY(-120%);
    padding: 0.6rem 1.1rem;
    background: var(--bg-dark);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold-soft);
    border-radius: 0 0 6px 0;
    text-decoration: none;
}

.skip-to-content:focus {
    transform: translateY(0);
}

/* Visually-hidden but available to assistive tech (screen-reader-only). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(22, 11, 173, 0.25),
            transparent 55%
        );
}

.page-home .site-main {
    justify-content: center;
    align-items: center;
    padding-top: 0;
}

.page-home .content-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    margin: 0;
    max-width: 900px;
}






/* ============================================
 * SITE HEADER - Three-Zone Grid Layout
 * ============================================ */

.site-header {
    position: relative;
    min-height: var(--header-height);
    padding: var(--space-xl) var(--space-2xl);
    z-index: 100;
}

/* Home page gets extra top spacing for visual breathing room */
.page-home .site-header {
    padding-top: var(--space-4xl);
    min-height: calc(var(--header-height) + var(--space-2xl));
}

/* Logo is centered on the page */
.header-center {
    position: absolute;
    left: 50%;
    top: var(--space-xl);
    transform: translateX(-50%);
}

.page-home .header-center {
    top: var(--space-4xl);
}

.site-logo {
    display: block;
}

.brand-wordmark {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

/* Navigation floats in top right corner */
.header-right {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-2xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Desktop navigation buttons - only visible on home page */
.header-nav {
    display: none; /* Hidden by default */
    gap: var(--space-md);
    align-items: center;
}

/* Hide nav on login/account pages - moon menu only */
.page-login .header-nav {
    display: none !important;
}

/* Moon menu toggle */
.moon-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    color: var(--text-dim);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
                color var(--transition-fast);
    position: relative;
}

/* Expanded clickable area without affecting visual position.
   right: 0 (not -16px) to avoid extending past the viewport edge at narrow widths. */
.moon-toggle::before {
    content: '';
    position: absolute;
    top: -16px;
    right: 0;
    bottom: -16px;
    left: -16px;
}

.moon-toggle:hover {
    color: #ffffff;
    transform: scale(1.12);
}

.moon-toggle:hover .moon-icon {
    filter: drop-shadow(0 0 10px rgba(var(--white-rgb), 0.8)) 
            drop-shadow(0 0 20px rgba(200, 200, 255, 0.6))
            drop-shadow(0 0 30px rgba(200, 200, 255, 0.4))
            drop-shadow(0 0 40px rgba(var(--white-rgb), 0.6));
}

.moon-toggle:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.moon-toggle__icon {
    width: 3.5rem;
    height: 3.5rem;
    display: block;
    position: relative;
    z-index: 1;
}

/* Grip-line affordance — three small gold lines beside the moon read as
   "menu". Ported from the prototype .tabmock__grip. Hidden by default; shown
   only where the moon sits on its screen-edge tab (non-reading pages). */
.moon-toggle__grip {
    display: none;
}

.moon-toggle__grip i {
    display: block;
    width: 16px;
    /* Integer height + gap so all three lines land on whole pixels and render
       at identical thickness (sub-pixel 1.8px/3.5px looked uneven/blurry). */
    height: 2px;
    border-radius: 1px;
    background: rgba(var(--accent-gold-rgb), 0.82);
}

/* Moon icon glow effects */
.moon-icon {
    /* The "Holy Glow" Effect - enhanced for better visibility */
    filter: drop-shadow(0 0 10px rgba(var(--white-rgb), 0.8)) 
            drop-shadow(0 0 20px rgba(200, 200, 255, 0.6))
            drop-shadow(0 0 30px rgba(200, 200, 255, 0.4));
    
    /* Smooth transition for the phase change */
    transition: all 0.05s ease-in-out;
}

/* Make the Full Moon glow harder */
.moon-icon--full {
    filter: drop-shadow(0 0 12px rgba(var(--white-rgb), 0.8))
            drop-shadow(0 0 25px rgba(200, 200, 255, 0.5));
}

/* First-visit attention choreography, fires ~5s after the page settles:
     1) moonflash — a silver point of light traces the crescent's outer
        curve from bottom cusp up and around to top cusp, then exits off
        the top;
     2) beacon — slow glow-and-scale breath (awareness) + small squish
        (click-affordance). Runs once per device. */

/* The tracer: a small bright silver point with a soft glow that follows
   the crescent's lit outer curve via offset-path. The path is defined in
   the .moon-toggle's coordinate system (~72×72 including padding, moon
   icon centered with ~28px radius, crescent lit on the left side). */
.moon-toggle--flash::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    pointer-events: none;
    z-index: 3;
    border-radius: 50%;
    /* Tinkerbell shimmer — bright warm core, tight halo (not a broad
       cloud), faint twinkle so it reads as sparkle rather than bead. */
    background: radial-gradient(circle,
        rgba(var(--white-rgb), 1) 0%,
        rgba(255, 248, 220, 0.9) 30%,
        rgba(235, 225, 190, 0.4) 70%,
        transparent 100%);
    box-shadow:
        0 0 8px 1px rgba(var(--white-rgb), 1),
        0 0 18px 4px rgba(255, 240, 200, 0.75),
        0 0 36px 10px rgba(220, 210, 180, 0.3);
    filter: blur(0.5px);
    /* Trace the crescent's outer curve — radius 28 arc from bottom cusp
       toward the top. Path is unchanged from the working version. */
    offset-path: path('M 36 64 A 28 28 0 0 0 36 8');
    offset-rotate: 0deg;
    will-change: offset-distance, opacity, filter;
    /* Three stacked animations:
         — position: eases along the arc (felt natural earlier)
         — fade:     linear so the fade-out timing is predictable
         — twinkle:  rapid brightness pulse for fairy-light character.
       Twinkle uses filter (not transform) so it doesn't fight offset-path. */
    animation:
        moon-flash-trace-pos  800ms cubic-bezier(0.42, 0, 0.35, 1) both,
        moon-flash-trace-fade 800ms linear both,
        moon-flash-twinkle    200ms linear 0s 4 both;
}

@keyframes moon-flash-trace-pos {
    /* Travels along the arc. Ease-in-out handles acceleration naturally. */
    0%   { offset-distance: 0%;  }
    100% { offset-distance: 75%; }
}

@keyframes moon-flash-trace-fade {
    /* Linear fade over the last 45% of time (~360ms) so the dimming is
       clearly perceptible, not a blink-off. */
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    55%  { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes moon-flash-twinkle {
    /* Rapid brightness pulse — 4 iterations in the first 800ms. */
    0%, 100% { filter: blur(0.5px)  brightness(1);    }
    50%      { filter: blur(0.4px)  brightness(1.35); }
}

.moon-toggle--beacon {
    animation: moon-beacon 2300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.moon-toggle--beacon .moon-icon {
    animation: moon-beacon-glow 2300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes moon-beacon {
    /* A single slow breath — up to 1.08 and back to 1. No shrink below
       baseline (the old click-preview squish has been removed). */
    0%   { transform: scale(1); }
    30%  { transform: scale(1.08); }
    55%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes moon-beacon-glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(var(--white-rgb), 0.8))
                drop-shadow(0 0 20px rgba(200, 200, 255, 0.6))
                drop-shadow(0 0 30px rgba(200, 200, 255, 0.4));
    }
    30%, 55% {
        filter: drop-shadow(0 0 18px rgba(var(--white-rgb), 1))
                drop-shadow(0 0 36px rgba(200, 200, 255, 0.9))
                drop-shadow(0 0 54px rgba(200, 200, 255, 0.7))
                drop-shadow(0 0 72px rgba(var(--white-rgb), var(--o-50)));
    }
}

/* ============================================
 * MOON MENU - Slide-in Navigation Panel
 * ============================================ */

.moon-menu {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.moon-menu[aria-hidden="false"] {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.moon-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.moon-menu[aria-hidden="false"] .moon-menu__backdrop {
    opacity: 1;
}

.moon-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 85vw);
    background: rgba(2, 3, 20, 0.95);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border-left: 1px solid var(--border-subtle);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.moon-menu[aria-hidden="false"] .moon-menu__panel {
    transform: translateX(0);
}

.moon-menu__header {
    padding: var(--space-xl) var(--space-2xl);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: var(--space-xl);
    flex-shrink: 0;
}

.moon-menu__logo {
    display: block;
    flex: 1;
    text-align: center;
    max-width: none;
}

.moon-menu__wordmark {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.moon-menu__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.moon-menu__close:hover {
    transform: scale(1.1);
}

.moon-menu__close:hover .moon-icon {
    filter: drop-shadow(0 0 12px rgba(var(--white-rgb), 0.9)) 
            drop-shadow(0 0 25px rgba(200, 200, 255, 0.7))
            drop-shadow(0 0 45px rgba(var(--white-rgb), 0.6));
}

.moon-menu__moon {
    width: 3rem;
    height: 3rem;
    display: block;
}

.moon-menu__links {
    list-style: none;
    padding: var(--space-lg) var(--space-md);
    margin: 0;
    flex: 1;
}

.moon-menu__links li {
    margin-bottom: var(--space-xs);
}

.moon-menu__section {
    margin: var(--space-lg) var(--space-md) var(--space-xs);
    color: rgba(var(--accent-gold-rgb), 0.72);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.moon-menu__section:first-child {
    margin-top: 0;
}

.moon-menu__link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-soft);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition-slow);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
}

.moon-menu__link:hover {
    background: var(--glass-bg-hover);
    color: #ffffff;
    border-color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 0 20px var(--glow-white);
}

.moon-menu__link--action {
    /* For form buttons like Sign Out */
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.25rem;
    text-align: left;
    cursor: pointer;
}


/* ============================================
 * RESPONSIVE BREAKPOINTS
 * Must come AFTER component definitions so
 * media query overrides win by source order.
 * ============================================ */

/* Large screens: 1200px and below */
@media (max-width: 1200px) {
    .brand-wordmark {
        max-width: 480px;
    }
}

/* Medium screens: 1024px and below */
@media (max-width: 1024px) {
    /* Begin compressing header spacing */
    :root {
        --header-height: 4.5rem;
    }
}

/* Small tablets: 900px and below - MOON MENU ACTIVATES */
@media (max-width: 900px) {
    /* Header adjustments */
    .site-header {
        padding: var(--space-lg) var(--space-xl);
    }

    .header-center {
        top: var(--space-lg);
    }

    .page-home .header-center {
        top: var(--space-2xl);
    }

    .brand-wordmark {
        max-width: 400px;
    }

    .header-right {
        top: var(--space-lg);
        right: var(--space-xl);
    }

    /* Hide desktop navigation on ALL pages (including home) */
    .header-nav {
        display: none;
    }

    /* Show moon toggle on ALL pages (including home) */
    .page-home .moon-toggle {
        display: flex;
    }

}

/* Mobile: 768px and below */
@media (max-width: 768px) {
    .page-bg { background-position: 10% center; }

    .site-header {
        padding: var(--space-md) var(--space-lg);
    }

    .header-center {
        top: var(--space-md);
    }

    .page-home .header-center {
        top: var(--space-xl);
    }

    .header-right {
        top: var(--space-md);
        right: var(--space-lg);
    }

    .brand-wordmark {
        max-width: 320px;
    }

    .moon-menu__panel {
        width: 90vw;
    }
}

/* Small mobile: 640px and below */
@media (max-width: 640px) {
    :root {
        --header-height: 4rem;
    }

    .site-header {
        padding: var(--space-sm) var(--space-md);
    }

    .header-center {
        top: var(--space-sm);
    }

    .page-home .header-center {
        top: var(--space-lg);
    }

    .header-right {
        top: var(--space-sm);
        right: var(--space-sm);
    }

    .brand-wordmark {
        max-width: 280px;
    }

    .moon-toggle {
        padding: var(--space-xs);
    }

    .moon-toggle__icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .moon-menu__header {
        padding: var(--space-xl) var(--space-md);
        gap: var(--space-md);
    }

    .moon-menu__moon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .moon-menu__wordmark {
        max-width: 150px;
    }

    .moon-menu__links {
        padding: var(--space-xl) var(--space-md);
    }

    .moon-menu__link {
        font-size: 1.125rem;
    }
}


.site-main {
    min-height: calc(100vh - var(--header-height));
    padding: var(--space-2xl) var(--space-md) var(--space-4xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Home page centers content vertically */
.page-home .site-main {
    justify-content: center;
    padding-top: 0;
}


.content-panel {
    max-width: var(--content-max-width);
    width: 90%;
    padding: 3rem;
    background: var(--panel-bg);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border-radius: 16px;
    border: 1px solid rgba(var(--white-rgb), var(--o-08));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}


.home-hero {
    text-align: center;
    padding: 2rem;
    margin-top: 0;
}

.home-description {
    text-align: center;
    padding: 0 2rem;
    margin-top: 1.5rem;
    max-width: 36em;
    margin-left: auto;
    margin-right: auto;
}

.home-description p {
    font-family: 'Philosopher', sans-serif;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 400;
    line-height: 1.7;
    margin: 0;
    color: #e6e1d8;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.02em;
    opacity: 0.85;
}

.home-description__cta {
    margin-top: 1.5rem;
}

.home-description__link {
    color: var(--accent-gold-soft);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent-gold-soft) 40%, transparent);
    text-underline-offset: 0.18em;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.home-description__link:hover {
    color: var(--accent-gold);
    text-decoration-color: var(--accent-gold);
}

.home-description__link:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
    text-decoration-color: var(--accent-gold);
}

.home-tagline {
    text-align: center;
    padding: 1rem;
    margin-top: 1.5rem;
}

.hero-main {
    font-family: 'Philosopher', sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    color: #e6e1d8;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.05em;
}

.hero-sub {
    font-family: 'Philosopher', sans-serif;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 400;
    margin: 0;
    color: #e6e1d8;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.05em;
}

/* ============================================
 * UNIFIED FORM SYSTEM
 * ============================================ */

.form-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-2xl) var(--space-md);
}

.page-login .site-main {
    padding-top: calc(var(--header-height) + var(--space-2xl));
}

.form-container h1 {
    font-family: 'Philosopher', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-soft);
    text-align: center;
    margin-bottom: var(--space-lg);
    letter-spacing: 0.05em;
}

.form-intro {
    text-align: center;
    color: rgba(230, 225, 216, 0.8);
    margin-bottom: var(--space-xl);
    font-size: 0.95rem;
    line-height: 1.6;
}

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-field label {
    color: rgba(230, 225, 216, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="date"],
.form-field input[type="time"],
.form-field select,
.form-field textarea {
    padding: var(--space-sm) var(--space-md);
    background: rgba(var(--white-rgb), var(--o-04));
    border: 1px solid rgba(var(--white-rgb), var(--o-12));
    border-radius: var(--radius-lg);
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}

.form-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23E6E1D8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: calc(var(--space-md) + 20px);
    cursor: pointer;
}

.form-field select option {
    background: #0a0b1a;
    color: #e0e0e0;
}

.u-hidden {
    display: none !important;
}

.form-input--autogrow {
    resize: vertical;
}

/* ─── Info Tooltips ─── */

.info-tooltip {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.info-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    margin-left: 0.4em;
    padding: 0.3em 0.25em;
    border: none;
    background: none;
    color: var(--text-muted, #b8b4c2);
    font: inherit;
    font-size: 0.85em;
    line-height: 1.2;
    cursor: pointer;
    opacity: 0.85;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.info-tooltip__label {
    text-decoration: underline dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.info-tooltip__trigger:hover,
.info-tooltip__trigger:focus-visible {
    color: var(--accent-gold-soft, #f9dca2);
    opacity: 1;
}

.info-tooltip__trigger:focus-visible {
    outline: 2px solid var(--accent-gold-soft);
    outline-offset: 2px;
}

.info-tooltip__icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.info-tooltip__content {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    width: min(320px, 80vw);
    padding: var(--space-sm) var(--space-md);
    background: #1a1a2e;
    border: 1px solid rgba(var(--white-rgb), 0.15);
    border-radius: var(--radius-lg);
    color: var(--text-soft, #e6e1d8);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 100;
    white-space: normal;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.info-tooltip:hover .info-tooltip__content,
.info-tooltip:focus-within .info-tooltip__content,
.info-tooltip.is-open .info-tooltip__content {
    display: block;
}

/* Wider panel for content-heavy tooltips. `top: 100%` removes the 8px
   trigger→panel gap so the cursor can move straight down onto the panel with no
   dead zone to drop the hover (no bridge needed — and a bridge wouldn't work
   anyway, since `overflow-y: auto` clips anything outside the panel box). */
.info-tooltip__content--wide {
    width: min(560px, 92vw);
    top: 100%;
}

/* Links inside tooltips use the site's standard gold link treatment. */
.info-tooltip__content a {
    color: var(--accent-gold-soft);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent-gold-soft) 40%, transparent);
    text-underline-offset: 0.18em;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.info-tooltip__content a:hover {
    color: var(--accent-gold);
    text-decoration-color: var(--accent-gold);
}

.info-tooltip__content a:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Make date/time picker icons white */
.form-field input[type="date"],
.form-field input[type="time"] {
    color-scheme: dark;
    /* Native date/time controls resist shrinking below their intrinsic width on mobile
       WebKit; let them shrink so they can't overflow a narrow column. */
    min-width: 0;
    max-width: 100%;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: 2px solid var(--accent-gold-soft);
    outline-offset: 2px;
    background: rgba(var(--white-rgb), var(--o-08));
    border-color: var(--accent-gold-soft);
    box-shadow: 0 0 0 2px rgba(249, 220, 162, 0.1);
}

.form-field input::placeholder {
    color: rgba(var(--white-rgb), 0.55);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.turnstile-container {
    display: flex;
    justify-content: center;
    margin: var(--space-sm) 0;
}

.form-divider {
    position: relative;
    text-align: center;
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: rgba(var(--white-rgb), var(--o-12));
}

.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

/* Boxed error style for the auth/account forms. The Django/allauth-default `errorlist`
 * class name is kept so auto-rendered errors style too. This unifies the former auth split
 * (plain `.errorlist` on login/signup vs boxed `.form-errors` on the password/email pages)
 * onto one boxed look. NOTE: `.form-errors` below is now an identical duplicate, still used
 * by the set-coordinates / suggestions forms — a candidate to fold into `.errorlist` too. */
.errorlist {
    list-style: none;
    margin: var(--space-xs) 0 0 0;
    padding: 0.75rem 1rem;
    background: var(--error-red-bg);
    border: 1px solid var(--error-red-border);
    border-radius: var(--radius-md);
    color: var(--error-red-text);
    font-size: 0.9rem;
}

.errorlist li {
    padding: 0.125rem 0;
}

.form-helptext,
.form-help {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    line-height: 1.4;
}

.form-help a,
.form-intro a,
.form-field--consent .consent-label a {
    color: var(--text-soft);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.form-help a {
    text-decoration-color: rgba(230, 225, 216, 0.25);
}

.form-field__aux {
    margin: calc(var(--space-xs) * -0.25) 0 0 0;
    text-align: right;
}

.form-help a:hover,
.form-intro a:hover,
.form-field--consent .consent-label a:hover {
    color: #ffffff;
}

.form-field__aux a {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.6;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-fast);
}

.form-field__aux a:hover {
    color: #ffffff;
}

.form-help a:hover {
    text-decoration-color: rgba(var(--white-rgb), 0.45);
}

.form-help a:focus-visible,
.form-intro a:focus-visible,
.form-field__aux a:focus-visible,
.form-field--consent .consent-label a:focus-visible {
    outline: 2px solid var(--accent-gold-soft);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.form-errors {
    padding: 0.75rem 1rem;
    background: var(--error-red-bg);
    border: 1px solid var(--error-red-border);
    border-radius: var(--radius-md);
    color: var(--error-red-text);
    font-size: 0.9rem;
}

.form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Contrast: --reading-text-bright (#f5eed9) on --message-warning-bg
   (rgba(251,191,36,0.2)) over --bg-dark → ~10:1, well above WCAG AA 4.5:1. */
.form-notice--warning {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
    background: var(--message-warning-bg);
    border: 1px solid var(--message-warning-border);
    color: var(--reading-text-bright);
}

.field-required::after {
    content: " *";
    color: var(--error-red-asterisk);
}

/* Checkbox styling */
.form-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: var(--space-sm);
    cursor: pointer;
}

.form-field--checkbox {
    flex-direction: row;
    align-items: center;
}

.form-field--checkbox label {
    margin-bottom: 0;
    cursor: pointer;
}

.form-field--consent {
    gap: 0.25rem;
}

.form-field--consent .consent-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-field--consent .form-help {
    padding-left: calc(18px + var(--space-sm));
    font-size: 0.82rem;
}

/* Social login buttons — provider-required styling (Google, Facebook) */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity var(--transition-fast);
    box-sizing: border-box;
    cursor: pointer;
}

.btn-social:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-google {
    background-color: #ffffff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
}

.btn-google .icon-google {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.btn-facebook {
    background-color: #1877f2;
    color: #ffffff;
    border: 1px solid #1877f2;
}

.btn-facebook .icon-facebook {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

/* Page icon — centered emoji used on auth status pages */
.page-icon {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

/* Separator for secondary help text on auth pages */
.form-help--separated {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(230, 225, 216, 0.15);
}

/* Password requirements (signup page) */
#password-requirements {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
    font-size: 0.85rem;
    color: rgba(230, 225, 216, 0.6);
}

#password-requirements li {
    transition: color 0.3s ease;
    padding: 0.25rem 0;
}

/* ============================================
 * UNIFIED BUTTON SYSTEM
 * ============================================ */

.btn {
    /* Base styles */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-min);
    padding: var(--space-sm) var(--space-lg);
    
    /* Typography */
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    
    /* Visual */
    border: none;
    border-radius: var(--radius-pill); /* Pill shape */
    cursor: pointer;
    transition: all var(--transition-normal);
    
    /* Accessibility */
    user-select: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.btn--primary {
    /* Golden gradient CTA - main actions */
    background: var(--accent-gold-gradient);
    color: #1a0a05;
    border: 1px solid rgba(174, 134, 37, 0.3);
    box-shadow: 0 2px 8px rgba(174, 134, 37, 0.3);
    transition: all var(--transition-slow);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(174, 134, 37, 0.5),
                0 0 20px rgba(247, 239, 138, 0.4);
}

.btn--outline {
    /* Ghost button - subtle, for navigation */
    background: var(--glass-bg);
    color: var(--text-dim);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    transition: all var(--transition-slow);
}

.btn--outline:hover:not(:disabled) {
    background: var(--glass-bg-hover);
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 20px var(--glow-white);
    transform: translateY(-1px);
}

.btn--ghost {
    /* Minimal button - for secondary actions */
    background: transparent;
    color: var(--text-dim);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.btn--ghost:hover:not(:disabled) {
    color: #ffffff;
    background: var(--glass-bg);
}

/* Social button styling removed - use provider default styles */

/* Button Sizes */
.btn--sm {
    min-height: 36px;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn--lg {
    min-height: 52px;
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

/* Icon Support */
.btn__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn--sm .btn__icon {
    width: 16px;
    height: 16px;
}

.btn--lg .btn__icon {
    width: 24px;
    height: 24px;
}




.messages {
    position: fixed;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-overlay);
    max-width: var(--content-max-width);
    width: 90%;
}

.message {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    backdrop-filter: blur(var(--blur-md));
    cursor: pointer;
    animation: fadeOut 6s ease-in-out forwards;
}

@keyframes fadeOut {
    0%, 65% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        pointer-events: none;
    }
}

.message.success { background: var(--message-success-bg); border: 1px solid var(--message-success-border); }
.message.error { background: var(--message-error-bg); border: 1px solid var(--message-error-border); }
.message.warning { background: var(--message-warning-bg); border: 1px solid var(--message-warning-border); }
.message.info { background: var(--message-info-bg); border: 1px solid var(--message-info-border); }
.message.error,
.message.warning { animation: none; }

.message__close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 var(--space-md);
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    float: right;
    margin-top: -2px;
    position: relative;
}

/* Transparent ≥44px touch target, centered on the glyph; absolute, so zero layout impact. */
.message__close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

.message__close:hover {
    opacity: 1;
}

.message__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}


.site-footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    font-size: 0.85rem;
    color: rgba(var(--white-rgb),0.55);
    background: var(--footer-bg);
    border-top: 1px solid rgba(var(--accent-gold-rgb), var(--o-12));
}

.site-footer .footer-link {
    color: rgba(var(--white-rgb), var(--o-70));
    text-decoration: underline;
    text-decoration-color: rgba(var(--white-rgb),0.25);
    text-underline-offset: 2px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.site-footer .footer-link:hover {
    color: var(--accent-gold);
    text-decoration-color: var(--accent-gold);
}

.site-footer .footer-divider {
    margin: 0 var(--space-sm);
    color: rgba(var(--white-rgb), var(--o-30));
}


/* Additional mobile-specific responsive styles (continuing 768px breakpoint) */
@media (max-width: 768px) {
    .content-panel {
        padding: var(--space-xl) var(--space-lg);
    }

    .home-hero {
        margin-top: 0;
        padding: var(--space-md);
    }

    .hero-main {
        font-size: clamp(1.5rem, 5vw, 2rem);
        line-height: 1.3;
    }

    .home-description {
        padding: 0 var(--space-md);
        margin-top: var(--space-md);
    }

    .hero-sub {
        font-size: clamp(1rem, 4vw, 1.25rem);
        margin-top: var(--space-sm);
    }
    
    /* Form containers adjust */
    .form-container {
        padding: 0 var(--space-xl) var(--space-md);
    }
    
    /* Beta status adjustments */
    .lighthouse-image {
        width: 200px;
        margin-bottom: var(--space-lg);
    }
}

/* Set Coordinates Page */
.page-coordinates .site-main {
    min-height: calc(100vh - var(--header-height));
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-2xl);
}

.page-coordinates .content-panel {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.coordinates-container {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-xs) var(--space-2xl) var(--space-2xl);
    background: var(--panel-bg);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Phones: the flat 3rem side padding squeezes the column enough to push the native
   date/time pickers off-screen — shrink it to a standard mobile gutter. */
@media (max-width: 600px) {
    .coordinates-container {
        padding: var(--space-xs) var(--space-md) var(--space-2xl);
    }
}

.coordinates-container h1 {
    font-family: 'Philosopher', sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 400;
    color: var(--text-soft);
    text-align: center;
    margin-bottom: var(--space-lg);
    letter-spacing: 0.05em;
}

.coordinates-intro {
    text-align: center;
    color: rgba(230, 225, 216, 0.8);
    margin-bottom: var(--space-xl);
    font-size: 0.95rem;
    line-height: 1.6;
}

.coordinates-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.location-picker {
    margin-top: 0;
}

.location-picker__status {
    min-height: 1.25rem;
    color: rgba(230, 225, 216, 0.72);
    font-size: 0.9rem;
}

.location-picker__results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: var(--space-sm);
}

.location-picker__option {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(var(--accent-gold-rgb), var(--o-20));
    border-radius: var(--radius-xl);
    padding: 0.75rem 0.9rem;
    background: rgba(18, 20, 25, 0.78);
    color: var(--text-soft);
    cursor: pointer;
}

.location-picker__option:hover,
.location-picker__option:focus-visible {
    border-color: rgba(var(--accent-gold-rgb), 0.52);
    background: rgba(31, 35, 43, 0.92);
}

.location-picker__preview {
    margin-top: var(--space-sm);
    padding: 0.9rem;
    border: 1px solid rgba(var(--accent-gold-rgb), var(--o-20));
    border-radius: var(--radius-2xl);
    background: rgba(18, 20, 25, 0.78);
}

.location-picker__summary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-soft);
}

.location-picker__summary span {
    color: rgba(230, 225, 216, 0.72);
    font-size: 0.92rem;
}

.page-coordinates .form-help {
    font-size: 0.95rem;
}

.location-picker__preview .form-help {
    margin-bottom: var(--space-sm);
}

.location-picker__map {
    width: 100%;
    height: 220px;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.coordinates-security-note {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.coordinates-email-prefs {
    border: none;
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-md) 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.coordinates-email-prefs__legend {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-muted);
    padding: 0 var(--space-sm);
}

/* ─── Account Tabs ─── */

.account-tabs {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(var(--white-rgb), var(--o-12));
    padding-bottom: 0;
}

.account-tabs__tab {
    padding: var(--space-sm) var(--space-xs);
    padding-bottom: var(--space-sm);
    color: var(--text-soft, #e6e1d8);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    opacity: 0.6;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: opacity var(--transition-fast), border-color var(--transition-fast);
}

.account-tabs__tab:hover {
    opacity: 0.85;
}

.account-tabs__tab--active {
    opacity: 1;
    color: var(--accent-gold, #ffd875);
    border-bottom-color: var(--accent-gold, #ffd875);
}

/* ─── Profile Page ─── */

.profile-form {
    margin-top: var(--space-xl);
}

.profile-section {
    margin-bottom: var(--space-2xl);
}

.profile-section h2 {
    color: var(--vision-gold, #c7953d);
    font-family: var(--font-heading);
    margin-bottom: var(--space-lg);
}

.profile-form .form-input--textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.profile-saved {
    background: rgba(199, 149, 61, 0.1);
    border: 1px solid rgba(199, 149, 61, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
    color: var(--accent-gold-soft);
}

.profile-nav-links {
    margin-top: var(--space-xl);
    text-align: center;
    font-size: 0.9rem;
}

/* Beta Status Page */
.page-beta-status .site-main {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.page-beta-status .content-panel {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

.safe-harbor-content {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

.observatory-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.observatory-stars span {
    position: absolute;
    width: 2.5px;
    height: 2.5px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 5px 1.5px rgba(var(--accent-gold-rgb), var(--o-50));
}

.observatory-stars span:nth-child(1) {
    top: 8%;
    left: 28%;
    animation: star-twinkle 4.2s ease-in-out 0.3s infinite;
}

.observatory-stars span:nth-child(2) {
    top: 14%;
    right: 25%;
    animation: star-twinkle 5.8s ease-in-out 1.7s infinite;
}

.observatory-stars span:nth-child(3) {
    top: 22%;
    left: 18%;
    animation: star-twinkle 6.3s ease-in-out 3.1s infinite;
}

.observatory-stars span:nth-child(4) {
    top: 5%;
    right: 35%;
    width: 2px;
    height: 2px;
    animation: star-twinkle 5.1s ease-in-out 0.8s infinite;
}

.observatory-stars span:nth-child(5) {
    top: 18%;
    right: 18%;
    width: 2px;
    height: 2px;
    animation: star-twinkle 7.2s ease-in-out 4.5s infinite;
}

.observatory-stars span:nth-child(6) {
    top: 11%;
    left: 38%;
    width: 2px;
    height: 2px;
    animation: star-twinkle 4.7s ease-in-out 2.2s infinite;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
}

.lighthouse-image {
    width: 260px;
    max-width: 100%;
    height: auto;
    margin: var(--space-3xl) auto -2.5rem;
    display: block;
    mix-blend-mode: lighten;
    mask-image: linear-gradient(to right, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 75%, transparent 100%);
}

.safe-harbor-content h1 {
    font-family: 'Philosopher', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--text-soft);
    margin-bottom: var(--space-md);
    letter-spacing: 0.05em;
}

.safe-harbor-content p {
    color: rgba(230, 225, 216, 0.9);
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.safe-harbor-content .closing {
    margin-bottom: var(--space-lg);
}

.safe-harbor-status {
    color: var(--accent-gold-soft) !important;
    margin-bottom: var(--space-md);
}

.safe-harbor-content .btn {
    margin-bottom: var(--space-md);
}

.beta-application-form {
    width: 100%;
    max-width: 100%;
    margin: var(--space-md) auto var(--space-lg);
    text-align: left;
}

.beta-application-form[hidden] {
    display: none;
}

.beta-application-form__field {
    margin-bottom: var(--space-md);
}

.beta-application-form label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-soft);
    font-family: 'Philosopher', sans-serif;
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.4;
    text-align: center;
}

.beta-application-form__textarea {
    width: 100%;
    min-height: 11rem;
    padding: var(--space-md);
    box-sizing: border-box;
    background: rgba(var(--white-rgb), var(--o-04));
    border: 1px solid rgba(249, 220, 162, 0.28);
    border-radius: var(--radius-lg);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.beta-application-form__textarea:focus {
    outline: 2px solid var(--accent-gold-soft);
    outline-offset: 2px;
    background: rgba(var(--white-rgb), var(--o-08));
    border-color: var(--accent-gold-soft);
    box-shadow: 0 0 0 3px rgba(249, 220, 162, 0.12);
}

.beta-application-form__help {
    margin: var(--space-xs) 0 0 !important;
    color: rgba(230, 225, 216, 0.68) !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    text-align: center;
}

.beta-application-form .btn {
    display: block;
    margin: 0 auto var(--space-md);
}

.safe-harbor-explore {
    margin-top: var(--space-lg);
    text-align: left;
    font-size: clamp(0.925rem, 1.8vw, 1rem);
    line-height: 1.9;
    color: rgba(230, 225, 216, 0.75);
}

.safe-harbor-explore a,
.safe-harbor-explore a:visited,
.safe-harbor-content p a,
.safe-harbor-content p a:visited {
    color: var(--accent-gold) !important;
    text-decoration: underline !important;
    text-decoration-color: color-mix(in srgb, var(--accent-gold) 50%, transparent) !important;
    text-underline-offset: 0.2em;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast), text-shadow var(--transition-fast);
}

.safe-harbor-explore a:hover,
.safe-harbor-content p a:hover {
    color: var(--accent-gold-soft) !important;
    text-decoration-color: var(--accent-gold-soft) !important;
    text-shadow: 0 0 8px rgba(var(--accent-gold-rgb), 0.4), 0 0 20px rgba(var(--accent-gold-rgb), 0.15);
}


/* Error Pages */
.page-error .error-container {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.page-error .error-icon {
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.page-error .error-title {
    font-family: 'Philosopher', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-error .error-message {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Shared by .in-progress__glyph (reading.css) and .reading-complete__text (report.css);
   defined here once since main.css loads on both the reading and report pages. */
@keyframes gentlePulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

/* ============================================
 * Star-rating cell (shared)
 * One set of star-cell rules for both the per-page rating widget (.page-rating__star,
 * in reading.css) and the feedback overall-rating widget (.feedback-star, in report.css).
 * Lives here because main.css loads on both surfaces; each surface only differs in size
 * and transition speed, parameterized via --star-size / --star-speed. The surface-specific
 * wrapper/layout rules (.page-rating__stars, .feedback-star-group/-anchor/-stars) stay put.
 * ============================================ */

.page-rating__star { --star-size: 1.3rem; --star-speed: 0.1s; }
.feedback-star { --star-size: 2rem; --star-speed: 0.15s; }

.page-rating__star, .feedback-star {
    font-size: var(--star-size);
    color: rgba(var(--accent-gold-rgb), 0.15);
    cursor: pointer;
    transition: color var(--star-speed);
    user-select: none;
}

button.page-rating__star, button.feedback-star {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.page-rating__star--full, .feedback-star--full {
    color: var(--accent-gold-soft, #f9dca2);
}

/* Doubled class so the gradient outranks `button.…{ background: none }` (0,1,1). */
.page-rating__star.page-rating__star--half, .feedback-star.feedback-star--half {
    background: linear-gradient(90deg, var(--accent-gold-soft, #f9dca2) 50%, rgba(var(--accent-gold-rgb), 0.15) 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Doubled class + explicit resets so a full-hover preview over an already-selected
   half star clears its gradient/transparent fill (else the half stays visible). */
.page-rating__star.page-rating__star--hover, .feedback-star.feedback-star--hover {
    color: rgba(var(--accent-gold-rgb), var(--o-50));
    background: none;
    -webkit-text-fill-color: currentColor;
}

.page-rating__star.page-rating__star--hover-half, .feedback-star.feedback-star--hover-half {
    background: linear-gradient(90deg, rgba(var(--accent-gold-rgb), var(--o-50)) 50%, rgba(var(--accent-gold-rgb), 0.15) 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Legal Pages */
.page-legal .site-main {
    padding-top: calc(var(--header-height) + var(--space-lg));
}

.page-legal .content-panel {
    max-width: 1000px;
    padding-top: 0.5rem;
}

.page-legal .legal-content {
    max-width: 1000px;
    margin: 0 auto;
}

.page-legal h1 {
    font-family: 'Philosopher', sans-serif;
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    text-align: center;
}

.page-legal .last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.page-legal .legal-section {
    margin-bottom: 2.5rem;
}

.page-legal h2 {
    font-family: 'Philosopher', sans-serif;
    font-size: 1.75rem;
    color: var(--accent-gold-soft);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-legal h3 {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.page-legal p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.page-legal ul {
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.page-legal li {
    margin-bottom: 0.5rem;
}

.page-legal .legal-link {
    color: var(--accent-gold-soft);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-gold-rgb), var(--o-30));
    transition: border-color var(--transition-fast);
}

.page-legal .legal-link:hover {
    border-bottom-color: var(--accent-gold);
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

/* Privacy Page Table Styles */
.privacy-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.privacy-table th,
.privacy-table td {
    border: 1px solid var(--border-subtle);
    padding: 12px;
    text-align: left;
    color: var(--text-light);
}

.privacy-table th {
    background-color: var(--glass-bg);
    font-weight: bold;
    color: var(--text-soft);
}

.privacy-table tr:nth-child(even) {
    background-color: var(--glass-bg-hover);
}

@media (max-width: 640px) {
    .privacy-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Extra small phones - very narrow screens */
@media (max-width: 480px) {
    .header-right {
        right: var(--space-xs);
    }

    .moon-toggle {
        padding: var(--space-xs);
    }

    .moon-toggle__icon {
        width: 36px;
        height: 36px;
    }
}

/* =============================================================================
   Share Button & Modal
   ============================================================================= */

/* Share trigger button */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.share-btn:hover,
.share-btn:focus-visible {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: var(--glass-bg-hover);
    outline: none;
}

.share-btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Share modal overlay */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.share-modal[aria-hidden="false"] {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.share-modal[aria-hidden="false"] .share-modal__backdrop {
    opacity: 1;
}

/* Modal panel — centered dialog */
.share-modal__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(420px, 90vw);
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(2, 3, 20, 0.95);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-normal);
}

.share-modal[aria-hidden="false"] .share-modal__panel {
    transform: translate(-50%, -50%) scale(1);
}

/* AI prompt modal */
.ai-prompt-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-high);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.ai-prompt-modal[aria-hidden="false"] {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.ai-prompt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ai-prompt-modal__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.97);
    width: min(432px, 92vw);
    max-height: min(72vh, 42rem);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(9, 10, 31, 0.975), rgba(4, 5, 20, 0.988));
    border: 1px solid rgba(var(--accent-gold-rgb), var(--o-12));
    border-radius: 14px;
    box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(var(--white-rgb), 0.015);
    transition: transform var(--transition-normal);
}

.ai-prompt-modal[aria-hidden="false"] .ai-prompt-modal__panel {
    transform: translate(-50%, -50%) scale(1);
}

.ai-prompt-modal__close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(var(--white-rgb), var(--o-04));
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-pill);
}

/* Transparent ≥44px touch target, centered on the button; absolute, so zero layout impact. */
.ai-prompt-modal__close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

.ai-prompt-modal__close:hover,
.ai-prompt-modal__close:focus-visible {
    background: rgba(var(--accent-gold-rgb), var(--o-08));
    color: var(--text-light);
    outline: none;
}

.ai-prompt-modal__content {
    max-height: min(72vh, 42rem);
    overflow-y: auto;
}

.ai-prompt-modal__loading {
    padding: var(--space-xl);
    color: var(--text-muted);
}

.ai-prompt-sheet {
    padding: 0;
}

.ai-prompt-sheet .ai-prompt-sheet__header {
    position: relative;
    padding: 0.58rem 1rem;
    border-bottom: 1px solid rgba(var(--accent-gold-rgb), var(--o-08));
}

.ai-prompt-sheet .ai-prompt-sheet__title {
    margin: 0;
    display: block;
    padding: 0 2.3rem;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.005em;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: anywhere;
    width: 100%;
}

.ai-prompt-sheet .ai-prompt-sheet__song-title,
.ai-prompt-sheet .ai-prompt-sheet__title i,
.ai-prompt-sheet .ai-prompt-sheet__title em {
    color: var(--accent-gold-soft);
    font-style: italic;
    font-weight: 600;
    margin-inline: 0.18rem;
}

.ai-prompt-sheet .ai-prompt-modal__close--inline {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    z-index: auto;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    background: rgba(var(--white-rgb), var(--o-04));
}

.ai-prompt-sheet__body-block {
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1rem 1rem;
}

.ai-prompt-sheet__body {
    margin: 0 0 0.85rem !important;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.62;
    text-wrap: pretty;
}

.ai-prompt-sheet__note {
    margin: 0 0 0.22rem !important;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.24;
}

.ai-prompt-sheet__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
    margin-top: 0;
}

.ai-prompt-sheet .ai-option {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.62rem;
    min-width: 0;
    min-height: 2.92rem;
    padding: 0.7rem 0.82rem;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(var(--accent-gold-rgb), var(--o-12));
    background:
        linear-gradient(180deg, rgba(var(--accent-gold-rgb), var(--o-04)), rgba(var(--white-rgb), 0.018)),
        rgba(var(--white-rgb), var(--o-04));
    box-shadow: inset 0 1px 0 rgba(var(--white-rgb), var(--o-04));
    color: var(--text-soft);
    text-decoration: none !important;
    text-decoration-line: none !important;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition:
        border-color var(--transition-fast),
        color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.ai-prompt-sheet .ai-option,
.ai-prompt-sheet .ai-option:link,
.ai-prompt-sheet .ai-option:visited,
.ai-prompt-sheet .ai-option:hover,
.ai-prompt-sheet .ai-option:active,
.ai-prompt-sheet .ai-option * {
    text-decoration: none !important;
}

.ai-prompt-sheet .ai-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.42rem;
    height: 1.42rem;
    flex-shrink: 0;
    padding: 0.16rem;
    border-radius: var(--radius-pill);
    background: rgba(var(--accent-gold-rgb), var(--o-04));
    border: 1px solid rgba(var(--accent-gold-rgb), var(--o-12));
    box-shadow: inset 0 1px 0 rgba(var(--white-rgb), var(--o-04));
    box-sizing: border-box;
}

.ai-prompt-sheet .ai-option:not(.ai-option--copy):not(:has(.ai-option__icon--provider))::before {
    content: "";
    width: 1.42rem;
    height: 1.42rem;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: rgba(var(--accent-gold-rgb), var(--o-04));
    border: 1px solid rgba(var(--accent-gold-rgb), var(--o-12));
    box-sizing: border-box;
}

.ai-prompt-sheet .ai-option__icon--provider {
    object-fit: contain;
    border-radius: var(--radius-pill);
}

.ai-prompt-sheet .ai-option__label {
    min-width: 0;
    line-height: 1.2;
    color: inherit;
    text-decoration: none !important;
    text-decoration-line: none !important;
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
}

.ai-prompt-sheet .ai-option:hover,
.ai-prompt-sheet .ai-option:focus-visible {
    border-color: rgba(var(--accent-gold-rgb), var(--o-30));
    color: var(--text-light);
    background:
        linear-gradient(180deg, rgba(var(--accent-gold-rgb), var(--o-08)), rgba(var(--accent-gold-rgb), var(--o-04)) 24%, rgba(var(--white-rgb), var(--o-04))),
        rgba(var(--white-rgb), var(--o-04));
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(var(--white-rgb), var(--o-04)),
        0 10px 22px rgba(0, 0, 0, 0.22);
    outline: none;
}

.ai-prompt-sheet .ai-option--copy .ai-option__icon {
    background: rgba(var(--accent-gold-rgb), var(--o-08));
    border-color: rgba(var(--accent-gold-rgb), 0.16);
}

.ai-prompt-sheet__status {
    margin: 0;
    padding: 0 1rem 0.8rem;
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.4;
}

.ai-prompt-sheet__status:empty {
    display: none;
}

.ai-prompt-sheet__clipboard {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Header */
.share-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.share-modal__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

.share-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    position: relative;
}

/* Transparent ≥44px touch target, centered on the button; absolute, so zero layout impact. */
.share-modal__close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

.share-modal__close:hover,
.share-modal__close:focus-visible {
    color: var(--text-light);
    background: var(--glass-bg-hover);
    outline: none;
}

/* Preview area */
.share-modal__preview {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.share-modal__image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.share-modal__preview-title {
    font-size: 0.875rem;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Platform grid */
.share-modal__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

/* Individual share option */
.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    border-radius: var(--radius-lg);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.share-option:hover,
.share-option:focus-visible {
    background: var(--glass-bg-hover);
    color: var(--text-light);
    outline: none;
}

.share-option__icon {
    width: 24px;
    height: 24px;
}

.share-option__label {
    text-align: center;
}

/* Mobile: bottom sheet */
@media (max-width: 768px) {
    .share-modal__panel {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        width: 100%;
        max-height: 80vh;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }

    .share-modal[aria-hidden="false"] .share-modal__panel {
        transform: translateY(0);
    }

    .share-modal__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ai-prompt-modal__panel {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 76vh;
        transform: translateY(100%);
        border-radius: 18px 18px 0 0;
    }

    .ai-prompt-modal[aria-hidden="false"] .ai-prompt-modal__panel {
        transform: translateY(0);
    }
}

@media (max-width: 430px) {
    .ai-prompt-sheet__actions {
        grid-template-columns: 1fr;
    }

    .ai-prompt-sheet .ai-prompt-sheet__title {
        font-size: 0.9rem;
        padding-inline: 2.1rem;
    }
}


/* ============================================
 * Readings Hub
 * ============================================ */

.readings-hub {
    max-width: 52rem;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl) var(--space-4xl);
}

/* Header */

.readings-hub__eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(var(--accent-gold-rgb), var(--o-50));
    margin-bottom: 0.6rem;
}

.readings-hub__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 400;
    color: #f5eed9;
    line-height: 1.15;
    margin: 0 0 var(--space-md) 0;
}

.readings-hub__intro {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 var(--space-2xl) 0;
}

.readings-hub__intro a:visited {
    color: var(--color-accent);
}


/* CTA + Credits */

.readings-hub__actions {
    display: flex;
    align-items: baseline;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(var(--accent-gold-rgb), var(--o-08));
}

.readings-hub__cta {
    display: inline-block;
    padding: 0.7rem 2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.readings-hub__cta--primary {
    background: rgba(var(--accent-gold-rgb), 0.9);
    color: var(--reading-text-dark);
}

.readings-hub__cta--primary:hover {
    background: rgba(var(--accent-gold-rgb), 1);
}

.readings-hub__cta--disabled {
    background: rgba(var(--white-rgb), var(--o-08));
    color: var(--text-muted);
    cursor: not-allowed;
}

.readings-hub__credit-count {
    font-size: 0.88rem;
    color: rgba(184, 180, 194, 0.7);
}

.readings-hub__credit-count strong {
    color: var(--text-soft);
}

.readings-hub__purchase-placeholder {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

.readings-hub__pipeline-select {
    padding: 0.4rem 0.6rem;
    background: rgba(var(--white-rgb), var(--o-04));
    border: 1px solid rgba(var(--white-rgb), var(--o-12));
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.85rem;
    margin-right: var(--space-sm);
}

.readings-hub__pipeline-select option {
    background: #1a1a2e;
    color: var(--text-light);
}

/* Card Projection control — same gold CTA as "Begin a New Reading", with the
   button to the right of its pipeline dropdown so the row lines up with the
   dropdown + button above. The (staff-only) astrology toggle wraps to its own
   line beneath them. */
.readings-hub__card-proj {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
}

.readings-hub__astrology-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(184, 180, 194, 0.75);
}

.readings-hub__astrology-toggle {
    cursor: pointer;
    order: 1;
    flex-basis: 100%;
}

.readings-hub__astrology-toggle input[type="checkbox"] {
    accent-color: rgba(var(--accent-gold-rgb), 0.9);
}

/* Past Readings — Editorial List */

.readings-hub__history-title {
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(var(--accent-gold-rgb), 0.45);
    margin: 0 0 var(--space-md) 0;
}

.readings-hub__sort-row {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: 0.8rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(var(--accent-gold-rgb), var(--o-08));
}

.readings-hub__sort-label {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(var(--accent-gold-rgb), var(--o-30));
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.readings-hub__sort-label:hover {
    color: rgba(var(--accent-gold-rgb), 0.6);
}

.readings-hub__sort-label--active {
    color: rgba(var(--accent-gold-rgb), 0.65);
}

.readings-hub__sort-label--active::after {
    content: ' \2193';
    font-size: 0.55rem;
}

.readings-hub__sort-label--asc::after {
    content: ' \2191';
    font-size: 0.55rem;
}

.readings-hub__entry {
    display: flex;
    align-items: baseline;
    gap: var(--space-lg);
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(var(--white-rgb), var(--o-04));
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    cursor: pointer;
}

.readings-hub__entry:hover {
    background: rgba(var(--accent-gold-rgb), var(--o-04));
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: var(--radius-md);
}

.readings-hub__entry:last-child {
    border-bottom: none;
}

.readings-hub__entry-title {
    font-family: 'EB Garamond', 'Georgia', serif;
    font-size: 1.12rem;
    color: #ede8db;
    flex: 1;
    min-width: 0;
}

.readings-hub__entry-meta {
    display: flex;
    gap: 1.2rem;
    align-items: baseline;
    flex-shrink: 0;
}

.readings-hub__entry-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.readings-hub__entry-visited {
    font-size: 0.72rem;
    color: rgba(184, 180, 194, 0.45);
    white-space: nowrap;
}

.readings-hub__entry-status {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    min-width: 5.5rem;
    text-align: right;
}

.readings-hub__entry-status--completed { color: #8bc48a; }
.readings-hub__entry-status--expired { color: #b8956a; }
.readings-hub__entry-status--in_progress { color: #e8c547; }
.readings-hub__entry-status--report_stalled { color: #d48a8a; }

/* Responsive */

@media (max-width: 640px) {
    .readings-hub {
        padding: var(--space-xl) var(--space-md) var(--space-3xl);
    }

    .readings-hub__actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .readings-hub__cta {
        display: block;
        text-align: center;
    }

    .readings-hub__entry {
        flex-direction: column;
        gap: 0.3rem;
        padding: 1rem 0;
    }

    .readings-hub__entry:hover {
        margin: 0 -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .readings-hub__entry-meta {
        gap: 0.8rem;
    }

    .readings-hub__entry-status {
        text-align: left;
    }

    .readings-hub__sort-row {
        gap: var(--space-md);
    }
}

/* ============================================
 * Sticky Moon Toggle — non-reading pages
 *
 * On every non-reading page, the moon pins to the
 * viewport top-right so it stays reachable as
 * content scrolls away. Reading pages keep the
 * moon inside their own header, which is made
 * sticky separately in reading.css — that keeps
 * the save/return link and chart title visible
 * alongside the moon.
 * ============================================ */

body:not(.page-reading) .moon-toggle {
    --moon-edge-offset: var(--space-2xl);
    position: fixed;
    top: var(--space-xl);
    right: var(--moon-edge-offset);
    z-index: 100;
    isolation: isolate;
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
                color var(--transition-fast);
}

/* Stronger menu tab — solid panel, brighter gold inset edge, projecting
   shadow. Ported from the prototype .tabmock--strong treatment. */
body:not(.page-reading) .moon-toggle:not(.moon-toggle--flash)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: calc(-1 * var(--moon-edge-offset) - 0.15rem);
    width: calc(100% + var(--moon-edge-offset) + 0.55rem);
    height: calc(100% + 0.55rem);
    transform: translateY(-50%);
    border-radius: 999px 0 0 999px;
    background:
        linear-gradient(90deg, rgba(6, 7, 22, 0.4), rgba(12, 12, 30, 0.9) 45%, rgba(14, 13, 33, 0.95)),
        radial-gradient(circle 48px at 85% 50%, rgba(216, 226, 255, 0.16), rgba(170, 164, 224, 0.09) 32%, rgba(var(--accent-gold-rgb), var(--o-04)) 52%, transparent 72%);
    box-shadow:
        inset 4px 0 0 rgba(var(--accent-gold-rgb), 0.6),
        -10px 0 26px rgba(0, 0, 0, 0.45),
        0 0 20px rgba(160, 170, 255, 0.1),
        0 0 12px rgba(var(--accent-gold-rgb), var(--o-12));
    mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 100%);
    pointer-events: none;
    z-index: 0;
}

/* Grip-lines beside the moon, sitting on the tab panel (left of the icon). */
body:not(.page-reading) .moon-toggle__grip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 50%;
    right: calc(100% - 0.35rem);
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Hover slides the tab out from the screen edge. */
body:not(.page-reading) .moon-toggle:hover {
    transform: translateX(-6px) scale(1.12);
}

/* Homepage almanac moon is decorative, not a control. */
.page-home .almanac-moon {
    pointer-events: none;
}

@media (max-width: 900px) {
    body:not(.page-reading) .moon-toggle {
        --moon-edge-offset: var(--space-xl);
        top: var(--space-lg);
        right: var(--moon-edge-offset);
    }
}

@media (max-width: 768px) {
    body:not(.page-reading) .moon-toggle {
        --moon-edge-offset: var(--space-lg);
        top: var(--space-md);
        right: var(--moon-edge-offset);
    }
}

@media (max-width: 640px) {
    body:not(.page-reading) .moon-toggle {
        --moon-edge-offset: var(--space-sm);
        top: var(--space-sm);
        right: var(--moon-edge-offset);
    }
}

@media (max-width: 480px) {
    body:not(.page-reading) .moon-toggle {
        --moon-edge-offset: var(--space-xs);
        right: var(--moon-edge-offset);
    }
}

/* ============================================
 * Reduced Transparency
 * ============================================ */

@media (prefers-reduced-transparency: reduce) {
    .content-panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(2, 3, 20, 0.92);
    }

    .moon-menu__panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(2, 3, 20, 0.98);
    }

    .moon-menu__backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .share-modal__panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(2, 3, 20, 0.98);
    }

    .ai-prompt-modal__panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(4, 5, 20, 0.98);
    }

    .share-modal__backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .ai-prompt-modal__backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .btn--outline {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

