:root {
    --bg: #0f172a;
    --card: #111827;
    --panel: #0b1021;
    --muted: #cbd5e1;
    --text: #e2e8f0;
    --accent: #7c3aed;
    --accent-2: #22c55e;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 70px rgba(12, 15, 34, 0.55);
    --radius: 18px;
    --max-width: 1100px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.15), transparent 25%),
                radial-gradient(circle at 90% 10%, rgba(34, 197, 94, 0.12), transparent 25%),
                radial-gradient(circle at 50% 70%, rgba(56, 189, 248, 0.15), transparent 30%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent-2);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.brand img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

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

.nav-links a {
    padding: 0.65rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 600;
    color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
    border-color: var(--border);
    background: rgba(124, 58, 237, 0.1);
    color: var(--text);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-cta {
    background: linear-gradient(135deg, var(--accent), #5b21b6);
    color: #fff;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.45);
}

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    border-radius: 12px;
    cursor: pointer;
}

main {
    flex: 1 0 auto;
}

.hero {
    padding: 2rem 0 1rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.hero-copy {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(124, 58, 237, 0.08);
    font-weight: 700;
    font-size: 0.85rem;
}

.hero-title {
    font-size: clamp(2rem, 2.5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.hero-list {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.hero-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
}

.hero-list i {
    color: var(--accent-2);
}

.form-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.form-card::before,
.form-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
}

.form-card::before {
    width: 180px;
    height: 180px;
    background: rgba(124, 58, 237, 0.18);
    top: -70px;
    right: -60px;
}

.form-card::after {
    width: 160px;
    height: 160px;
    background: rgba(34, 197, 94, 0.2);
    bottom: -80px;
    left: -60px;
}

.form-card h2 {
    margin-bottom: 0.9rem;
    font-size: 1.3rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-weight: 600;
}

.input-control {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(17, 24, 39, 0.8);
    color: var(--text);
    padding: 0.9rem 1rem;
    font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(17, 24, 39, 0.8);
    color: var(--text);
    padding: 0.9rem 1rem;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea::placeholder {
    color: #94a3b8;
}

.input-hint {
    color: var(--muted);
    font-size: 0.95rem;
}

.input-block {
    display: grid;
    gap: 0.35rem;
}

.obscurity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.slider {
    width: 100%;
    margin: 0.5rem 0;
    accent-color: var(--accent);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.9rem;
}

.submit-button {
    width: 100%;
    border: none;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--accent), #5b21b6 50%, #1f2937 100%);
    color: #fff;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(124, 58, 237, 0.45);
}

.button-text {
    position: relative;
    z-index: 1;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.submit-button.loading .spinner {
    display: inline-block;
}

.submit-button.loading .button-text {
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.reader-profile-input {
    padding: 2rem 0;
}

.reader-profile-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.reader-profile-intro-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: grid;
    gap: 1rem;
}

.prompt-ideas {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.chip {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(124, 58, 237, 0.08);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.reader-profile-form-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 1rem;
}

.reader-profile-form-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.12), transparent 35%),
                radial-gradient(circle at 90% 30%, rgba(34, 197, 94, 0.12), transparent 40%);
    z-index: 0;
    pointer-events: none;
}

.reader-profile-form-card > * {
    position: relative;
    z-index: 1;
}

.reader-profile-form-body {
    display: grid;
    gap: 1rem;
}

.reader-profile-fieldset {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    background: rgba(17, 24, 39, 0.65);
    display: grid;
    gap: 0.9rem;
}

.reader-profile-fieldset legend {
    font-weight: 800;
    padding: 0 0.35rem;
}

.dual-stack {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-header h2 {
    margin-top: 0.15rem;
}

.section-title {
    margin: 2rem 0 1rem;
    font-size: 1.4rem;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.book-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.book-card h3 {
    font-size: 1.1rem;
}

.book-card p {
    color: var(--muted);
}

.book-thumbnail {
    max-width: 96px;
    flex-shrink: 0;
}

.book-thumbnail img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.description-toggle button {
    background: none;
    color: var(--accent-2);
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.see-more {
    color: var(--accent-2);
    font-weight: 700;
}

footer {
    padding: 2rem 0 1.5rem;
    color: #94a3b8;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

footer .footer-grid {
    display: grid;
    gap: 0.75rem;
    color: var(--muted);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fecdd3;
}

.reader-profile-shell {
    max-width: 1100px;
    margin: 0 auto 2rem;
    display: grid;
    gap: 1.5rem;
    padding: 0 0.5rem;
}

.reader-profile-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.reader-profile-header {
    display: grid;
    gap: 0.75rem;
}

.reader-profile-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.reader-profile-description {
    color: var(--muted);
}

.reader-profile-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.trait-pill {
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.14);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.reader-profile-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.reader-profile-book-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    align-items: center;
}

.book-thumbnail {
    width: 100px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.book-thumbnail img,
.book-thumbnail .no-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    display: grid;
    place-items: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.reader-profile-book-info {
    display: grid;
    gap: 0.4rem;
}

.book-meta h3 {
    margin: 0;
}

.reader-profile-book-info .author {
    color: var(--muted);
    font-weight: 600;
}

.reader-profile-book-info .reason {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    line-height: 1.5;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(124, 58, 237, 0.15));
    color: #fff;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: var(--shadow);
}

.link-button:hover,
.link-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(124, 58, 237, 0.35);
}

.link-button.ghost {
    background: transparent;
    color: var(--text);
    box-shadow: none;
}

.reader-profile-share {
    display: grid;
    gap: 1rem;
}

.share-card {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 0.75rem;
}

.share-card textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.share-card button {
    width: fit-content;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.35);
}

.reader-profile-share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.reader-profile-share-buttons .link-button {
    padding-inline: 1.1rem;
}

.blog-page {
    display: grid;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
}

.blog-page-header,
.blog-list-header {
    display: grid;
    gap: 0.4rem;
}

.blog-page-subtitle {
    color: var(--muted);
    max-width: 720px;
}

.featured-post-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(34, 197, 94, 0.04));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.featured-post-link {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    align-items: stretch;
    color: inherit;
}

.featured-media {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    background: rgba(255, 255, 255, 0.02);
}

.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-copy {
    padding: 1.4rem;
    display: grid;
    gap: 0.6rem;
}

.blog-meta {
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.blog-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover,
.blog-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(124, 58, 237, 0.32);
}

.blog-card-link {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    color: inherit;
}

.blog-thumb {
    height: 180px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-body {
    padding: 1rem;
    display: grid;
    gap: 0.4rem;
}

.blog-card h3 {
    font-size: 1.1rem;
}

.blog-excerpt {
    color: var(--muted);
}

@media (max-width: 720px) {
    .nav-links {
        position: absolute;
        inset: 74px 1.5rem auto;
        background: rgba(15, 23, 42, 0.97);
        border: 1px solid var(--border);
        padding: 1rem;
        border-radius: var(--radius);
        flex-direction: column;
        align-items: flex-start;
        box-shadow: var(--shadow);
        display: none;
    }

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

    .nav-actions {
        display: none;
    }

    .hamburger {
        display: inline-flex;
    }
}
