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

:root {
    --cream: #f5f1e8;
    --dark-cream: #e8e0d5;
    --charcoal: #2c2c2c;
    --gold: #c9a961;
    --bronze: #8b6f47;

    /* Modal backdrop — overridden by dark mode in theme.css */
    --modal-overlay-bg: rgba(0, 0, 0, 0.55);
    --modal-overlay-blur: 4px;
    --modal-scanline: rgba(255, 255, 255, 0.03);

    /* Scroll-area thumb — subtle at rest */
    --scrollbar-thumb: rgba(139, 111, 71, 0.4);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.8;
    overflow-x: hidden;
    /* Firefox custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--bronze) var(--dark-cream);
}

/* Webkit custom scrollbar (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bronze);
    border-radius: 5px;
    border: 2px solid var(--dark-cream);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 40px;
    position: relative;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.hero.compact {
    min-height: auto;
    padding: 25px 40px;
    background: rgba(245, 241, 232, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.hero.compact .hero-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-direction: row;
    min-width: 0;
    margin-right: 60px; /* clearance for the fixed close button */
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 60px;
    border: 3px solid var(--gold);
    padding: 3px;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: block;
    overflow: hidden;
}

.logo.fade-out {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.logo.hidden {
    visibility: hidden;
}

a.logo {
    text-decoration: none;
}

.hero.compact .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    position: relative;
    flex-shrink: 0;
}

.hero.compact .logo img {
    transform: scale(1.15) translate(1%, 2%);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3em, 6vw, 6em);
    font-weight: 300;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

h1 a {
    color: inherit;
    text-decoration: none;
}

.hero.compact .logo,
.hero.compact h1 {
    cursor: pointer;
}

.hero.compact h1 {
    font-size: clamp(2em, 3vw, 3em);
    margin-bottom: 0;
    text-align: left;
    display: inline;
    flex-shrink: 0; /* name never truncates */
}

.tagline {
    font-size: clamp(1em, 2vw, 1.4em);
    font-weight: 300;
    color: var(--bronze);
    text-align: center;
    max-width: 600px;
    opacity: 1;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero.compact .tagline {
    font-size: 1em;
    opacity: 0.7;
    text-align: left;
    max-width: none;
    display: inline;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--gold);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.hero.compact .title-wrapper {
    text-align: left;
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}

/* Navigation
   Background/blur/border live on ::before so that backdrop-filter
   doesn't create a containing-block that traps position:fixed children
   (the mobile theme toggle). Visually identical — just a different layer. */
nav {
    position: fixed;
    bottom: 15vh;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 0;
    transition: bottom 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(245, 241, 232, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gold);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

nav.fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 0;
    z-index: 100;
}

nav.fixed-bottom::before {
    opacity: 1;
}

.nav-content {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.hero.compact .nav-content {
    gap: 40px;
}

nav a {
    color: var(--charcoal);
    text-decoration: none;
    font-size: 0.9em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.4s ease;
}

nav a:hover {
    color: var(--gold);
}

nav a:hover::after {
    width: 100%;
}

/* Active square indicator — left of link */
nav a.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -14px;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: transparent;
    border: 1px solid var(--gold);
    animation: subtleFloat 3s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(-50%) translateX(-2px);
    }
}

/* Content Container */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
}

.content-container:has(.content-box) {
    padding-bottom: 120px;
}

/* ── Section-open: scroll containment ─────────────────
   When a section is active the body stops scrolling and
   the content-container becomes the sole scroll area.
   This confines the scrollbar between header & footer
   and prevents body content from peeking behind them. */
body.section-open {
    overflow: hidden;
}

body.section-open .content-container {
    max-width: none;
    padding: 0;
    overflow-y: auto;
    height: calc(100vh - var(--header-h, 110px) - var(--footer-h, 56px));
    /* Firefox: thin subtle thumb, no visible track */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Webkit: transparent track — only the thumb floats */
body.section-open .content-container::-webkit-scrollbar-track {
    background: transparent;
}
body.section-open .content-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-color: transparent;
}

/* Content stays centered at a readable max-width */
body.section-open .content-box {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

/* Bottom cushion inside the scroll area */
body.section-open .content-container:has(.content-box) {
    padding-bottom: 40px;
}

/* Content Box */
.content-box {
    background: var(--cream);
    border: 1px solid var(--gold);
    padding: 50px 60px;
    margin: 30px 0;
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.content-box.visible {
    opacity: 1;
    transform: scale(1);
}

.content-box h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5em, 4vw, 4em);
    font-weight: 300;
    margin-bottom: 35px;
    text-align: center;
    position: relative;
}

