/* ═══════════════════════════════════════════════════════════════════
   QuotesCosmos — Sacred Text Base Stylesheet
   Universal CSS for all sacred text traditions.
   
   Design System:
   - Material Design 3 typography scale
   - Mobile-first responsive (320px → 1440px+)
   - CSS Custom Properties for theming
   - Dark mode default, light mode + auto support
   - RTL override support
   - Glassmorphism used sparingly
   
   Sections:
   01. Reset & Defaults
   02. CSS Custom Properties (Dark Mode Default)
   03. Light Mode Overrides
   04. Typography Scale (M3 Roles)
   05. Layout System (Grid + Flexbox)
   06. Skip Link & Accessibility
   07. Header & Logo
   08. Desktop Navigation
   09. Hamburger Menu (Mobile)
   10. Mobile Navigation Overlay
   11. Hero Section
   12. Breadcrumb Navigation
   13. Main Content & Article
   14. Sidebar
   15. Cards & Glassmorphism
   16. Quote Function Icons
   17. Share Overlay
   18. Buttons & Interactive
   19. Footer
   20. Back to Top
   21. Toast Notifications
   22. Animation Keyframes
   23. Scroll-triggered Animations
   24. RTL Overrides
   25. Print Styles
   26. Responsive Breakpoints
   ═══════════════════════════════════════════════════════════════════ */


/* ─── 01. Reset & Defaults ──────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    hanging-punctuation: first last;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Reduced motion preference */
@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;
    }
}


/* ─── 02. CSS Custom Properties (Dark Mode Default) ─────────────── */
/* Bible (KJV) theme as fallback — overridden by [THEME_CSS] per page */

:root {
    /* Brand & Accent */
    --brand: #7c3aed;
    --brand-rgb: 124, 58, 237;
    --accent: #9333ea;

    /* Surfaces */
    --surface: #1a1a2e;
    --surface-2: #16213e;
    --surface-3: #1e2a4a;
    --bg: #0b0e17;
    --bg-rgb: 11, 14, 23;

    /* Text */
    --text: #e2e8f0;
    --text-secondary: #cbd5e1;
    --muted: #94a3b8;

    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Gradients */
    --brand-gradient: linear-gradient(135deg, #7c3aed, #9333ea);
    --hero-gradient: linear-gradient(180deg, rgba(var(--brand-rgb), 0.05) 0%, var(--bg) 100%);
    --card-gradient: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);

    /* Typography */
    --font-heading: 'Inter', 'Segoe UI', 'Roboto', system-ui, sans-serif;
    --font-body: 'Georgia', 'Cambria', 'Times New Roman', Times, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* M3 Type Scale Sizes */
    --fs-display-lg: clamp(3rem, 5vw + 1rem, 4.5rem);
    --fs-display-md: clamp(2.5rem, 4vw + 0.75rem, 3.5rem);
    --fs-display-sm: clamp(2rem, 3vw + 0.5rem, 2.75rem);
    --fs-headline-lg: clamp(1.75rem, 2.5vw + 0.5rem, 2rem);
    --fs-headline-md: clamp(1.5rem, 2vw + 0.25rem, 1.75rem);
    --fs-headline-sm: 1.375rem;
    --fs-title-lg: 1.25rem;
    --fs-title-md: 1.125rem;
    --fs-title-sm: 1rem;
    --fs-body-lg: 1.125rem;
    --fs-body-md: 1rem;
    --fs-body-sm: 0.875rem;
    --fs-label-lg: 0.875rem;
    --fs-label-md: 0.8125rem;
    --fs-label-sm: 0.6875rem;

    /* Spacing (4px baseline) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Radii */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-brand: 0 8px 32px rgba(var(--brand-rgb), 0.25);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 8px;
    --glass-bg-strong: rgba(255, 255, 255, 0.08);

    /* Transitions */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;

    /* Layout */
    --header-height: 4rem;
    --sidebar-width: 280px;
    --content-max: 1200px;
    --content-narrow: 800px;
}


/* ─── 03. Light Mode Overrides ──────────────────────────────────── */

