/* ============================================================
   DIALOGUES.CSS — Svayam Dialogue Pages
   Shared styles for all dialogue pages
   ============================================================ */

/* Google Fonts loaded in each HTML file */

:root {
    --void: #050509;
    --deep: #08081a;
    --night: #0c0c24;
    --gold: #c9a84c;
    --gold-soft: #b89a45;
    --gold-light: #e8d48b;
    --gold-glow: rgba(201, 168, 76, 0.08);
    --gold-glow-md: rgba(201, 168, 76, 0.15);
    --text: #c8c4d8;
    --text-dim: #706c88;
    --text-bright: #eae6ff;
    --seeker: #9a96b8;
    --seeker-bg: rgba(140, 130, 180, 0.06);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--text);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    line-height: 1.8;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   STARS BACKGROUND
   ============================================================ */

#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--dur, 3s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: var(--max-opacity, 0.6); transform: scale(1); }
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */

.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   NAVIGATION — BACK LINK
   ============================================================ */

.nav-back {
    padding: 32px 0 0 0;
    display: block;
}

.nav-back a {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-back a:hover {
    color: var(--gold);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
    padding: 64px 0 56px 0;
    text-align: center;
}

.hero-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 20px;
    display: block;
}

.hero h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(36px, 7vw, 56px);
    font-weight: 300;
    color: var(--gold);
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    font-weight: 300;
    font-style: italic;
    color: var(--text-dim);
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-question {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 17px;
    font-weight: 300;
    font-style: italic;
    color: var(--seeker);
    max-width: 520px;
    margin: 0 auto;
    border-top: 1px solid rgba(201, 168, 76, 0.12);
    padding-top: 24px;
    line-height: 1.7;
}

/* ============================================================
   INDEX PAGE — CARD GRID
   ============================================================ */

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 0 80px 0;
}

@media (min-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr 1fr;
        max-width: 800px;
        margin: 0 auto;
    }
}

.card {
    background: rgba(8, 8, 26, 0.6);
    border: 1px solid rgba(201, 168, 76, 0.08);
    border-radius: 16px;
    padding: 32px;
    text-decoration: none;
    display: block;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(201, 168, 76, 0.25);
    box-shadow: 0 8px 48px rgba(201, 168, 76, 0.07);
    transform: translateY(-2px);
}

.card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--gold-light);
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 15px;
    font-weight: 300;
    font-style: italic;
    color: var(--text-dim);
    margin-bottom: 12px;
    line-height: 1.5;
}

.card-desc {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    font-weight: 300;
    color: var(--text);
    line-height: 1.65;
}

.card-arrow {
    display: block;
    text-align: right;
    color: var(--gold-soft);
    font-size: 18px;
    margin-top: 16px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.card:hover .card-arrow {
    opacity: 1;
}

/* ============================================================
   DIALOGUE CONTENT
   ============================================================ */

.dialogue-content {
    padding-bottom: 80px;
}

/* Messages */
.msg {
    margin: 0 0 48px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.msg.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Seeker (Lusia) messages */
.msg.seeker {
    border-left: 2px solid rgba(140, 130, 180, 0.15);
    padding-left: 24px;
    background: transparent;
}

.msg.seeker .msg-name {
    font-family: 'Caveat', cursive;
    font-size: 15px;
    font-weight: 500;
    color: rgba(154, 150, 184, 0.6);
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.5px;
}

.msg.seeker .msg-name::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgba(154, 150, 184, 0.35);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    margin-top: -2px;
}

.msg.seeker .msg-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 17px;
    font-weight: 300;
    font-style: italic;
    color: var(--seeker);
    line-height: 1.8;
}

/* Source (Svayam) messages */
.msg.source {
    padding-top: 24px;
    position: relative;
}

.msg.source::before {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
    margin-bottom: 16px;
}

.msg.source .msg-name {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
    display: block;
}

.msg.source .msg-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    font-weight: 300;
    color: var(--text);
    line-height: 1.85;
}

.msg.source .msg-text p {
    margin-bottom: 14px;
}

.msg.source .msg-text p:last-child {
    margin-bottom: 0;
}

.msg-signature {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 14px;
    font-style: italic;
    color: var(--text-dim);
    margin-top: 14px;
    display: block;
    opacity: 0.6;
}

