/* ============================================================
   GLOBECHART — style.css
   Aesthetic: Dark Observatory / Editorial Data
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1420;
    --bg-tertiary: #141b2b;
    --bg-card: #111827;
    --bg-card-hover: #161f33;

    --text-primary: #e8ecf4;
    --text-secondary: #8b95a8;
    --text-tertiary: #5a6478;
    --text-muted: #3d4659;

    --accent-primary: #3b82f6;
    --accent-primary-dim: rgba(59, 130, 246, 0.12);
    --accent-trade: #f59e0b;
    --accent-macro: #3b82f6;
    --accent-sustain: #10b981;
    --accent-digital: #a78bfa;

    --green: #22c55e;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --red: #ef4444;

    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'Instrument Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --nav-height: 64px;
    --container-max: 1200px;
    --container-pad: 24px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: calc(var(--nav-height) + 32px);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
img { max-width: 100%; display: block; }
input { font-family: inherit; }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* --- Utilities --- */
[data-animate] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
.nav.is-scrolled {
    background: rgba(10, 14, 23, 0.82);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 1px 0 var(--border);
}
.nav__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.nav__logo-icon { color: var(--text-secondary); display: flex; }
.nav__logo-highlight { color: var(--accent-primary); }
.nav__links {
    display: flex;
    gap: 32px;
}
.nav__link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.25s;
    position: relative;
}
.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent-primary);
    transition: width 0.3s var(--ease-out);
}
.nav__link:hover { color: var(--text-primary); }
.nav__link:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 12px; }
.nav__search-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}
.nav__search-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.nav__mobile-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    padding: 4px 0;
}
.nav__mobile-btn span {
    display: block;
    height: 1.5px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Search Overlay */
.search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s var(--ease-out);
}
.search-overlay.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.search-overlay__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    display: flex;
    align-items: center;
    gap: 12px;
}
.search-overlay__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding: 8px 0;
}
.search-overlay__input::placeholder { color: var(--text-tertiary); }
.search-overlay__close {
    color: var(--text-tertiary);
    display: flex;
    transition: color 0.2s;
}
.search-overlay__close:hover { color: var(--text-primary); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px var(--container-pad) 80px;
}
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero__bg canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.hero__grain {
    position: absolute;
    inset: 0;
    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='0.03'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}
.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
}
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 12px;
    background: var(--accent-primary-dim);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 28px;
}
.hero__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
}
.hero__title-accent {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #818cf8 50%, var(--accent-sustain) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.hero__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}
.hero__stat { text-align: center; }
.hero__stat-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}
.hero__stat-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.hero__stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
}

.hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    z-index: 1;
}
.hero__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scroll-bounce 2s infinite;
}
@keyframes scroll-bounce {
    0%, 100% { transform: scaleY(1); transform-origin: top; }
    50% { transform: scaleY(0.4); transform-origin: top; }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.25s var(--ease-out);
    white-space: nowrap;
}
.btn--sm { padding: 9px 18px; font-size: 0.84rem; }
.btn--primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}
.btn--primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}
.btn--ghost {
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.btn--ghost:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 14px 0;
    overflow: hidden;
}
.ticker__track { overflow: hidden; }
.ticker__content {
    display: flex;
    gap: 48px;
    animation: ticker-scroll 40s linear infinite;
    width: max-content;
}
.ticker__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}
.ticker__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.ticker__dot--green { background: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
.ticker__dot--blue { background: var(--blue); box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
.ticker__dot--amber { background: var(--amber); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.ticker__dot--red { background: var(--red); box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header { margin-bottom: 48px; }
.section-header__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-primary);
    margin-bottom: 12px;
}
.section-header__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.section-header__desc {
    color: var(--text-secondary);
    max-width: 520px;
    font-size: 1rem;
    line-height: 1.7;
}

/* ============================================================
   CONTENT PILLARS
   ============================================================ */
.pillars {
    padding: 100px 0;
}
.pillars__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pillar-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.35s var(--ease-out);
    overflow: hidden;
}
.pillar-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.pillar-card__glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.pillar-card:hover .pillar-card__glow { opacity: 1; }

.pillar-card__icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pillar-card__icon-wrap--trade { background: rgba(245, 158, 11, 0.1); color: var(--accent-trade); }
.pillar-card__icon-wrap--macro { background: rgba(59, 130, 246, 0.1); color: var(--accent-macro); }
.pillar-card__icon-wrap--sustain { background: rgba(16, 185, 129, 0.1); color: var(--accent-sustain); }
.pillar-card__icon-wrap--digital { background: rgba(167, 139, 250, 0.1); color: var(--accent-digital); }

.pillar-card__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
}
.pillar-card__desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
    flex: 1;
}
.pillar-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 600;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.pillar-card__meta svg { transition: transform 0.3s var(--ease-out); }
.pillar-card:hover .pillar-card__meta svg { transform: translateX(4px); }
.pillar-card:hover .pillar-card__meta { color: var(--text-secondary); }

