:root {
    --bg: #e8edf1;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #fdfefe;
    --ink: #18222d;
    --muted: #586472;
    --line: rgba(24, 34, 45, 0.11);
    --accent: #1f4f78;
    --accent-deep: #163955;
    --accent-soft: #d6e3ee;
    --shadow: 0 24px 60px rgba(27, 45, 61, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.65;
    background:
        radial-gradient(circle at top left, rgba(31, 79, 120, 0.16), transparent 34%),
        radial-gradient(circle at top right, rgba(85, 107, 128, 0.12), transparent 30%),
        linear-gradient(180deg, #f5f8fa 0%, var(--bg) 55%, #dde5eb 100%);
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(245, 248, 250, 0.82);
    border-bottom: 1px solid var(--line);
}

.nav-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--ink);
    background: rgba(31, 79, 120, 0.12);
    transform: translateY(-1px);
}

.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.hero-panel,
.page-intro,
.timeline-card,
.text-card,
.resume-frame-card {
    animation: rise 700ms ease both;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy,
.hero-card,
.timeline-card,
.text-card,
.resume-frame-card,
.project-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 3rem;
}

.hero-copy h1,
.page-intro h1 {
    font-size: clamp(2.7rem, 5vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    margin-top: 0.65rem;
}

.hero-summary,
.page-intro p,
.text-card p,
.project-card p,
.timeline-card li,
.hero-card p {
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-summary {
    max-width: 42rem;
    margin-top: 1.4rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.9rem 1.4rem;
    text-decoration: none;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--accent);
    color: #f8fbfd;
    box-shadow: 0 14px 30px rgba(31, 79, 120, 0.24);
}

.button-primary:hover {
    background: var(--accent-deep);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    border: 1px solid var(--line);
}

.hero-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(214, 227, 238, 0.72)),
        var(--surface-strong);
}

.card-label,
.eyebrow {
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

.hero-card h2 {
    font-size: 1.8rem;
    line-height: 1.1;
    margin: 0.7rem 0;
}

.hero-stat-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: 2rem;
}

