/* ========================================
   Eurasia Mining Consulting - Custom Styles
   Dark (Deep Space + Gold) / Light (Marble + Gold)
   ======================================== */

/* ---- Base & Reset ---- */
:root {
    --deep-space: #0a0f1e;
    --deep-space-light: #111827;
    --graphite: #1a1f2e;
    --graphite-light: #242938;
    --gold: #c9a84c;
    --gold-light: #d4b85e;
    --gold-dark: #a88a3a;
    --copper: #b87333;
    --copper-light: #cd8844;

    /* Semantic tokens (dark default) */
    --bg-body: #0a0f1e;
    --bg-surface: rgba(26, 31, 46, 0.5);
    --bg-surface-solid: #1a1f2e;
    --bg-elevated: rgba(26, 31, 46, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;
    --text-dim: #4b5563;
    --shadow-card: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(10, 15, 30, 0.6);
    --nav-bg-scrolled: rgba(10, 15, 30, 0.95);
}

/* ---- Light Theme ---- */
[data-theme="light"] {
    --deep-space: #fafaf8;
    --deep-space-light: #f3f4f6;
    --graphite: #f0f1f3;
    --graphite-light: #e5e7eb;
    --gold: #a6872e;
    --gold-light: #bfa044;
    --gold-dark: #8b7024;
    --copper: #9a6028;
    --copper-light: #b07030;

    --bg-body: #fafaf8;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-solid: #ffffff;
    --bg-elevated: rgba(255, 255, 255, 0.95);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.10);
    --text-primary: #1a1a2e;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-dim: #d1d5db;
    --shadow-card: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(250, 250, 248, 0.75);
    --nav-bg-scrolled: rgba(250, 250, 248, 0.97);
}

/* Light theme — global overrides for Tailwind text/bg classes */
[data-theme="light"] body { background: var(--bg-body); color: var(--text-secondary); }
[data-theme="light"] .text-white   { color: var(--text-primary) !important; }
[data-theme="light"] .text-gray-50 { color: var(--text-primary) !important; }
[data-theme="light"] .text-gray-100{ color: var(--text-primary) !important; }
[data-theme="light"] .text-gray-200{ color: var(--text-secondary) !important; }
[data-theme="light"] .text-gray-300{ color: var(--text-secondary) !important; }
[data-theme="light"] .text-gray-400{ color: var(--text-tertiary) !important; }
[data-theme="light"] .text-gray-500{ color: var(--text-muted) !important; }
[data-theme="light"] .bg-white\/5,
[data-theme="light"] .bg-white\/10 { background-color: rgba(0, 0, 0, 0.04) !important; }

/* Light theme — navigation */
[data-theme="light"] #main-nav { background: var(--nav-bg); }
[data-theme="light"] #main-nav.scrolled {
    background: var(--nav-bg-scrolled);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .nav-link { color: var(--text-tertiary); }
[data-theme="light"] .nav-link:hover { color: var(--gold); }
[data-theme="light"] .nav-link.active { color: var(--gold); }

/* Light theme — hero */
[data-theme="light"] .hero-gradient {
    background: linear-gradient(135deg, rgba(250,250,248,0.92) 0%, rgba(245,243,238,0.88) 30%, rgba(240,236,228,0.9) 60%, rgba(250,250,248,0.93) 100%),
                url('/static/images/hero-banner.jpg') center/cover no-repeat;
}
[data-theme="light"] .hero-gradient .text-gray-400 { color: var(--text-secondary) !important; }
[data-theme="light"] .hero-gradient .text-gray-500 { color: var(--text-tertiary) !important; }
[data-theme="light"] .hero-gradient .text-gray-600 { color: var(--text-tertiary) !important; }
[data-theme="light"] .hero-gradient::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(166, 135, 46, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(154, 96, 40, 0.04) 0%, transparent 50%);
}
[data-theme="light"] .hero-particles {
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(166, 135, 46, 0.12) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 60%, rgba(0, 0, 0, 0.04) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 30%, rgba(166, 135, 46, 0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 70%, rgba(0, 0, 0, 0.03) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 40%, rgba(166, 135, 46, 0.10) 0%, transparent 100%);
}

/* Light theme — cards */
[data-theme="light"] .card-dark {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    backdrop-filter: blur(10px);
}
[data-theme="light"] .card-dark:hover {
    background: var(--bg-elevated);
    border-color: rgba(166, 135, 46, 0.25);
    box-shadow: 0 20px 40px var(--shadow-card), 0 0 0 1px rgba(166, 135, 46, 0.1);
}

