/* ═══════════════════════════════════════════════════════════════
   KATINA MEMORIAL - Epic RPG Codex Style
   A tribute to the eternal guardian of the deep
   ═══════════════════════════════════════════════════════════════ */

/* CSS Variables - Fantasy Ocean Palette */
:root {
    /* Primary Colors - Deep Ocean */
    --ocean-abyss: #050a12;
    --ocean-deep: #0a1628;
    --ocean-midnight: #0d1f33;
    --ocean-twilight: #1a3a5c;
    --ocean-current: #2d5a7b;
    
    /* Accent Colors - Ethereal Glow */
    --moonlight-silver: #c4dff6;
    --starlight-blue: #7eb8da;
    --ethereal-glow: #4a9ece;
    --mystic-teal: #2dd4bf;
    
    /* Warm Accents */
    --gold-ancient: #c9a227;
    --gold-fade: #8b7355;
    --parchment: #e8dcc4;
    --parchment-dark: #d4c4a8;
    
    /* Typography */
    --font-display: 'Cinzel Decorative', serif;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--ocean-abyss);
    color: var(--moonlight-silver);
    line-height: 1.8;
    font-size: 18px;
    overflow-x: hidden;
    min-height: 100vh;
    padding-top: 60px; /* Space for social links bar */
}

@media (max-width: 768px) {
    body {
        padding-top: 100px; /* More space for stacked links */
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 0; /* Relative positioning on mobile */
    }
}

/* ═══════════════════════════════════════════════════════════════
   SOCIAL LINKS BAR
   ═══════════════════════════════════════════════════════════════ */

.social-links-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(180deg, 
        rgba(5, 10, 18, 0.95) 0%,
        rgba(10, 22, 40, 0.9) 100%
    );
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ocean-twilight);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.social-links-bar > .social-link {
    flex-shrink: 0;
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.social-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* X (Twitter) Link */
.x-link {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.x-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.x-icon {
    transition: transform 0.3s ease;
}

.x-link:hover .x-icon {
    transform: scale(1.1);
}

/* Pump.fun Link */
.pump-link {
    background: linear-gradient(135deg, 
        rgba(45, 212, 191, 0.1) 0%,
        rgba(78, 158, 206, 0.1) 100%
    );
    color: var(--mystic-teal);
    border-color: rgba(45, 212, 191, 0.3);
}

.pump-link:hover {
    background: linear-gradient(135deg, 
        rgba(45, 212, 191, 0.2) 0%,
        rgba(78, 158, 206, 0.2) 100%
    );
    border-color: var(--mystic-teal);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.3);
    transform: translateY(-2px);
}

.pump-icon {
    color: var(--mystic-teal);
    animation: pump-pulse 2s ease-in-out infinite;
    border-radius: 4px;
    object-fit: contain;
}

@keyframes pump-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.pump-address {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    color: var(--starlight-blue);
    max-width: 350px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .social-links-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: var(--space-sm);
        padding: var(--space-xs) var(--space-sm);
    }
    
    .social-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .pump-address {
        font-size: 0.65rem;
        max-width: 200px;
    }
    
    .social-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .social-links-bar {
        position: relative;
        flex-direction: row;
        gap: var(--space-xs);
        padding: var(--space-xs);
    }
    
    .pump-address {
        max-width: 120px;
        font-size: 0.6rem;
    }
    
    .social-text {
        font-size: 0.7rem;
    }
    
    .social-link {
        padding: 0.4rem 0.6rem;
    }
    
    .social-icon {
        width: 18px;
        height: 18px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   AMBIENT EFFECTS
   ═══════════════════════════════════════════════════════════════ */

/* Floating particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -20px;
    background: radial-gradient(circle, var(--starlight-blue) 0%, transparent 70%);
    border-radius: 50%;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* God rays effect */
.god-rays {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        conic-gradient(
            from 180deg at 50% 0%,
            transparent 0deg,
            rgba(78, 158, 206, 0.03) 10deg,
            transparent 20deg,
            rgba(78, 158, 206, 0.05) 40deg,
            transparent 50deg,
            rgba(78, 158, 206, 0.03) 70deg,
            transparent 80deg,
            rgba(78, 158, 206, 0.04) 100deg,
            transparent 110deg,
            rgba(78, 158, 206, 0.03) 130deg,
            transparent 140deg,
            rgba(78, 158, 206, 0.05) 160deg,
            transparent 180deg
        );
    pointer-events: none;
    z-index: 0;
    animation: rays-pulse 8s ease-in-out infinite;
    transition: transform 0.3s ease-out;
}

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

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTAINER - CODEX STYLE
   ═══════════════════════════════════════════════════════════════ */

.memorial-codex {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    background: 
        linear-gradient(180deg, 
            var(--ocean-abyss) 0%, 
            var(--ocean-deep) 20%,
            var(--ocean-midnight) 50%,
            var(--ocean-deep) 80%,
            var(--ocean-abyss) 100%
        );
    box-shadow: 
        0 0 100px rgba(78, 158, 206, 0.1),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--ocean-twilight);
    border-right: 3px solid var(--ocean-twilight);
}

/* Parchment texture overlay */
.memorial-codex::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER - ORNATE TITLE SECTION
   ═══════════════════════════════════════════════════════════════ */

.codex-header {
    position: relative;
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    background: 
        radial-gradient(ellipse at center top, 
            rgba(78, 158, 206, 0.15) 0%, 
            transparent 60%
        );
}

/* Rune borders */
.rune-border {
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--ocean-twilight) 20%,
        var(--starlight-blue) 50%,
        var(--ocean-twilight) 80%,
        transparent 100%
    );
    position: relative;
}

