/* ═══════════════════════════════════════════════
   PandaDoc EM Career Matrix — Design System
   ═══════════════════════════════════════════════ */

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

:root {
    /* ── Emerald (Primary — M3) — Brand palette ── */
    --primary-10: #E7F0EE;
    --primary-20: #CDDED9;
    --primary-30: #B9CDC7;
    --primary-40: #87B5A7;
    --primary: #248567;
    --primary-dark: #1d6a52;
    --primary-darker: #16503e;

    --primary-lighter: var(--primary-10);
    --primary-light: var(--primary-20);

    /* ── Coral (M4) — Brand palette ── */
    --coral-10: #FFEAE7;
    --coral-20: #FFC9BF;
    --coral-30: #FFB3A6;
    --coral-40: #FF826C;

    /* ── Amethyst (Director — future) — Brand palette ── */
    --amethyst-10: #EEE8FF;
    --amethyst-20: #D6CEFF;
    --amethyst-30: #C5BCFF;
    --amethyst-40: #A496FF;

    /* ── Sand — Backgrounds ── */
    --sand-10: #F8F5F3;
    --sand-20: #EEE9E1;
    --sand-30: #D4C7B1;

    /* ── Black (Senior Director — future) ── */
    --black: #242424;

    /* ── Neutral borders ── */
    --border-light: #EEEBE8;
    --border: #E2DFDB;
    --border-strong: #D4D1CD;

    /* ── Brand text — only #242424 or #ffffff per brand guide ── */
    --text-primary: #242424;
    --text-secondary: rgba(36, 36, 36, 0.75);
    --text-tertiary: rgba(36, 36, 36, 0.45);
    --text-inverse: #ffffff;

    /* ── Surfaces ── */
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --page-bg: var(--sand-10);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(27,29,36,0.04);
    --shadow-sm: 0 1px 3px rgba(27,29,36,0.06), 0 1px 2px rgba(27,29,36,0.04);
    --shadow-md: 0 4px 12px rgba(27,29,36,0.07), 0 1px 3px rgba(27,29,36,0.04);
    --shadow-lg: 0 8px 24px rgba(27,29,36,0.08), 0 2px 6px rgba(27,29,36,0.04);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Layout */
    --header-h: 56px;
    --nav-h: 52px;
    --max-w: 1280px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    background: var(--page-bg);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ─── Fade-in animation ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
.header {
    height: var(--header-h);
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

.header-context {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════
   AREA NAVIGATION
   ═══════════════════════════════════════════════ */
.area-nav {
    height: var(--nav-h);
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 223, 219, 0.6);
    position: sticky;
    top: 0;
    z-index: 90;
}

.area-nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.area-nav-inner::-webkit-scrollbar { display: none; }

.area-tab {
    position: relative;
    padding: 0 1.125rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.area-tab:hover {
    color: var(--text-primary);
}

.area-tab.active {
    color: var(--primary);
    font-weight: 600;
}

.area-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.area-tab.active::after {
    opacity: 1;
    transform: scaleX(1);
}


/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
.main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}


/* ═══════════════════════════════════════════════
   SECTION
   ═══════════════════════════════════════════════ */
.section {
    margin-bottom: 4rem;
    scroll-margin-top: calc(var(--nav-h) + 24px);
    animation: fadeUp 0.5s ease-out both;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }
.section:nth-child(6) { animation-delay: 0.5s; }

.section-header {
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 720px;
}


/* ═══════════════════════════════════════════════
   CARDS GRID — side by side
   ═══════════════════════════════════════════════ */
.cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}


/* ═══════════════════════════════════════════════
   LEVEL CARD
   ═══════════════════════════════════════════════ */
.level-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.level-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

/* ── Card header ── */
.card-header {
    padding: 1.375rem 1.75rem 1.125rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-light);
}

/* M3 card header */
.level-card.m3 .card-header {
    background: var(--primary-20);
    border-bottom-color: var(--primary-30);
}

