/* ==========================================================================
   STRESSBAAS v3.4 — Optimized Stylesheet
   
   Performance Improvements:
   - Separated backdrop-filter from animated elements
   - GPU-accelerated transforms for cursor
   - Idle-aware animation states
   - Theme classes on :root for FOUC prevention
   - Reduced motion support
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS & ANIMATION VARIABLES
   ========================================================================== */
:root,
html.theme-light {
    /* Colors */
    --c-primary: #0F2923;
    --c-secondary: #4CAF50;
    --c-accent: #D4A373;
    --c-bg: #F2F7F5;
    --c-surface: #FFFFFF;
    --c-text-main: #0F2923;
    --c-text-muted: #5C6F68;
    --c-border: #E0E8E5;
    
    /* Bio-Hacking Glass Tokens */
    --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.65));
    --glass-border: 1px solid rgba(255, 255, 255, 0.9);
    --glass-edge: inset 0 1px 0 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    
    /* Deep Shadow Layering */
    --shadow-soft: 
        0 4px 6px -1px rgba(15, 41, 35, 0.05),
        0 10px 15px -3px rgba(15, 41, 35, 0.05),
        0 20px 25px -5px rgba(15, 41, 35, 0.05);
    
    --shadow-glow: 
        0 0 20px rgba(76, 175, 80, 0.1),
        0 10px 40px -10px rgba(76, 175, 80, 0.2);

    /* Typography */
    --font-head: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    /* Geometry */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-pill: 100px;
    
    /* Physics & Somatic Animation Curves */
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-fluid: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-breath: cubic-bezier(0.45, 0, 0.55, 1);
    --ease-snappy: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-return: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Dark Theme - Applied to html element */
html.theme-dark {
    --c-primary: #E8F5E9;
    --c-secondary: #81C784;
    --c-accent: #FFE082;
    --c-bg: #050F0C;
    --c-surface: #0F221E;
    --c-text-main: #F1F7F4;
    --c-text-muted: #A0B3AD;
    --c-border: #1F3630;
    
    --glass-bg: linear-gradient(145deg, rgba(15, 34, 30, 0.85), rgba(10, 25, 22, 0.75));
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-edge: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(0, 0, 0, 0.2);
    --shadow-soft: 0 15px 35px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(76, 175, 80, 0.15);
}

/* Backward compatibility - body class support */
body.theme-dark {
    --c-primary: #E8F5E9;
    --c-secondary: #81C784;
    --c-accent: #FFE082;
    --c-bg: #050F0C;
    --c-surface: #0F221E;
    --c-text-main: #F1F7F4;
    --c-text-muted: #A0B3AD;
    --c-border: #1F3630;
    
    --glass-bg: linear-gradient(145deg, rgba(15, 34, 30, 0.85), rgba(10, 25, 22, 0.75));
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-edge: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(0, 0, 0, 0.2);
    --shadow-soft: 0 15px 35px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(76, 175, 80, 0.15);
}

/* ==========================================================================
   2. GLOBAL RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--c-bg);
    color: var(--c-text-main);
    line-height: 1.6;
    transition: background-color 0.5s, color 0.3s;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide cursor on fine pointer devices (custom cursor enabled) */
@media (pointer: fine) {
    body {
        cursor: none;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.1;
    color: var(--c-text-main);
}

h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.02em;
}

p {
    color: var(--c-text-muted);
    max-width: 65ch;
    margin-bottom: 1.5rem;
}

a {
    color: inherit;
    text-decoration-skip-ink: auto;
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
    font-size: inherit;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--c-secondary);
    outline-offset: 2px;
}

/* ==========================================================================
   3. VIEW TRANSITIONS & ANIMATIONS
   ========================================================================== */
#app-mount {
    view-transition-name: app-container;
    min-height: 400px;
    display: grid;
    place-items: center;
}

::view-transition-old(app-container),
::view-transition-new(app-container) {
    height: 100%;
}

::view-transition-group(app-container) {
    animation-duration: 0.6s;
    animation-timing-function: var(--ease-fluid);
}

/* View Transition Names */
.vt-title {
    view-transition-name: hero-title;
    width: fit-content;
    margin-inline: auto;
}

.vt-action {
    view-transition-name: action-bar;
}

