/*
 * Catalyst Theme — Execution Transformation
 * Bold transformation aesthetic for PE post-close execution research
 * Charcoal + flame orange + amber
 */

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

:root {
    --charcoal: #1C1917;
    --charcoal-800: #292524;
    --charcoal-700: #44403C;
    --charcoal-600: #57534E;
    --flame: #EA580C;
    --flame-dark: #C2410C;
    --flame-light: #FB923C;
    --amber: #F59E0B;
    --amber-light: #FCD34D;
    --muted: #A8A29E;
    --cream: #FFFBEB;
    --cream-warm: #FFF7ED;
    --warm-100: #F5F0E8;
    --white: #FFFFFF;
    --text-primary: #1C1917;
    --text-secondary: #44403C;
    --text-muted: #78716C;
    --border: #D6D3D1;
    --border-light: #E7E5E4;
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

/* === TOPBAR === */

.topbar {
    background: var(--charcoal);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--flame);
}

.topbar-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.topbar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.brand-arrow {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--flame);
    line-height: 1;
}

.brand-text {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--white);
    letter-spacing: -0.01em;
}

.topbar-nav .nav-links {
    display: flex;
    list-style: none;
    gap: 0;
}

.topbar-nav .nav-links li a {
    display: block;
    padding: 1rem 1.1rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-family: 'Sora', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.15s, border-color 0.15s;
    border-bottom: 2px solid transparent;
    line-height: 1.5rem;
}

.topbar-nav .nav-links li a:hover {
    color: var(--white);
    border-bottom-color: var(--flame);
}

.topbar-nav .nav-links li.active a {
    color: var(--white);
    border-bottom-color: var(--flame);
}

/* Nav toggle (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
    z-index: 101;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.7);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* === HERO === */

.hero {
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--charcoal-800) 40%, var(--flame-dark) 100%);
    padding: 5rem 1.5rem 6rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 40px,
        rgba(234,88,12,0.06) 40px,
        rgba(234,88,12,0.06) 80px
    );
    pointer-events: none;
}

.hero-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--cream);
    clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 100%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 48rem;
    margin: 0 auto;
}

.hero-label {
    font-family: 'Sora', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: 'Sora', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.7);
    max-width: 36rem;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.35rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--flame);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--flame-light);
    color: var(--charcoal);
    box-shadow: 0 4px 16px rgba(234,88,12,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,0.08);
}

/* Interior hero (shorter) */
.hero-interior {
    padding: 3.5rem 1.5rem 4.5rem;
}

.hero-interior h1 {
    font-size: 2.25rem;
}

.hero-slim {
    padding: 2.5rem 1.5rem 3.5rem;
}

.hero-slim h1 {
    font-size: 1.85rem;
    margin-bottom: 0;
}

/* === CONTENT AREA === */

.content-wrap {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.35rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

/* === TYPOGRAPHY === */

.content h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--charcoal);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.content h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--flame);
    position: relative;
}

.content h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal-700);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--flame);
}

.content h4 {
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.content a {
    color: var(--flame-dark);
    text-decoration: underline;
    text-decoration-color: var(--flame-light);
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.15s;
}

.content a:hover {
    color: var(--flame);
}

.content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, var(--flame), var(--amber), transparent);
    margin: 2.5rem 0;
}

/* === LISTS === */

.content ul, .content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.25rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.content li strong {
    color: var(--text-primary);
}

/* === TABLES === */

.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    display: block;
}

.content thead th {
    background: var(--charcoal);
    color: var(--white);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.content thead th:first-child {
    border-left: 3px solid var(--flame);
}

.content tbody td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
    background: var(--white);
}

.content tbody tr:hover td {
    background: var(--cream-warm);
}

.content tbody tr:last-child td {
    border-bottom: 3px solid var(--charcoal);
}

.content tbody td:first-child {
    font-weight: 700;
    color: var(--charcoal);
    border-left: 3px solid transparent;
}

.content tbody tr:hover td:first-child {
    border-left-color: var(--flame);
}

/* Harvey ball alignment */
.content td:not(:first-child),
.content th:not(:first-child) {
    text-align: center;
}

/* === HARVEY BALL SPRITE === */
/* Charcoal stroke (#1C1917), flame fill (#EA580C) */