html.light-mode,
[data-theme="light"] {
    --brand: #6d28d9;
    --brand-rgb: 109, 40, 217;
    --accent: #7c3aed;

    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --bg: #f8fafc;
    --bg-rgb: 248, 250, 252;

    --text: #1e293b;
    --text-secondary: #334155;
    --muted: #64748b;

    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);

    --hero-gradient: linear-gradient(180deg, rgba(var(--brand-rgb), 0.04) 0%, var(--bg) 100%);
    --card-gradient: linear-gradient(135deg, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0.03) 100%);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-brand: 0 8px 32px rgba(var(--brand-rgb), 0.15);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-bg-strong: rgba(255, 255, 255, 0.85);
}


/* ─── 04. Typography Scale (M3 Roles) ──────────────────────────── */

body {
    font-family: var(--font-body);
    font-size: var(--fs-body-md);
    color: var(--text);
    background-color: var(--bg);
}

/* Display */
.type-display-lg {
    font-family: var(--font-heading);
    font-size: var(--fs-display-lg);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.025em;
}
.type-display-md {
    font-family: var(--font-heading);
    font-size: var(--fs-display-md);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.type-display-sm {
    font-family: var(--font-heading);
    font-size: var(--fs-display-sm);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

/* Headline */
.type-headline-lg {
    font-family: var(--font-heading);
    font-size: var(--fs-headline-lg);
    font-weight: 700;
    line-height: 1.3;
}
.type-headline-md {
    font-family: var(--font-heading);
    font-size: var(--fs-headline-md);
    font-weight: 600;
    line-height: 1.35;
}
.type-headline-sm {
    font-family: var(--font-heading);
    font-size: var(--fs-headline-sm);
    font-weight: 600;
    line-height: 1.4;
}

/* Title */
.type-title-lg {
    font-family: var(--font-heading);
    font-size: var(--fs-title-lg);
    font-weight: 600;
    line-height: 1.4;
}
.type-title-md {
    font-family: var(--font-heading);
    font-size: var(--fs-title-md);
    font-weight: 600;
    line-height: 1.45;
}
.type-title-sm {
    font-family: var(--font-heading);
    font-size: var(--fs-title-sm);
    font-weight: 500;
    line-height: 1.5;
}

/* Body */
.type-body-lg {
    font-family: var(--font-body);
    font-size: var(--fs-body-lg);
    font-weight: 400;
    line-height: 1.7;
}
.type-body-md {
    font-family: var(--font-body);
    font-size: var(--fs-body-md);
    font-weight: 400;
    line-height: 1.6;
}
.type-body-sm {
    font-family: var(--font-body);
    font-size: var(--fs-body-sm);
    font-weight: 400;
    line-height: 1.55;
}

/* Label */
.type-label-lg {
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.02em;
}
.type-label-md {
    font-family: var(--font-heading);
    font-size: var(--fs-label-md);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.03em;
}
.type-label-sm {
    font-family: var(--font-heading);
    font-size: var(--fs-label-sm);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Emphasized variants (M3) */
.type-emphasis {
    font-style: italic;
}
.type-emphasis-strong {
    font-weight: 700;
    font-style: italic;
}

/* Heading defaults */
h1 { font-family: var(--font-heading); font-weight: 900; line-height: 1.1; }
h2 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }
h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; }
h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.35; }
h5, h6 { font-family: var(--font-heading); font-weight: 500; line-height: 1.4; }

/* Gradient text utility (used by hero titles) */
.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* fallback */
}


/* ─── 05. Layout System (Grid + Flexbox) ────────────────────────── */

.st-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Two-column layout: main + sidebar */
.st-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
    width: 100%;
}

@media (min-width: 1024px) {
    .st-layout {
        grid-template-columns: 1fr var(--sidebar-width);
        padding: var(--space-10) var(--space-8);
    }
}

@media (min-width: 1280px) {
    .st-layout {
        gap: var(--space-12);
        padding: var(--space-12) var(--space-10);
    }
}

/* Container utility */
.st-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding-inline: var(--space-4);
}

@media (min-width: 768px) {
    .st-container {
        padding-inline: var(--space-8);
    }
}