.rune-border::before,
.rune-border::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--starlight-blue);
    font-size: 12px;
    text-shadow: 0 0 10px var(--ethereal-glow);
}

.rune-border::before {
    left: 15%;
}

.rune-border::after {
    right: 15%;
}

.rune-border.bottom {
    margin-top: var(--space-md);
}

.header-content {
    position: relative;
    z-index: 1;
}

/* Ocean sigil/emblem */
.ocean-sigil {
    margin-bottom: var(--space-md);
}

.orca-emblem {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px rgba(78, 158, 206, 0.5));
    animation: emblem-glow 4s ease-in-out infinite;
}

@keyframes emblem-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(78, 158, 206, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(78, 158, 206, 0.8));
    }
}

/* Title styling */
.memorial-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--moonlight-silver);
    text-shadow: 
        0 0 40px rgba(78, 158, 206, 0.8),
        0 0 80px rgba(78, 158, 206, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.title-flourish {
    font-size: 0.4em;
    color: var(--starlight-blue);
    animation: flourish-pulse 3s ease-in-out infinite;
}

@keyframes flourish-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.memorial-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--starlight-blue);
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

.life-dates {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--gold-ancient);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.date-ornament {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN SCROLL CONTENT
   ═══════════════════════════════════════════════════════════════ */

.codex-scroll {
    position: relative;
    z-index: 1;
}

/* Section reveal animation */
section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   TRIBUTE SECTION - ORNATE FRAME
   ═══════════════════════════════════════════════════════════════ */

.tribute-section {
    padding: var(--space-lg);
}

.ornate-frame {
    position: relative;
    padding: var(--space-lg);
    background: 
        linear-gradient(135deg, 
            rgba(26, 58, 92, 0.3) 0%,
            rgba(13, 31, 51, 0.5) 50%,
            rgba(26, 58, 92, 0.3) 100%
        );
    border: 2px solid var(--ocean-twilight);
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(78, 158, 206, 0.1);
}

/* Corner decorations */
.frame-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--starlight-blue);
}

.frame-corner.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.frame-corner.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
}

.frame-corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
}

.frame-corner.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

/* Corner runes */
.frame-corner::after {
    content: '✦';
    position: absolute;
    color: var(--starlight-blue);
    font-size: 14px;
    text-shadow: 0 0 10px var(--ethereal-glow);
}