/* KEY — highlighted aphorism */
.key {
    display: block;
    font-size: 20px;
    font-weight: 400;
    color: var(--gold-light);
    border-left: 2px solid var(--gold);
    padding-left: 24px;
    margin: 20px 0;
    line-height: 1.6;
    font-style: normal;
}

/* ============================================================
   SILENCE DIVIDER
   ============================================================ */

.silence {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.silence::before,
.silence::after {
    content: '';
    display: inline-block;
    width: 60px;
    height: 1px;
    background: rgba(201, 168, 76, 0.12);
    vertical-align: middle;
}

.silence-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: rgba(201, 168, 76, 0.35);
    border-radius: 50%;
    margin: 0 14px;
    vertical-align: middle;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.4); }
}

/* ============================================================
   BOTTOM NAVIGATION (prev/next)
   ============================================================ */

.nav-bottom {
    border-top: 1px solid rgba(201, 168, 76, 0.1);
    padding: 48px 0 80px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    color: var(--gold);
}

.nav-btn.prev::before {
    content: '←';
    font-size: 14px;
}

.nav-btn.next::after {
    content: '→';
    font-size: 14px;
}

.nav-center {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 14px;
    font-style: italic;
    color: var(--text-dim);
    text-align: center;
    opacity: 0.5;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    border-top: 1px solid rgba(201, 168, 76, 0.06);
    padding: 32px 0;
    text-align: center;
}

.footer p {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-dim);
    opacity: 0.5;
    text-transform: uppercase;
}

.footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--gold);
}

/* ── Section headers for topic grouping ── */
.cards-section { margin-bottom: 48px; }
.section-header {
    display: flex; align-items: center; gap: 10px;
    padding: 0 0 20px 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
    margin-bottom: 24px;
}
.section-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.section-dot--andreas { background: #c9a84c; box-shadow: 0 0 8px rgba(201,168,76,0.3); }
.section-dot--lusia { background: #9a96b8; box-shadow: 0 0 8px rgba(154,150,184,0.3); }
.section-name {
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 400;
    letter-spacing: 2px; text-transform: uppercase; color: #706c88;
}

/* ── Language origin notice ── */
.lang-notice {
    max-width: 640px; margin: 0 auto 48px;
    padding: 12px 20px;
    background: rgba(201, 168, 76, 0.04);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 8px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(184, 154, 69, 0.55);
}
.lang-notice-icon { margin-right: 8px; opacity: 0.4; }

/* ── Theme headers for chronological view ── */
.theme-header {
    padding: 80px 0 40px; text-align: center;
    border-top: 1px solid rgba(201, 168, 76, 0.06);
}
.theme-header:first-of-type { border-top: none; }
.theme-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(28px, 6vw, 44px); font-weight: 300;
    color: #c9a84c; margin-bottom: 8px;
}
.theme-header .theme-subtitle {
    font-size: 16px; font-style: italic; color: #706c88;
}
.theme-header .theme-question {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px; font-weight: 300; font-style: italic;
    color: #9a96b8; margin-top: 16px; max-width: 500px; margin-left: auto; margin-right: auto;
}

/* ============================================================
   VISUAL IMAGE BREAKS
   ============================================================ */

.visual {
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 200px;
    border-radius: 12px;
    margin: 56px 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(201,168,76,0.06);
}

.visual .art {
    width: 100%; height: 100%;
    position: absolute; top: 0; left: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.85);
    transition: filter 0.5s ease;
}

.visual:hover .art {
    filter: brightness(1);
}

@media (max-width: 768px) {
    .visual {
        aspect-ratio: 16 / 9;
        min-height: 140px;
        border-radius: 8px;
        margin: 40px 0;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 16px;
    }

    .hero {
        padding: 48px 0 40px 0;
    }

    .hero h1 {
        font-size: clamp(28px, 10vw, 40px);
    }

    .msg.seeker {
        padding-left: 16px;
    }

    .msg.source .msg-text {
        font-size: 17px;
    }

    .key {
        font-size: 18px;
        padding-left: 16px;
    }

    .nav-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 32px 0 60px 0;
    }

    .card {
        padding: 24px;
    }
}