/* ─── 06. Skip Link & Accessibility ────────────────────────────── */

.st-skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: calc(var(--z-toast) + 1);
    padding: var(--space-3) var(--space-6);
    background: var(--brand);
    color: #fff;
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
    font-weight: 600;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    text-decoration: none;
    transition: top var(--duration-fast) var(--ease-out);
}

.st-skip-link:focus {
    top: 0;
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Focus-visible for keyboard navigation only */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}


/* ─── 07. Header & Logo ────────────────────────────────────────── */

.st-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: var(--header-height);
    background: rgba(var(--bg-rgb), 0.85);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-normal) var(--ease-in-out);
}

.st-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .st-header__inner {
        padding: 0 var(--space-8);
    }
}

.st-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    flex-shrink: 0;
}

.st-logo__icon {
    font-size: 1.5rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform var(--duration-normal) var(--ease-out);
}

.st-logo:hover .st-logo__icon {
    transform: rotate(72deg) scale(1.1);
}

.st-logo__text {
    font-family: var(--font-heading);
    font-size: var(--fs-title-md);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.st-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}


/* ─── 08. Desktop Navigation ───────────────────────────────────── */

.st-desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .st-desktop-nav {
        display: flex;
        align-items: center;
    }
}

.st-desktop-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.st-desktop-nav__list a {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
    font-weight: 500;
    color: var(--muted);
    border-radius: var(--radius-md);
    transition: color var(--duration-fast) var(--ease-in-out),
                background var(--duration-fast) var(--ease-in-out);
    white-space: nowrap;
}

.st-desktop-nav__list a:hover,
.st-desktop-nav__list a:focus-visible {
    color: var(--text);
    background: var(--glass-bg);
}

.st-desktop-nav__list a[aria-current="page"] {
    color: var(--brand);
    font-weight: 600;
}


/* ─── 09. Hamburger Menu (Mobile — RIGHT side) ──────────────────── */

.st-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    gap: 5px;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-in-out);
}

@media (min-width: 768px) {
    .st-hamburger {
        display: none;
    }
}

.st-hamburger:hover,
.st-hamburger:focus-visible {
    background: var(--glass-bg);
}

.st-hamburger__line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: var(--radius-full);
    transition: transform var(--duration-normal) var(--ease-out),
                opacity var(--duration-fast) var(--ease-in-out);
}

/* Animated X state */
.st-hamburger[aria-expanded="true"] .st-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.st-hamburger[aria-expanded="true"] .st-hamburger__line:nth-child(2) {
    opacity: 0;
}
.st-hamburger[aria-expanded="true"] .st-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ─── 10. Mobile Navigation Overlay ────────────────────────────── */

.st-mobile-nav {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    pointer-events: none;
    visibility: hidden;
}

.st-mobile-nav.is-open {
    pointer-events: auto;
    visibility: visible;
}

.st-mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-in-out);
}

.st-mobile-nav.is-open .st-mobile-nav__backdrop {
    opacity: 1;
}

.st-mobile-nav__panel {
    position: absolute;
    top: 0;
    right: 0; /* Slides in from the RIGHT per project rules */
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform var(--duration-slow) var(--ease-out);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.st-mobile-nav.is-open .st-mobile-nav__panel {
    transform: translateX(0);
}

.st-mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.st-mobile-nav__title {
    font-family: var(--font-heading);
    font-size: var(--fs-title-sm);
    font-weight: 600;
    color: var(--muted);
}

.st-mobile-nav__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    color: var(--muted);
    transition: color var(--duration-fast), background var(--duration-fast);
}

.st-mobile-nav__close:hover {
    color: var(--text);
    background: var(--glass-bg);
}

.st-mobile-nav__list {
    padding: var(--space-4) var(--space-2);
}

.st-mobile-nav__list a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-heading);
    font-size: var(--fs-body-md);
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast), color var(--duration-fast);
}

.st-mobile-nav__list a:hover,
.st-mobile-nav__list a:focus-visible {
    background: var(--glass-bg-strong);
    color: var(--brand);
}