.vt-visual {
    view-transition-name: hero-visual;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-elastic) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-fluid), transform 0.8s var(--ease-fluid);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   4. GLASSMORPHISM COMPONENTS — Optimized
   ========================================================================== */

/* Base glass styles - shared by all glass elements */
.glass-panel,
.app-card,
.tool-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: var(--glass-border);
    box-shadow: var(--shadow-soft), var(--glass-edge);
    transition: transform 0.4s var(--ease-fluid), box-shadow 0.4s var(--ease-fluid), border-color 0.3s;
}

/* Static blur layer - NOT animated (performance critical) */
.glass-panel::before,
.app-card::before,
.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: inherit;
}

/* Noise texture overlay */
.glass-panel::after,
.app-card::after,
.tool-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    border-radius: inherit;
}

/* Ensure content stacks above pseudo-elements */
.glass-panel > *,
.app-card > *,
.tool-card > * {
    position: relative;
    z-index: 2;
}

/* Animated glow layer - separate from blur for performance */
.glow-layer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    animation: glow-pulse 8s var(--ease-breath) infinite;
    pointer-events: none;
    z-index: -3;
}

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

/* App Card - Main container for views */
.app-card {
    max-width: 700px;
    width: 100%;
    margin-inline: auto;
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

/* Tool Cards */
.tool-card {
    padding: 1.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow), var(--glass-edge);
    border-color: var(--c-secondary);
}

.tool-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow), var(--glass-edge);
    border-color: var(--c-secondary);
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn {
    position: relative;
    padding: 1rem 3rem;
    border-radius: var(--radius-pill);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
    text-decoration: none;
}

.btn--primary {
    background: var(--c-text-main);
    color: var(--c-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn__bg {
    position: absolute;
    inset: 0;
    background: var(--c-secondary);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s var(--ease-elastic);
    pointer-events: none;
}

.btn--primary:hover .btn__bg,
.btn--primary:focus-visible .btn__bg {
    transform: scaleY(1);
}

.btn__text {
    position: relative;
    z-index: 2;
}

.btn--ghost {
    background: transparent;
    color: var(--c-text-muted);
    padding: 0.75rem 2rem;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
    color: var(--c-text-main);
    background: rgba(0, 0, 0, 0.05);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-main);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ==========================================================================
   6. MAGNETIC ELEMENTS
   ========================================================================== */
.magnetic {
    will-change: auto;
    transition: transform 0.5s var(--ease-fluid);
}

/* Active state: JS controls transform, disable CSS transition */
.magnetic.is-active {
    transition: none;
    will-change: transform;
}

/* Returning state: smooth spring-back animation */
.magnetic.is-returning {
    transition: transform 0.7s var(--ease-return);
    will-change: transform;
}

/* ==========================================================================
   7. LAYOUT UTILITIES
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1000px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.section {
    padding-block: clamp(4rem, 10vh, 8rem);
    position: relative;
}

.section--compact {
    padding-block: 2rem;
}

.section--app {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

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

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--c-text-muted);
}

.margin-top-md {
    margin-top: 2rem;
}

.glass-inset {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    margin-top: 1.5rem;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid--tools {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ==========================================================================
   8. HERO SECTION
   ========================================================================== */
.hero {
    min-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.hero__content {
    text-align: center;
    display:flex; 
    flex-direction: column;
    align-items: center;
    gap: 0.50rem;
}

.hero__title {
    display: flex;
    flex-direction: row;
    gap: 1.0rem; /* spacing between child elements */
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
}

.hero__text {
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;

}

.hero__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.block {
    display: block;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--c-secondary);
    font-weight: 500;
    margin-bottom: 1rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--c-secondary);
    display: block;
    margin-bottom: 1rem;
}

/* ==========================================================================
   9. NAVIGATION
   ========================================================================== */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding-block: 1.5rem;
    mix-blend-mode: difference;
    color: white;
}