.frame-corner.top-left::after { top: 5px; left: 5px; }
.frame-corner.top-right::after { top: 5px; right: 5px; }
.frame-corner.bottom-left::after { bottom: 5px; left: 5px; }
.frame-corner.bottom-right::after { bottom: 5px; right: 5px; }

.tribute-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-lg);
    align-items: center;
}

@media (max-width: 900px) {
    .tribute-content {
        grid-template-columns: 1fr;
    }
}

/* Hero portrait */
.hero-portrait {
    display: flex;
    justify-content: center;
}

.portrait-frame {
    position: relative;
    width: 280px;
    height: 200px;
    background: var(--ocean-deep);
    border: 4px solid var(--ocean-twilight);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(78, 158, 206, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.portrait-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, 
        rgba(78, 158, 206, 0.2) 0%, 
        transparent 70%
    );
    animation: portrait-pulse 4s ease-in-out infinite;
}

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

.orca-silhouette {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.orca-art {
    width: 100%;
    height: 100%;
    animation: orca-swim 6s ease-in-out infinite;
}

@keyframes orca-swim {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(5px) rotate(1deg);
    }
    75% {
        transform: translateX(-5px) rotate(-1deg);
    }
}

/* Legend text */
.legend-text {
    position: relative;
}

.legend-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--gold-ancient);
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
}

.illuminated-letter {
    float: left;
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 0.8;
    margin-right: var(--space-sm);
    margin-top: 0.1em;
    color: var(--gold-ancient);
    text-shadow: 
        0 0 20px rgba(201, 162, 39, 0.5),
        2px 2px 0 var(--ocean-twilight);
    background: linear-gradient(180deg, var(--gold-ancient) 0%, var(--gold-fade) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legend-paragraph {
    font-size: 1.15rem;
    margin-bottom: var(--space-md);
    text-align: justify;
    color: var(--parchment-dark);
}

.legend-paragraph strong {
    color: var(--moonlight-silver);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   LINEAGE/STATS SECTION
   ═══════════════════════════════════════════════════════════════ */

.lineage-section {
    padding: var(--space-xl) var(--space-lg);
    background: 
        linear-gradient(180deg, 
            transparent 0%,
            rgba(26, 58, 92, 0.2) 50%,
            transparent 100%
        );
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    color: var(--moonlight-silver);
    letter-spacing: 0.15em;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.title-decoration {
    color: var(--starlight-blue);
    font-size: 0.6em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    max-width: 1000px;
    margin: 0 auto;
}

.stat-card {
    background: 
        linear-gradient(135deg, 
            rgba(26, 58, 92, 0.4) 0%,
            rgba(13, 31, 51, 0.6) 100%
        );
    border: 1px solid var(--ocean-twilight);
    padding: var(--space-md);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--starlight-blue) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(78, 158, 206, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    filter: grayscale(30%);
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--starlight-blue);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--moonlight-silver);
    margin-bottom: var(--space-xs);
}

.stat-detail {
    font-size: 0.9rem;
    color: var(--parchment-dark);
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════
   FAMILY SECTION
   ═══════════════════════════════════════════════════════════════ */

.family-section {
    padding: var(--space-xl) var(--space-lg);
}

.family-scroll {
    max-width: 900px;
    margin: 0 auto;
}

.family-category {
    margin-bottom: var(--space-lg);
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--gold-ancient);
    text-align: center;
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
    position: relative;
}

.category-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--gold-ancient) 50%,
        transparent 100%
    );
    margin: var(--space-sm) auto 0;
}

.family-members {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
}

.member-card {
    background: rgba(26, 58, 92, 0.3);
    border: 1px solid var(--ocean-twilight);
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    transition: all 0.3s ease;
}

.member-card:hover {
    background: rgba(78, 158, 206, 0.2);
    border-color: var(--starlight-blue);
}

.member-card.deceased {
    opacity: 0.7;
}