/* Light theme — sections */
[data-theme="light"] .section-alt {
    background: linear-gradient(180deg, #f5f3ee 0%, #fafaf8 100%);
}
[data-theme="light"] .section-dark {
    background: linear-gradient(180deg, #f0ece4 0%, #fafaf8 100%);
}

/* Light theme — form inputs */
[data-theme="light"] .form-input,
[data-theme="light"] .form-select {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--border-medium);
    color: var(--text-primary);
}
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus {
    background: #ffffff;
    border-color: var(--gold);
}
[data-theme="light"] .form-input::placeholder { color: #9ca3af; }
[data-theme="light"] .form-label { color: var(--text-tertiary); }

/* Light theme — article cards */
[data-theme="light"] .article-card {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}
[data-theme="light"] .article-card:hover {
    border-color: rgba(166, 135, 46, 0.2);
    box-shadow: 0 25px 50px var(--shadow-card);
}
[data-theme="light"] .article-card .card-image {
    background: linear-gradient(135deg, #e5e7eb 0%, #f0f1f3 100%);
}

/* Light theme — methodology */
[data-theme="light"] .verify-layer {
    background: rgba(255, 255, 255, 0.6);
    border-color: var(--border-subtle);
}
[data-theme="light"] .verify-layer:hover {
    background: rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .risk-gate {
    background: rgba(166, 135, 46, 0.04);
    border-color: rgba(166, 135, 46, 0.12);
}
[data-theme="light"] .risk-gate:hover {
    background: rgba(166, 135, 46, 0.08);
}

/* Light theme — SVG icons in body (not footer) */
[data-theme="light"] main svg:not(.text-gold) { color: var(--text-tertiary); }
[data-theme="light"] main .border-white\/10,
[data-theme="light"] main .border-white\/20 {
    border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] main .text-white\/60,
[data-theme="light"] main .text-white\/40 {
    color: var(--text-muted) !important;
}

/* Light theme — tabs & filters */
[data-theme="light"] .tab-btn { color: var(--text-muted); }
[data-theme="light"] .tab-btn:hover { color: var(--gold); }
[data-theme="light"] .filter-btn {
    border-color: var(--border-medium);
    color: var(--text-muted);
}
[data-theme="light"] .filter-btn:hover { color: var(--gold); }

/* Light theme — page header */
[data-theme="light"] .page-header {
    background: linear-gradient(180deg, #f5f3ee 0%, #fafaf8 100%);
}

/* Light theme — prose */
[data-theme="light"] .prose-gold { color: var(--text-secondary); }
[data-theme="light"] .prose-gold h2 { color: var(--text-primary); border-bottom-color: var(--border-subtle); }
[data-theme="light"] .prose-gold h3 { color: var(--text-primary); }
[data-theme="light"] .prose-gold th { background: #f5f3ee; color: var(--text-primary); }
[data-theme="light"] .prose-gold td { border-bottom-color: var(--border-subtle); }
[data-theme="light"] .prose-gold blockquote { color: var(--text-tertiary); }

/* Light theme — scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track { background: #f0f1f3; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d1d5db; }

/* Light theme — section heading */
[data-theme="light"] .section-heading h2 { color: var(--text-primary); }
[data-theme="light"] .section-heading p { color: var(--text-tertiary); }

/* Light theme — buttons */
[data-theme="light"] .btn-gold { color: #ffffff; }
[data-theme="light"] .btn-outline-gold {
    border-color: rgba(166, 135, 46, 0.4);
    color: var(--gold);
}
[data-theme="light"] .btn-outline-gold:hover {
    background: rgba(166, 135, 46, 0.06);
}

/* Light theme — timeline */
[data-theme="light"] .timeline-dot,
[data-theme="light"] .flow-step .step-number {
    background: var(--bg-body);
}

/* Light theme — selection */
[data-theme="light"] ::selection {
    background-color: rgba(166, 135, 46, 0.2);
    color: #1a1a2e;
}

/* Light theme — footer */
[data-theme="light"] footer,
[data-theme="light"] [data-theme="light"] .bg-\\[var\\(--deep-space\\)\\] {
    background: #1a1a2e !important;
}
[data-theme="light"] footer .text-white { color: #ffffff !important; }
[data-theme="light"] footer .text-gray-400 { color: #9ca3af !important; }
[data-theme="light"] footer .text-gray-500 { color: #6b7280 !important; }
[data-theme="light"] footer .text-gold { color: #c9a84c !important; }

::selection {
    background-color: rgba(201, 168, 76, 0.3);
    color: #ffffff;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--deep-space);
}

::-webkit-scrollbar-thumb {
    background: var(--graphite-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ---- Navigation ---- */
#main-nav {
    background: rgba(10, 15, 30, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#main-nav.scrolled {
    background: rgba(10, 15, 30, 0.95);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

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

/* ---- Hero Section ---- */
.hero-gradient {
    background: linear-gradient(135deg, rgba(10,15,30,0.75) 0%, rgba(15,22,41,0.7) 30%, rgba(17,24,39,0.75) 60%, rgba(10,15,30,0.8) 100%),
                url('/static/images/hero-banner.jpg') center/cover no-repeat;
    position: relative;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(184, 115, 51, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(201, 168, 76, 0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 30%, rgba(201, 168, 76, 0.1) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 40%, rgba(201, 168, 76, 0.12) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 15% 80%, rgba(201, 168, 76, 0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 85%, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

/* ---- Gold Accent Decorations ---- */
.gold-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.gold-line-center {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto;
}

.gold-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

/* ---- Cards ---- */
.card-dark {
    background: rgba(26, 31, 46, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.card-dark:hover {
    border-color: rgba(201, 168, 76, 0.2);
    background: rgba(26, 31, 46, 0.8);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(201, 168, 76, 0.1);
}

.card-gold-top {
    position: relative;
}

.card-gold-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-gold-top:hover::before {
    opacity: 1;
}

/* ---- Section Backgrounds ---- */
.section-alt {
    background: linear-gradient(180deg, #0d1220 0%, #0a0f1e 100%);
}

.section-dark {
    background: linear-gradient(180deg, #070b15 0%, #0a0f1e 100%);
}

/* ---- Buttons ---- */
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--deep-space);
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-gold:hover::before {
    left: 100%;
}

.btn-gold:hover {
    box-shadow: 0 8px 25px rgba(201, 168, 76, 0.3);
    transform: translateY(-1px);
}

.btn-outline-gold {
    border: 1px solid rgba(201, 168, 76, 0.4);
    color: var(--gold);
    padding: 14px 32px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-outline-gold:hover {
    background: rgba(201, 168, 76, 0.08);
    border-color: var(--gold);
    box-shadow: 0 8px 25px rgba(201, 168, 76, 0.1);
}

/* ---- Flow / Process Steps ---- */
.flow-step {
    position: relative;
}

.flow-step .step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-weight: 600;
    font-size: 16px;
    background: var(--deep-space);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.flow-step:hover .step-number {
    background: var(--gold);
    color: var(--deep-space);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

/* ---- Timeline ---- */
.timeline-line {
    position: absolute;
    left: 23px;
    top: 48px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), rgba(201, 168, 76, 0.1));
}

.timeline-dot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: var(--deep-space);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.timeline-dot:hover,
.timeline-item:hover .timeline-dot {
    background: var(--gold);
    box-shadow: 0 0 25px rgba(201, 168, 76, 0.4);
}

.timeline-dot:hover svg,
.timeline-item:hover .timeline-dot svg {
    color: var(--deep-space);
}

/* ---- Tabs ---- */
.tab-btn {
    padding: 12px 24px;
    color: #8a919e;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 14px;
}

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

.tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

/* ---- Filter Buttons ---- */
.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8a919e;
    transition: all 0.3s ease;
    background: transparent;
}

.filter-btn:hover {
    border-color: rgba(201, 168, 76, 0.3);
    color: var(--gold-light);
}

.filter-btn.active {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

/* ---- Form Inputs ---- */
.form-input {
    background: rgba(26, 31, 46, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 4px;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: rgba(201, 168, 76, 0.5);
    background: rgba(26, 31, 46, 0.8);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

.form-input::placeholder {
    color: #4b5563;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-select {
    background: rgba(26, 31, 46, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 4px;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a919e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select:focus {
    outline: none;
    border-color: rgba(201, 168, 76, 0.5);
    background-color: rgba(26, 31, 46, 0.8);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

/* ---- Article Card ---- */
.article-card {
    background: rgba(26, 31, 46, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.article-card:hover {
    border-color: rgba(201, 168, 76, 0.15);
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.article-card .card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--graphite) 0%, var(--graphite-light) 100%);
    position: relative;
    overflow: hidden;
}

.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 2px;
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.2);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ---- Section Heading ---- */
.section-heading {
    position: relative;
}

.section-heading .section-tag {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
    display: block;
}

.section-heading h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.3;
}

.section-heading p {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.8;
    max-width: 640px;
}

/* ---- Methodology Visual ---- */
.verify-layer {
    background: rgba(26, 31, 46, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--gold);
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.verify-layer:hover {
    border-left-color: var(--gold-light);
    background: rgba(26, 31, 46, 0.8);
    transform: translateX(4px);
}

.risk-gate {
    background: rgba(201, 168, 76, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.15);
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.risk-gate:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: rgba(201, 168, 76, 0.3);
}

/* ---- Coverage Map (CSS) ---- */
.region-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    position: absolute;
    animation: pulse-dot 2s ease-in-out infinite;
}

.region-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.3);
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

/* ---- Loading Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--deep-space);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Page Header ---- */
.page-header {
    padding-top: 120px;
    padding-bottom: 60px;
    background: linear-gradient(180deg, rgba(10, 15, 30, 1) 0%, rgba(13, 18, 32, 1) 100%);
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.15), transparent);
}

/* ---- Prose Content (Article Detail) ---- */
.prose-gold {
    color: #d1d5db;
    line-height: 1.9;
    font-size: 15px;
}

.prose-gold h2 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prose-gold h3 {
    color: #e5e7eb;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose-gold p {
    margin-bottom: 1.25rem;
}

.prose-gold ul, .prose-gold ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose-gold li {
    margin-bottom: 0.5rem;
}

.prose-gold blockquote {
    border-left: 3px solid var(--gold);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-style: italic;
}

.prose-gold a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.prose-gold table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose-gold th {
    background: rgba(26, 31, 46, 0.8);
    color: #e5e7eb;
    padding: 10px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.prose-gold td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
}

/* ---- Responsive ---- */

/* === Large tablets & small laptops (≤1024px) === */
@media (max-width: 1024px) {
    .page-header {
        padding-top: 100px;
        padding-bottom: 48px;
    }
}

/* === Tablets (≤768px) === */
@media (max-width: 768px) {
    .section-heading h2 {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem !important;
    }

    .page-header {
        padding-top: 88px;
        padding-bottom: 36px;
    }

    /* Cards: tighter padding on tablet */
    .card-dark {
        padding: 1.25rem;
    }

    /* Buttons: slightly smaller on tablet */
    .btn-gold,
    .btn-outline-gold {
        padding: 12px 24px;
        font-size: 13px;
    }

    /* Tabs: scrollable with fade hint */
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Timeline: tighter positioning */
    .timeline-line {
        left: 19px;
    }

    .timeline-dot,
    .flow-step .step-number {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    /* Prose: better reading on tablet */
    .prose-gold {
        font-size: 14px;
    }

    .prose-gold h2 {
        font-size: 1.3rem;
    }

    /* Article card image: shorter on tablet */
    .article-card .card-image {
        height: 170px;
    }
}

/* === Mobile phones (≤640px) === */
@media (max-width: 640px) {
    .section-heading h2 {
        font-size: 1.35rem;
        margin-bottom: 10px;
    }

    .section-heading p {
        font-size: 13px;
        line-height: 1.7;
    }

    .section-heading .section-tag {
        font-size: 10px;
        letter-spacing: 0.15em;
        margin-bottom: 8px;
    }

    .hero-title {
        font-size: 1.5rem !important;
        line-height: 1.35 !important;
    }

    /* Buttons: full-width on small phones */
    .btn-gold,
    .btn-outline-gold {
        padding: 12px 20px;
        font-size: 13px;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Cards: compact padding */
    .card-dark {
        padding: 1rem;
    }

    /* Form inputs: larger touch targets */
    .form-input,
    .form-select {
        padding: 14px 16px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    /* Filter buttons: smaller on mobile */
    .filter-btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* Gold accent lines: shorter */
    .gold-line {
        width: 40px;
    }

    .gold-line-center {
        width: 40px;
    }

    /* Article card image: shorter on phone */
    .article-card .card-image {
        height: 150px;
    }

    /* Disable hover transforms on touch devices */
    .card-dark:hover {
        transform: none;
    }

    .article-card:hover {
        transform: none;
    }

    /* Verify layers & risk gates: tighter */
    .verify-layer,
    .risk-gate {
        padding: 12px 14px;
    }

    /* Timeline: compact */
    .timeline-line {
        left: 15px;
    }

    .timeline-dot,
    .flow-step .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Prose tables: horizontal scroll */
    .prose-gold table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .prose-gold th,
    .prose-gold td {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* === Small phones (≤380px) === */
@media (max-width: 380px) {
    .hero-title {
        font-size: 1.3rem !important;
    }

    .section-heading h2 {
        font-size: 1.2rem;
    }

    .btn-gold,
    .btn-outline-gold {
        padding: 11px 16px;
        font-size: 12px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .lang-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
}

/* === Accessibility: reduced motion === */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .animate-float,
    .animate-glow {
        animation: none;
    }

    .card-dark,
    .article-card,
    .verify-layer,
    .risk-gate,
    .nav-link::after,
    .btn-gold::before {
        transition: none;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* === Touch device optimizations === */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover-only effects on touch devices */
    .card-dark:hover {
        transform: none;
        box-shadow: none;
    }

    .article-card:hover {
        transform: none;
    }

    .card-gold-top:hover::before {
        opacity: 0;
    }

    /* Larger touch targets */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .filter-btn {
        min-height: 40px;
    }

    /* Prevent text selection on interactive elements */
    .btn-gold,
    .btn-outline-gold,
    .tab-btn,
    .filter-btn,
    .lang-btn,
    .theme-toggle {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
    }
}

/* ---- Utility Animations ---- */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(201, 168, 76, 0.2); }
    50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.4); }
}

/* ---- Gradient Text ---- */
.text-gradient-gold {
    background: linear-gradient(135deg, var(--gold), var(--copper-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Theme Toggle & Language Switcher
   ======================================== */

/* ---- Theme Toggle ---- */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--gold);
    border-color: rgba(201, 168, 76, 0.3);
    background: rgba(201, 168, 76, 0.06);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle {
    border-color: rgba(0, 0, 0, 0.15);
    color: #4b5563;
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .theme-toggle:hover {
    color: var(--gold);
    border-color: rgba(166, 135, 46, 0.4);
    background: rgba(166, 135, 46, 0.08);
}

/* ---- Language Switcher ---- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px;
    background: transparent;
}
.lang-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: transparent;
    border: none;
    line-height: 1.4;
    text-transform: uppercase;
}
.lang-btn:hover {
    color: var(--gold-light);
}
.lang-btn.active {
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold);
}
[data-theme="light"] .lang-switcher {
    border-color: rgba(0, 0, 0, 0.10);
}
[data-theme="light"] .lang-btn {
    color: #9ca3af;
}
[data-theme="light"] .lang-btn:hover {
    color: var(--gold);
}
[data-theme="light"] .lang-btn.active {
    background: rgba(166, 135, 46, 0.10);
    color: var(--gold);
}

/* ---- Controls group in nav ---- */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile language switcher */
@media (max-width: 1023px) {
    .lang-switcher-desktop { display: none; }
    .theme-toggle-desktop { display: none; }
}
@media (min-width: 1024px) {
    .lang-switcher-mobile { display: none; }
    .theme-toggle-mobile { display: none; }
}

/* ========================================
   Mobile Menu Slide Animation
   ======================================== */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 0;
    display: block !important;
}

#mobile-menu.menu-open {
    max-height: 100vh;
    opacity: 1;
}

/* Override Tailwind hidden when using animation */
#mobile-menu.hidden {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

#mobile-menu .mobile-menu-inner {
    transform: translateY(-8px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.menu-open .mobile-menu-inner {
    transform: translateY(0);
}

/* Mobile menu links: staggered entrance */
#mobile-menu.menu-open a {
    animation: menuItemSlide 0.3s ease forwards;
    opacity: 0;
}

#mobile-menu.menu-open a:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.menu-open a:nth-child(2) { animation-delay: 0.08s; }
#mobile-menu.menu-open a:nth-child(3) { animation-delay: 0.11s; }
#mobile-menu.menu-open a:nth-child(4) { animation-delay: 0.14s; }
#mobile-menu.menu-open a:nth-child(5) { animation-delay: 0.17s; }
#mobile-menu.menu-open a:nth-child(6) { animation-delay: 0.20s; }
#mobile-menu.menu-open a:nth-child(7) { animation-delay: 0.23s; }
#mobile-menu.menu-open .lang-switcher { animation-delay: 0s; opacity: 1; }

@keyframes menuItemSlide {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Safe Area & Viewport Fixes
   ======================================== */

/* Support for notched phones (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
    /* Floating CTA button: respect bottom safe area */
    .fixed.bottom-6.right-6 {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
        right: calc(1.5rem + env(safe-area-inset-right));
    }

    /* Footer: bottom padding for safe area */
    footer > div:last-child {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }

    /* Mobile menu: safe area padding */
    #mobile-menu .mobile-menu-inner {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Dynamic viewport height for hero sections */
@supports (min-height: 100svh) {
    .min-h-screen {
        min-height: 100svh;
    }
}
