/* ============================================
   SOUSEI (創生) - Mystical Dark Theme
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #a78bfa;
    --primary-glow: rgba(124, 58, 237, 0.4);
    --secondary: #2d1b69;
    --accent: #6c3fa0;
    --accent-warm: #e8590c;

    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a28;
    --bg-elevated: #16161f;
    --bg-input: #0e0e16;

    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --text-bright: #f9fafb;

    --border: #1f1f2e;
    --border-light: #2a2a3d;

    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4), 0 4px 10px -4px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);

    --transition: 0.3s ease;
    --transition-fast: 0.15s ease;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Cinzel', 'Noto Serif JP', serif;
    --font-jp: 'Noto Serif JP', serif;

    --header-height: 70px;
    --container-max: 1200px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-bright);
    line-height: 1.3;
    font-weight: 600;
}

/* --- Utility --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Film Grain Overlay --- */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
    .film-grain { display: none; }
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
    background: rgba(5, 5, 8, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo-img {
    height: 44px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: color var(--transition-fast), background var(--transition-fast);
    letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-bright);
    background: rgba(124, 58, 237, 0.1);
}

.nav-link.active {
    color: var(--primary-light);
}

.nav-cta {
    background: var(--primary);
    color: var(--text-bright) !important;
    border-radius: var(--radius);
    font-weight: 600;
    margin-left: 0.5rem;
}

.nav-cta:hover {
    background: var(--primary-dark);
    color: var(--text-bright) !important;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    z-index: 1001;
}

.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open .nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: var(--bg-darker);
        border-left: 1px solid var(--border);
        padding: 5rem 2rem 2rem;
        gap: 0.5rem;
        transition: right var(--transition);
        z-index: 1000;
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .nav-cta {
        margin-left: 0;
        margin-top: 0.5rem;
        text-align: center;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-height) + 2rem) 1.5rem 4rem;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(45, 27, 105, 0.15) 0%, var(--bg-dark) 70%);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(108, 63, 160, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

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

.hero-logo {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.hero-subtitle {
    font-family: var(--font-jp);
    font-size: 1.1rem;
    color: var(--primary-light);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.hero-tagline {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

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

/* Mystical particles canvas in hero */
#heroParticles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Rune background pattern */
.rune-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L55 30 L30 55 L5 30Z' fill='none' stroke='%237c3aed' stroke-width='0.5'/%3E%3Ccircle cx='30' cy='30' r='10' fill='none' stroke='%237c3aed' stroke-width='0.3'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-bright);
    border-color: var(--primary-light);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 5rem 0;
}

.section-dark {
    background: var(--bg-darker);
}

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

.section-label {
    font-family: var(--font-jp);
    font-size: 0.85rem;
    color: var(--primary-light);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    display: block;
}

.section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Section divider (mystical seal line) */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto;
    max-width: 300px;
    opacity: 0.3;
    margin-bottom: 2rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
}

.section-divider i {
    color: var(--primary);
    font-size: 0.7rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
}

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

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ============================================
   FEATURE CARDS (Home page)
   ============================================ */
.feature-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.4rem;
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   FACTION CARDS
   ============================================ */
.faction-card {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.faction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--faction-color, var(--primary));
    border-radius: 4px 0 0 4px;
}

.faction-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    background: rgba(124, 58, 237, 0.08);
    color: var(--faction-color, var(--primary-light));
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.faction-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.faction-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.faction-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.faction-feature-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary-light);
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.15);
}

/* ============================================
   NEWS CARDS
   ============================================ */
.news-card {
    display: flex;
    flex-direction: column;
}

.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: -1.5rem -1.5rem 1.25rem;
    width: calc(100% + 3rem);
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.news-card-category {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(124, 58, 237, 0.12);
    color: var(--primary-light);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.news-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.news-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
}

.news-card .btn {
    margin-top: 1rem;
    align-self: flex-start;
}

/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--bg-card);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-bright);
    font-weight: 500;
    font-size: 1rem;
    transition: background var(--transition-fast);
}

.faq-question:hover {
    background: var(--bg-card-hover);
}