.nav__wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo {
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.nav__logo .dot {
    color: var(--c-secondary);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme Icons */
.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-sun,
.icon-moon {
    display: none;
}

/* Light theme: show moon icon */
html.theme-light .icon-moon,
body.theme-light .icon-moon {
    display: block;
}

/* Dark theme: show sun icon */
html.theme-dark .icon-sun,
body.theme-dark .icon-sun {
    display: block;
}

/* ==========================================================================
   10. CURSOR & BACKGROUND FX
   ========================================================================== */
.cursor-wrapper {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: exclusion;
}

.cursor-dot,
.cursor-ring {
    will-change: transform;
    backface-visibility: hidden;
    position: absolute;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 1px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    opacity: 0.5;
}

/* Background Effects Layer */
.fx-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(200px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out;
    border-radius: 80%;
}

.blob--1 {
    top: -20%;
    left: -20%;
    width: 800px;
    height: 800px;
    background: var(--c-secondary);
}

.blob--2 {
    bottom: -20%;
    right: -20%;
    width: 900px;
    height: 900px;
    background: var(--c-accent);
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, -100) scale(1);
    }
    50% {
        transform: translate(30px, 50px) scale(1.05);
    }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC42IiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI24pIiBvcGFjaXR5PSIwLjUiLz48L3N2Zz4=');
    pointer-events: none;
}

/* ==========================================================================
   11. ACCORDION
   ========================================================================== */
.accordion {
    overflow: hidden;
    transition: all 0.3s;
}

.accordion__trigger {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion__trigger::-webkit-details-marker {
    display: none;
}

.accordion__trigger svg {
    transition: transform 0.3s var(--ease-snappy);
}

details[open] .accordion__trigger svg {
    transform: rotate(180deg);
}

.accordion__content {
    padding: 0 1.5rem 2rem;
}

/* ==========================================================================
   12. MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 41, 35, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-wrapper {
    position: relative;
    width: 90%;
    max-width: 700px;
    z-index: 10;
    max-height: 90vh;
    display: flex;
}

.modal-content {
    width: 100%;
    overflow-y: auto;
    padding: 3rem;
    background: var(--c-surface);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s var(--ease-elastic);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-lg);
}

.modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0) scale(1);
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--c-text-main);
    z-index: 20;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-close:hover,
.btn-close:focus-visible {
    background: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   13. FILTERS
   ========================================================================== */
.toolkit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    border: 1px solid var(--c-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: var(--c-text-muted);
}

.filter-btn:hover,
.filter-btn:focus-visible,
.filter-btn.active {
    background: var(--c-text-main);
    color: var(--c-bg);
    border-color: var(--c-text-main);
}

/* ==========================================================================
   14. WARMUP & BREATHING
   ========================================================================== */
.warmup-card {
    min-height: 450px;
}

.warmup-header {
    margin-bottom: 1rem;
}

.breath-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 2rem auto;
    display: grid;
    place-items: center;
}

.breath-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-glow);
    transform: scale(0.8);
}

.breath-circle.is-active {
    animation: somatic-breath 10s var(--ease-breath) forwards;
}

.breath-label {
    position: relative;
    z-index: 2;
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--c-text-main);
    transition: opacity 0.5s;
}

@keyframes somatic-breath {
    0% {
        transform: scale(0.8);
    }
    40% {
        transform: scale(1.3);
        background: rgba(255, 255, 255, 0.3);
    }
    100% {
        transform: scale(0.8);
    }
}

.warmup-skip {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-top: 0.5rem;
}

.warmup-skip:hover,
.warmup-skip:focus-visible {
    opacity: 1;
}

/* ==========================================================================
   15. QUIZ
   ========================================================================== */
.quiz-card {
    text-align: left;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.quiz-back {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--c-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
}

.quiz-back:hover,
.quiz-back:focus-visible {
    color: var(--c-text-main);
    background: rgba(0, 0, 0, 0.05);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--c-secondary);
    width: 0%;
    transition: width 0.6s var(--ease-elastic);
}

.step-counter {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-text-muted);
    min-width: 40px;
    text-align: right;
}

.quiz-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.quiz-option {
    width: 100%;
    text-align: left;
    padding: 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--c-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.05rem;
    color: var(--c-text-main);
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-snappy), opacity 0.3s ease;
}

.quiz-option:hover,
.quiz-option:focus-visible {
    background: var(--c-surface);
    border-color: var(--c-secondary);
    transform: translateX(5px);
}

