/* ==============================================================
   why-what-how.css
   Shared styles for why.html, what.html, how.html.
   Loaded after styles.css. Inherits all theme tokens, header,
   footer, buttons, and typography from the main stylesheet.
   ============================================================== */

/* Page wrapper sits below the fixed header (60-72px) and above the footer.
   We stretch to fill the viewport so the closer strip hugs the bottom on
   tall screens while still scrolling cleanly on short ones. */
.ww-page {
    /* The fixed header is ~76–80px tall (logo + button min-height +
       padding). Padding-top must always exceed it; otherwise the
       eyebrow / hero is hidden behind the header at small viewports
       (<800 tall). */
    padding-top: clamp(92px, 11vh, 108px);
    padding-bottom: clamp(16px, 2.5vh, 28px);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 22px);
    min-height: calc(100vh - 120px);
}

/* ── Hero strip ───────────────────────────────────────────────── */
.ww-hero {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 12px);
    max-width: 920px;
}

.ww-eyebrow {
    display: inline-block;
    font-size: clamp(11px, 1.4vw, 13px);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}

.ww-h1 {
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.02em;
}

.ww-lede {
    font-size: clamp(14px, 1.4vw, 16px);
    line-height: 1.5;
    color: var(--text-dim);
    margin: 0;
    max-width: 80ch;
}

.ww-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: clamp(2px, 0.6vh, 6px);
}

/* ── Pillar grid ──────────────────────────────────────────────── */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 1.4vw, 20px);
    flex: 1 1 auto;
}

.pillar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: clamp(12px, 1.3vw, 18px);
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.6vh, 8px);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.pillar:hover {
    border-color: rgba(var(--accent-rgb), 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.08);
}

.pillar-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    flex-shrink: 0;
}

.pillar-icon svg {
    width: 18px;
    height: 18px;
}

.pillar-title {
    font-size: clamp(15px, 1.4vw, 17px);
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.pillar-body {
    font-size: clamp(13px, 1.05vw, 14px);
    line-height: 1.55;
    color: var(--text-dim);
    margin: 0;
    flex: 1 1 auto;
}

.pillar-link {
    margin-top: auto;
    align-self: flex-start;
    font-size: clamp(12px, 1vw, 13px);
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.pillar-link:hover {
    border-bottom-color: var(--accent);
}

/* ── Closer strip ─────────────────────────────────────────────── */
.ww-closer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 1.6vw, 20px);
    padding: clamp(10px, 1.4vh, 14px) clamp(14px, 1.6vw, 20px);
    background: linear-gradient(135deg,
        rgba(var(--primary-rgb), 0.12),
        rgba(var(--accent-rgb), 0.08));
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.ww-closer p {
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 500;
    color: var(--text);
    margin: 0;
}

.ww-closer .btn-primary,
.ww-closer .btn-secondary {
    flex-shrink: 0;
}

/* ── Why narrative variant ────────────────────────────────────── */
.story-column {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.8vh, 20px);
    max-width: 880px;
    flex: 1 1 auto;
}

.story-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    font-weight: 500;
    margin-left: 4px;
}
.story-link:hover { border-bottom-color: var(--accent); }

.story-beat {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: clamp(14px, 2vw, 22px);
    align-items: start;
}

.story-num {
    font-size: clamp(40px, 5vw, 56px);
    font-weight: 700;
    line-height: 1;
    color: rgba(var(--accent-rgb), 0.35);
    font-feature-settings: "tnum";
    letter-spacing: -0.04em;
}

.story-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.story-eyebrow {
    font-size: clamp(11px, 1.3vw, 13px);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}

.story-body {
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    max-width: 60ch;
}

.story-body strong {
    color: var(--text);
    background: linear-gradient(180deg, transparent 70%, rgba(var(--accent-rgb), 0.25) 70%);
    padding: 0 2px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1279px) {
    .pillar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .pillar-grid {
        grid-template-columns: 1fr;
    }
    .story-beat {
        grid-template-columns: 44px 1fr;
        gap: 12px;
    }
    .story-num {
        font-size: 36px;
    }
    .ww-closer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Light theme tweaks (the rest is inherited from styles.css tokens) */
[data-theme="light"] .pillar {
    box-shadow: 0 1px 4px rgba(13, 30, 44, 0.05);
}
[data-theme="light"] .story-num {
    color: rgba(1, 190, 178, 0.35);
}
[data-theme="light"] .story-body strong {
    background: linear-gradient(180deg, transparent 70%, rgba(1, 190, 178, 0.22) 70%);
}
[data-theme="light"] .ww-closer {
    background: linear-gradient(135deg, rgba(1, 190, 178, 0.10), rgba(67, 114, 195, 0.06));
}

/* ── Q&A list (faq.html). Class names use `qa-` prefix to avoid the
   legacy `.faq-item` IntersectionObserver fade-in hook in script.min.js
   (which sets opacity:0 on first paint and never recovers on tall pages). */
.qa-section {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vh, 14px);
    margin-top: clamp(16px, 2vh, 24px);
}

.qa-section + .qa-section {
    margin-top: clamp(20px, 2.6vh, 32px);
}

.qa-section-title {
    font-size: clamp(11px, 1.3vw, 13px);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 4px;
}

.qa-item {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--card-bg);
    padding: clamp(12px, 1.4vh, 18px) clamp(14px, 1.6vw, 20px);
    transition: border-color 0.2s;
}

.qa-item:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
}

.qa-q {
    font-size: clamp(15px, 1.4vw, 16px);
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    margin: 0 0 8px;
}

.qa-a {
    font-size: clamp(13px, 1.05vw, 14px);
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0;
    max-width: 80ch;
}

[data-theme="light"] .qa-item {
    box-shadow: 0 1px 4px rgba(13, 30, 44, 0.05);
}

/* ── Comparison table (compare.html) ─────────────────────────── */
.cmp-wrap {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
}

.cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(12px, 1.05vw, 14px);
    line-height: 1.5;
    min-width: 900px;
}

.cmp-table th,
.cmp-table td {
    padding: clamp(10px, 1.4vh, 14px) clamp(10px, 1.2vw, 16px);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--card-border);
}

.cmp-table thead th {
    font-weight: 600;
    font-size: clamp(11px, 1.05vw, 13px);
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(var(--accent-rgb), 0.06);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.cmp-table thead th:first-child {
    color: var(--text-dim);
    background: transparent;
}

.cmp-table tbody th {
    font-weight: 600;
    color: var(--text);
    width: 22%;
    background: rgba(var(--primary-rgb), 0.04);
}

.cmp-table tbody td {
    color: var(--text-dim);
}

.cmp-table tbody td.cmp-kdcube {
    color: var(--text);
    background: rgba(var(--accent-rgb), 0.06);
    font-weight: 500;
}

.cmp-table tbody tr:last-child th,
.cmp-table tbody tr:last-child td {
    border-bottom: 0;
}

.cmp-note {
    font-size: clamp(12px, 1vw, 13px);
    color: var(--text-muted);
    margin: 0;
    max-width: 80ch;
}

[data-theme="light"] .cmp-wrap {
    box-shadow: 0 1px 4px rgba(13, 30, 44, 0.05);
}