.st-mobile-nav__divider {
    height: 1px;
    margin: var(--space-3) var(--space-4);
    background: var(--border);
}

.st-mobile-nav__section-label {
    padding: var(--space-3) var(--space-4) var(--space-1);
    font-family: var(--font-heading);
    font-size: var(--fs-label-sm);
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


/* ─── 11. Hero Section ─────────────────────────────────────────── */

.st-hero {
    position: relative;
    overflow: hidden;
    background: var(--hero-gradient);
}

.st-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 80% at 50% 0%, rgba(var(--brand-rgb), 0.08), transparent),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(var(--brand-rgb), 0.04), transparent);
    pointer-events: none;
}


/* ─── 12. Breadcrumb Navigation ────────────────────────────────── */

/* Base breadcrumb styling — the HTML is generated by SacredTextGenerator::buildBreadcrumb() */
.st-hero nav[aria-label="Breadcrumb"],
nav[aria-label="Breadcrumb"] {
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
}

nav[aria-label="Breadcrumb"] ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: 0;
    margin: 0;
    list-style: none;
}

nav[aria-label="Breadcrumb"] li {
    display: flex;
    align-items: center;
}

nav[aria-label="Breadcrumb"] a {
    color: var(--muted);
    font-weight: 500;
    transition: color var(--duration-fast) var(--ease-in-out);
    padding: var(--space-1) 0;
}

nav[aria-label="Breadcrumb"] a:hover,
nav[aria-label="Breadcrumb"] a:focus-visible {
    color: var(--brand);
}

nav[aria-label="Breadcrumb"] svg {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
    opacity: 0.5;
    margin: 0 var(--space-1);
    flex-shrink: 0;
}

nav[aria-label="Breadcrumb"] span[itemprop="name"] {
    white-space: nowrap;
}


/* ─── 13. Main Content & Article ───────────────────────────────── */

.st-main-content {
    min-width: 0; /* prevent grid blowout */
    outline: none;
}

.st-article {
    font-family: var(--font-body);
    font-size: var(--fs-body-lg);
    line-height: 1.8;
    color: var(--text);
}

.st-article h2 {
    font-size: var(--fs-headline-lg);
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    color: var(--text);
}

.st-article h3 {
    font-size: var(--fs-headline-sm);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    color: var(--text);
}

.st-article p {
    margin-bottom: var(--space-4);
    max-width: 72ch; /* Optimal readability */
}

.st-article blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-6);
    border-left: 3px solid var(--brand);
    background: var(--glass-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Verse text styling */
.verse-text {
    font-family: var(--font-body);
    font-size: var(--fs-body-lg);
    line-height: 1.9;
    color: var(--text);
}

.verse-number {
    font-family: var(--font-heading);
    font-size: var(--fs-label-sm);
    font-weight: 700;
    color: var(--brand);
    vertical-align: super;
    margin-right: var(--space-1);
    opacity: 0.8;
}


/* ─── 14. Sidebar ──────────────────────────────────────────────── */

.st-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .st-sidebar {
        display: block;
    }
}

/* Sticky sidebar behavior */
.st-sidebar .sticky {
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
}

/* Sidebar card */
.st-sidebar .bg-surface\/50,
.st-sidebar-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}


/* ─── 15. Cards & Glassmorphism ────────────────────────────────── */

.st-card {
    position: relative;
    background: var(--card-gradient);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-in-out);
}

.st-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

/* Glassmorphism card (sparingly used per project rules) */
.st-card--glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.st-card--glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.06) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.02) 100%
    );
    pointer-events: none;
}

/* Book / Surah / Chapter grid card (Netflix style from generator) */
.st-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .st-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--space-5);
    }
}

@media (min-width: 1024px) {
    .st-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--space-6);
    }
}

.st-grid-card {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
}

.st-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-brand);
    border-color: rgba(var(--brand-rgb), 0.3);
}

/* Premium Homepage Dashboard Grid */
.st-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-6);
}

.st-dashboard-item {
    grid-column: span 12;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.st-dashboard-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(var(--brand-rgb), 0.3);
}

.st-dashboard-item--large {
    grid-column: span 12;
}