.quiz-option span:first-child {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.quiz-option.is-selected {
    background: var(--c-text-main);
    color: var(--c-bg);
    border-color: var(--c-text-main);
    transform: scale(1.02);
    z-index: 10;
}

.quiz-option.is-muted {
    opacity: 0.3;
    pointer-events: none;
    transform: scale(0.98);
    filter: blur(2px);
}

/* ==========================================================================
   16. DASHBOARD
   ========================================================================== */
.dashboard-card {
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.profile-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.profile-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.profile-title {
    font-size: 1.75rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 100px 1fr;
        text-align: left;
    }
    
    .profile-summary {
        justify-content: flex-start;
    }
    
    .dashboard-card {
        text-align: left;
    }
    
    .status-box {
        text-align: left;
    }
}

/* Polyvagal Ladder Visualizer */
.ladder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 320px;
    padding: 1.5rem 0.5rem;
    position: relative;
    background: rgba(255, 255, 255, 0.4);
}

.ladder-track {
    width: 8px;
    flex: 1;
    margin: 10px 0;
    border-radius: 10px;
    position: relative;
    background: linear-gradient(to bottom,
        #10B981 0%,
        #10B981 20%,
        #F59E0B 45%,
        #F59E0B 55%,
        #64748B 80%,
        #64748B 100%
    );
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.ladder-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* Static Floating Marker - Non-Interactive */
.ladder-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    pointer-events: none;
    cursor: default;
    transition: top 1.2s var(--ease-elastic);
    z-index: 10;
}

.marker-dot {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--c-secondary) 0%, #2d7d32 100%);
    border: 3px solid var(--c-surface);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(76, 175, 80, 0.1);
}

.marker-pulse {
    position: absolute;
    inset: 0;
    border: 2px solid var(--c-secondary);
    border-radius: 50%;
    opacity: 0;
    animation: marker-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes marker-ping {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Dashboard Actions */
.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
}

.status-box p {
    margin-bottom: 0.5rem;
}

.journey-preview {
    margin-top: 0.5rem;
}

.journey-steps {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.step-pill {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--c-text-muted);
    font-weight: 500;
}

.results-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-border);
}

/* ==========================================================================
   17. SESSION PLAYER
   ========================================================================== */
.player-card {
    display: flex;
    flex-direction: column;
    min-height: 520px;
    max-height: 85vh;
    padding: 1.5rem;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.step-indicator {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--c-text-muted);
}

/* Organic Timer Wrapper */
.timer-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 1.5rem auto 2rem;
}

.timer-ring-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Soft Breathing Glow */
.timer-glow {
    position: absolute;
    inset: -24px;
    background: radial-gradient(
        circle at center,
        rgba(76, 175, 80, 0.12) 0%,
        rgba(76, 175, 80, 0.04) 50%,
        transparent 70%
    );
    border-radius: 50%;
    animation: timer-breathe 6s var(--ease-breath) infinite;
    pointer-events: none;
}

@keyframes timer-breathe {
    0%, 100% {
        transform: scale(0.92);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

/* Timer SVG */
.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.05));
}

.timer-track {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 2;
    opacity: 0.25;
}

.timer-progress {
    fill: none;
    stroke: url(#timer-gradient);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timer Center Content */
.timer-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timer-time {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--c-text-main);
    line-height: 1;
    transition: opacity 0.3s ease;
}

.timer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-text-muted);
    margin-top: 0.35rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* Subtle Corner Accents */
.timer-accents {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.timer-accent {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-secondary);
    opacity: 0.2;
}

.timer-accent:nth-child(1) {
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.timer-accent:nth-child(2) {
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
}

.timer-accent:nth-child(3) {
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.timer-accent:nth-child(4) {
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
}

.timer-wrapper:not(.is-paused) .timer-accent {
    animation: accent-pulse 3s ease-in-out infinite;
}

.timer-accent:nth-child(2) {
    animation-delay: 0.75s;
}

.timer-accent:nth-child(3) {
    animation-delay: 1.5s;
}

.timer-accent:nth-child(4) {
    animation-delay: 2.25s;
}

@keyframes accent-pulse {
    0%, 100% {
        opacity: 0.2;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1.3);
    }
}

.timer-accent:nth-child(2),
.timer-accent:nth-child(4) {
    animation-name: accent-pulse-y;
}

@keyframes accent-pulse-y {
    0%, 100% {
        opacity: 0.2;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.3);
    }
}