/*
 * Dragon-spine divider — animated
 * ─────────────────────────────────────────────────────
 * ::after — all-in-one element with 3 background layers:
 *   1 & 2: left/right particle diamonds (SVG-animated drift+fade)
 *   3:     serpentine wave that undulates in place via SVG
 *          <animate> on the path 'd' attribute — morphs between
 *          normal and inverted wave states so crests and troughs
 *          rise and fall like a living snake spine.
 *
 * No CSS animation needed — everything is SVG-internal.
 * Width is 60% of the h2 → gains/loses undulations on resize.
 */

/* ── Undulating wave + shedding particles ─────────── */
.content-box h2::after {
    content: '';
    display: block;
    width: 60%;
    height: 14px;
    margin: 14px auto 0;

    background-image:
        /* Layer 1 — left-edge particles: 2 diamonds drift left + fade */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Crect x='18' y='5' width='1.8' height='1.8' rx='0.3' transform='rotate(45 18.9 5.9)' fill='%23c9a961'%3E%3Canimate attributeName='x' values='18;2' dur='8s' repeatCount='indefinite' /%3E%3Canimate attributeName='opacity' values='0.6;0' dur='8s' repeatCount='indefinite' /%3E%3C/rect%3E%3Crect x='20' y='9' width='1.4' height='1.4' rx='0.2' transform='rotate(45 20.7 9.7)' fill='%23c9a961'%3E%3Canimate attributeName='x' values='20;6' dur='10s' begin='3s' repeatCount='indefinite' /%3E%3Canimate attributeName='opacity' values='0.4;0' dur='10s' begin='3s' repeatCount='indefinite' /%3E%3C/rect%3E%3C/svg%3E"),
        /* Layer 2 — right-edge particles: mirrored, drifting right */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Crect x='4' y='5' width='1.8' height='1.8' rx='0.3' transform='rotate(45 4.9 5.9)' fill='%23c9a961'%3E%3Canimate attributeName='x' values='4;20' dur='8s' repeatCount='indefinite' /%3E%3Canimate attributeName='opacity' values='0.6;0' dur='8s' repeatCount='indefinite' /%3E%3C/rect%3E%3Crect x='2' y='9' width='1.4' height='1.4' rx='0.2' transform='rotate(45 2.7 9.7)' fill='%23c9a961'%3E%3Canimate attributeName='x' values='2;16' dur='10s' begin='3s' repeatCount='indefinite' /%3E%3Canimate attributeName='opacity' values='0.4;0' dur='10s' begin='3s' repeatCount='indefinite' /%3E%3C/rect%3E%3C/svg%3E"),
        /* Layer 3 — serpentine wave: path morphs between normal
           and inverted states over 8s for slow undulation.
           A→B: crests fall, troughs rise   B→A: reverse
           calcMode=spline with ease-in-out for organic motion. */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14'%3E%3Cpath d='M0 7 C 25 7, 35 1, 50 1 S 75 7, 100 7 S 135 13, 150 13 S 175 7, 200 7' fill='none' stroke='%23c9a961' stroke-width='1' stroke-linecap='round'%3E%3Canimate attributeName='d' dur='8s' repeatCount='indefinite' calcMode='spline' keySplines='0.4 0 0.6 1; 0.4 0 0.6 1' keyTimes='0;0.5;1' values='M0 7 C 25 7, 35 1, 50 1 S 75 7, 100 7 S 135 13, 150 13 S 175 7, 200 7;M0 7 C 25 7, 35 13, 50 13 S 75 7, 100 7 S 135 1, 150 1 S 175 7, 200 7;M0 7 C 25 7, 35 1, 50 1 S 75 7, 100 7 S 135 13, 150 13 S 175 7, 200 7' /%3E%3C/path%3E%3C/svg%3E");

    background-repeat:
        no-repeat,       /* left particles  — pinned left  */
        no-repeat,       /* right particles — pinned right */
        repeat-x;        /* wave tiles across              */

    background-position:
        left center,
        right center,
        center center;

    background-size:
        24px 14px,
        24px 14px,
        80px 14px;

    /* Fade the wave to transparent at both edges */
    -webkit-mask-image: linear-gradient(to right,
        transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right,
        transparent 0%, black 15%, black 85%, transparent 100%);
}

