/* ═══════════════════════════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Legend ── */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.9rem;
    /* min 0.9rem */
    font-weight: 500;
    color: var(--chart-text-secondary);
    letter-spacing: 0.01em;
}

.legend-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Mulish', sans-serif;
    font-size: 1rem;
    /* min 0.9rem */
    font-weight: 500;
    color: var(--chart-text-secondary);
    letter-spacing: 0.01em;
}

.legend-title {
    font-family: 'Mulish', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--chart-text-secondary);
    letter-spacing: 0.01em;
    margin-right: 0.5em;
}


.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 500px;
    flex-shrink: 0;
}

.legend-line {
    width: 16px;
    height: 2.5px;
    border-radius: 1px;
    flex-shrink: 0;
}


/* ── Chart title block ── */

.chart-title {
    font-family: 'Commissioner', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.025em;
    color: var(--chart-text-primary);
    margin-bottom: 18px;
    text-align: center;
}

.chart-subtitle {
    font-family: 'Mulish', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--chart-text-secondary);
    line-height: 1.45;
    padding-bottom: 6px;
}

.subtitle-highlight {
    font-weight: 600;
}

.chart-grid-title {
    font-family: 'Commissioner', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.18;
    color: var(--chart-text-primary);
}

/* ── Footer ── */
.chart-footer-block {
    margin-top: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    align-items: start;
}

.chart-source {
    font-family: 'Mulish', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--chart-text-muted);
    line-height: 1.45;
}

.chart-source strong {
    font-weight: 600;
}

.chart-credit {
    font-family: 'Mulish', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--chart-text-muted);
    white-space: nowrap;
}


/* ─────────────────────────────────────────────────────────────
   Colour theme
   ───────────────────────────────────────────────────────────── */
:root,
[data-theme="dark"] {

    /* ── Core hues (categorical) ── */
    --c-violet: #5238A8;
    --c-magenta: #D957CB;
    --c-cyan: #23A8C3;
    --c-orange: #F9932F;
    --c-yellow: #F4CF25;
    --c-green: #8FD14F;
    --c-grey: #8282A0;
    --c-red: #E8454A;
    --c-blue: #4A82E8;


    /* Tints (area fills, backgrounds) */
    --c-violet-tint: rgba(98, 68, 200, 0.2);
    --c-magenta-tint: rgba(217, 87, 203, 0.16);
    --c-cyan-tint: rgba(35, 168, 195, 0.16);
    --c-orange-tint: rgba(249, 147, 47, 0.16);
    --c-yellow-tint: rgba(244, 207, 37, 0.16);
    --c-green-tint: rgba(143, 209, 79, 0.16);
    --c-grey-tint: #57576A;

    /* Shades (hover, depth) */
    --c-violet-dark: #4a33a8;
    --c-magenta-dark: #a83e9b;
    --c-cyan-dark: #187d91;
    --c-orange-dark: #c96e18;
    --c-yellow-dark: #c9a800;
    --c-green-dark: #65a02e;
    --c-grey-dark: #2B2B3B;

    /* Light variants (labels on filled shapes) */
    --c-violet-light: #a590e8;
    --c-magenta-light: #f09be8;
    --c-cyan-light: #80d4e4;
    --c-orange-light: #fcbe87;
    --c-yellow-light: #f9e580;
    --c-green-light: #c0e895;


    /* ── Chart canvas ── */
    --chart-bg: #050216;
    --chart-bg-alt: #0d0a28;
    --chart-border: #221d44;
    --chart-border-subtle: rgba(255, 255, 255, 0.15);


    /* ── Chart text ── */
    --chart-text-primary: #f0edf8;
    --chart-text-secondary: #c9c7d5;
    --chart-text-muted: #706c96;

    /* ── Hero background blobs ── */
    --grad-hero-bg:
        radial-gradient(ellipse at 18% 55%, rgba(98, 68, 200, 0.28) 0%, transparent 58%),
        radial-gradient(ellipse at 80% 18%, rgba(217, 87, 203, 0.16) 0%, transparent 52%),
        radial-gradient(ellipse at 62% 82%, rgba(35, 168, 195, 0.12) 0%, transparent 50%);

    /* ── Buttons (solid, no gradient) ── */
    --btn-primary-bg: var(--c-violet);
    --btn-primary-bg-hover: #7358d8;
    --btn-primary-text: #ffffff;
    --btn-secondary-border: #3a3560;
    --btn-secondary-border-hover: var(--c-cyan);
    --btn-secondary-text: var(--page-text);
    --btn-secondary-text-hover: var(--c-cyan);
    --btn-secondary-bg-hover: rgba(35, 168, 195, 0.08);

    /* ── Slider ── */
    --slider-track: #2a2550;
    --slider-thumb: var(--c-cyan);
    --slider-thumb-shadow: 0 0 8px rgba(35, 168, 195, 0.45);

    /* ── Form inputs ── */
    --input-bg: var(--page-surface-3);
    --input-border: var(--page-border);
    --input-border-focus: var(--c-cyan);
    --input-focus-ring: rgba(35, 168, 195, 0.2);
    --input-placeholder: var(--page-text-muted);

    /* ── Swatch border for light swatches ── */
    --swatch-border: transparent;

    /* page background */
    --page-bg: #1D1934;

    /* chart border */
    --chart-box-shadow: 0 0 0 1px rgba(var(--c-violet-rgb), 0.3),
        0 0 32px rgba(var(--c-violet-rgb), 0.08);
}