.faq-question i {
    color: var(--primary-light);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-answer-inner {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.faq-answer-inner p {
    margin-bottom: 0.75rem;
}

.faq-answer-inner code {
    background: var(--bg-elevated);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-light);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.form-label .required {
    color: var(--error);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-dim);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.35rem;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

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

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1rem auto;
    max-width: var(--container-max);
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PAGE HEADERS
   ============================================ */
.page-header {
    padding: calc(var(--header-height) + 3rem) 0 3rem;
    text-align: center;
    background: radial-gradient(ellipse at center top, rgba(45, 27, 105, 0.12) 0%, transparent 70%);
    position: relative;
}

.page-header .rune-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
    position: relative;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
}

.legal-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-content h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
}

.legal-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.legal-content ul,
.legal-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content ul {
    list-style: disc;
}

.legal-content ol {
    list-style: decimal;
}

.legal-content li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.legal-content a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ============================================
   RULES PAGE
   ============================================ */
.rules-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.rules-tab {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-tab:hover,
.rules-tab.active {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(124, 58, 237, 0.08);
}

.rule-section {
    margin-bottom: 2rem;
}

.rule-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.rule-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--primary-light);
}

.rule-item p,
.rule-item ul,
.rule-item ol {
    color: var(--text-muted);
    line-height: 1.8;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 3rem 0;
}

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

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-light);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* ============================================
   CONNECT / CTA SECTION
   ============================================ */
.cta-section {
    text-align: center;
    padding: 5rem 0;
    position: relative;
    background: linear-gradient(to bottom, var(--bg-dark), rgba(45, 27, 105, 0.08), var(--bg-dark));
}

.cta-section h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.connect-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.connect-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.connect-badge i {
    color: var(--primary-light);
}

.connect-badge code {
    font-family: monospace;
    color: var(--text-bright);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-tagline {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-style: italic;
}

.footer-links h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

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

.footer-partner {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.partner-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 0.75rem;
}

.partner-link {
    display: inline-block;
}

.partner-logo {
    height: 30px;
    width: auto;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.partner-logo:hover {
    opacity: 1;
}

.partner-desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    max-width: 500px;
    margin: 0.75rem auto 0;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.footer-disclaimer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

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

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all var(--transition-fast);
}

.pagination-link:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

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

.pagination-dots {
    color: var(--text-dim);
    padding: 0 0.25rem;
}

/* ============================================
   ABOUT PAGE
   ============================================ */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.about-content strong {
    color: var(--text-bright);
}

/* ============================================
   APPLY / CONTACT SUCCESS
   ============================================ */
.success-page {
    text-align: center;
    padding: calc(var(--header-height) + 5rem) 1.5rem 5rem;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.success-page h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-page p {
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ============================================
   FACTION DETAIL PAGE
   ============================================ */
.faction-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
}

.faction-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.faction-detail-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.faction-detail-header h1 {
    font-size: 2rem;
}

.faction-detail-body {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 1.05rem;
}

.faction-detail-body p {
    margin-bottom: 1.25rem;
}

.faction-detail-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
}

/* ============================================
   NEWS DETAIL PAGE
   ============================================ */
.news-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.news-detail-body {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 1.05rem;
}

.news-detail-body p {
    margin-bottom: 1.25rem;
}

.news-detail-body h2, .news-detail-body h3 {
    margin: 2rem 0 1rem;
}

.news-detail-body ul, .news-detail-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.news-detail-body ul { list-style: disc; }
.news-detail-body ol { list-style: decimal; }

.news-detail-body li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.news-detail-image {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================
   ANIMATIONS (respect reduced motion)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .fade-in.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .fade-in-delay-1 { transition-delay: 0.1s; }
    .fade-in-delay-2 { transition-delay: 0.2s; }
    .fade-in-delay-3 { transition-delay: 0.3s; }
    .fade-in-delay-4 { transition-delay: 0.4s; }
}

/* For reduced motion, show everything immediately */
@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }

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

    .hero {
        min-height: 85vh;
    }

    .hero-logo {
        max-width: 300px;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   PARTNER PAGE
   ============================================ */
.partner-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.partner-card {
    padding: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    overflow: hidden;
}

.partner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.partner-card-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem;
}

.partner-logo {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
}

.partner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    display: block;
}

.partner-logo-placeholder {
    font-size: 2rem;
    color: var(--primary-light);
}

.partner-info {
    flex: 1;
    min-width: 0;
}