.hero-stat-list div {
    padding: 1.15rem 1rem;
    min-height: 5.0rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.credential-logos {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    align-items: stretch;
}

.credential-logo-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.1rem 0.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.credential-logo-item img {
    width: 100%;
    max-width: 72px;
    height: 56px;
    object-fit: contain;
}

.credential-logo-item span {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.3;
}

.stat-number {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}

.stat-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.content-section,
.page-intro,
.portfolio-grid,
.resume-frame-card,
.timeline-card {
    margin-top: 2rem;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h2 {
    font-size: clamp(1.9rem, 3vw, 3rem);
    line-height: 1.05;
    margin-top: 0.5rem;
}

.text-card {
    padding: 2rem;
}

.text-card p + p {
    margin-top: 1rem;
}

.page-intro {
    padding: 2.4rem 0 0.5rem;
    max-width: 50rem;
}

.timeline-card {
    padding: 2rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.role-company {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

.timeline-header h2 {
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 0.35rem;
}

.role-dates {
    white-space: nowrap;
    color: var(--muted);
    font-weight: 700;
}

.detail-list {
    padding-left: 1.2rem;
}

.detail-list li + li {
    margin-top: 0.9rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.project-card {
    padding: 1.2rem;
    animation: rise 800ms ease both;
}

.project-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    z-index: 0;
    cursor: pointer;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.project-link:hover {
    transform: translateY(-8px);
    z-index: 2;
    box-shadow: 0 30px 64px rgba(27, 45, 61, 0.18);
    border-color: rgba(31, 79, 120, 0.24);
    background: rgba(255, 255, 255, 0.9);
}

.project-link:hover .project-image {
    transform: scale(1.04);
    filter: saturate(1.05) contrast(1.02);
}

.project-link:hover .project-content h2 {
    color: var(--accent);
}

.project-link:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.project-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    box-shadow: inset 0 0 0 1px rgba(31, 79, 120, 0.08);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    background: #dbe4eb;
    transition: transform 260ms ease, filter 260ms ease;
}

.project-content {
    padding: 1.2rem 0.25rem 0.2rem;
}

.project-details {
    max-height: 5.8rem;
    overflow: hidden;
    transition: max-height 320ms ease;
}

.project-card-expand:hover .project-details {
    max-height: 48rem;
}

.project-image-contain {
    object-fit: contain;
    padding: 1rem;
    background: #f0f4f7;
}

.project-details p + p {
    margin-top: 0.85rem;
}

.project-details ul {
    padding-left: 1.2rem;
    margin: 0;
}

.project-details ul li {
    margin-bottom: 0.55rem;
    line-height: 1.55;
}

.project-card h2 {
    font-size: 1.45rem;
    margin-bottom: 0.7rem;
    transition: color 220ms ease;
}

.resume-frame-card {
    padding: 1rem;
}

.feature-panel {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: minmax(300px, 1.05fr) minmax(0, 1.15fr);
    gap: 1.2rem;
}

.feature-visual-card,
.feature-text-card,
.resource-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.feature-visual-card {
    padding: 1rem;
}

.feature-image {
    width: 100%;
    height: 100%;
    min-height: 20rem;
    object-fit: cover;
    border-radius: 20px;
    display: block;
    background: #dbe4eb;
}

.feature-text-card {
    padding: 2rem;
}

.feature-text-card h2 {
    font-size: 2rem;
    line-height: 1.08;
    margin: 0.65rem 0 1rem;
}

.feature-text-card p + p {
    margin-top: 1rem;
}

.subsection-title {
    font-size: 1.25rem;
    line-height: 1.15;
    margin-top: 1.35rem;
    margin-bottom: 0.85rem;
}

.resource-grid {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.resource-card {
    padding: 1.6rem;
}

.resource-kicker {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

.resource-card h3 {
    font-size: 1.4rem;
    line-height: 1.15;
    margin: 0.55rem 0 0.75rem;
}

.resource-card p {
    color: var(--muted);
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.15rem;
}

.resource-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: var(--accent);
    background: rgba(31, 79, 120, 0.08);
    border: 1px solid rgba(31, 79, 120, 0.11);
}

.resource-links a:hover {
    background: rgba(31, 79, 120, 0.14);
}

.resume-frame {
    width: 100%;
    min-height: 78vh;
    border: 0;
    border-radius: 20px;
    background: #ffffff;
}

/* ── Flight Controls long-form page ─────────────────── */

.story-section {
    margin-top: 3rem;
}

.story-card {
    margin-top: 1.5rem;
}

.figure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.inline-figure {
    display: flex;
    flex-direction: column;
}

.inline-figure img {
    width: 100%;
    border-radius: 18px;
    display: block;
    background: #dbe4eb;
    object-fit: cover;
}

.inline-figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

.equation-block {
    margin: 1.5rem 0;
    padding: 1.25rem 1.75rem;
    background: rgba(31, 79, 120, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    font-family: "Courier New", monospace;
    font-size: 0.93rem;
    color: var(--ink);
    line-height: 1.9;
}

.equation-block .eq-label {
    font-family: Georgia, serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin-bottom: 0.5rem;
    display: block;
}

.subsection-h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.65rem;
    color: var(--ink);
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.stat-pill {
    display: inline-flex;
    flex-direction: column;
    padding: 0.85rem 1.15rem;
    border-radius: 18px;
    background: rgba(31, 79, 120, 0.06);
    border: 1px solid rgba(31, 79, 120, 0.13);
    min-width: 130px;
}

.stat-pill .pill-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
    font-family: "Courier New", monospace;
}

.stat-pill .pill-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.3rem;
    line-height: 1.35;
}

/* ── Controls Coursework collapsible sections ──────── */

.course-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.course-section {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 4px 20px rgba(27, 45, 61, 0.07);
    overflow: hidden;
}

.course-section summary {
    padding: 1.25rem 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
    background: var(--surface-strong);
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}

.course-section[open] summary {
    border-bottom-color: var(--line);
}

.course-section summary::-webkit-details-marker {
    display: none;
}

.course-section summary span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    flex: 1;
}

.course-section summary::after {
    content: "+";
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent);
    margin-left: 1rem;
    flex-shrink: 0;
    line-height: 1;
}

.course-section[open] summary::after {
    content: "\2212";
}

.course-section-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.course-section-body p {
    line-height: 1.7;
}

.course-intro-text {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.75;
}

.course-video-link {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
    transition: background 0.15s;
}

.course-video-link:hover {
    background: var(--accent-deep);
}

.figure-caption {
    margin-top: 0.6rem;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ────────────────────────────────────────────────── */

.site-footer {
    padding: 2rem 1.5rem 3rem;
    text-align: center;
    color: var(--muted);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .hero-panel,
    .portfolio-grid,
    .feature-panel,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .timeline-header {
        flex-direction: column;
    }

    .role-dates {
        white-space: normal;
    }
}

@media (max-width: 720px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        justify-content: flex-start;
    }

    .page-shell {
        padding: 2rem 1rem 4rem;
    }

    .hero-copy,
    .hero-card,
    .timeline-card,
    .text-card,
    .project-card,
    .resume-frame-card {
        padding: 1.35rem;
        border-radius: 22px;
    }

    .hero-copy h1,
    .page-intro h1 {
        font-size: 2.5rem;
    }

    .resume-frame {
        min-height: 70vh;
    }
}
