:root {
    --bg: #FFF8F3;
    --bg-alt: #FFEFE5;
    --text: #1C0F07;
    --text-muted: #7A6355;
    --accent: #1FC8A9;
    --accent-light: #D4F5EE;
    --border: #EDD8C8;
    --white: #FFFFFF;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --max-width: 1100px;
    --section-pad: 5rem;
}

[data-theme="dark"] {
    --bg: #130D08;
    --bg-alt: #1C1309;
    --text: #F5EDE5;
    --text-muted: #967E72;
    --accent: #1FC8A9;
    --accent-light: #0B2E24;
    --border: #2A1B10;
    --white: #1A1008;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── Password gate ── */
.password-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.password-gate.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-gate-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.password-gate-icon {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.password-gate-name {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.password-gate-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.password-gate-form {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.password-gate-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.password-gate-input:focus {
    border-color: var(--accent);
}

.password-gate-input.shake {
    animation: shake 0.4s ease;
    border-color: #e05252;
}

.password-gate-btn {
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.password-gate-btn:hover {
    opacity: 0.85;
}

.password-gate-error {
    font-size: 0.875rem;
    color: #e05252;
    opacity: 0;
    transition: opacity 0.2s;
    min-height: 1.25rem;
}

.password-gate-error.visible {
    opacity: 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* ── Nav ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
    transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
    background: rgba(255, 248, 243, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--border);
}

[data-theme="dark"] .nav.scrolled {
    background: rgba(19, 13, 8, 0.95);
}

/* ── Theme toggle ── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: flex; }
[data-theme="dark"] .theme-toggle .icon-sun { display: flex; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
    color: var(--text);
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-telescope {
    display: block;
    transition: color 0.3s;
}

/* The animated part of the telescope — tilts on hover */
.scope-group {
    transform-box: view-box;
    transform-origin: 12px 13px;
    transition: transform 0.6s ease-in-out;
}

.nav-logo:hover .scope-group {
    transform: rotate(-15deg);
    transition-duration: 0.8s;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* ── Hero ── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    position: relative;
}

.hero-content {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
}

.hero-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 700;
    line-height: 1.02;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.1875rem);
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.65;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.hero-cta:hover {
    opacity: 0.65;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.hero-scroll-indicator span {
    display: block;
    width: 1px;
    height: 3rem;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.9; }
}

/* ── Sections ── */
.section {
    padding: var(--section-pad) 2rem;
}

.section--alt {
    background-color: var(--bg-alt);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 3rem;
    align-items: start;
}

.section-label {
    padding-top: 0.25rem;
}

.section-label span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-muted);
    position: sticky;
    top: 5.5rem;
    display: block;
}

.section-body p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.0625rem;
}

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

/* ── Content links ── */
.section-body a,
.bio-lead a,
.education-freelance-item a,
.timeline-desc a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.section-body a:hover,
.bio-lead a:hover,
.education-freelance-item a:hover,
.timeline-desc a:hover {
    border-bottom-color: var(--accent);
}

.bio-lead {
    font-size: 1.25rem !important;
    color: var(--text) !important;
    font-weight: 500;
}

/* ── Timeline ── */
.timeline-item {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.timeline-item:last-child {
    border-bottom: 1px solid var(--border);
}

.timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.timeline-company {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
}

.timeline-company a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.timeline-company a:hover {
    border-bottom-color: var(--accent);
}

.timeline-period {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.timeline-role {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.625rem;
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

.timeline-item--group .timeline-roles {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-subrole {
    padding: 1rem 0 1rem 1.25rem;
    border-left: 2px solid var(--accent-light);
    margin-bottom: 0.75rem;
}

.timeline-subrole:last-child {
    margin-bottom: 0;
}

.timeline-subrole-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}

.timeline-subrole .timeline-role {
    font-size: 1.0625rem;
    margin-bottom: 0;
}

.timeline-subrole .timeline-period {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.timeline-subrole .timeline-desc {
    font-size: 0.9rem;
}

/* ── Work Grid ── */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.work-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.work-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(109, 40, 217, 0.09);
}

.work-card-tag {
    font-size: 0.71875rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.work-card h3 {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.625rem;
    line-height: 1.3;
}

.work-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ── Skills ── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem 2rem;
}

.skill-group h4 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 1rem;
}

.skill-group ul {
    list-style: none;
}

.skill-group ul li {
    font-size: 0.9375rem;
    color: var(--text-muted);
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
}

.skill-group ul li:last-child {
    border-bottom: none;
}

/* ── Project / Work cards ── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.project-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.project-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-card-img img {
    transform: scale(1.03);
}

/* Placeholder state (no image) */
.project-card-img svg {
    background: repeating-linear-gradient(
        45deg,
        var(--bg-alt),
        var(--bg-alt) 10px,
        var(--bg) 10px,
        var(--bg) 20px
    );
    width: 100%;
    height: 100%;
    padding: calc(50% - 16px);
    box-sizing: border-box;
}

.project-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.project-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.project-card-body h3 {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.project-card-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

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

/* ── Education ── */
.education-details {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.education-row {
    display: flex;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.education-label {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    min-width: 6rem;
}

.education-row--freelance {
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
}

.education-freelance-item {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.education-freelance-item strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Speaking & Partnerships ── */
.speaking-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.speaking-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.speaking-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(109,40,217,0.08);
    transform: translateX(3px);
}

.speaking-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.speaking-card-venue {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.speaking-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.speaking-card-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.speaking-card:hover .speaking-card-arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* ── Contact ── */
.contact-block {
    text-align: center;
    max-width: 580px;
    margin: 0 auto;
    padding: 2rem 0;
}

.contact-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.contact-heading {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.contact-links a {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.contact-links a:hover {
    opacity: 0.65;
}

/* ── Footer ── */
.footer {
    padding: 2rem;
    border-top: 1px solid var(--border);
}

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

.footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.theme-toggle--footer {
    display: none;
}

/* ── Hamburger & mobile nav ── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .theme-toggle:not(.theme-toggle--footer) {
        display: none;
    }

    .theme-toggle--footer {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 2rem 1.5rem;
        gap: 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

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

    .nav-links li {
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.875rem 0;
        font-size: 1rem;
    }
}

/* ── Reveal animation ── */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .section-label span {
        position: static;
    }

    .work-grid {
        grid-template-columns: 1fr 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .hero {
        padding: 7rem 1.5rem 4rem;
    }
}

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

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .section {
        padding: 3.5rem 1.5rem;
    }
}