.partner-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.partner-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.partner-url {
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color var(--transition-fast);
}

.partner-card:hover .partner-url {
    color: var(--primary);
}

/* Footer partner list */
.footer-partner-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-partner-list .partner-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-partner-list .partner-logo-img {
    height: 24px;
    width: auto;
    border-radius: 4px;
}

@media (max-width: 480px) {
    .partner-card-inner {
        flex-direction: column;
        text-align: center;
    }

    .partner-logo {
        margin: 0 auto;
    }

    .partner-info {
        text-align: center;
    }
}

/* ============================================
   Team Section
   ============================================ */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.team-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.team-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.team-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.team-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.team-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 3px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-dim);
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-info h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.team-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .team-card {
        padding: 1rem;
    }

    .team-avatar {
        width: 64px;
        height: 64px;
    }

    .team-info h3 {
        font-size: 0.9rem;
    }

    .team-role {
        font-size: 0.65rem;
    }
}

/* ============================================
   Document Cards - Book Style
   ============================================ */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    justify-items: center;
}

.doc-card {
    width: 100%;
    max-width: 200px;
    height: 280px;
    background: linear-gradient(160deg, #2a1810 0%, #1a0f0a 50%, #0d0705 100%);
    border-radius: 4px 12px 12px 4px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        -4px 0 8px rgba(0,0,0,0.3),
        0 8px 20px rgba(0,0,0,0.4),
        inset -2px 0 4px rgba(255,255,255,0.05);
    text-decoration: none;
}

/* Book spine effect */
.doc-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(90deg,
        rgba(232, 89, 12, 0.8) 0%,
        rgba(185, 28, 28, 0.9) 50%,
        rgba(100, 20, 10, 1) 100%);
    border-radius: 4px 0 0 4px;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
}

/* Gold accent lines */
.doc-card::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 10px;
    height: 2px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.6), transparent);
}

.doc-card:hover {
    transform: translateY(-10px) rotate(-2deg);
    box-shadow:
        -6px 4px 12px rgba(0,0,0,0.4),
        0 15px 35px rgba(232, 89, 12, 0.2),
        inset -2px 0 4px rgba(255,255,255,0.08);
}

.doc-card-icon {
    width: 60px;
    height: 60px;
    margin-top: 1rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.doc-card:hover .doc-card-icon {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-color: rgba(212, 175, 55, 0.5);
    transform: scale(1.05);
}

.doc-card-icon i {
    font-size: 1.5rem;
    color: #d4af37;
}

.doc-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #d4af37;
    margin: 0.75rem 0 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.doc-card p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9) 0%, rgba(180, 140, 40, 0.9) 100%);
    color: #1a0f0a;
    border: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

.doc-card .btn:hover {
    background: linear-gradient(135deg, rgba(232, 195, 75, 1) 0%, rgba(212, 175, 55, 1) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.doc-card .btn i {
    font-size: 0.75rem;
}

/* Bottom gold line */
.doc-card .btn::before {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 20px;
    right: 10px;
    height: 2px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.6), transparent);
    pointer-events: none;
}

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

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

@media (max-width: 500px) {
    .doc-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .doc-card {
        max-width: 160px;
        height: 240px;
        padding: 1rem 0.75rem;
    }

    .doc-card-icon {
        width: 50px;
        height: 50px;
    }

    .doc-card-icon i {
        font-size: 1.25rem;
    }

    .doc-card h3 {
        font-size: 0.85rem;
    }

    .doc-card .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }
}

/* ============================================
   Visitor Counter - Footer
   ============================================ */
.visitor-counter {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.counter-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(45, 27, 105, 0.2) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.counter-inner:hover {
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.counter-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, 0.4);
}

.counter-icon i {
    font-size: 1.1rem;
    color: var(--primary-light, #a78bfa);
}

.counter-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.counter-number {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-light, #a78bfa);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.counter-label {
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

@media (max-width: 480px) {
    .counter-inner {
        padding: 0.6rem 1.2rem;
        gap: 0.75rem;
    }

    .counter-icon {
        width: 35px;
        height: 35px;
    }

    .counter-icon i {
        font-size: 1rem;
    }

    .counter-number {
        font-size: 1.2rem;
    }

    .counter-label {
        font-size: 0.65rem;
    }
}
