/* ==========================================================================
   Design tokens — Ledger Dashboard
   ========================================================================== */
:root {
    /* Paper (light / default) — warm, muted manila ledger paper */
    --paper: #efece3;
    --paper-raised: #fbfaf6;
    --ink: #1f1c14;
    --ink-soft: #4f4a3d;
    --ink-faint: #615b4b;

    --emerald: #0b6e4f;
    --emerald-deep: #084f39;
    --emerald-tint: #e4efe7;
    --on-emerald: #f7f9f4;

    --rule: rgba(31, 28, 20, 0.14);
    --rule-strong: rgba(31, 28, 20, 0.22);
    --spine: rgba(11, 110, 79, 0.28);

    --shadow-elevate: 0 8px 24px -12px rgba(31, 28, 20, 0.18);

    --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Spline Sans Mono', 'SFMono-Regular', Consolas, monospace;

    --container-width: 1100px;
    --section-padding: 6rem;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme {
    --paper: #0d1210;
    --paper-raised: #131a17;
    --ink: #f4f1e8;
    --ink-soft: #a9b3ac;
    --ink-faint: #7e8880;

    --emerald: #2fcb93;
    --emerald-deep: #1f9c70;
    --emerald-tint: #11251c;
    --on-emerald: #0a1210;

    --rule: rgba(244, 241, 232, 0.14);
    --rule-strong: rgba(244, 241, 232, 0.24);
    --spine: rgba(47, 203, 147, 0.3);

    --shadow-elevate: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

body {
    font-family: var(--font-body);
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

::selection {
    background: var(--emerald);
    color: var(--on-emerald);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--paper);
}

::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border-radius: 6px;
}

:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ==========================================================================
   Ledger spine — the continuous rule running through every section
   ========================================================================== */
.ledger-rule {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(50vw - min(50vw - 1.25rem, calc(var(--container-width) / 2 + 0.75rem)));
    width: 2px;
    background: var(--spine);
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   Typography & shared classes
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

p {
    color: var(--ink-soft);
    margin-bottom: 1rem;
    font-size: 1.0625rem;
    max-width: 68ch;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section-heading {
    font-size: 1.75rem;
    padding-bottom: 1.25rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--rule);
}

.text-center {
    text-align: center;
}

.text-center p {
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--emerald);
    color: var(--on-emerald);
}

.btn-primary:hover {
    background: var(--emerald-deep);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule-strong);
}

.btn-secondary:hover {
    border-color: var(--emerald);
    color: var(--emerald);
}

.btn-large {
    padding: 1rem 2.25rem;
    font-size: 1rem;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.25rem 0;
    transition: var(--transition-smooth);
    background: transparent;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    padding: 0.875rem 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    white-space: nowrap;
}

.brand-mark {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    color: var(--emerald);
}

.brand-trail {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--ink-faint);
    display: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--ink-soft);
    position: relative;
    padding-bottom: 0.35rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--emerald);
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--ink);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 4px;
    color: var(--ink-soft);
    background: none;
    border: none;
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--emerald);
    background: var(--emerald-tint);
}

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

.mobile-menu-btn {
    display: none;
}

/* ==========================================================================
   Hero — record header
   ========================================================================== */
.hero {
    min-height: 100vh;
    padding-top: 9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-record {
    max-width: 720px;
}

.hero-name {
    font-size: clamp(2.75rem, 6vw, 4rem);
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.record-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.field {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1rem;
    align-items: baseline;
}

.field dt {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.field dd {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
}

.field-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    flex-shrink: 0;
}

.hero-desc {
    font-size: 1.1875rem;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--ink-faint);
}

/* KPI row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    max-width: 720px;
}

.kpi-tile {
    background: var(--emerald);
    color: var(--on-emerald);
    padding: 1.5rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.kpi-label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--on-emerald);
    opacity: 0.85;
}

body.dark-theme .kpi-label {
    color: var(--on-emerald);
    opacity: 0.75;
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: start;
}

.panel-card {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 2rem;
    box-shadow: var(--shadow-elevate);
}

.panel-title {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.expertise-fields {
    display: flex;
    flex-direction: column;
}

.expertise-field {
    padding: 1.25rem 0;
    border-top: 1px solid var(--rule);
}

.expertise-field:first-child {
    border-top: none;
    padding-top: 0;
}

.expertise-field:last-child {
    padding-bottom: 0;
}

.expertise-field dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--emerald);
    margin-bottom: 0.4rem;
}

.expertise-field dd {
    font-size: 0.9375rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

/* ==========================================================================
   Experience — ledger
   ========================================================================== */
.ledger {
    list-style: none;
}

.ledger-entry {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--rule);
}

.ledger-entry:last-child {
    border-bottom: 1px solid var(--rule);
}

.entry-mark {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--emerald);
    border: 2px solid var(--emerald);
    outline: 1px solid var(--emerald);
    outline-offset: 2px;
    border-radius: 2px;
    padding: 0.3rem 0.6rem;
    height: fit-content;
    text-align: center;
    transform: rotate(-2.5deg);
}

.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.entry-title {
    font-size: 1.25rem;
}

.entry-date {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--ink-faint);
    white-space: nowrap;
}

.entry-company {
    color: var(--emerald);
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.entry-scope {
    color: var(--ink-faint);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-width: 62ch;
}

.entry-highlights {
    padding-left: 0;
    color: var(--ink-soft);
    list-style: none;
}

.entry-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    line-height: 1.55;
    font-size: 0.9375rem;
}

.entry-highlights li svg {
    width: 14px;
    height: 14px;
    margin-top: 0.3em;
    color: var(--ink-faint);
    flex-shrink: 0;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-panel {
    max-width: 640px;
    margin: 0 auto;
    padding: 3.5rem 2.5rem;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: 4px;
    box-shadow: var(--shadow-elevate);
}

.contact-desc {
    max-width: 480px;
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.contact-actions {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    padding: 2rem 0;
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-container p {
    margin: 0;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    color: var(--ink-faint);
}

.footer-links a {
    color: var(--ink-faint);
    display: flex;
}

.footer-links a:hover {
    color: var(--emerald);
}

/* ==========================================================================
   Reveal animation — single authored moment
   ========================================================================== */
.reveal-up, .reveal-right {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.active, .reveal-right.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Media queries
   ========================================================================== */
@media (min-width: 640px) {
    .brand-trail {
        display: inline;
    }
}

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .brand-trail {
        display: none;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links.mobile-active {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--paper);
        padding: 1.5rem 2rem;
        gap: 1.25rem;
        border-bottom: 1px solid var(--rule);
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .kpi-row {
        grid-template-columns: 1fr;
    }

    .ledger-entry {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .entry-mark {
        width: fit-content;
    }
}