/* ============================================================
   FEATURED CHARTS
   ============================================================ */
.featured {
    padding: 80px 0 100px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.featured__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
}
.chart-card--wide {
    grid-row: 1 / 3;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s;
}
.chart-card:hover { border-color: var(--border-light); }

.chart-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.chart-card__tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 100px;
}
.chart-card__tag--macro { background: rgba(59,130,246,0.12); color: var(--accent-macro); }
.chart-card__tag--sustain { background: rgba(16,185,129,0.12); color: var(--accent-sustain); }
.chart-card__tag--trade { background: rgba(245,158,11,0.12); color: var(--accent-trade); }
.chart-card__tag--digital { background: rgba(167,139,250,0.12); color: var(--accent-digital); }

.chart-card__date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.chart-card__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.3;
}
.chart-card--wide .chart-card__title { font-size: 1.35rem; }

.chart-card__canvas-wrap {
    flex: 1;
    min-height: 160px;
    position: relative;
}
.chart-card__canvas-wrap canvas {
    width: 100% !important;
}

.chart-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}
.chart-card__source {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.chart-card__embed-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.chart-card__embed-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-primary-dim);
}

/* ============================================================
   EMBED CTA
   ============================================================ */
.embed-cta {
    padding: 60px 0;
}
.embed-cta__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 36px 40px;
    background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(16,185,129,0.04) 100%);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: var(--radius-xl);
}
.embed-cta__icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary-dim);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}
.embed-cta__text { flex: 1; }
.embed-cta__text h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 6px;
}
.embed-cta__text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================
   METHODOLOGY
   ============================================================ */
.methodology {
    padding: 100px 0;
}
.methodology__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}
.methodology__text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 12px;
}
.methodology__list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.methodology__list li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 16px;
    padding-left: 0;
}
.methodology__list li strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}
.methodology__sources {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.source-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.3s, background 0.3s;
}
.source-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}
.source-card__logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
}
.source-card strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.source-card span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}
.newsletter__inner {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}
.newsletter__inner h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 10px;
}
.newsletter__inner p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}
.newsletter__form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.newsletter__input {
    flex: 1;
    padding: 11px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}
.newsletter__input:focus { border-color: var(--accent-primary); }
.newsletter__input::placeholder { color: var(--text-muted); }
.newsletter__note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    padding: 64px 0 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}
.footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer__tagline {
    color: var(--text-tertiary);
    font-size: 0.88rem;
    margin-top: 12px;
    line-height: 1.6;
    max-width: 260px;
}
.footer__col h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}
.footer__col a {
    display: block;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 5px 0;
    transition: color 0.2s;
}
.footer__col a:hover { color: var(--text-primary); }

.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer__social {
    display: flex;
    gap: 16px;
}
.footer__social a {
    color: var(--text-tertiary);
    transition: color 0.2s;
    display: flex;
}
.footer__social a:hover { color: var(--text-primary); }

/* ============================================================
   EMBED MODAL
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal.is-active { opacity: 1; visibility: visible; }
.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}
.modal__content {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 540px;
    width: 90%;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.3s var(--ease-out);
}
.modal.is-active .modal__content { transform: scale(1) translateY(0); }
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.modal__header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
}
.modal__close {
    color: var(--text-tertiary);
    display: flex;
    padding: 4px;
    transition: color 0.2s;
}
.modal__close:hover { color: var(--text-primary); }
.modal__desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 16px;
    line-height: 1.6;
}
.modal__code-wrap {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
}
.modal__code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    display: block;
    padding-right: 60px;
}
.modal__copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.modal__copy-btn:hover { background: #2563eb; }

/* ============================================================
   INSIGHTS SECTION
   ============================================================ */
.insights {
    padding: 100px 0;
    background: var(--bg-primary);
}
.insights__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.insight-card {
    position: relative;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: all 0.4s var(--ease-out);
    overflow: hidden;
}
.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-sustain));
    opacity: 0;
    transition: opacity 0.4s;
}
.insight-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.insight-card:hover::before { opacity: 1; }

