/* ==========================================================================
   The Sigma Emperor — Standalone Book Site Stylesheet
   Dark, atmospheric, editorial design evoking Sardinian coast & November light
   ========================================================================== */

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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f0e18;
    --bg-card: #14121f;
    --bg-card-hover: #1c1930;
    --text-primary: #e8e8ec;
    --text-secondary: #a8a8b8;
    --text-muted: #6a6a7a;
    --accent-gold: #c9a84c;
    --accent-gold-hover: #dfc06a;
    --accent-gold-dim: rgba(201, 168, 76, 0.10);
    --accent-sea: #5a8a8a;
    --accent-sea-dim: rgba(90, 138, 138, 0.10);
    --violet: #8b5cf6;
    --violet-dim: rgba(139, 92, 246, 0.08);
    --border: #1e1a2e;
    --border-light: #2a2540;
    --max-width: 1100px;
    --max-width-narrow: 780px;
    --header-height: 64px;
    --radius: 4px;
    --transition: 0.3s ease;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.75;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-gold-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.9rem; margin: 0 0 1.2rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

main { flex: 1; }

/* --- Header / Navigation --- */
#main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-gold) !important;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-gold);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gold);
}

.nav-links a.nav-cta {
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 0.35rem 1rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
}

.nav-links a.nav-cta:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    /* Atmospheric gradient: November Sardinian coast */
    background:
        radial-gradient(ellipse 120% 60% at 50% 80%, rgba(90, 138, 138, 0.08) 0%, transparent 70%),
        linear-gradient(
            180deg,
            #08080d 0%,
            #0c1118 15%,
            #101a24 28%,
            #162530 40%,
            #1a2a35 48%,
            #18252e 55%,
            #1a1e20 65%,
            #16140f 75%,
            #100e0a 85%,
            #0a0a0f 100%
        );
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 70%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(90, 138, 138, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero h1 em {
    font-style: italic;
    color: var(--accent-gold);
}

.hero .sub-headline {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-family: var(--font-serif);
}

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

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: 1px solid var(--accent-gold);
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.btn-secondary:hover {
    background: var(--accent-gold-dim);
    color: var(--accent-gold-hover);
}

/* --- Sections --- */
.section {
    padding: 5rem 2rem;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-narrow {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-serif);
    font-style: italic;
    margin-bottom: 3rem;
    font-size: 1rem;
}

.section-divider {
    width: 60px;
    height: 1px;
    background: var(--accent-gold);
    margin: 0 auto 3rem;
    opacity: 0.5;
}

/* Alternating section backgrounds */
.section-dark {
    background: var(--bg-secondary);
}

/* --- Synopsis Section --- */
.synopsis {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.synopsis p {
    margin-bottom: 1.3rem;
}

.synopsis p:last-of-type {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* --- Character Strip (Homepage) --- */
.char-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.char-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 1.5rem;
    transition: all var(--transition);
}

.char-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.char-card h3 {
    font-size: 1.05rem;
    color: var(--accent-gold);
    margin-bottom: 0.3rem;
}

.char-card .char-epithet {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.char-card p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* --- Character Page (alternating image/text rows) --- */
.character-full {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: stretch;
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border);
}

.character-full:nth-child(even) {
    direction: rtl;
}

.character-full:nth-child(even) > * {
    direction: ltr;
}

.character-full:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.char-portrait {
    width: 100%;
    min-height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.char-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.char-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder state — atmospheric silhouette */
.char-portrait-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-card) 0%, #0e0c16 100%);
}

.char-portrait-placeholder span {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: rgba(201, 168, 76, 0.12);
    font-style: italic;
    user-select: none;
}

.char-text h3 {
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.3rem;
}

.char-text .char-epithet {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: block;
}

.char-text p {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* --- Newsletter / Email Capture --- */
.newsletter-form {
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition);
}

.newsletter-form input[type="email"]::placeholder {
    color: var(--text-muted);
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--accent-gold);
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-sans);
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.newsletter-form button:hover {
    background: var(--accent-gold-hover);
}

.newsletter-offer {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.newsletter-fine {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* --- World Page --- */
.world-concept {
    margin-bottom: 3.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.world-concept:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.world-concept h3 {
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 1.2rem;
}

.world-concept p {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* --- Author Page --- */
.author-bio {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.author-bio p {
    margin-bottom: 1.3rem;
}

/* --- Newsletter / Coming Soon Section --- */
.newsletter-section {
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 60%),
        var(--bg-secondary);
}

.newsletter-section .section-inner {
    max-width: 600px;
}

.newsletter-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.newsletter-coming-soon {
    display: inline-block;
    padding: 0.6rem 1.8rem;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

/* --- Logline / Pullquote --- */
.pullquote {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.pullquote blockquote {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.pullquote blockquote::before {
    content: '\201C';
    position: absolute;
    top: -0.4em;
    left: -0.6em;
    font-size: 3rem;
    color: var(--accent-gold);
    opacity: 0.3;
    font-family: var(--font-serif);
}

/* --- Page Header (interior pages) --- */
.page-header {
    text-align: center;
    padding: 5rem 2rem 3rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(90, 138, 138, 0.05) 0%, transparent 70%),
        var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
}

.page-header .page-desc {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* --- Footer --- */
#main-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-inner .social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-inner .social-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer-inner .social-links a:hover {
    color: var(--accent-gold);
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
}

.footer-legal a {
    color: var(--text-muted);
}

.footer-legal span {
    color: var(--text-muted);
}

.footer-inner p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-back {
    margin-top: 1rem;
    font-size: 0.8rem;
}

.footer-back a {
    color: var(--text-muted);
    font-style: italic;
}

/* --- Coming Soon Overlay --- */
.coming-soon-badge {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-sea);
    border: 1px solid var(--accent-sea);
    padding: 0.25rem 0.8rem;
    border-radius: 2px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1rem;
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        min-height: 70vh;
    }

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

    .hero .sub-headline {
        font-size: 0.95rem;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .section {
        padding: 3.5rem 1.5rem;
    }

    .char-strip {
        grid-template-columns: 1fr;
    }

    .character-full {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .character-full:nth-child(even) {
        direction: ltr;
    }

    .char-portrait {
        min-height: 220px;
        max-height: 300px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }

    .page-header {
        padding: 3.5rem 1.5rem 2rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .pullquote blockquote {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .char-card {
        padding: 1.3rem 1.2rem;
    }

    .nav-links {
        padding: 1rem 1.5rem;
    }
}