@media (min-width: 768px) {
    .st-dashboard-item { grid-column: span 6; }
    .st-dashboard-item--large { grid-column: span 12; }
}
@media (min-width: 1024px) {
    .st-dashboard-item { grid-column: span 4; }
    .st-dashboard-item--large { grid-column: span 8; }
}

/* Micro-animations */
.hover-reveal-parent .hover-reveal-child {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
}
.hover-reveal-parent:hover .hover-reveal-child,
.hover-reveal-parent:focus-within .hover-reveal-child {
    opacity: 1;
    transform: translateY(0);
}

.hover-transform-up {
    transition: transform var(--duration-normal) var(--ease-out);
}
.hover-transform-up:hover,
.hover-transform-up:focus-visible {
    transform: translateY(-4px);
}


/* ─── 16. Quote Function Icons ─────────────────────────────────── */

.qf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-in-out),
                background var(--duration-fast) var(--ease-in-out),
                transform var(--duration-fast) var(--ease-out);
}

.qf-btn:hover {
    color: var(--brand);
    background: rgba(var(--brand-rgb), 0.12);
    transform: scale(1.1);
}

.qf-btn:active {
    transform: scale(0.95);
}

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

.qf-btn svg {
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

/* Quote function row (wrapping container) */
.qf-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    opacity: 0.7;
    transition: opacity var(--duration-fast);
}

.qf-row:hover {
    opacity: 1;
}


/* ─── 17. Share Overlay ────────────────────────────────────────── */

.st-share-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
}

@media (min-width: 640px) {
    .st-share-overlay {
        align-items: center;
    }
}

.st-share-overlay.is-open {
    pointer-events: auto;
    visibility: visible;
}

.st-share-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-in-out);
}

.st-share-overlay.is-open .st-share-overlay__backdrop {
    opacity: 1;
}

.st-share-overlay__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: var(--space-6);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-out);
}

@media (min-width: 640px) {
    .st-share-overlay__panel {
        border-radius: var(--radius-2xl);
        transform: translateY(20px) scale(0.95);
        opacity: 0;
        transition: transform var(--duration-normal) var(--ease-out),
                    opacity var(--duration-normal) var(--ease-in-out);
    }
}

.st-share-overlay.is-open .st-share-overlay__panel {
    transform: translateY(0);
    opacity: 1;
}

@media (min-width: 640px) {
    .st-share-overlay.is-open .st-share-overlay__panel {
        transform: translateY(0) scale(1);
    }
}

.st-share-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.st-share-overlay__header h3 {
    font-family: var(--font-heading);
    font-size: var(--fs-title-lg);
    font-weight: 700;
}

.st-share-overlay__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    color: var(--muted);
    transition: color var(--duration-fast), background var(--duration-fast);
}

.st-share-overlay__close:hover {
    color: var(--text);
    background: var(--glass-bg-strong);
}

.st-share-overlay__buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-3);
}

.st-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3);
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-size: var(--fs-label-md);
    font-weight: 500;
    color: var(--text);
    transition: background var(--duration-fast), transform var(--duration-fast);
}

.st-share-btn:hover {
    background: var(--glass-bg-strong);
    transform: translateY(-2px);
}