.member-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--moonlight-silver);
    display: block;
}

.member-note {
    font-size: 0.85rem;
    color: var(--gold-ancient);
    display: block;
    margin-top: var(--space-xs);
}

.member-status {
    color: var(--starlight-blue);
    margin-left: var(--space-xs);
}

.family-members.small {
    gap: var(--space-xs);
}

.member-inline {
    font-family: var(--font-heading);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(26, 58, 92, 0.2);
    border: 1px solid rgba(45, 90, 123, 0.5);
    font-size: 0.95rem;
}

.member-inline.deceased {
    opacity: 0.6;
}

.legend-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--starlight-blue);
    margin-top: var(--space-md);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   COMMUNITY SECTION
   ═══════════════════════════════════════════════════════════════ */

.community-section {
    padding: var(--space-xl) var(--space-lg);
    background: 
        radial-gradient(ellipse at center, 
            rgba(45, 90, 123, 0.15) 0%, 
            transparent 70%
        );
}

.community-intro {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-style: italic;
    text-align: center;
    color: var(--parchment);
    margin-bottom: var(--space-lg);
    line-height: 1.8;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.tweet-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.tweet-frame {
    position: relative;
    max-width: 550px;
    width: 100%;
    padding: var(--space-md);
    background: 
        linear-gradient(135deg, 
            rgba(26, 58, 92, 0.4) 0%,
            rgba(13, 31, 51, 0.6) 100%
        );
    border: 2px solid var(--ocean-twilight);
    border-radius: 12px;
    box-shadow: 
        0 0 40px rgba(78, 158, 206, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.tweet-frame::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--starlight-blue) 50%,
        transparent 100%
    );
}

/* Twitter embed overrides */
.tweet-frame .twitter-tweet {
    margin: 0 auto !important;
}

.community-cta {
    text-align: center;
    margin-top: var(--space-lg);
}

.cta-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--parchment-dark);
    margin-bottom: var(--space-md);
    letter-spacing: 0.05em;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 1rem 2rem;
    background: linear-gradient(135deg, 
        rgba(45, 212, 191, 0.15) 0%,
        rgba(78, 158, 206, 0.15) 100%
    );
    border: 2px solid var(--mystic-teal);
    border-radius: 50px;
    color: var(--mystic-teal);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

.cta-button:hover {
    background: linear-gradient(135deg, 
        rgba(45, 212, 191, 0.3) 0%,
        rgba(78, 158, 206, 0.3) 100%
    );
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(45, 212, 191, 0.3);
}

.cta-icon {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .community-section {
        padding: var(--space-lg) var(--space-md);
    }
    
    .community-intro {
        font-size: 1.1rem;
    }
    
    .tweet-frame {
        padding: var(--space-sm);
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SPIRIT GALLERY - WINGS OF FREEDOM
   ═══════════════════════════════════════════════════════════════ */

.spirit-gallery {
    padding: var(--space-xl) var(--space-lg);
    background: 
        radial-gradient(ellipse at center, 
            rgba(45, 90, 123, 0.15) 0%, 
            transparent 70%
        );
}

.gallery-intro {
    text-align: center;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--parchment);
    margin-bottom: var(--space-xl);
    line-height: 2;
    opacity: 0.9;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    max-width: 1000px;
    margin: 0 auto var(--space-xl);
}

.gallery-item {
    position: relative;
}

.gallery-item.featured {
    grid-row: span 1;
}

.gallery-item.wide {
    grid-column: span 2;
}

/* Gallery Frame */
.gallery-frame {
    position: relative;
    background: linear-gradient(145deg, 
        var(--ocean-deep) 0%, 
        var(--ocean-midnight) 50%,
        var(--ocean-deep) 100%
    );
    padding: 12px;
    border-radius: 8px;
    box-shadow: 
        0 0 40px rgba(78, 158, 206, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.gallery-frame:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 0 60px rgba(78, 158, 206, 0.4),
        0 30px 80px rgba(0, 0, 0, 0.6),
        inset 0 0 60px rgba(0, 0, 0, 0.2);
}

/* Frame glow effect */
.frame-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(126, 184, 218, 0.15) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    animation: glow-rotate 10s linear infinite;
}

@keyframes glow-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.gallery-frame:hover .frame-glow {
    opacity: 1;
}

/* Inner frame border */
.frame-border {
    position: relative;
    border: 3px solid var(--ocean-twilight);
    border-radius: 4px;
    overflow: hidden;
    background: var(--ocean-abyss);
}

.frame-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(126, 184, 218, 0.3);
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}