[data-theme="light"] {

    /* ── Core hues — adjusted for FEFBF7 background ── */
    --c-violet: #3D2A8A;
    --c-magenta: #B83FAA;
    --c-cyan: #23A8C3;
    --c-orange: #E07818;
    --c-yellow: #E3B81F;
    --c-green: #0E8C6A;
    --c-grey: #5a5878;
    --c-red: #C42B30;
    --c-blue: #2A5EC4;

    --c-violet-tint: rgba(61, 42, 138, 0.1);
    --c-magenta-tint: rgba(184, 63, 170, 0.1);
    --c-cyan-tint: rgba(26, 136, 160, 0.1);
    --c-orange-tint: rgba(224, 120, 24, 0.1);
    --c-yellow-tint: rgba(176, 136, 0, 0.1);
    --c-green-tint: rgba(14, 140, 106, 0.1);
    --c-grey-tint: #D8D8DA;

    --c-violet-dark: #2a1a6a;
    --c-magenta-dark: #8a2880;
    --c-cyan-dark: #0e6070;
    --c-orange-dark: #b85c08;
    --c-yellow-dark: #886400;
    --c-green-dark: #0a6a50;

    --c-violet-light: #6a56b8;
    --c-magenta-light: #d870c8;
    --c-cyan-light: #50b8d0;
    --c-orange-light: #f0a860;
    --c-yellow-light: #d4b040;
    --c-green-light: #40b890;

    /* ── Chart canvas ── */
    --chart-bg: #FEFBF7;
    --chart-bg-alt: #f5f0e8;
    --chart-border: #ddd8cc;
    --chart-border-subtle: rgba(0, 0, 0, 0.07);
    --chart-box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;

    /* ── Chart text ── */
    --chart-text-primary: #18142a;
    --chart-text-secondary: #4a4668;
    --chart-text-muted: #8a8698;

    /* ── Hero background blobs (lighter) ── */
    --grad-hero-bg:
        radial-gradient(ellipse at 18% 55%, rgba(61, 42, 138, 0.12) 0%, transparent 58%),
        radial-gradient(ellipse at 80% 18%, rgba(184, 63, 170, 0.08) 0%, transparent 52%),
        radial-gradient(ellipse at 62% 82%, rgba(26, 136, 160, 0.07) 0%, transparent 50%);

    /* ── Buttons ── */
    --btn-primary-bg: var(--c-violet);
    --btn-primary-bg-hover: #5040aa;
    --btn-primary-text: #ffffff;
    --btn-secondary-border: #c8c2d8;
    --btn-secondary-border-hover: var(--c-cyan);
    --btn-secondary-text: var(--page-text);
    --btn-secondary-text-hover: var(--c-cyan);
    --btn-secondary-bg-hover: rgba(26, 136, 160, 0.08);

    /* ── Slider ── */
    --slider-track: #d5cfc0;
    --slider-thumb: var(--c-violet);
    --slider-thumb-shadow: 0 0 8px rgba(61, 42, 138, 0.35);

    /* ── Form inputs ── */
    --input-bg: #ffffff;
    --input-border: var(--page-border);
    --input-border-focus: var(--c-cyan);
    --input-focus-ring: rgba(26, 136, 160, 0.18);
    --input-placeholder: #a8a4b8;

    /* ── Swatch border for very light swatches ── */
    --swatch-border: rgba(0, 0, 0, 0.1);

    /* page background */
    --page-bg: #ffffff;
}