/* Platform-specific accent colors */
.st-share-btn--facebook:hover { color: #1877f2; }
.st-share-btn--x:hover { color: var(--text); }
.st-share-btn--reddit:hover { color: #ff4500; }
.st-share-btn--pinterest:hover { color: #bd081c; }
.st-share-btn--linkedin:hover { color: #0a66c2; }
.st-share-btn--instagram:hover { color: #e4405f; }
.st-share-btn--email:hover { color: var(--brand); }


/* ─── 18. Buttons & Interactive ────────────────────────────────── */

.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.st-btn--primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--shadow-brand);
}

.st-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(var(--brand-rgb), 0.35);
}

.st-btn--secondary {
    background: var(--glass-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.st-btn--secondary:hover {
    background: var(--glass-bg-strong);
    border-color: var(--border-strong);
}

.st-btn--ghost {
    background: transparent;
    color: var(--muted);
}

.st-btn--ghost:hover {
    color: var(--text);
    background: var(--glass-bg);
}

/* Load More button (pagination per project rules) */
.st-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-4) var(--space-8);
    margin-top: var(--space-8);
    font-family: var(--font-heading);
    font-size: var(--fs-body-md);
    font-weight: 600;
    color: var(--brand);
    background: transparent;
    border: 2px solid rgba(var(--brand-rgb), 0.2);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.st-load-more:hover {
    background: rgba(var(--brand-rgb), 0.08);
    border-color: rgba(var(--brand-rgb), 0.4);
    transform: translateY(-1px);
}


/* ─── 19. Footer ───────────────────────────────────────────────── */

.st-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.st-footer__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-12) var(--space-4) var(--space-8);
}

@media (min-width: 768px) {
    .st-footer__inner {
        padding: var(--space-16) var(--space-8) var(--space-10);
    }
}

.st-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 640px) {
    .st-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .st-footer__grid {
        grid-template-columns: 1.5fr repeat(3, 1fr);
        gap: var(--space-10);
    }
}

.st-footer__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    margin-bottom: var(--space-3);
}

.st-footer__logo-icon {
    font-size: 1.25rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.st-footer__logo-text {
    font-family: var(--font-heading);
    font-size: var(--fs-title-md);
    font-weight: 800;
    color: var(--text);
}

.st-footer__tagline {
    font-size: var(--fs-body-sm);
    color: var(--muted);
    max-width: 28ch;
    line-height: 1.5;
}

.st-footer__heading {
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.st-footer__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.st-footer__list a {
    font-size: var(--fs-body-sm);
    color: var(--muted);
    transition: color var(--duration-fast) var(--ease-in-out);
    padding: var(--space-1) 0;
}

.st-footer__list a:hover {
    color: var(--brand);
}

.st-footer__bottom {
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    text-align: center;
}

.st-footer__copyright {
    font-family: var(--font-heading);
    font-size: var(--fs-label-md);
    color: var(--muted);
}

.st-footer__separator {
    margin: 0 var(--space-2);
    opacity: 0.5;
}


/* ─── 20. Back to Top ──────────────────────────────────────────── */

.st-back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-dropdown);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-in-out),
                transform var(--duration-normal) var(--ease-out),
                background var(--duration-fast);
}

.st-back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.st-back-to-top:hover {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-brand);
}


/* ─── 21. Toast Notifications ──────────────────────────────────── */

.st-toast {
    position: fixed;
    bottom: var(--space-8);
    left: 50%;
    z-index: var(--z-toast);
    transform: translateX(-50%) translateY(20px);
    padding: var(--space-3) var(--space-6);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: var(--fs-label-lg);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-in-out),
                transform var(--duration-normal) var(--ease-out);
    white-space: nowrap;
}

.st-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}


/* ─── 22. Animation Keyframes ──────────────────────────────────── */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* Utility classes for direct animation usage */
.animate-fade-in-up {
    animation: fadeInUp 0.6s var(--ease-out) both;
}

.animate-fade-in {
    animation: fadeIn 0.5s var(--ease-in-out) both;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s var(--ease-out) both;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s var(--ease-out) both;
}

.animate-scale-in {
    animation: scaleIn 0.4s var(--ease-out) both;
}

/* Staggered animation delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }


/* ─── 23. Scroll-triggered Animations (IntersectionObserver) ───── */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-out),
                transform 0.6s var(--ease-out);
}

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

/* Slide-in variants */
.animate-on-scroll--left {
    transform: translateX(-24px);
}
.animate-on-scroll--left.is-visible {
    transform: translateX(0);
}

.animate-on-scroll--right {
    transform: translateX(24px);
}
.animate-on-scroll--right.is-visible {
    transform: translateX(0);
}

.animate-on-scroll--scale {
    transform: scale(0.92);
}
.animate-on-scroll--scale.is-visible {
    transform: scale(1);
}


/* ─── 24. RTL Overrides ────────────────────────────────────────── */

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Breadcrumb chevron flip */
[dir="rtl"] nav[aria-label="Breadcrumb"] svg {
    transform: rotate(180deg);
}

