/* ========================================================
   Storiographer - styles.css
   Colors: #1a1a2e, #4a90d9, #f5f0e8, #e8b84b, #6c757d
   Fonts: Inter (body), Playfair Display (retro-display headings)
   ======================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a2e;
    color: #f5f0e8;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Skeleton Loading Overlay --- */
.skeleton-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.skeleton-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-inner {
    width: 80%;
    max-width: 900px;
}

.skeleton-logo-bar {
    width: 200px;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 40px;
    background: linear-gradient(90deg, #2a2a4e 25%, #3a3a5e 50%, #2a2a4e 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.skeleton-card {
    border-radius: 8px;
    background: linear-gradient(90deg, #2a2a4e 25%, #3a3a5e 50%, #2a2a4e 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 217, 0.1), transparent);
    animation: neonShimmer 2s infinite;
}

.skeleton-card-lg { height: 260px; grid-column: span 2; }
.skeleton-card-sm { height: 180px; }
.skeleton-card-md { height: 200px; }

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

@keyframes neonShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* --- Typography --- */
.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 3rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #f5f0e8;
}

.section-desc {
    color: #6c757d;
    font-size: 1.1rem;
    margin-top: 0.75rem;
}

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

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(74, 144, 217, 0.15);
    transition: transform 0.3s ease;
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #e8b84b;
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #f5f0e8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4a90d9;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px rgba(74, 144, 217, 0.5);
}

.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: #4a90d9; }

.nav-link-accent {
    color: #e8b84b;
    border: 1px solid rgba(232, 184, 75, 0.4);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link-accent::after { display: none; }

.nav-link-accent:hover {
    background: rgba(232, 184, 75, 0.1);
    border-color: #e8b84b;
    color: #e8b84b;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #f5f0e8;
    transition: all 0.3s ease;
}

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

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

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

.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 46, 0.97);
    backdrop-filter: blur(12px);
    z-index: 999;
    padding: 1.5rem 2rem;
    flex-direction: column;
    gap: 1rem;
    border-bottom: 1px solid rgba(74, 144, 217, 0.2);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-link {
    color: #f5f0e8;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8rem 2rem 4rem;
}

.hero-watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(74, 144, 217, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(232, 184, 75, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(74, 144, 217, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.hero-title-line {
    display: block;
    font-size: 5rem;
    line-height: 1.05;
    color: #f5f0e8;
}

.hero-title-accent {
    color: #e8b84b;
    text-shadow: 0 0 40px rgba(232, 184, 75, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #4a90d9;
    color: #f5f0e8;
    box-shadow: 0 0 20px rgba(74, 144, 217, 0.3);
}

.btn-primary:hover {
    background: #5a9fe8;
    box-shadow: 0 0 30px rgba(74, 144, 217, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #f5f0e8;
    border: 1px solid rgba(245, 240, 232, 0.3);
}

.btn-outline:hover {
    border-color: #e8b84b;
    color: #e8b84b;
    box-shadow: 0 0 20px rgba(232, 184, 75, 0.15);
}

/* --- Neon Decorations --- */
.hero-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.neon-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, #4a90d9, transparent);
    opacity: 0.15;
}

.neon-line-1 {
    top: 20%;
    left: -10%;
    width: 50%;
    height: 1px;
    animation: neonFloat 8s ease-in-out infinite;
}

.neon-line-2 {
    bottom: 30%;
    right: -10%;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e8b84b, transparent);
    animation: neonFloat 10s ease-in-out infinite reverse;
}

.neon-line-3 {
    top: 60%;
    left: 20%;
    width: 30%;
    height: 1px;
    animation: neonFloat 12s ease-in-out infinite 2s;
}

@keyframes neonFloat {
    0%, 100% { transform: translateX(0) translateY(0); opacity: 0.1; }
    50% { transform: translateX(30px) translateY(-10px); opacity: 0.25; }
}

/* --- Stories Section --- */
.stories-section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    grid-auto-flow: dense;
}

/* Card Sizes */
.story-card-featured { grid-column: span 2; }
.story-card-compact { grid-column: span 1; }
.story-card-medium { grid-column: span 1; }

/* Story Card */
.story-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(245, 240, 232, 0.04);
    border: 1px solid rgba(74, 144, 217, 0.1);
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.story-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.story-card-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.story-card:hover .story-card-watercolor {
    opacity: 0.25;
}

/* Watercolor category backgrounds */
.watercolor-mythology {
    background: radial-gradient(ellipse at 30% 40%, rgba(232, 184, 75, 0.4) 0%, transparent 70%),
                radial-gradient(ellipse at 70% 60%, rgba(74, 144, 217, 0.3) 0%, transparent 60%);
}

.watercolor-folklore {
    background: radial-gradient(ellipse at 40% 30%, rgba(74, 144, 217, 0.4) 0%, transparent 65%),
                radial-gradient(ellipse at 60% 70%, rgba(108, 117, 125, 0.3) 0%, transparent 55%);
}

.watercolor-epic {
    background: radial-gradient(ellipse at 50% 40%, rgba(232, 184, 75, 0.35) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(74, 144, 217, 0.25) 0%, transparent 50%);
}

.watercolor-fable {
    background: radial-gradient(ellipse at 60% 50%, rgba(74, 144, 217, 0.3) 0%, transparent 65%),
                radial-gradient(ellipse at 30% 30%, rgba(232, 184, 75, 0.2) 0%, transparent 50%);
}

.watercolor-legend {
    background: radial-gradient(ellipse at 40% 60%, rgba(232, 184, 75, 0.35) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(74, 144, 217, 0.2) 0%, transparent 55%);
}

.watercolor-parable {
    background: radial-gradient(ellipse at 50% 50%, rgba(108, 117, 125, 0.3) 0%, transparent 60%),
                radial-gradient(ellipse at 30% 70%, rgba(74, 144, 217, 0.25) 0%, transparent 50%);
}

.story-card-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 220px;
}

.story-card-compact .story-card-content {
    min-height: 180px;
}

.story-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #4a90d9;
    background: rgba(74, 144, 217, 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.story-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #f5f0e8;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

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

.story-excerpt {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
    font-size: 0.8rem;
}

.story-origin { color: #e8b84b; font-weight: 500; }
.story-reading-time { color: #6c757d; }

/* Neon border effect on cards */
.story-card-neon-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    box-shadow: inset 0 0 0 2px rgba(74, 144, 217, 0.5);
}

.story-card:hover .story-card-neon-border {
    opacity: 1;
    box-shadow: inset 0 0 0 2px rgba(74, 144, 217, 0.6), 0 0 15px rgba(74, 144, 217, 0.15);
}

/* --- Categories Section --- */
.categories-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0) 0%, rgba(74, 144, 217, 0.03) 50%, rgba(26, 26, 46, 0) 100%);
}