/* About Content */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2em;
    text-align: center;
    line-height: 2;
}

.about-content p {
    margin-bottom: 28px;
}

.highlight {
    color: var(--gold);
    font-weight: 600;
}

/* Skills Grid */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-item {
    text-align: center;
    padding: 40px 20px;
    border: 1px solid transparent;
    transition: all 0.4s ease;
}

.skill-item:hover {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.05);
}

.skill-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8em;
    margin-bottom: 15px;
    color: var(--charcoal);
}

.skill-level {
    font-size: 2.5em;
    color: var(--gold);
    font-weight: 300;
    margin-bottom: 10px;
}

.skill-category {
    font-size: 0.75em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--bronze);
}

/* Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    padding: 60px 0;
    border-bottom: 1px solid var(--dark-cream);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }

.timeline-item:last-child {
    border-bottom: none;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-year {
    font-size: 0.9em;
    color: var(--gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.timeline-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2em;
    margin-bottom: 10px;
}

.timeline-company {
    font-size: 1.1em;
    color: var(--bronze);
    margin-bottom: 20px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 60px;
}

.project {
    padding: 50px;
    border: 1px solid var(--dark-cream);
    transition: all 0.5s ease;
    background: var(--cream);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.project:nth-child(1) { animation-delay: 0.1s; }
.project:nth-child(2) { animation-delay: 0.2s; }
.project:nth-child(3) { animation-delay: 0.3s; }
.project:nth-child(4) { animation-delay: 0.4s; }

.project:hover {
    border-color: var(--gold);
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.project-category {
    font-size: 0.8em;
    color: var(--gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.project-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2em;
    margin-bottom: 25px;
}

.project-links {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.btn {
    padding: 15px 35px;
    border: 1px solid var(--charcoal);
    color: var(--charcoal);
    text-decoration: none;
    font-size: 0.85em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all 0.4s ease;
    display: inline-block;
}

.btn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--cream);
}

/* Contact Grid */
.contact-grid {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-item {
    text-align: center;
    padding: 28px 20px;
    border: 1px solid var(--dark-cream);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.contact-item:nth-child(1) { animation-delay: 0.1s; }
.contact-item:nth-child(2) { animation-delay: 0.2s; }
.contact-item:nth-child(3) { animation-delay: 0.3s; }
.contact-item:nth-child(4) { animation-delay: 0.4s; }

.contact-item:hover {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.05);
}

.contact-label {
    font-size: 0.8em;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: 15px;
}

.contact-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4em;
    color: var(--charcoal);
}

.contact-value a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-value a:hover {
    color: var(--gold);
}

/* Close Button */
.close-btn {
    position: fixed;
    top: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    border: 1px solid var(--gold);
    background: var(--cream);
    cursor: pointer;
    z-index: 101;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--gold);
    transition: all 0.3s;
    text-decoration: none;
}

.close-btn:hover {
    background: var(--gold);
    color: var(--cream);
}

.close-btn.visible {
    display: flex;
}

/* Resume Page */
.resume-page {
    max-width: 800px;
    margin: 0 auto;
}

.resume-header {
    text-align: center;
    margin-bottom: 30px;
}

.resume-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2em;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.resume-title {
    font-size: 0.95em;
    color: var(--bronze);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.resume-contact {
    font-size: 0.85em;
    color: var(--bronze);
    letter-spacing: 0.05em;
}

.resume-summary {
    font-size: 0.95em;
    line-height: 1.7;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--dark-cream);
}

.resume-section {
    margin-bottom: 25px;
}

.resume-section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gold);
}

