/* 
   -------------------------------------------------------------------------
   STILL EYES - DESIGN SYSTEM v2 (Unscary / Respectful Editorial)
   Theme: High-End Journalistic Archive
   -------------------------------------------------------------------------
*/

:root {
    /* Vibrant Cosmic Color Palette */
    --bg-color: #1a1530;
    /* Deep Purple-Blue */
    --bg-secondary: #251f3e;
    /* Rich Purple */
    --bg-tertiary: #2d2550;
    /* Medium Purple */
    --text-primary: #ffffff;
    --text-secondary: #c4b5fd;
    /* Light Purple */
    --accent-color: #fbbf24;
    /* Vibrant Gold */
    --accent-color-hover: #fcd34d;
    /* Bright Gold */
    --danger-color: #f472b6;
    /* Bright Pink */
    --teal-accent: #2dd4bf;
    /* Vibrant Teal */
    --purple-accent: #a78bfa;
    /* Bright Purple */
    --cyan-accent: #22d3ee;
    /* Electric Cyan */
    --border-color: rgba(167, 139, 250, 0.2);
    /* Purple border */
    --card-hover: rgba(167, 139, 250, 0.1);

    /* Gradients */
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-teal: linear-gradient(135deg, #2dd4bf 0%, #06b6d4 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Space Grotesk', sans-serif;

    /* Layout */
    --nav-height: 80px;
    --container-width: 1440px;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: default;
    /* Standard cursor for accessibility/comfort */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom Cursor - Optional, subtle hint only */
.cursor-dot,
.cursor-outline {
    display: none;
    /* Removing custom cursor to reduce "game/spooky" feel */
}

/* Typography Helpers */
h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.text-gold {
    color: var(--accent-color);
}

.text-teal {
    color: var(--teal-accent);
}

.text-danger {
    color: var(--danger-color);
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Background Texture - REMOVED from global, now in .hero::before */

/* Hero Section with Background */
.hero {
    position: relative;
    z-index: 1;
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    overflow: hidden;
}

/* Background image only in hero section */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('cosmic_background_v2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    filter: brightness(0.5) contrast(1.1);
}

/* Dark overlay for text readability with purple tint */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(circle at center, rgba(103, 58, 183, 0.3) 0%, rgba(26, 21, 48, 0.8) 100%);
    pointer-events: none;
}

/* Ensure hero content is above the background and overlay */
.hero h1,
.hero p,
.hero .btn {
    position: relative;
    z-index: 10;
}

/* Spiritual Numbers - Vibrant and glowing */
.spiritual-number {
    position: fixed;
    color: var(--cyan-accent);
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    pointer-events: none;
    user-select: none;
    z-index: 5;
    animation: floatUp 8s linear forwards;
    text-shadow: 0 0 30px var(--cyan-accent), 0 0 15px var(--purple-accent), 0 0 5px rgba(255, 255, 255, 0.8);
    font-weight: bold;
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: linear-gradient(180deg, rgba(26, 21, 48, 0.98) 0%, rgba(37, 31, 62, 0.95) 100%);
    backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 2px solid var(--purple-accent);
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-brand img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--gradient-cosmic);
    transition: width 0.4s var(--ease-out-expo);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu open state */
.nav-links.mobile-open {
    display: flex !important;
}


/* Hero Section */
.hero {
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

/* SPIRITUAL NUMBERS ANIMATION */
.spiritual-number {
    position: fixed;
    color: rgba(100, 200, 255, 0.4);
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    /* Behind content but above very back bg */
    animation: floatUp 8s linear forwards;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.6);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }

    20% {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }

    80% {
        opacity: 0.6;
        transform: translateY(-50px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.9);
    }
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 30px;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    letter-spacing: -0.01em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero h1 span {
    display: block;
    font-size: 1.25rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    margin-top: 16px;
    font-weight: 300;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 4px;
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--bg-color);
    border: none;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--gradient-cosmic);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(167, 139, 250, 0.4);
}

.btn-outline {
    border: 2px solid var(--purple-accent);
    color: var(--purple-accent);
}

.btn-outline:hover {
    border-color: var(--teal-accent);
    background: rgba(45, 212, 191, 0.1);
    color: var(--teal-accent);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.3);
}

/* Featured Cases Grid */
.section {
    padding: 100px 40px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.section-header h2 {
    font-size: 2.5rem;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* Case Card */
.case-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--border-color);
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(167, 139, 250, 0.3), 0 0 30px rgba(45, 212, 191, 0.2);
    border-color: var(--purple-accent);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, #3d2f5e 100%);
}

.card-image {
    width: 100%;
    height: 300px;
    /* Increased height for better portrait visibility */
    background-color: #15181c;
    margin-bottom: 20px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 4/5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    /* Crucial: Focus on top (faces) by default */
    opacity: 0.9;
    transition: opacity 0.3s, transform 0.5s;
}

.case-card:hover .card-image img {
    opacity: 1;
    transform: scale(1.05);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-location {
    font-size: 0.9rem;
    color: var(--teal-accent);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.prediction-badge {
    position: absolute;
    top: 34px;
    right: 34px;
    padding: 6px 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.9) 0%, rgba(103, 58, 183, 0.9) 100%);
    border: 2px solid var(--purple-accent);
    color: white;
    border-radius: 6px;
    z-index: 2;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.4);
}