.hb {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAxMjAgMjQiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRkZGRkZGIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFDMTkxNyIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMzYiIGN5PSIxMiIgcj0iMTAiIGZpbGw9IiNGRkZGRkYiLz48cGF0aCBkPSJNMzYsMTIgTDM2LDIgQTEwLDEwIDAgMCwxIDQ2LDEyIFoiIGZpbGw9IiNFQTU4MEMiLz48Y2lyY2xlIGN4PSIzNiIgY3k9IjEyIiByPSIxMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMUMxOTE3IiBzdHJva2Utd2lkdGg9IjIiLz48Y2lyY2xlIGN4PSI2MCIgY3k9IjEyIiByPSIxMCIgZmlsbD0iI0ZGRkZGRiIvPjxwYXRoIGQ9Ik02MCwxMiBMNjAsMiBBMTAsMTAgMCAwLDEgNjAsMjIgWiIgZmlsbD0iI0VBNTgwQyIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iMTIiIHI9IjEwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxQzE5MTciIHN0cm9rZS13aWR0aD0iMiIvPjxjaXJjbGUgY3g9Ijg0IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRkZGRkZGIi8+PHBhdGggZD0iTTg0LDEyIEw4NCwyIEExMCwxMCAwIDEsMSA3NCwxMiBaIiBmaWxsPSIjRUE1ODBDIi8+PGNpcmNsZSBjeD0iODQiIGN5PSIxMiIgcj0iMTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzFDMTkxNyIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMTA4IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSIjRUE1ODBDIi8+PGNpcmNsZSBjeD0iMTA4IiBjeT0iMTIiIHI9IjEwIiBmaWxsPSJub25lIiBzdHJva2U9IiMxQzE5MTciIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPgo=");
    background-repeat: no-repeat;
    background-size: 110px 22px;
    vertical-align: middle;
    position: relative;
}

.hb-1 { background-position: 0 0; }
.hb-2 { background-position: -22px 0; }
.hb-3 { background-position: -44px 0; }
.hb-4 { background-position: -66px 0; }
.hb-5 { background-position: -88px 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* === BLOCKQUOTES === */

.content blockquote {
    border-left: 4px solid var(--flame);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--cream-warm);
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 0.35rem 0.35rem 0;
}

.content blockquote p:last-child {
    margin-bottom: 0;
}

.content blockquote strong {
    font-style: normal;
}

/* === CODE === */

.content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.83em;
    background: var(--warm-100);
    padding: 0.15em 0.4em;
    border-radius: 0.2rem;
    color: var(--text-primary);
}

.content pre {
    background: var(--charcoal);
    color: #E7E5E4;
    padding: 1.25rem 1.5rem;
    border-radius: 0.35rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--flame);
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* === GLOSSARY INDEX PAGE === */

.glossary-index-page .content ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.glossary-index-page .content ul li {
    margin: 0;
    padding: 0;
}

.glossary-index-page .content ul li a {
    display: block;
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--flame);
    border-radius: 0 0.35rem 0.35rem 0;
    text-decoration: none;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--charcoal);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.glossary-index-page .content ul li a:hover {
    border-left-color: var(--amber);
    box-shadow: 0 4px 12px rgba(28,25,23,0.08);
    transform: translateY(-1px);
}

/* === GLOSSARY ENTRY PAGE === */

.glossary-entry-page .content h2 {
    font-size: 1.15rem;
    margin-top: 2rem;
}

.glossary-entry-page .content h2::after {
    content: '';
    display: block;
    width: 2rem;
    height: 2px;
    background: var(--flame);
    margin-top: 0.35rem;
}

.glossary-entry-page .content {
    border-left: 3px solid var(--border-light);
    padding-left: 1.5rem;
}

/* === COMPARISON PAGE === */

.comparison-page .content table {
    font-size: 0.82rem;
}

.comparison-page .content tbody td:first-child {
    min-width: 160px;
}

/* === LANDSCAPE PAGE === */

.landscape-page .content {
    max-width: 100%;
}

.landscape-page .content table {
    font-size: 0.8rem;
}

/* === FOOTER === */

.site-footer {
    background: var(--charcoal);
    color: rgba(255,255,255,0.45);
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-top: 3px solid var(--flame);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--amber);
}

.footer-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.footer-arrow {
    color: var(--flame);
    font-size: 1.25rem;
    font-weight: 800;
}

.footer-disclosure {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.footer-edition {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    html { font-size: 16px; }

    .nav-toggle {
        display: flex;
    }

    .topbar-nav .nav-links {
        display: none;
        position: absolute;
        top: 3.5rem;
        left: 0;
        right: 0;
        background: var(--charcoal-800);
        flex-direction: column;
        border-bottom: 3px solid var(--flame);
        padding: 0.5rem 0;
    }

    .topbar-nav .nav-links.open {
        display: flex;
    }

    .topbar-nav .nav-links li a {
        text-align: center;
        padding: 0.65rem 1rem;
        border-bottom: none;
    }

    .topbar-nav .nav-links li.active a {
        border-bottom: none;
        color: var(--flame);
    }

    .topbar-inner {
        position: relative;
    }

    .hero {
        padding: 3rem 1rem 4rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-interior {
        padding: 2rem 1rem 3rem;
    }

    .hero-interior h1 {
        font-size: 1.65rem;
    }

    .hero-slim {
        padding: 1.5rem 1rem 2.5rem;
    }

    .hero-slim h1 {
        font-size: 1.35rem;
    }

    .content-wrap {
        padding: 1.5rem 1rem 3rem;
    }

    .glossary-index-page .content ul {
        grid-template-columns: 1fr;
    }

    .glossary-entry-page .content {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.65rem;
    }

    .hero-subtitle {
        font-size: 0.88rem;
    }

    .content h1 {
        font-size: 1.5rem;
    }

    .content h2 {
        font-size: 1.15rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .brand-text {
        font-size: 0.9rem;
    }
}