.insight-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary-dim);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    margin-bottom: 20px;
    transition: all 0.4s var(--ease-out);
}
.insight-card:hover .insight-card__icon {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.insight-card h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.3;
}

.insight-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
    margin: 0;
}

/* Chart Insights */
.chart-card__insight {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, rgba(16,185,129,0.03) 100%);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: var(--radius-md);
}
.chart-card__insight svg {
    flex-shrink: 0;
    color: var(--accent-primary);
    margin-top: 2px;
}
.chart-card__insight p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0;
}
.chart-card__insight strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* SDG Section */
.sdg-section {
    padding: 100px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.sdg-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px 44px;
    display: flex;
    align-items: flex-start;
    gap: 36px;
    position: relative;
    overflow: hidden;
}
.sdg-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.sdg-card__badge {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent-primary), #2563eb);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(59,130,246,0.3);
}
.sdg-card__number {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 400;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}
.sdg-card__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.8);
}
.sdg-card__content {
    flex: 1;
}
.sdg-card__content h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.2;
}
.sdg-card__desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 28px;
    line-height: 1.6;
}
.sdg-card__targets {
    margin-bottom: 32px;
}
.sdg-card__targets h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}
.sdg-card__targets ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}
.sdg-card__targets li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    padding-left: 0;
}
.sdg-card__targets strong {
    color: var(--accent-primary);
    font-weight: 700;
}
.sdg-card__progress {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}
.sdg-card__progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
}
.sdg-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--amber));
    border-radius: 100px;
    transition: width 1s var(--ease-out);
}
.sdg-card__progress-text {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
}

/* Charts Section */
.charts-section {
    padding: 100px 0;
    background: var(--bg-primary);
}
.chart-card--featured {
    margin-bottom: 24px;
}
.chart-card__subtitle {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.chart-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Related Topics */
.related-topics {
    padding: 100px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}
.topics__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.topic-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.35s var(--ease-out);
}
.topic-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.topic-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary-dim);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}
.topic-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 4px;
}
.topic-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    flex: 1;
}
.topic-card__arrow {
    color: var(--accent-primary);
    font-size: 1.5rem;
    transition: transform 0.3s var(--ease-out);
}
.topic-card:hover .topic-card__arrow {
    transform: translateX(4px);
}

/* Page Variants */
.hero--compact {
    min-height: auto;
    padding: 120px var(--container-pad) 60px;
}
.hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}
.hero__breadcrumb a {
    color: var(--text-secondary);
    transition: color 0.2s;
}
.hero__breadcrumb a:hover {
    color: var(--text-primary);
}
.hero__breadcrumb svg {
    width: 12px;
    height: 12px;
}
.hero__title--page {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    margin-bottom: 16px;
}
.hero__subtitle--page {
    font-size: 1.05rem;
    max-width: 640px;
    margin-bottom: 0;
}
.hero__stats--inline {
    margin-top: 28px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .pillars__grid { grid-template-columns: 1fr 1fr; }
    .featured__grid { grid-template-columns: 1fr; }
    .chart-card--wide { grid-row: auto; }
    .methodology__grid { grid-template-columns: 1fr; gap: 40px; }
    .insights__grid { grid-template-columns: 1fr; }
    .sdg-card { flex-direction: column; padding: 36px 32px; }
    .sdg-card__targets ul { grid-template-columns: 1fr; }
    .topics__grid { grid-template-columns: repeat(2, 1fr); }
    .chart-card__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --container-pad: 18px; }

    .nav__links { display: none; }
    .nav__mobile-btn { display: flex; }

    .nav__links.is-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 16px var(--container-pad);
        gap: 8px;
    }
    .nav__links.is-open .nav__link {
        padding: 10px 0;
        font-size: 1rem;
    }

    .hero { padding: 100px var(--container-pad) 60px; min-height: 90vh; }
    .hero__stats { gap: 20px; }
    .hero__stat-number { font-size: 1.4rem; }
    .hero__scroll { display: none; }

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

    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer__brand { grid-column: 1 / -1; }
    .footer__bottom { flex-direction: column; gap: 16px; text-align: center; }

    .embed-cta__inner { flex-direction: column; text-align: center; padding: 28px 24px; }
    .newsletter__form { flex-direction: column; }

    .topics__grid { grid-template-columns: 1fr; }
    .sdg-card { padding: 28px 24px; gap: 28px; }
    .sdg-card__content h2 { font-size: 2rem; }
}

@media (max-width: 480px) {
    .hero__title { font-size: 2.4rem; }
    .hero__actions { flex-direction: column; align-items: center; }
    .footer__grid { grid-template-columns: 1fr; }
}
