/**
 * themes.css - Per-standard visual identity system
 *
 * CSS custom properties with body.theme-* class overrides.
 * Pages opt into a theme by adding a class to <body>.
 * Hub pages (no body class) use the default :root tokens.
 */

/* ══════════════════════════════════════════════════════
   ROOT TOKENS — defaults for hub/shared pages
   ══════════════════════════════════════════════════════ */
:root {
    /* Structural tokens (never change per-theme) */
    --bg-base: #0a0a0f;
    --bg-card: rgba(15, 12, 25, 0.7);
    --bg-card-subtle: rgba(15, 12, 25, 0.5);
    --text-primary: #e8e4ef;
    --text-secondary: #9a93a8;
    --text-muted: #706a7e;
    --radius-card: 12px;
    --radius-small: 8px;
    --blur-card: 12px;

    /* Brand palette (always available on every page) */
    --color-vibes: #00c8d4;
    --color-vibes-bright: #5de8f0;
    --color-vibes-rgb: 0, 200, 212;
    --color-verify: #e8587a;
    --color-verify-bright: #f0849e;
    --color-verify-rgb: 232, 88, 122;
    --color-evolve: #d4723c;
    --color-evolve-bright: #e8956a;
    --color-evolve-rgb: 212, 114, 60;
    --color-prism: #9b6dd7;
    --color-prism-bright: #b794f4;
    --color-prism-rgb: 155, 109, 215;

    /* Active theme accent (default = cyan for hub pages) */
    --accent: var(--color-vibes);
    --accent-bright: var(--color-vibes-bright);
    --accent-rgb: var(--color-vibes-rgb);

    /* Derived tokens (auto-computed from --accent-rgb) */
    --accent-bg-subtle: rgba(var(--accent-rgb), 0.04);
    --accent-bg-light: rgba(var(--accent-rgb), 0.08);
    --accent-bg-medium: rgba(var(--accent-rgb), 0.15);
    --accent-border-subtle: rgba(var(--accent-rgb), 0.06);
    --accent-border-light: rgba(var(--accent-rgb), 0.1);
    --accent-border-medium: rgba(var(--accent-rgb), 0.15);
    --accent-border-strong: rgba(var(--accent-rgb), 0.3);
    --accent-glow: rgba(var(--accent-rgb), 0.25);
    --accent-text-shadow: rgba(var(--accent-rgb), 0.3);

    /* Card stripe gradient (default = full sunset) */
    --stripe-gradient: linear-gradient(90deg, #e8587a, #d4723c, #00c8d4);

    /* Background atmosphere (default = existing cyan grid + coral/cyan blooms) */
    --grid-color: rgba(var(--accent-rgb), 0.03);
    --bloom-bottom: rgba(232, 88, 122, 0.06);
    --bloom-top: rgba(0, 200, 212, 0.04);
}

/* ══════════════════════════════════════════════════════
   THEME OVERRIDES — per-standard accent palettes
   ══════════════════════════════════════════════════════ */

/* ── VIBES (Cyan) ────────────────────────────────────── */
body.theme-vibes {
    --accent: #00c8d4;
    --accent-bright: #5de8f0;
    --accent-rgb: 0, 200, 212;
    --stripe-gradient: linear-gradient(90deg, #00c8d4, #5de8f0, #00c8d4);
    --grid-color: rgba(0, 200, 212, 0.03);
    --bloom-bottom: rgba(0, 200, 212, 0.04);
    --bloom-top: rgba(0, 200, 212, 0.06);
}

/* ── VERIFY (Coral) ──────────────────────────────────── */
body.theme-verify {
    --accent: #e8587a;
    --accent-bright: #f0849e;
    --accent-rgb: 232, 88, 122;
    --stripe-gradient: linear-gradient(90deg, #e8587a, #f0849e, #e8587a);
    --grid-color: rgba(232, 88, 122, 0.025);
    --bloom-bottom: rgba(232, 88, 122, 0.06);
    --bloom-top: rgba(232, 88, 122, 0.03);
}

/* ── EVOLVE (Orange) ─────────────────────────────────── */
body.theme-evolve {
    --accent: #d4723c;
    --accent-bright: #e8956a;
    --accent-rgb: 212, 114, 60;
    --stripe-gradient: linear-gradient(90deg, #d4723c, #e8956a, #d4723c);
    --grid-color: rgba(212, 114, 60, 0.025);
    --bloom-bottom: rgba(212, 114, 60, 0.05);
    --bloom-top: rgba(212, 114, 60, 0.03);
}

/* ── PRISM (Purple) ─────────────────────────────────── */
body.theme-prism {
    --accent: #9b6dd7;
    --accent-bright: #b794f4;
    --accent-rgb: 155, 109, 215;
    --stripe-gradient: linear-gradient(90deg, #9b6dd7, #b794f4, #9b6dd7);
    --grid-color: rgba(155, 109, 215, 0.025);
    --bloom-bottom: rgba(155, 109, 215, 0.05);
    --bloom-top: rgba(155, 109, 215, 0.03);
}

/* ── VIBES-Low (Green, child of VIBES — keeps cyan grid) */
body.theme-vibes-low {
    --accent: #4caf50;
    --accent-bright: #66bb6a;
    --accent-rgb: 76, 175, 80;
    --stripe-gradient: linear-gradient(90deg, #4caf50, #66bb6a, #4caf50);
    --grid-color: rgba(0, 200, 212, 0.03);
    --bloom-bottom: rgba(76, 175, 80, 0.04);
    --bloom-top: rgba(0, 200, 212, 0.04);
}

/* ── VIBES-Medium (Orange, child of VIBES — keeps cyan grid) */
body.theme-vibes-medium {
    --accent: #d4723c;
    --accent-bright: #e8956a;
    --accent-rgb: 212, 114, 60;
    --stripe-gradient: linear-gradient(90deg, #d4723c, #e8956a, #d4723c);
    --grid-color: rgba(0, 200, 212, 0.03);
    --bloom-bottom: rgba(212, 114, 60, 0.04);
    --bloom-top: rgba(0, 200, 212, 0.04);
}

/* ── VIBES-High (Coral, child of VIBES — keeps cyan grid) */
body.theme-vibes-high {
    --accent: #e8587a;
    --accent-bright: #f0849e;
    --accent-rgb: 232, 88, 122;
    --stripe-gradient: linear-gradient(90deg, #e8587a, #f0849e, #e8587a);
    --grid-color: rgba(0, 200, 212, 0.03);
    --bloom-bottom: rgba(232, 88, 122, 0.04);
    --bloom-top: rgba(0, 200, 212, 0.04);
}

/* ══════════════════════════════════════════════════════
   THEMED BODY BACKGROUND — grid + bloom atmosphere
   ══════════════════════════════════════════════════════ */
body.theme-vibes,
body.theme-verify,
body.theme-evolve,
body.theme-prism,
body.theme-vibes-low,
body.theme-vibes-medium,
body.theme-vibes-high {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
        radial-gradient(ellipse at 50% 100%, var(--bloom-bottom) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, var(--bloom-top) 0%, transparent 50%);
}

/* ══════════════════════════════════════════════════════
   THEMED CARD STRIPES
   ══════════════════════════════════════════════════════ */
body.theme-vibes .content-section::before,
body.theme-vibes .section-container::before,
body.theme-verify .content-section::before,
body.theme-verify .section-container::before,
body.theme-evolve .content-section::before,
body.theme-evolve .section-container::before,
body.theme-prism .content-section::before,
body.theme-prism .section-container::before,
body.theme-vibes-low .content-section::before,
body.theme-vibes-low .section-container::before,
body.theme-vibes-medium .content-section::before,
body.theme-vibes-medium .section-container::before,
body.theme-vibes-high .content-section::before,
body.theme-vibes-high .section-container::before {
    background: var(--stripe-gradient);
}

/* ══════════════════════════════════════════════════════
   THEMED CARD BORDERS AND HOVER GLOW
   ══════════════════════════════════════════════════════ */
body.theme-vibes .content-section,
body.theme-vibes .section-container,
body.theme-verify .content-section,
body.theme-verify .section-container,
body.theme-evolve .content-section,
body.theme-evolve .section-container,
body.theme-prism .content-section,
body.theme-prism .section-container,
body.theme-vibes-low .content-section,
body.theme-vibes-low .section-container,
body.theme-vibes-medium .content-section,
body.theme-vibes-medium .section-container,
body.theme-vibes-high .content-section,
body.theme-vibes-high .section-container {
    border-color: rgba(var(--accent-rgb), 0.1);
}

body.theme-vibes .content-section:hover,
body.theme-vibes .section-container:hover,
body.theme-verify .content-section:hover,
body.theme-verify .section-container:hover,
body.theme-evolve .content-section:hover,
body.theme-evolve .section-container:hover,
body.theme-prism .content-section:hover,
body.theme-prism .section-container:hover,
body.theme-vibes-low .content-section:hover,
body.theme-vibes-low .section-container:hover,
body.theme-vibes-medium .content-section:hover,
body.theme-vibes-medium .section-container:hover,
body.theme-vibes-high .content-section:hover,
body.theme-vibes-high .section-container:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(var(--accent-rgb), 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* ══════════════════════════════════════════════════════
   THEMED HEADINGS, LINKS, AND HIGHLIGHTS
   ══════════════════════════════════════════════════════ */
body[class*="theme-"] h1 {
    text-shadow: 0 0 20px var(--accent-text-shadow);
}

body[class*="theme-"] .content-section h2,
body[class*="theme-"] .section-container h2 {
    color: var(--accent);
    border-bottom-color: var(--accent-border-medium);
}

body[class*="theme-"] a {
    color: var(--accent);
}

body[class*="theme-"] a:hover {
    color: var(--accent-bright);
}

body[class*="theme-"] .highlight {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-text-shadow);
}

/* ══════════════════════════════════════════════════════
   SHARED COMPONENT STYLES — extracted from assurance pages
   These were duplicated across vibes-low/medium/high,
   differing only in color values. Now tokenized.
   ══════════════════════════════════════════════════════ */

/* ── Hero badge ──────────────────────────────────────── */
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--accent-bg-medium);
    color: var(--accent);
    border: 1px solid var(--accent-border-strong);
    margin-bottom: 16px;
}

/* ── Hero question ───────────────────────────────────── */
.hero-question {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 12px;
    max-width: 700px;
    text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
}

/* ── Hero answer ─────────────────────────────────────── */
.hero-answer {
    font-size: 1.05rem;
    color: #9a93a8;
    max-width: 700px;
    margin: 0 auto 8px;
    line-height: 1.8;
}

/* ── Hero overhead ───────────────────────────────────── */
.hero-overhead {
    font-size: 0.9rem;
    color: #706a7e;
    margin: 0 auto;
}

.hero-overhead strong {
    color: var(--accent);
}

/* ── Data list ───────────────────────────────────────── */
.data-list {
    text-align: left;
    max-width: 800px;
    margin: 16px auto;
    padding: 0;
    list-style: none;
}

.data-list li {
    text-align: left;
    color: #9a93a8;
    font-size: 0.95rem;
    line-height: 2;
    padding: 4px 0;
    border-bottom: 1px solid var(--accent-border-subtle);
}

.data-list li:last-child {
    border-bottom: none;
}

.data-list li code {
    color: var(--accent);
    font-size: 0.88rem;
}

.data-list li .required-tag {
    display: inline-block;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

.data-list li .optional-tag {
    display: inline-block;
    background: rgba(112, 106, 126, 0.15);
    color: #706a7e;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

.data-list li .inherited-tag {
    display: inline-block;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

/* ── Use cases ───────────────────────────────────────── */
.use-cases {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    margin: 20px auto;
}

.use-case {
    background: var(--accent-bg-subtle);
    border: 1px solid var(--accent-border-light);
    border-radius: 10px;
    padding: 18px 20px;
    text-align: left;
}

.use-case h4 {
    color: var(--accent);
    font-size: 1rem;
    margin: 0 0 6px;
    text-align: left;
}

.use-case p {
    color: #9a93a8;
    font-size: 0.9rem;
    margin: 0;
    max-width: none;
    text-align: left;
    line-height: 1.7;
}

/* ── Audience list ───────────────────────────────────── */
.audience-list {
    text-align: left;
    max-width: 700px;
    margin: 16px auto;
    padding: 0;
    list-style: none;
}

.audience-list li {
    text-align: left;
    color: #9a93a8;
    font-size: 0.95rem;
    line-height: 2;
    padding: 4px 0 4px 20px;
    position: relative;
}

.audience-list li::before {
    content: '\2713';
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: 600;
}

/* ── Implementation steps ────────────────────────────── */
.impl-steps {
    text-align: left;
    max-width: 800px;
    margin: 16px auto;
    counter-reset: impl-step;
}

.impl-step {
    background: rgba(15, 12, 25, 0.5);
    border: 1px solid var(--accent-border-light);
    border-radius: 10px;
    padding: 18px 20px 18px 56px;
    margin-bottom: 12px;
    position: relative;
    text-align: left;
}

.impl-step::before {
    counter-increment: impl-step;
    content: counter(impl-step);
    position: absolute;
    left: 18px;
    top: 18px;
    width: 26px;
    height: 26px;
    background: var(--accent-bg-medium);
    color: var(--accent);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-border-strong);
}

.impl-step h4 {
    color: #e8e4ef;
    font-size: 0.95rem;
    margin: 0 0 6px;
    text-align: left;
}

.impl-step p {
    color: #9a93a8;
    font-size: 0.9rem;
    margin: 0;
    max-width: none;
    text-align: left;
    line-height: 1.7;
}

.impl-step code {
    color: var(--accent);
    font-size: 0.85rem;
}

.impl-step .new-tag {
    display: inline-block;
    background: var(--accent-bg-medium);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── JSON examples ───────────────────────────────────── */
.json-example {
    background: rgba(15, 12, 25, 0.8);
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: 8px;
    padding: 16px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #c8c0d8;
    white-space: pre;
    overflow-x: auto;
    text-align: left;
    margin: 16px auto;
    max-width: 800px;
    line-height: 1.5;
}

.json-example * {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.json-example .json-key { color: var(--accent); }
.json-example .json-string { color: #d4723c; }
.json-example .json-number { color: #e8587a; }
.json-example .json-bool { color: #00c8d4; }
.json-example .json-null { color: #706a7e; }
.json-example .json-comment,
.json-example .comment { color: #706a7e; font-style: italic; }

/* ── JSON toggle (collapsible) ───────────────────────── */
details.json-toggle {
    margin: 12px auto;
    max-width: 800px;
}

details.json-toggle summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.9rem;
    padding: 8px 0;
    transition: color 0.3s ease;
}

details.json-toggle summary:hover {
    color: var(--accent-bright);
}

/* ── Level navigation ────────────────────────────────── */
.level-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 24px auto;
    max-width: 800px;
}

.level-nav-link {
    display: inline-block;
    background: linear-gradient(135deg, rgba(232, 88, 122, 0.1), rgba(0, 200, 212, 0.1));
    color: #00c8d4;
    padding: 10px 22px;
    border: 1px solid rgba(0, 200, 212, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.level-nav-link:hover {
    background: linear-gradient(135deg, rgba(232, 88, 122, 0.2), rgba(0, 200, 212, 0.2));
    border-color: #00c8d4;
    box-shadow: 0 0 16px rgba(0, 200, 212, 0.12);
    transform: translateY(-2px);
    color: #5de8f0;
}

.level-nav-link.current {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent-border-strong);
    color: var(--accent);
    cursor: default;
}

.level-nav-link.current:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent-border-strong);
    box-shadow: none;
    transform: none;
    color: var(--accent);
}

/* ── Security callout ────────────────────────────────── */
.security-callout {
    background: rgba(232, 88, 122, 0.06);
    border: 1px solid rgba(232, 88, 122, 0.15);
    border-left: 3px solid #e8587a;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px auto;
    max-width: 800px;
    text-align: left;
}

.security-callout h4 {
    color: #e8587a;
    font-size: 0.95rem;
    margin: 0 0 8px;
    text-align: left;
}

.security-callout p {
    color: #9a93a8;
    font-size: 0.88rem;
    margin: 0;
    max-width: none;
    text-align: left;
    line-height: 1.7;
}

.security-callout code {
    color: var(--accent);
    font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES — shared component breakpoints
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-question {
        font-size: 1.3rem;
    }

    .json-example {
        font-size: 0.7rem;
        padding: 12px;
    }

    .impl-step {
        padding-left: 48px;
    }

    .use-case {
        padding: 14px 16px;
    }
}