/* Frame corner ornaments */
.frame-ornament {
    position: absolute;
    width: 30px;
    height: 30px;
    z-index: 3;
}

.frame-ornament::before,
.frame-ornament::after {
    content: '';
    position: absolute;
    background: var(--gold-ancient);
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.frame-ornament.top-left {
    top: 6px;
    left: 6px;
}
.frame-ornament.top-left::before {
    top: 0;
    left: 0;
    width: 20px;
    height: 3px;
}
.frame-ornament.top-left::after {
    top: 0;
    left: 0;
    width: 3px;
    height: 20px;
}

.frame-ornament.top-right {
    top: 6px;
    right: 6px;
}
.frame-ornament.top-right::before {
    top: 0;
    right: 0;
    width: 20px;
    height: 3px;
}
.frame-ornament.top-right::after {
    top: 0;
    right: 0;
    width: 3px;
    height: 20px;
}

.frame-ornament.bottom-left {
    bottom: 6px;
    left: 6px;
}
.frame-ornament.bottom-left::before {
    bottom: 0;
    left: 0;
    width: 20px;
    height: 3px;
}
.frame-ornament.bottom-left::after {
    bottom: 0;
    left: 0;
    width: 3px;
    height: 20px;
}

.frame-ornament.bottom-right {
    bottom: 6px;
    right: 6px;
}
.frame-ornament.bottom-right::before {
    bottom: 0;
    right: 0;
    width: 20px;
    height: 3px;
}
.frame-ornament.bottom-right::after {
    bottom: 0;
    right: 0;
    width: 3px;
    height: 20px;
}

/* Image styling */
.gallery-frame img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    filter: saturate(0.9) contrast(1.05);
    transition: all 0.5s ease;
}

.gallery-item.featured .frame-border,
.gallery-item:not(.wide) .frame-border {
    aspect-ratio: 4/3;
}

.gallery-item.featured .frame-border img,
.gallery-item:not(.wide) .frame-border img {
    height: 100%;
    object-fit: cover;
}

.gallery-item.wide .frame-border {
    aspect-ratio: 21/9;
}

.gallery-item.wide .frame-border img {
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gallery-frame:hover img {
    filter: saturate(1.1) contrast(1.1);
    transform: scale(1.03);
}

/* Caption */
.gallery-caption {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--starlight-blue);
    margin-top: var(--space-sm);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.gallery-frame:hover + .gallery-caption {
    opacity: 1;
    color: var(--moonlight-silver);
    text-shadow: 0 0 20px rgba(126, 184, 218, 0.5);
}

/* Quote section */
.gallery-quote {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: var(--space-lg);
    position: relative;
}

.gallery-quote p {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--parchment-dark);
    line-height: 1.9;
}

.quote-mark {
    font-size: 3rem;
    color: var(--gold-ancient);
    opacity: 0.5;
    display: block;
    line-height: 1;
}

.quote-mark:first-child {
    margin-bottom: var(--space-sm);
}

.quote-mark:last-child {
    margin-top: var(--space-sm);
}

/* Responsive gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .gallery-item.wide {
        grid-column: span 1;
    }
    
    .gallery-item.wide .frame-border {
        aspect-ratio: 16/9;
    }
    
    .gallery-intro {
        font-size: 1rem;
        padding: 0 var(--space-sm);
    }
    
    .gallery-quote p {
        font-size: 1.1rem;
    }
    
    .spirit-gallery {
        padding: var(--space-lg) var(--space-md);
    }
}

/* ═══════════════════════════════════════════════════════════════
   FINAL TRIBUTE / EPITAPH
   ═══════════════════════════════════════════════════════════════ */

