/* AI Character Creator — SEO Doorway (Light Lavender Theme)
 * Brand: AI Fantasy (aifantasy.site) — SFW creative-builder doorway.
 * Palette per doorway-spec: primary #7c3aed, secondary #ddd6fe,
 * accent #4c1d95, body bg #faf5ff, text #1a0d2e.
 * Standalone CSS for SEO isolation per SEO_Strategy_FantasyXXX.md §5.
 */
:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --secondary: #ddd6fe;
    --accent: #4c1d95;
    --bg-page: #faf5ff;
    --bg-card: #ffffff;
    --bg-soft: #f3e8ff;
    --text: #1a0d2e;
    --text-muted: #6b5b7d;
    --border: #e9d5ff;
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #c4b5fd 100%);
    --shadow-soft: 0 4px 16px rgba(124, 58, 237, 0.08);
    --shadow-glow: 0 8px 32px rgba(124, 58, 237, 0.18);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, system-ui, sans-serif;
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 6px 0;
}

.skip-link:focus {
    top: 0;
}

/* ===== Header ===== */
.header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-soft);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 1.25rem;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
}

.nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 6px;
}

.nav a:hover,
.nav a.nav-active {
    color: var(--primary);
    background: var(--bg-soft);
}

/* ===== Hero ===== */
.hero {
    background: var(--gradient-primary);
    color: #fff;
    padding: 72px 24px 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,0.18), transparent 40%),
        radial-gradient(circle at 82% 70%, rgba(255,255,255,0.12), transparent 40%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 880px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero h1 .accent-text {
    color: var(--secondary);
    display: inline-block;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.95;
    max-width: 720px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.hero-cta {
    display: inline-block;
    background: #ffffff;
    color: var(--accent);
    padding: 16px 32px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0,0,0,0.24);
    color: var(--accent);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 36px;
    flex-wrap: wrap;
}

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

.hero-stat .num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
}

.hero-stat .label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Main Container ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 24px;
}

/* ===== Filters ===== */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 32px;
}

.filter-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 6px;
}

.filter-btn {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Models Grid ===== */
.models-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.models-grid--three {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1100px) {
    .models-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
    .models-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .models-grid { grid-template-columns: 1fr; }
}

/* ===== Model Card ===== */
.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.model-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--secondary);
}

.model-card a {
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.model-card .thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.model-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.model-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.model-tag {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 8px;
    align-self: flex-start;
}

.model-excerpt {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.model-cta {
    margin-top: auto;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

/* ===== Bio / Model Detail Page ===== */
.bio-detail {
    padding-top: 32px;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .sep {
    color: var(--border);
}

.bio-hero {
    display: grid;
    grid-template-columns: minmax(0, 360px) 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 48px;
}

@media (max-width: 800px) {
    .bio-hero {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.bio-image-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.bio-image-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bio-meta h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.bio-subtitle {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.bio-attributes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.attr-chip {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--text);
}

.attr-chip .attr-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.attr-chip .attr-value {
    font-weight: 600;
    color: var(--accent);
}

.bio-story {
    color: var(--text);
    line-height: 1.8;
    font-size: 1.02rem;
    margin-bottom: 28px;
}

.bio-story p {
    margin-bottom: 16px;
}

.bio-story strong {
    color: var(--accent);
}

.bio-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-glow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(124, 58, 237, 0.28);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--accent);
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--bg-soft);
}

/* ===== SEO Content Section ===== */
.seo-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    margin: 32px 0;
    box-shadow: var(--shadow-soft);
}

.seo-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 14px;
}

.seo-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 22px;
    margin-bottom: 10px;
}

.seo-section p,
.seo-section li {
    color: var(--text);
    line-height: 1.75;
    margin-bottom: 12px;
}

.seo-section ul {
    list-style: none;
    padding-left: 0;
}

.seo-section li {
    padding: 8px 0 8px 24px;
    position: relative;
}

.seo-section li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* ===== FAQ ===== */
.faq-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.faq-item {
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 18px 22px;
}

.faq-q {
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 1rem;
}

.faq-a {
    color: var(--text);
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
}

/* ===== Footer ===== */
.footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 40px 24px 24px;
    margin-top: 64px;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin-bottom: 28px;
}

.footer-col h4 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 4px 0;
    transition: color 0.2s;
}

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

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 4px 0;
}

.footer-cross-link {
    background: var(--bg-soft);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: center;
}

.footer-cross-link p {
    margin: 0;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.6;
}

.footer-cross-link a {
    color: var(--primary);
    font-weight: 600;
}

.footer-cross-link a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ===== Related / Cross-link grid ===== */
.cross-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.cross-link-tile {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.cross-link-tile:hover {
    border-color: var(--primary);
    background: #fff;
    transform: translateY(-2px);
}

.cross-link-tile .arrow {
    margin-left: auto;
    color: var(--primary);
}

/* ===== Focus styles ===== */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Print ===== */
@media print {
    .header,
    .footer,
    .filters,
    .bio-actions,
    .footer-cross-link {
        display: none;
    }
    body { background: #fff; color: #000; }
    .seo-section { box-shadow: none; border: 1px solid #ddd; }
}

/* ===== Mobile header (stack nav) ===== */
@media (max-width: 720px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .nav {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }
    .nav a {
        font-size: 0.85rem;
        padding: 4px 8px;
    }
    .hero {
        padding: 56px 18px 40px;
    }
    .container {
        padding: 36px 18px;
    }
    .seo-section {
        padding: 22px;
    }
}