/* M4 card header */
.level-card.m4 .card-header {
    background: var(--coral-20);
    border-bottom-color: var(--coral-30);
}

.card-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3125rem 0.75rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    min-width: 40px;
}

.level-card.m3 .card-level {
    background: var(--primary);
    color: #fff;
}

.level-card.m4 .card-level {
    background: var(--coral-40);
    color: #fff;
}

.card-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* ── Card body ── */
.card-body {
    padding: 1.5rem 1.75rem 1.75rem;
}


/* ═══════════════════════════════════════════════
   CARD META (Area of Impact)
   ═══════════════════════════════════════════════ */
.card-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.meta-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.meta-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 5.5rem;
}


/* ═══════════════════════════════════════════════
   CONTENT / DESCRIPTION
   ═══════════════════════════════════════════════ */
.content-group {
    margin-bottom: 1.5rem;
}

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

.content-group + .content-group {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.content-label {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.level-card.m3 .content-label {
    color: var(--primary-dark);
}

.level-card.m4 .content-label {
    color: var(--coral-40);
}

.content-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.875rem;
}

.content-list {
    list-style: none;
}

.content-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
    line-height: 1.5;
}

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

.content-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.level-card.m3 .content-bullet {
    background: var(--primary);
}

.level-card.m4 .content-bullet {
    background: var(--coral-40);
}


/* ═══════════════════════════════════════════════
   EXPANDABLE SECTIONS
   ═══════════════════════════════════════════════ */
.expandable {
    margin-top: 0.875rem;
}

.expand-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0;
    width: 100%;
    text-align: left;
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
}

.level-card.m3 .expand-toggle {
    color: var(--primary);
}

.level-card.m4 .expand-toggle {
    color: var(--coral-40);
}

.level-card.m3 .expand-toggle:hover {
    color: var(--primary-dark);
}

.level-card.m4 .expand-toggle:hover {
    color: var(--coral-40);
    filter: brightness(0.85);
}

.expand-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.expand-toggle.open .expand-icon {
    transform: rotate(180deg);
}

.expand-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                margin 0.25s ease;
    margin-top: 0;
}

.expand-toggle.open + .expand-content {
    max-height: 1200px;
    opacity: 1;
    margin-top: 0.75rem;
}


/* ═══════════════════════════════════════════════
   DETAIL SECTIONS (Behaviors / Success)
   ═══════════════════════════════════════════════ */
/* Behaviors section — solid left border */
.detail-section {
    padding: 0.875rem 0 0.875rem 1.125rem;
    margin-bottom: 1rem;
    border-left: 3px solid transparent;
    border-radius: 0;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.level-card.m3 .detail-section {
    border-left-color: var(--primary-40);
}

.level-card.m4 .detail-section {
    border-left-color: var(--coral-40);
}

.detail-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.level-card.m3 .detail-title {
    color: var(--primary);
}

.level-card.m4 .detail-title {
    color: var(--coral-40);
}

.detail-title svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 0.625rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.level-card.m3 .detail-bullet {
    background: var(--primary-40);
}

.level-card.m4 .detail-bullet {
    background: var(--coral-40);
}


/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════
   FOCUS & ACCESSIBILITY
   ═══════════════════════════════════════════════ */
.area-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.level-card.m3 .expand-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.level-card.m4 .expand-toggle:focus-visible {
    outline: 2px solid var(--coral-40);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
    .cards-container {
        grid-template-columns: 1fr;
    }

    .section-subtitle {
        padding-left: 0;
    }
}

@media (max-width: 640px) {
    .header-inner {
        padding: 0 1rem;
    }

    .header-context {
        display: none;
    }

    .header-divider {
        display: none;
    }

    .main {
        padding: 1.5rem 1rem 3rem;
    }

    .area-nav-inner {
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.375rem;
    }

    .card-header {
        padding: 1.125rem 1.25rem 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .footer-inner {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
}