/* ═══════════════════════════════════════════════════════════════
   TAG
   ═══════════════════════════════════════════════════════════════ */
.tag {
    display: inline-flex;
    align-items: center;
    font-family: 'Mulish', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.45em 0.8em;
    border-radius: 12px;
    background: var(--page-surface-2);
    color: var(--page-text-muted);
    border: 1px solid var(--page-border);
}

.tag-cyan {
    background: var(--c-cyan-tint);
    color: var(--c-cyan);
    border-color: rgba(35, 168, 195, 0.28);
}

.tag-violet {
    background: var(--c-violet-tint);
    color: var(--c-violet);
    border-color: rgba(98, 68, 200, 0.28);
}

.tag-mag {
    background: var(--c-magenta-tint);
    color: var(--c-magenta);
    border-color: rgba(217, 87, 203, 0.28);
}

.tag-orange {
    background: var(--c-orange-tint);
    color: var(--c-orange);
    border-color: rgba(249, 147, 47, 0.28);
}

/* ═══════════════════════════════════════════════════════════════
   BODY
   ═══════════════════════════════════════════════════════════════ */
p {
    font-family: 'Mulish', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    color: var(--page-text)
}

h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--page-text)
}

a {
    color: var(--c-cyan);
    text-decoration: underline;
    transition: color 0.15s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
    min-height: 50svh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 0px;
    background-color: var(--chart-bg);
}

.hero-container {
    display: flex;
    max-width: 1000px;
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 48px);
    width: 100%;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 860px;
}

.hero-meta {
    font-family: 'Mulish', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-cyan);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-title {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(2.6rem, 6.5vw, 6.5rem);
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -0.04em;
    color: var(--chart-text-primary);
    margin-bottom: 24px;
}

/* Gradient text — kept as decorative element */
.hero-title-accent {
    background: linear-gradient(135deg, var(--c-violet) 0%, var(--c-magenta) 45%, var(--c-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    padding-bottom: 0.15em;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--chart-text-secondary);
    line-height: 1.65;
    max-width: 50ch;
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-palette {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.hero-swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.hero-swatch:hover {
    transform: scale(1.3) translateY(-4px);
}

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

/* Fade up animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.d1 {
    animation-delay: 0.08s;
}

.d2 {
    animation-delay: 0.16s;
}

.d3 {
    animation-delay: 0.24s;
}

.d4 {
    animation-delay: 0.33s;
}

.d5 {
    animation-delay: 0.42s;
}

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--chart-text-secondary);
    background: var(--chart-bg);
    color: var(--chart-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--chart-text-secondary);
    color: var(--chart-bg);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION STRUCTURE
   ═══════════════════════════════════════════════════════════════ */
section {
    padding-block: 25px;
}

.section-title-block {
    padding-bottom: 35px;
    display: flex;
    flex-direction: column;
    gap: 6px;

}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto;
    padding: 6px;
    background-color: #ffffff;
}

@media (max-width: 500px) {
    .hero {
        padding-top: 64px;
        align-items: flex-start;
    }

    .hero .hero-container {
        display: flex;
        justify-content: flex-start;
    }

    .hero-content {
        text-align: left;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

@media (max-width: 620px) {

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}