/* ==========================================
   TRIBUTE TO SOMA — CSS STYLES
   Design inspired by rexion.ai (dark grid bg)
   ========================================== */

/* CSS Variables - Dark Theme (Default) */
:root,
[data-theme="dark"] {
    --bg-primary: #0a0e14;
    --bg-secondary: #0f1620;
    --bg-card: #131c28;
    --bg-card-hover: #182536;
    --text-primary: #e8f0f7;
    --text-secondary: #94afc4;
    --text-muted: #5a7a94;
    --accent: #7fb7d4;
    --accent-dim: #5a9ab8;
    --border: #1e3044;
    --border-light: #162232;
    --gradient-start: #7fb7d4;
    --gradient-end: #4ecdc4;
    --grid-color: rgba(127, 183, 212, 0.02);
    --grid-line: rgba(127, 183, 212, 0.05);
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 40px rgba(127, 183, 212, 0.12);
    --linkedin-color: #0a66c2;
    --twitter-color: #1da1f2;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f7fbfd;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f7fb;
    --text-primary: #1a2a3a;
    --text-secondary: #4a6070;
    --text-muted: #7a94a4;
    --accent: #4a9ab8;
    --accent-dim: #3d8aa8;
    --border: #d4e4ee;
    --border-light: #e8f2f8;
    --gradient-start: #7fb7d4;
    --gradient-end: #4ecdc4;
    --grid-color: rgba(127, 183, 212, 0.03);
    --grid-line: rgba(127, 183, 212, 0.06);
    --shadow: 0 4px 30px rgba(0, 40, 80, 0.06);
    --shadow-hover: 0 8px 40px rgba(127, 183, 212, 0.15);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Effects - Rexion.ai inspired with parallax */
.bg-grid {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 0;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.7;
    transform: translate(
        calc(var(--mouse-x, 0) * -8px),
        calc(var(--mouse-y, 0) * -8px)
    );
    transition: transform 0.3s ease-out;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(ellipse at calc(50% + var(--mouse-x, 0) * 30px) calc(30% + var(--mouse-y, 0) * 20px), rgba(127, 183, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(78, 205, 196, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 70%, rgba(127, 183, 212, 0.03) 0%, transparent 60%);
    transition: background 0.3s ease-out;
}

[data-theme="light"] .bg-grid {
    opacity: 0.35;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    backdrop-filter: blur(20px);
    background: rgba(10, 14, 20, 0.85);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(247, 251, 253, 0.92);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 100px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 60px;
}

.hero-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 24px;
    font-weight: 400;
}

/* Hero Image */
.hero-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 32px;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px rgba(127, 183, 212, 0.2);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 600;
    line-height: 1.5;
    padding-bottom: 0.15em;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    overflow: visible;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.hero-roles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.hero-roles span {
    white-space: nowrap;
}

.hero-roles .separator {
    color: var(--accent);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hero-scroll::before {
    content: '\2193';
    font-size: 1.2rem;
    color: var(--accent);
    animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.scroll-line {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* Sections */
.section {
    padding: 120px 0;
    position: relative;
    z-index: 1;
}

.section-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 16px;
    font-weight: 500;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 48px;
    line-height: 1.7;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.about-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px;
}

.about-image {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-lead {
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.8;
    font-weight: 400;
}

.about-text p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Playfair Display', serif;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* Photo Memories Section - Grid Collage */
.photos-section {
    padding-bottom: 80px;
    overflow-x: hidden;
}

.photos-wrapper {
    position: relative;
}

.photos-scroll-btn {
    display: none;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    scrollbar-width: none;
}

.photos-grid::-webkit-scrollbar {
    display: none;
}

.photo-card {
    overflow: hidden;
    position: relative;
    display: block;
    aspect-ratio: 1/1;
}

.photo-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: brightness(0.85) saturate(0.9);
}

.photo-card:hover img {
    transform: scale(1.05);
    filter: brightness(1) saturate(1);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    font-size: 0.7rem;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-card:hover .photo-caption {
    opacity: 1;
}

/* Carousel / Tribute Cards */
.carousel-wrapper {
    overflow: hidden;
    margin-bottom: 20px;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.carousel-track {
    display: flex;
    gap: 20px;
    animation: scrollLeft 40s linear infinite;
    width: max-content;
}

.carousel-track.reverse {
    animation: scrollRight 45s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scrollRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.tribute-card {
    flex-shrink: 0;
    width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
}

.tribute-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.tribute-card blockquote {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-style: italic;
}

.tribute-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-info strong {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.author-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.source-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.source-badge:hover {
    transform: scale(1.05);
    background: var(--bg-card-hover);
}

.source-badge.linkedin {
    color: var(--linkedin-color);
    border-color: rgba(10, 102, 194, 0.3);
    cursor: pointer;
}

.source-badge.linkedin:hover {
    background: rgba(10, 102, 194, 0.1);
}

.source-badge.twitter {
    color: var(--twitter-color);
    border-color: rgba(29, 161, 242, 0.3);
    cursor: pointer;
}

.source-badge.twitter:hover {
    background: rgba(29, 161, 242, 0.1);
}

/* Community Grid */
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.community-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s ease;
}

.community-card:hover {
    border-color: var(--accent-dim);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.community-card blockquote {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    font-style: italic;
}

/* Kudos Section */
.kudos-embed {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

/* Press Section */
.press-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.press-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.press-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.press-source {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.press-card h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
}

.press-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 80px 0 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-light);
}

.footer-memory {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.footer-dates {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-right {
        position: static;
        flex-direction: column;
        gap: 20px;
    }

    .about-image {
        flex: 1;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stat-card {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: 100px 20px 80px;
        min-height: 100vh;
    }

    .hero-content {
        margin-bottom: 80px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-image {
        width: 120px;
        height: 120px;
    }

    .hero-roles {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 12px;
        font-size: 0.8rem;
    }

    .hero-roles .separator {
        display: inline;
    }

    .section {
        padding: 60px 0;
    }

    .tribute-card {
        width: 300px;
    }

    .community-grid {
        grid-template-columns: 1fr;
    }

    .press-grid {
        grid-template-columns: 1fr;
    }

    .about-right {
        flex-direction: column;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .photos-grid {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        animation: scrollPhotosMobile 40s linear infinite;
        width: max-content;
        mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .photos-grid::-webkit-scrollbar {
        display: none;
    }

    .photos-grid .photo-card {
        flex-shrink: 0;
        width: 260px;
        height: 195px;
        aspect-ratio: auto;
        border-radius: 10px;
    }

    .photos-grid .photo-card img {
        object-position: center;
    }

    .photos-grid .photo-card:first-child {
        grid-column: auto;
        grid-row: auto;
        width: 260px;
        height: 195px;
    }

    @keyframes scrollPhotosMobile {
        0% { transform: translateX(0); }
        100% { transform: translateX(-50%); }
    }

    .kudos-embed iframe {
        height: 500px !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-image {
        width: 110px;
        height: 110px;
        margin-bottom: 24px;
    }

    .tribute-card {
        width: 270px;
        padding: 20px;
    }

    .community-card {
        padding: 20px;
    }

    .photos-grid {
        gap: 6px;
        padding: 0;
    }

    .photos-grid .photo-card {
        width: 220px;
        height: 165px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1rem;
    }
}

/* Animations */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        animation: none;
    }

    .scroll-line {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Menu Open State */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 16px;
}