.final-tribute {
    padding: var(--space-xl) var(--space-lg);
    background: 
        radial-gradient(ellipse at center bottom, 
            rgba(78, 158, 206, 0.1) 0%, 
            transparent 60%
        );
}

.tribute-frame {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.wave-decoration {
    overflow: hidden;
    height: 50px;
}

.wave-decoration svg {
    width: 100%;
    height: 100%;
}

.epitaph {
    background: 
        linear-gradient(180deg, 
            rgba(26, 58, 92, 0.3) 0%,
            rgba(13, 31, 51, 0.5) 50%,
            rgba(26, 58, 92, 0.3) 100%
        );
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    border-left: 2px solid var(--ocean-twilight);
    border-right: 2px solid var(--ocean-twilight);
}

.epitaph-verse {
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--parchment);
    line-height: 2;
    margin-bottom: var(--space-lg);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Memorial seal */
.memorial-seal {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.seal-outer {
    width: 100px;
    height: 100px;
    border: 3px solid var(--gold-ancient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, 
        rgba(201, 162, 39, 0.1) 0%, 
        transparent 70%
    );
    animation: seal-glow 4s ease-in-out infinite;
}

@keyframes seal-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(201, 162, 39, 0.6);
    }
}

.seal-inner {
    width: 70px;
    height: 70px;
    border: 2px solid var(--gold-ancient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-text {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--gold-ancient);
    letter-spacing: 0.2em;
}

.closing-words {
    font-size: 1.1rem;
    color: var(--parchment-dark);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
    line-height: 1.8;
}

.farewell {
    margin-top: var(--space-md);
}

.farewell-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--starlight-blue);
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(78, 158, 206, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.codex-footer {
    position: relative;
    padding: var(--space-lg) var(--space-md) var(--space-xl);
    text-align: center;
    overflow: hidden;
}

.footer-runes {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
    color: var(--starlight-blue);
}

.rune {
    opacity: 0.6;
    animation: rune-pulse 3s ease-in-out infinite;
}

.rune:nth-child(2) {
    animation-delay: 1s;
}

.rune:nth-child(3) {
    animation-delay: 2s;
}

@keyframes rune-pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.footer-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--moonlight-silver);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.footer-sub {
    font-size: 0.9rem;
    color: var(--parchment-dark);
    opacity: 0.7;
}

.footer-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    z-index: -1;
}

.footer-wave svg {
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .codex-header {
        padding: var(--space-lg) var(--space-md);
    }
    
    .memorial-title {
        flex-direction: column;
        gap: var(--space-sm);
        letter-spacing: 0.15em;
    }
    
    .title-flourish {
        display: none;
    }
    
    .tribute-section,
    .lineage-section,
    .family-section,
    .final-tribute {
        padding: var(--space-lg) var(--space-md);
    }
    
    .ornate-frame {
        padding: var(--space-md);
    }
    
    .frame-corner {
        width: 40px;
        height: 40px;
    }
    
    .illuminated-letter {
        font-size: 3.5rem;
    }
    
    .epitaph-verse {
        font-size: 1.1rem;
    }
    
    .portrait-frame {
        width: 240px;
        height: 170px;
    }
}

@media (max-width: 480px) {
    .life-dates {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .date-ornament {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .member-card {
        padding: var(--space-xs) var(--space-sm);
    }
    
    .section-title {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .title-decoration:first-child {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY & PRINT
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particles,
    .god-rays {
        display: none;
    }
}

@media print {
    .particles,
    .god-rays {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .memorial-codex {
        box-shadow: none;
        border: none;
    }
}

/* Selection styling */
::selection {
    background: var(--ocean-twilight);
    color: var(--moonlight-silver);
}