/* Blockquote border flip */
[dir="rtl"] .st-article blockquote {
    border-left: none;
    border-right: 3px solid var(--brand);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Mobile nav slides from LEFT in RTL */
[dir="rtl"] .st-mobile-nav__panel {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
}

[dir="rtl"] .st-mobile-nav.is-open .st-mobile-nav__panel {
    transform: translateX(0);
}

/* Back to top on the LEFT in RTL */
[dir="rtl"] .st-back-to-top {
    right: auto;
    left: var(--space-6);
}

/* Verse number on the right side */
[dir="rtl"] .verse-number {
    margin-right: 0;
    margin-left: var(--space-1);
}

/* Hero share button layout */
[dir="rtl"] .st-hero .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

/* Grid card arrow direction */
[dir="rtl"] .st-grid-card svg {
    transform: rotate(180deg);
}

/* Slide-in animations reversed */
[dir="rtl"] .animate-slide-in-right {
    animation-name: slideInLeft;
}

[dir="rtl"] .animate-slide-in-left {
    animation-name: slideInRight;
}

/* Layout sidebar order in RTL */
@media (min-width: 1024px) {
    [dir="rtl"] .st-layout {
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    [dir="rtl"] .st-main-content {
        order: 2;
    }

    [dir="rtl"] .st-sidebar {
        order: 1;
    }
}


/* ─── 25. Print Styles ─────────────────────────────────────────── */
/* Primary print styles are inline in the template <head>.
   These are supplementary overrides. */

@media print {
    .st-header,
    .st-mobile-nav,
    .st-share-overlay,
    .st-back-to-top,
    .st-toast,
    .st-hamburger,
    .st-theme-toggle {
        display: none !important;
    }

    .st-layout {
        display: block;
        max-width: 100%;
        padding: 0;
    }

    .st-sidebar {
        display: none !important;
    }

    .st-footer {
        border-top: 1px solid #ccc;
        background: none;
    }

    .st-footer__grid {
        display: none;
    }

    .st-footer__bottom {
        display: block;
    }

    .st-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .animate-on-scroll,
    .animate-fade-in-up,
    .animate-fade-in {
        opacity: 1 !important;
        transform: none !important;
    }
}


/* ─── 26. Responsive Breakpoints ───────────────────────────────── */
/* Mobile-first: base styles → sm (640px) → md (768px) → lg (1024px) → xl (1280px) → 2xl (1440px) */

/* ---- Small (≥640px) ---- */
@media (min-width: 640px) {
    .st-hero h1 {
        font-size: var(--fs-display-md);
    }
}

/* ---- Medium (≥768px) ---- */
@media (min-width: 768px) {
    .st-hero h1 {
        font-size: var(--fs-display-lg);
    }

    .st-article {
        font-size: var(--fs-body-lg);
    }
}

/* ---- Large (≥1024px) ---- */
@media (min-width: 1024px) {
    /* Header adjustments */
    .st-header__inner {
        gap: var(--space-6);
    }
}

/* ---- Extra Large (≥1280px) ---- */
@media (min-width: 1280px) {
    :root {
        --sidebar-width: 320px;
    }
}

/* ---- 2XL (≥1440px) ---- */
@media (min-width: 1440px) {
    :root {
        --content-max: 1320px;
    }
}


/* ─── Utility Classes ──────────────────────────────────────────── */

/* Flex utilities matching SacredTextGenerator output */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Spacing utilities */
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mx-2 { margin-inline: var(--space-2); }
.mx-auto { margin-inline: auto; }
.ml-auto { margin-inline-start: auto; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.px-4 { padding-inline: var(--space-4); }
.py-12 { padding-block: var(--space-12); }

/* Size utilities */
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-sm { font-size: var(--fs-body-sm); }
.text-xs { font-size: var(--fs-label-sm); }
.text-lg { font-size: var(--fs-body-lg); }
.text-muted { color: var(--muted); }
.text-text { color: var(--text); }
.text-brand { color: var(--brand); }
.font-sans { font-family: var(--font-heading); }
.font-serif { font-family: var(--font-body); }
.font-heading { font-family: var(--font-heading); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-medium { font-weight: 500; }
.italic { font-style: italic; }
.tracking-tight { letter-spacing: -0.025em; }
.leading-tight { line-height: 1.25; }

/* Display & position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-3 { top: var(--space-3); }
.right-3 { right: var(--space-3); }
.top-24 { top: 6rem; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.-z-10 { z-index: -10; }
.overflow-hidden { overflow: hidden; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Visual utilities */
.rounded { border-radius: var(--radius-md); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.border { border: 1px solid var(--border); }
.opacity-0 { opacity: 0; }
.opacity-40 { opacity: 0.4; }
.opacity-70 { opacity: 0.7; }
.opacity-90 { opacity: 0.9; }

/* Background utilities */
.bg-surface\/50 { background: rgba(var(--bg-rgb), 0.5); }
.bg-bg { background-color: var(--bg); }

/* Transition utilities */
.transition { transition: all var(--duration-normal) var(--ease-in-out); }
.transition-all { transition: all var(--duration-normal) var(--ease-in-out); }
.transition-colors { transition: color var(--duration-fast) var(--ease-in-out), background-color var(--duration-fast) var(--ease-in-out); }
.transition-opacity { transition: opacity var(--duration-fast) var(--ease-in-out); }

/* Transform utilities */
.transform { will-change: transform; }

/* Hover utilities */
.hover\:text-brand:hover { color: var(--brand); }
.hover\:bg-bg:hover { background-color: var(--bg); }
.hover\:bg-surface-2:hover { background-color: var(--surface-2); }
.hover\:opacity-100:hover { opacity: 1; }

/* Gradient text (used by hero) */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}
.text-transparent {
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--brand), var(--accent));
}
.bg-gradient-to-t {
    background-image: linear-gradient(to top, var(--bg), transparent);
}
.bg-gradient-to-b {
    background-image: linear-gradient(to bottom, rgba(var(--brand-rgb), 0.05), var(--bg));
}

/* Image utilities */
.object-cover { object-fit: cover; }
.filter { filter: var(--image-filter, none); }
.grayscale { filter: grayscale(1); }
.mix-blend-overlay { mix-blend-mode: overlay; }

/* Drop shadow */
.drop-shadow-sm { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
.drop-shadow-md { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }

/* Hover transforms */
.hover\:-translate-y-1:hover { transform: translateY(-4px); }

/* Spacing within sidebar */
.space-y-2 > * + * { margin-top: var(--space-2); }
.space-y-8 > * + * { margin-top: var(--space-8); }

/* Responsive display */
@media (min-width: 768px) {
    .md\:text-xl { font-size: var(--fs-title-lg); }
    .md\:text-7xl { font-size: var(--fs-display-lg); }
    .md\:py-20 { padding-block: var(--space-20); }
}

/* Group hover utilities (for card hover effects) */
.group:hover .group-hover\:text-brand-300 { color: color-mix(in srgb, var(--brand) 70%, white); }
.group:hover .group-hover\:scale-105 { transform: scale(1.05); }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:grayscale-0 { filter: grayscale(0); }
.group:hover .group-hover\:brightness-110 { filter: brightness(1.1); }
.group:hover .group-hover\:sepia-0 { filter: sepia(0); }
.group:hover .group-hover\:from-black\/80 { /* handled by nested gradient */ }

/* Lazy loading shimmer placeholder */
.st-skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Aspect ratio */
.aspect-\[2\/3\] { aspect-ratio: 2/3; }

/* Sepia filter */
.sepia-\[\.2\] { filter: sepia(0.2); }
.brightness-90 { filter: brightness(0.9); }

/* Backdrop blur */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Theme toggle icon management */
.st-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    color: var(--muted);
    transition: color var(--duration-fast), background var(--duration-fast);
}

.st-theme-toggle:hover {
    color: var(--text);
    background: var(--glass-bg);
}

.st-theme-toggle__icon {
    display: none;
}

/* Default: show dark mode icon */
.st-theme-toggle__icon--dark {
    display: block;
}