/* Voting UI */
.vote-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.vote-bar-fill {
    height: 100%;
    background: var(--gradient-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
}

.case-card:hover .vote-bar-fill {
    background: linear-gradient(90deg, var(--accent-color), var(--danger-color));
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.vote-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.btn-vote {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    transition: all 0.2s;
    cursor: pointer;
    border-radius: 4px;
}

.btn-vote-alive:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.btn-vote-dead:hover {
    background: rgba(244, 114, 182, 0.2);
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 15px rgba(244, 114, 182, 0.3);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 40px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.disclaimer {
    max-width: 600px;
    margin: 0 auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom Interaction */
.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.zoom-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.zoom-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.case-card.zoomed .card-image img {
    /* JS handles transform for pan/zoom */
    cursor: grab;
    filter: contrast(1.1) brightness(1.1);
}

.case-card.zoomed .card-image img:active {
    cursor: grabbing;
    transition: none;
    /* Instant movement when dragging */
}

/* Ensure images don't get cut off weirdly in cards */
.card-image {
    position: relative;
    overflow: hidden;
    /* Prevent default drag behavior of images */
    user-select: none;
}

.card-image img {
    /* Smooth transition for zoom in/out, but we disable it during drag via JS class or inline style */
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    pointer-events: auto;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Toast Overlay */
.zoom-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--accent-color);
    padding: 20px 40px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 9999;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    text-shadow: 0 0 10px var(--accent-color);
}

.zoom-toast.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.btn-view-case {
    display: block;
    width: 100%;
    margin-bottom: 15px;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-view-case:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Mobile Devices (320px - 768px) */
@media (max-width: 768px) {

    /* Navigation */
    nav {
        padding: 0 20px;
        height: 70px;
    }

    .nav-brand img {
        width: 40px;
        height: 40px;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile navigation dropdown */
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: linear-gradient(180deg, rgba(26, 21, 48, 0.98) 0%, rgba(37, 31, 62, 0.95) 100%);
        backdrop-filter: blur(20px);
        padding: 20px;
        gap: 15px;
        border-bottom: 2px solid var(--purple-accent);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-link {
        padding: 12px;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link:last-child {
        border-bottom: none;
    }


    /* Hero Section */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 100px 20px 60px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 30px;
        padding: 0 10px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.9rem;
    }

    /* Spiritual Numbers - smaller on mobile */
    .spiritual-number {
        font-size: 1rem;
    }

    /* Featured Cases Grid */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }

    .case-card {
        padding: 20px;
    }

    .card-image {
        height: 250px;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .prediction-badge {
        top: 20px;
        right: 20px;
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    /* Voting UI */
    .vote-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-vote {
        width: 100%;
        font-size: 0.85rem;
    }

    /* Section Spacing */
    .section {
        padding: 60px 20px;
    }

    .section h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    /* Footer */
    footer {
        padding: 40px 20px;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

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

    /* Zoom Toast */
    .zoom-toast {
        font-size: 1.2rem;
        padding: 15px 30px;
        max-width: 90%;
    }

    /* Hide custom cursor on mobile */
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .card-image {
        height: 200px;
    }

    .section h2 {
        font-size: 1.75rem;
    }
}

/* Tablet Devices (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Navigation */
    nav {
        padding: 0 30px;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    /* Hero */
    .hero {
        padding: 0 40px;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    /* Cases Grid - 2 columns on tablet */
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        padding: 0 30px;
    }

    .section {
        padding: 80px 30px;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .cases-grid {
        max-width: 1400px;
        margin: 0 auto;
    }

    .section {
        padding: 120px 60px;
    }

    .hero h1 {
        font-size: 5rem;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 80px 20px 40px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .spiritual-number {
        font-size: 0.9rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }

    .nav-link {
        padding: 12px 16px;
    }

    /* Remove hover effects on touch devices */
    .case-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

/* Author Page */
.author-content {
    max-width: 800px;
    margin: 0 auto;
}

.author-lead {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 40px;
    border-left: 2px solid var(--accent-color);
    padding-left: 24px;
}

/* ========================================
   CASE DETAIL PAGE STYLES
   ======================================== */

.detail-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 60px;
    margin-top: 100px;
}

.detail-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.detail-avatar {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-position: top;
    object-fit: cover;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    filter: grayscale(100%) contrast(120%);
}

.key-data {
    font-family: var(--font-body);
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.label {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
}

.badge-unalived {
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 5px 10px;
}

.badge-alive {
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 5px 10px;
}

.rationale-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--teal-accent);
    padding: 30px;
    margin-top: 40px;
}

.rationale-list li {
    margin-bottom: 10px;
    list-style-type: square;
    margin-left: 20px;
    color: var(--text-secondary);
}

/* Responsive Styles for Case Detail */
@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-top: 40px;
    }

    .detail-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 40px;
    }



    #case-name {
        font-size: 2.5rem !important;
    }

    .case-grid {
        grid-template-columns: 1fr;
    }
}