.resume-skills {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resume-skill-row {
    display: flex;
    font-size: 0.9em;
    line-height: 1.6;
}

.resume-skill-label {
    font-weight: 600;
    min-width: 120px;
    flex-shrink: 0;
    color: var(--charcoal);
}

.resume-job {
    margin-bottom: 20px;
}

.resume-job:last-child {
    margin-bottom: 0;
}

.resume-job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.resume-job-title {
    font-weight: 600;
    font-size: 1em;
}

.resume-job-company {
    font-size: 0.95em;
    color: var(--bronze);
}

.resume-job-dates {
    font-size: 0.85em;
    color: var(--gold);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.resume-job-desc {
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 8px;
}

.resume-bullets {
    font-size: 0.85em;
    line-height: 1.6;
    padding-left: 20px;
    margin: 0;
}

.resume-bullets li {
    margin-bottom: 4px;
}

.resume-icons {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--dark-cream);
}

.resume-icons a {
    color: var(--charcoal);
    transition: color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.resume-icons a:hover {
    color: var(--gold);
    transform: scale(1.15);
}

/* Site-wide social icons — aligned with nav */
.site-social {
    position: fixed;
    bottom: 15vh;
    right: 40px;
    display: flex;
    gap: 14px;
    z-index: 101;
    transition: bottom 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop/tablet: dock social icons into nav bar when section is open */
@media (min-width: 768px) {
    .hero.compact ~ .site-social {
        bottom: 18px;
    }
}

.site-social a {
    color: var(--charcoal);
    transition: color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.site-social a:hover {
    color: var(--gold);
    transform: scale(1.15);
}

/* Skill Tree */
.skill-tree {
    max-width: 800px;
    margin: 0 auto;
}

.skill-tree-category {
    margin-bottom: 32px;
}

.skill-tree-category:last-child {
    margin-bottom: 0;
}

.skill-tree-category-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--dark-cream);
}

.skill-tree-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-tree-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.skill-tree-name {
    font-size: 0.85em;
    min-width: 150px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.skill-tree-bar {
    flex: 1;
    height: 6px;
    background: var(--dark-cream);
    border-radius: 3px;
    overflow: hidden;
}

.skill-tree-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--bronze));
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-tree-level {
    font-size: 0.65em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.skill-tree-level.expert { color: var(--gold); font-weight: 600; }
.skill-tree-level.advanced { color: var(--bronze); }
.skill-tree-level.proficient { color: var(--charcoal); opacity: 0.6; }
.skill-tree-level.learning { color: var(--charcoal); opacity: 0.4; }

/* Resume Download Box */
.resume-download {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 30px;
    border: 2px solid var(--gold);
    margin: 30px auto 35px;
    max-width: 480px;
    transition: all 0.3s ease;
}

.resume-download:hover {
    background: rgba(201, 169, 97, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.resume-download-icon {
    flex-shrink: 0;
    color: var(--gold);
}

.resume-download-text {
    flex: 1;
}

.resume-download-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2em;
    font-weight: 600;
    display: block;
    line-height: 1.3;
}

.resume-download-sub {
    font-size: 0.75em;
    color: var(--bronze);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.resume-download-btn {
    margin-left: auto;
    padding: 10px 22px;
    border: 1px solid var(--charcoal);
    color: var(--charcoal);
    text-decoration: none;
    font-size: 0.78em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    font-family: 'Montserrat', sans-serif;
}

.resume-download-btn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--cream);
}

.resume-download-btn svg {
    transition: transform 0.3s ease;
}

.resume-download-btn:hover svg {
    transform: translateY(2px);
}

/* Contact Layout — callout left, cards right */
.contact-layout {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

/* Contact Callout */
.contact-callout {
    text-align: center;
    flex: 1;
    padding: 20px 30px;
}

.contact-callout-icon {
    margin-bottom: 14px;
}

.contact-callout h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8em;
    font-weight: 300;
    margin-bottom: 10px;
}

.contact-callout p {
    font-size: 0.95em;
    color: var(--bronze);
    margin-bottom: 18px;
    line-height: 1.7;
}

.contact-callout .btn {
    padding: 14px 30px;
}

.contact-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 240px;
}

.contact-grid-compact {
    grid-template-columns: repeat(3, 1fr);
}

/* FAQ Accordion */
.faq-section {
    max-width: 800px;
    margin: 60px auto 0;
    padding-top: 50px;
    border-top: 1px solid var(--dark-cream);
}

.faq-section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2em;
    font-weight: 300;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.faq-section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--gold);
    margin: 20px auto 0;
}