/* Paused State */
.timer-wrapper.is-paused .timer-glow {
    animation-play-state: paused;
    opacity: 0.3;
}

.timer-wrapper.is-paused .timer-time {
    opacity: 0.5;
}

.timer-wrapper.is-paused .timer-label {
    opacity: 1;
    color: var(--c-secondary);
}

.timer-wrapper.is-paused .timer-accent {
    animation: none;
    opacity: 0.1;
}

/* Player Instruction Area */
.player-instruction {
    flex: 1;
    text-align: center;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.instruction-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--c-text-muted);
    margin-top: 0.75rem;
    text-align: left;
    transition: opacity 0.3s ease;
}

.instruction-text li {
    margin-bottom: 0.5rem;
}

/* Player Control Deck */
.player-controls-deck {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 100px;
    padding: 0.6rem 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid var(--c-border);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-main);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease-snappy);
    will-change: auto;
}

.btn-control:hover:not(:disabled),
.btn-control:focus-visible:not(:disabled) {
    background: var(--c-text-main);
    color: var(--c-bg);
    transform: scale(1.08);
    border-color: transparent;
}

.btn-control:active:not(:disabled) {
    transform: scale(0.96);
}

.btn-control:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none;
}

.control-divider {
    width: 1px;
    height: 24px;
    background: var(--c-border);
    opacity: 0.4;
}