.categories-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.category-tile {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(245, 240, 232, 0.03);
    border: 1px solid rgba(74, 144, 217, 0.1);
    padding: 2.5rem 2rem;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    border-color: rgba(232, 184, 75, 0.3);
}

.category-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.category-tile:hover .category-watercolor {
    opacity: 0.2;
}

.category-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.category-icon {
    margin-bottom: 1rem;
}

.category-name {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #f5f0e8;
    margin-bottom: 0.5rem;
}

.category-count {
    font-size: 0.85rem;
    color: #6c757d;
    letter-spacing: 0.05em;
}

.category-neon-accent {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #e8b84b;
    box-shadow: 0 0 10px rgba(232, 184, 75, 0.5);
    transition: width 0.4s ease;
}

.category-tile:hover .category-neon-accent {
    width: 60%;
}

/* --- About Section --- */
.about-section {
    position: relative;
    padding: 6rem 2rem;
    overflow: hidden;
}

.about-watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 10% 50%, rgba(74, 144, 217, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 50%, rgba(232, 184, 75, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.about-description {
    color: #6c757d;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-top: 1.25rem;
}

.about-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
}

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

.stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 2.5rem;
    color: #e8b84b;
    text-shadow: 0 0 20px rgba(232, 184, 75, 0.3);
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
    display: block;
}

/* Story Map SVG */
.story-map-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-map-svg {
    width: 100%;
    max-width: 350px;
}

.story-node {
    opacity: 0;
    animation: nodeAppear 0.6s ease forwards;
}

.story-node-center {
    filter: drop-shadow(0 0 8px rgba(232, 184, 75, 0.5));
}

@keyframes nodeAppear {
    from { opacity: 0; r: 0; }
    to { opacity: 1; }
}

.story-connection {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: connectionDraw 2s ease forwards 0.5s;
}

@keyframes connectionDraw {
    to { stroke-dashoffset: 0; }
}

/* --- Contact Section --- */
.contact-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, transparent 0%, rgba(74, 144, 217, 0.03) 100%);
}

.contact-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.story-form {
    margin-top: 2.5rem;
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f5f0e8;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #f5f0e8;
    background: rgba(245, 240, 232, 0.04);
    border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(108, 117, 125, 0.6);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    padding: 4rem 2rem 2rem;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-tagline {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

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

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover { color: #4a90d9; }

.footer-bottom p {
    color: rgba(108, 117, 125, 0.6);
    font-size: 0.8rem;
}

.footer-neon-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4a90d9, transparent);
    opacity: 0.4;
}

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

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

/* --- Responsive --- */
@media (max-width: 1024px) {
    .story-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .story-card-featured { grid-column: span 2; }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .hero-title-line { font-size: 3rem; }
    .section-title { font-size: 2.2rem; }

    .story-grid {
        grid-template-columns: 1fr;
    }
    .story-card-featured,
    .story-card-compact,
    .story-card-medium { grid-column: span 1; }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-visual { order: -1; }

    .form-row {
        grid-template-columns: 1fr;
    }

    .about-stats {
        justify-content: center;
    }

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

    .skeleton-card-lg { grid-column: span 1; }
}

@media (max-width: 480px) {
    .hero-title-line { font-size: 2.4rem; }
    .hero-section { padding: 6rem 1.5rem 3rem; }
    .stories-section,
    .categories-section,
    .about-section,
    .contact-section { padding: 4rem 1.5rem; }

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

    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
}