.faq-item {
    border-bottom: 1px solid var(--dark-cream);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item summary {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3em;
    font-weight: 400;
    padding: 22px 0;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5em;
    color: var(--gold);
    font-weight: 300;
    flex-shrink: 0;
    margin-left: 20px;
    width: 24px;
    text-align: center;
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item summary:hover {
    color: var(--gold);
}

.faq-answer {
    padding: 0 0 28px;
    font-size: 0.95em;
    line-height: 1.8;
    color: var(--charcoal);
    opacity: 0.85;
}

.faq-answer p {
    margin-bottom: 16px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-emblem {
    float: left;
    margin: 4px 24px 12px 0;
}

.faq-emblem img {
    display: block;
}

.faq-answer::after {
    content: '';
    display: table;
    clear: both;
}

/* Subpage overrides */
body.subpage .hero,
body.subpage nav,
body.subpage .logo,
body.subpage .tagline,
body.subpage .site-social {
    transition: none;
}

body.subpage .content-box {
    opacity: 0;
    transform: scale(0.95);
    animation: contentReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
}

@keyframes contentReveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

body.subpage .close-btn {
    display: flex;
}

/* Responsive — tablets + phones (content/grid overrides) */
@media (max-width: 1024px) {
    .content-box {
        padding: 30px 20px;
    }

    .projects-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        gap: 30px;
    }

    .project {
        padding: 30px 20px;
    }

    .resume-skill-row {
        flex-direction: column;
        gap: 2px;
    }

    .resume-skill-label {
        min-width: auto;
    }

    .resume-job-header {
        flex-direction: column;
        gap: 2px;
    }

    .skill-tree-item {
        flex-wrap: wrap;
    }

    .skill-tree-name {
        min-width: 120px;
    }

    .resume-download {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .resume-download-btn {
        margin-left: 0;
    }

    .contact-layout {
        flex-direction: column;
    }

    .contact-sidebar {
        min-width: auto;
        width: 100%;
    }

    .contact-grid-compact {
        grid-template-columns: 1fr;
    }

    .faq-item summary {
        font-size: 1.15em;
    }

    .faq-emblem {
        float: none;
        text-align: center;
        margin: 4px 0 16px;
    }

    .faq-emblem img {
        max-width: 200px !important;
    }

}

/* ═══════════════════════════════════════════════════════
   Phones only (≤767px)
   Tablets (768px+) get the full desktop nav/hero layout.
   ═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Hide body scrollbar — users scroll by touch on phones;
       prevents the scrollbar overlapping the fixed top/bottom bars */
    html {
        scrollbar-width: none;
    }
    html::-webkit-scrollbar {
        display: none;
    }

    /* Hero — shorter on phone, no 100vh */
    .hero {
        padding: 25vh 20px 20px;
        min-height: auto;
    }

    .nav-content {
        gap: 24px;
    }

    nav a {
        font-size: 0.7em;
        letter-spacing: 0.08em;
        -webkit-tap-highlight-color: transparent;
    }

    /* Active square indicator — tighter offset for phones */
    nav a.active::before {
        top: 50%;
        left: -10px;
        width: 5px;
        height: 5px;
        transform: translateY(-50%);
        animation: subtleFloatLeft 3s ease-in-out infinite;
    }

    @keyframes subtleFloatLeft {
        0%, 100% { transform: translateY(-50%) translateX(0); }
        50% { transform: translateY(-50%) translateX(-1px); }
    }

    nav.fixed-bottom .nav-content {
        gap: 24px;
    }

    /* Compact header — sticky banner with logo + name */
    .hero.compact {
        min-height: auto;
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--cream);
        border-bottom: 1px solid var(--dark-cream);
    }

    .hero.compact .hero-content {
        gap: 12px;
    }

    .hero.compact .logo {
        width: 40px;
        height: 40px;
    }

    /* Slight crop at compact size */
    .hero.compact .logo img {
        transform: scale(1.2) translate(1%, 3%);
    }

    .hero.compact h1 {
        font-size: 1.2em;
    }

    .hero.compact .tagline {
        display: none;
    }

    .hero.compact .title-wrapper {
        flex-wrap: nowrap;
    }

    /* Content area */
    .content-container {
        padding: 0 16px 100px;
    }

    /* Close button: hidden on phone — logo/name tap closes */
    .close-btn {
        display: none !important;
    }

    /* Social icons — top-right on phone, shifted left to clear theme toggle */
    .site-social {
        top: 14px;
        right: 58px;
        bottom: auto;
        transition: none;
    }

    /* Restore side padding on phones — container is full-width for
       edge-aligned scrollbar, but content needs breathing room */
    body.section-open .content-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Extra-small phones — tighter nav to fit all 4 links */
@media (max-width: 380px) {
    .nav-content {
        gap: 16px;
    }

    nav a {
        font-size: 0.65em;
        letter-spacing: 0.05em;
    }

    nav.fixed-bottom .nav-content {
        gap: 16px;
    }
}