.btn-play-main {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--c-secondary) 0%, #3d9140 100%);
    color: white;
    border: none;
    box-shadow:
        0 4px 16px rgba(76, 175, 80, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-play-main:hover:not(:disabled),
.btn-play-main:focus-visible:not(:disabled) {
    background: linear-gradient(135deg, #5bb95e 0%, var(--c-secondary) 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Complete Button State (Last Step) */
.btn-control.btn-complete {
    background: linear-gradient(135deg, var(--c-secondary) 0%, #3d9140 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.3);
}

.btn-control.btn-complete:hover:not(:disabled),
.btn-control.btn-complete:focus-visible:not(:disabled) {
    background: linear-gradient(135deg, #5bb95e 0%, var(--c-secondary) 100%);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
}

/* ==========================================================================
   18. SUCCESS VIEW
   ========================================================================== */
.success-card .glow-layer {
    animation: none;
    opacity: 0;
}

.success-breathing {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(76, 175, 80, 0.15) 0%,
        rgba(76, 175, 80, 0.05) 70%,
        transparent 100%
    );
    margin: 0 auto 1.25rem;
    animation: gentle-breath 6s var(--ease-breath) infinite;
}

@keyframes gentle-breath {
    0%, 100% {
        transform: scale(0.85);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.success-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bloom-circle {
    position: absolute;
    inset: 0;
    background: var(--c-secondary);
    border-radius: 50%;
    opacity: 0.2;
    animation: bloom 2s var(--ease-elastic) infinite;
}

.check-icon {
    position: relative;
    z-index: 2;
    color: var(--c-secondary);
    opacity: 0;
    transform: scale(0.5);
    animation: popIn 0.6s var(--ease-elastic) 0.3s forwards;
}

@keyframes bloom {
    0% {
        transform: scale(0.8);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.2;
    }
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-message {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    color: var(--c-text-muted);
    line-height: 1.7;
}

.soft-exit-prompt {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin-bottom: 1rem;
    opacity: 0.7;
    font-style: italic;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

.mood-check {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-emoji {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s var(--ease-elastic), opacity 0.2s;
    opacity: 0.7;
    padding: 0.5rem;
}

.btn-emoji:hover,
.btn-emoji:focus-visible {
    transform: scale(1.2);
    opacity: 1;
}

/* ==========================================================================
   19. CRISIS VIEW
   ========================================================================== */
.crisis-card h2 {
    color: #e63946;
}

.crisis-resources a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.crisis-resources a:hover,
.crisis-resources a:focus-visible {
    color: #e63946;
}

/* ==========================================================================
   20. FOOTER
   ========================================================================== */
.footer {
    text-align: center;
    padding-block: 3rem;
}

.footer__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer__brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-text-main);
}

.footer p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* ==========================================================================
   21. DARK THEME ADJUSTMENTS
   ========================================================================== */
html.theme-dark .ladder-container,
body.theme-dark .ladder-container {
    background: rgba(0, 0, 0, 0.2);
}

html.theme-dark .quiz-option,
body.theme-dark .quiz-option {
    background: rgba(0, 0, 0, 0.2);
}

html.theme-dark .quiz-option:hover,
html.theme-dark .quiz-option:focus-visible,
body.theme-dark .quiz-option:hover,
body.theme-dark .quiz-option:focus-visible {
    background: var(--c-surface);
}

html.theme-dark .glass-inset,
body.theme-dark .glass-inset {
    background: rgba(255, 255, 255, 0.03);
}

html.theme-dark .timer-track,
body.theme-dark .timer-track {
    stroke: var(--c-border);
    opacity: 0.15;
}

html.theme-dark .player-controls-deck,
body.theme-dark .player-controls-deck {
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.theme-dark .modal-backdrop,
body.theme-dark .modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

html.theme-dark .quiz-back:hover,
html.theme-dark .quiz-back:focus-visible,
body.theme-dark .quiz-back:hover,
body.theme-dark .quiz-back:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

html.theme-dark .btn--ghost:hover,
html.theme-dark .btn--ghost:focus-visible,
body.theme-dark .btn--ghost:hover,
body.theme-dark .btn--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

html.theme-dark .btn-icon:hover,
html.theme-dark .btn-icon:focus-visible,
body.theme-dark .btn-icon:hover,
body.theme-dark .btn-icon:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

html.theme-dark .btn-close:hover,
html.theme-dark .btn-close:focus-visible,
body.theme-dark .btn-close:hover,
body.theme-dark .btn-close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   22. ACCESSIBILITY: REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .cursor-wrapper {
        display: none;
    }

    #app-mount {
        view-transition-name: none;
    }

    .magnetic {
        transform: none !important;
    }

    .magnetic.is-active,
    .magnetic.is-returning {
        transition: none !important;
    }

    .tool-card:hover {
        transform: none;
    }

    .glow-layer {
        animation: none;
        opacity: 0;
    }

    .timer-glow {
        animation: none;
        opacity: 0.5;
    }

    .timer-accent {
        animation: none;
    }

    .marker-pulse {
        animation: none;
        opacity: 0;
    }

    .breath-circle.is-active {
        animation: none;
        transform: scale(1);
    }

    .success-breathing {
        animation: none;
        opacity: 0.8;
    }

    .bloom-circle {
        animation: none;
    }

    .check-icon {
        animation: none;
        opacity: 1;
        transform: scale(1);
    }

    .blob {
        animation: none;
    }

    .fade-in {
        animation: none;
        opacity: 1;
    }
}

/* ==========================================================================
   23. PRINT STYLES
   ========================================================================== */
@media print {
    .nav,
    .cursor-wrapper,
    .fx-layer,
    .modal-overlay,
    .btn,
    .filter-btn,
    .player-controls-deck {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .app-card,
    .tool-card,
    .glass-panel {
        background: white;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .section {
        padding-block: 2rem;
    }
}

/* ==========================================================================
   24. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 480px) {
    .app-card {
        padding: 1.5rem;
    }

    .dashboard-card {
        padding: 1.5rem;
    }

    .player-card {
        padding: 1rem;
    }

    .hero__title {
        font-size: 2.5rem;
    }

    .toolkit-filters {
        gap: 0.35rem;
    }

    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .quiz-option {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .quiz-option span:first-child {
        font-size: 1.25rem;
    }

    .timer-wrapper {
        width: 140px;
        height: 140px;
    }

    .timer-time {
        font-size: 1.5rem;
    }

    .player-controls-deck {
        padding: 0.5rem 1rem;
    }

    .btn-control {
        width: 40px;
        height: 40px;
    }

    .btn-play-main {
        width: 48px;
        height: 48px;
    }
}

@media (min-width: 768px) {
    .container {
        padding-inline: 2rem;
    }

    .app-card {
        padding: 4rem;
    }

    .hero {
        min-height: 100vh;
    }
}

@media (min-width: 1024px) {
    .grid--tools {
        grid-template-columns: repeat(3, 1fr);
    }
}