/* ═══════════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════════ */
:root {
    --parchment: #f5f0e8;
    --parchment-dark: #e8e0cc;
    --parchment-deep: #d6c9a8;
    --ink: #2c2416;
    --ink-light: #5a4e3a;
    --ink-faint: #8a7d65;
    --sepia: #8b6914;
    --sepia-light: #c4973a;
    --wax-red: #8b2020;
    --wax-red-light: #b83232;
    --envelope-bg: #d4c5a0;
    --envelope-dark: #b8a882;
    --letter-bg: #faf7f0;
    --rule-color: rgba(139, 105, 20, 0.25);

    --font-serif: "Libre Baskerville", Georgia, serif;
    --font-display: "IM Fell English", Georgia, serif;
    --font-mono: "Courier Prime", "Courier New", monospace;
    --font-stamp: "Special Elite", cursive;

    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--parchment);
    color: var(--ink);
    width: 100%;
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238b6914' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════════
   SCROLL PROGRESS
═══════════════════════════════════════════════ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--parchment-dark);
    z-index: 10000;
}
.scroll-progress__bar {
    height: 100%;
    background: var(--sepia);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* ═══════════════════════════════════════════════
   PAGE LOADER
═══════════════════════════════════════════════ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition:
        opacity 0.8s var(--ease-out),
        visibility 0.8s var(--ease-out);
}
.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}
.loader-wax-seal {
    font-size: 6rem;
    color: var(--wax-red);
    animation: sealPulse 1.2s ease-in-out infinite;
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
}
.loader-text {
    font-family: var(--font-stamp);
    font-size: 1.8rem;
    color: var(--ink-light);
    letter-spacing: 0.1em;
}
@keyframes sealPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.6rem 5%;
    background: rgba(245, 240, 232, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid var(--rule-color);
    transition: all 0.3s ease;
}
header.scrolled {
    box-shadow: 0 2px 20px rgba(44, 36, 22, 0.12);
}

.logo {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--ink);
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}
.logo:hover {
    color: var(--sepia);
}

nav {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    border: 1px solid var(--rule-color);
    border-radius: 4px;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.4);
}
.nav-link {
    font-family: var(--font-stamp);
    font-size: 1.4rem;
    color: var(--ink-light);
    padding: 0.8rem 1.8rem;
    border-radius: 3px;
    transition: all 0.25s ease;
    letter-spacing: 0.05em;
}
.nav-link:hover {
    background: rgba(139, 105, 20, 0.08);
    color: var(--ink);
}
.nav-link.active {
    background: var(--ink);
    color: var(--parchment);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.5rem;
}
.hamburger span {
    width: 2.4rem;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: 0.3s ease;
}

/* ═══════════════════════════════════════════════
   SHARED SECTION STYLES
═══════════════════════════════════════════════ */
section {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 10rem 5% 6rem;
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}
.section-label {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--sepia);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.section-header h2 {
    font-family: var(--font-display);
    font-size: 3.8rem;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--rule-color);
    display: inline-block;
    padding-bottom: 0.8rem;
}
.section-sub {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--ink-faint);
    font-style: italic;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
    font-family: var(--font-stamp);
    padding: 1.1rem 2.8rem;
    font-size: 1.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 400;
    letter-spacing: 0.08em;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}
.btn-primary {
    background: var(--wax-red);
    color: var(--parchment);
    border: 2px solid var(--wax-red);
}
.btn-primary:hover {
    background: var(--wax-red-light);
    border-color: var(--wax-red-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 32, 32, 0.3);
}
.btn-secondary {
    background: transparent;
    color: var(--sepia);
    border: 2px solid var(--sepia);
}
.btn-secondary:hover {
    background: var(--sepia);
    color: var(--parchment);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   HERO — LETTER LAYOUT
═══════════════════════════════════════════════ */
.hero {
    padding-top: 12rem;
    background: transparent;
}

.hero-letter {
    background: var(--letter-bg);
    border: 1px solid var(--parchment-deep);
    border-radius: 4px;
    padding: 5rem 6rem;
    box-shadow:
        0 4px 40px rgba(44, 36, 22, 0.12),
        0 1px 0 var(--parchment-deep);
    position: relative;
    /* ruled lines */
    background-image: repeating-linear-gradient(
        transparent,
        transparent 2.7rem,
        var(--rule-color) 2.7rem,
        var(--rule-color) calc(2.7rem + 1px)
    );
    background-size: 100% 2.8rem;
    background-position: 0 4rem;
    animation: letterReveal 1.8s var(--ease-out) 0.3s both;
}
@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: perspective(1200px) rotateX(-20deg) translateY(-60px) scale(0.9);
        filter: blur(8px);
    }
    40% {
        opacity: 0.4;
        transform: perspective(1200px) rotateX(-10deg) translateY(-30px) scale(0.95);
        filter: blur(4px);
    }
    70% {
        opacity: 0.7;
        transform: perspective(1200px) rotateX(-3deg) translateY(-10px) scale(0.98);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1);
        filter: blur(0);
    }
}

/* top row: sender + stamp */
.hero-letter > .letter-sender,
.hero-letter > .letter-stamp {
    position: absolute;
    top: 3.5rem;
    animation: fadeInSlide 1s var(--ease-out) 1s both;
}
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.letter-sender {
    left: 6rem;
}
.letter-sender .sender-name {
    font-family: var(--font-stamp);
    font-size: 1.6rem;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.letter-sender p {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--ink-light);
    line-height: 1.6;
}

.letter-stamp {
    right: 6rem;
    width: 18rem;
    text-align: center;
    border: 2px solid var(--sepia);
    padding: 1rem;
    background: var(--parchment);
    box-shadow: 2px 2px 0 var(--parchment-deep);
}
.letter-stamp img {
    width: 100%;
    height: 15rem;
    object-fit: cover;
    display: block;
    filter: sepia(0.4);
}
.stamp-label {
    font-family: var(--font-stamp);
    font-size: 1.4rem;
    color: var(--sepia);
    display: block;
    margin-top: 0.6rem;
    letter-spacing: 0.1em;
}

/* Spotify player - fixed top right */
.spotify-player-fixed {
    position: absolute;
    top: 12rem;
    right: 2%;
    width: 35rem;
    border-radius: 12px;
    overflow: hidden;
    z-index: 999;
    transition: all 0.3s ease;
}

/* recipient block */
.letter-recipient {
    margin-top: 10rem;
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1.2s var(--ease-out) 1.3s both;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.recipient-name {
    font-family: var(--font-display);
    font-size: 3.2rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.recipient-org {
    font-family: var(--font-stamp);
    font-size: 2rem;
    color: var(--ink-light);
    margin-bottom: 0.3rem;
}
.recipient-detail {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--ink-light);
    line-height: 1.8;
}

/* letter body */
.letter-body {
    margin-top: 3rem;
    border-top: 1px solid var(--rule-color);
    padding-top: 2.5rem;
    animation: fadeInUp 1.2s var(--ease-out) 1.6s both;
}
.letter-salutation {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--ink);
    margin-bottom: 1.5rem;
    font-style: italic;
}
.letter-body p {
    font-size: 1.7rem;
    line-height: 2;
    color: var(--ink-light);
    margin-bottom: 1.5rem;
    font-family: var(--font-serif);
}
.letter-body p em {
    font-style: italic;
    color: var(--ink);
}
.letter-body p strong {
    font-weight: 700;
    color: var(--ink);
}
.letter-closing {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.8rem;
    color: var(--ink);
    margin-top: 2rem;
    margin-bottom: 0.5rem !important;
}
.letter-signature {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--sepia);
    font-style: italic;
    margin-bottom: 0 !important;
}

/* CTA row */
.letter-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--rule-color);
    padding-top: 2.5rem;
    animation: fadeInUp 1.2s var(--ease-out) 1.9s both;
}
.social-icons {
    display: flex;
    gap: 1.2rem;
    margin-left: auto;
}
.social-icons a {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sepia);
    border-radius: 50%;
    color: var(--sepia);
    font-size: 1.6rem;
    transition: all 0.25s ease;
}
.social-icons a:hover {
    background: var(--sepia);
    color: var(--parchment);
    transform: translateY(-3px);
}

/* ═══════════════════════════════════════════════
   PROJECTS — BIFOLD LETTER ANIMATION
═══════════════════════════════════════════════ */
.projects {
    background: var(--parchment-dark);
    border: 1px solid var(--parchment-deep);
    box-shadow: 0 2px 20px rgba(44, 36, 22, 0.08);
    overflow: visible; /* allow letter to extend below section */
}

.carousel-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 6rem;
}

/* carousel — fixed height, overflow visible so letter can extend below */
.projects-carousel {
    position: relative;
    width: 100%;
    height: 260px;
    border-radius: 4px;
    overflow: visible;
}

.projects-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%) scale(0.95);
    transition:
        transform 0.55s var(--ease-spring),
        opacity 0.55s var(--ease-spring);
    overflow: visible;
}
.projects-item.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    z-index: 2;
}
.projects-item.prev {
    transform: translateX(-100%) scale(0.95);
    opacity: 0;
}

/* ── BIFOLD CONTAINER ──
   Fixed height — never changes. No overflow hidden.
   Segments start at top:0 behind cover (z-index).
   On hover they slide out below — letter overlaps next section.
── */
.trifold-letter {
    position: relative;
    margin: 0 auto;
    font-size: 0;
    width: 100%;
    height: 240px;
    transition: 0.8s;
    transition-delay: 0.8s;
    cursor: pointer;
}

/* ── COVER ── z-index: 8 — fixed height, rotates away on hover ── */
.letter-cover {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: 290px;
    border: 1px solid var(--envelope-dark);
    border-radius: 4px;
    box-shadow:
        -2px 1px 5px 1px rgba(0, 0, 0, 0.06),
        1px -2px 5px 1px rgba(0, 0, 0, 0.06);
    transition: 0.8s;
    transition-delay: 0.8s;
    z-index: 8;
    overflow: hidden;
    background-image:
        linear-gradient(135deg, var(--envelope-dark) 0%, transparent 40%),
        linear-gradient(225deg, var(--envelope-dark) 0%, transparent 40%),
        linear-gradient(
            344deg,
            var(--envelope-bg) 0%,
            #ede0c0 50%,
            var(--envelope-bg) 100%
        );
    clip-path: inset(0 0 calc(100% - 300px) 0);
}
.trifold-letter:hover .letter-cover {
    top: -80px;
    left: 0;
    transform: rotate(12deg);
    transition: 0.8s;
    z-index: 0;
    box-shadow: 4px -4px 20px rgba(44, 36, 22, 0.2);
    clip-path: inset(0 0 0 0);
}

.letter-cover-text-top {
    position: absolute;
    top: 14px;
    left: 18px;
    font-size: 1.3rem;
    overflow: visible;
}
.letter-cover-text-top .env-sender-name {
    font-family: var(--font-stamp);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.2rem;
    font-size: 1.4rem;
}
.letter-cover-text-top p {
    font-family: var(--font-mono);
    color: var(--ink-light);
    line-height: 1.5;
    font-size: 1.2rem;
}

.letter-cover-stamp {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 90px;
    text-align: center;
    padding: 0.6rem;
    background: var(--parchment);
    outline: 2px dashed var(--sepia);
    outline-offset: 2px;
    box-shadow: 2px 2px 0 var(--envelope-dark);
    font-size: 1rem;
}
.letter-cover-stamp img {
    width: 100%;
    height: 68px;
    object-fit: cover;
    display: block;
    filter: sepia(0.25);
}
.letter-cover-stamp span {
    font-family: var(--font-stamp);
    font-size: 1rem;
    color: var(--sepia);
    display: block;
    margin-top: 0.3rem;
}

.letter-cover-text {
    position: relative;
    margin: 0 auto;
    top: 120px;
    max-width: 60%;
    min-width: 40%;
    text-align: center;
    font-size: 1.4rem;
    overflow: visible;
}
.env-project-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.25;
}
.env-project-sub {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--ink-light);
    margin-top: 0.4rem;
}

.env-postmark {
    position: absolute;
    bottom: 18px;
    right: 18px;
    border: 2px solid var(--sepia);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transform: rotate(-15deg);
    font-size: 0.9rem;
}
.env-postmark span {
    font-family: var(--font-stamp);
    font-size: 0.85rem;
    color: var(--sepia);
    text-align: center;
}

/* ── LETTER TOP: screenshot ── z-index: 7 ──
   Starts at top:0 — hidden behind cover.
   On hover: skews left, cover is gone so it's visible.
── */
.letter-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 220px;
    background: #1a1a1a;
    border-left: 1px solid rgba(44, 36, 22, 0.15);
    border-right: 1px solid rgba(44, 36, 22, 0.15);
    border-top: 1px solid rgba(44, 36, 22, 0.15);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    box-shadow: -5px -3px 10px 1px rgba(0, 0, 0, 0.06);
    transition: 0.8s;
    transition-delay: 0.8s;
    z-index: 7;
    overflow: hidden;
}
.trifold-letter:hover .letter-top {
    left: -16px;
    transform: skew(5deg);
    transition: 0.8s;
}

.letter-top-text {
    position: relative;
    margin: 0 auto;
    top: 0;
    height: 220px;
    max-width: 100%;
    font-size: 1.4rem;
    overflow: hidden;
}
.lc-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* ── LETTER BOT: details ── z-index: 6 ──
   Starts at top:0 — hidden behind cover and top.
   On hover: slides to top:220px with opposite skew.
── */
.letter-bot {
    position: absolute;
    top: 0;
    left: 0.5px;
    width: 100%;
    height: 280px;
    color: var(--ink);
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(44, 36, 22, 0.15);
    box-shadow: -5px -3px 10px 1px rgba(0, 0, 0, 0.06);
    transition: 0.8s;
    transition-delay: 0.8s;
    z-index: 6;
    overflow: hidden;
    background-image:
        linear-gradient(353deg, var(--letter-bg) 0%, #f2e7c9 79%, #fff8e4 100%),
        repeating-linear-gradient(
            transparent,
            transparent 2.4rem,
            var(--rule-color) 2.4rem,
            var(--rule-color) calc(2.4rem + 1px)
        );
    background-size:
        100% 100%,
        100% 2.5rem;
    background-position:
        0 0,
        0 3rem;
}
.trifold-letter:hover .letter-bot {
    top: 220px;
    left: -16px;
    transform: skew(-5deg);
    transition: 0.8s;
}

.letter-bot-text {
    position: relative;
    top: 14px;
    margin: 0 auto;
    max-width: 90%;
    height: 260px;
    font-size: 1.4rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 1rem;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.letter-bot-text::-webkit-scrollbar {
    display: none;
}

/* shared letter content styles */
.lc-date {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--ink-faint);
    margin-bottom: 0.4rem;
}
.lc-title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}
.lc-role {
    display: inline-block;
    font-family: var(--font-stamp);
    font-size: 1.1rem;
    color: var(--wax-red);
    border: 1px solid var(--wax-red);
    padding: 0.3rem 1rem;
    border-radius: 2px;
    margin-bottom: 0.8rem;
    letter-spacing: 0.04em;
}
.lc-body {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.75;
    color: var(--ink-light);
    margin-bottom: 0.8rem;
}
.lc-sub-heading {
    font-family: var(--font-stamp);
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
}
.lc-highlights ul {
    list-style: none;
    padding: 0;
    margin-bottom: 0.8rem;
}
.lc-highlights li {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--ink-light);
    padding-left: 1.6rem;
    position: relative;
    margin-bottom: 0.3rem;
}
.lc-highlights li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--sepia);
}
.lc-stack {
    margin-top: 0.3rem;
}
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.tech-tags span {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--ink-light);
    border: 1px solid var(--parchment-deep);
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    background: var(--parchment);
    transition: all 0.2s;
}
.tech-tags span:hover {
    background: var(--sepia);
    color: var(--parchment);
    border-color: var(--sepia);
}

/* project title below card */
.projects-info {
    padding: 1.5rem 0 0;
    text-align: center;
}
.projects-info h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--ink-light);
    font-weight: 400;
}

/* carousel buttons */
.carousel-btn {
    position: absolute;
    top: 130px;
    transform: translateY(-50%);
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--parchment);
    border: 1px solid var(--sepia);
    color: var(--sepia);
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(44, 36, 22, 0.1);
}
.carousel-btn:hover {
    background: var(--sepia);
    color: var(--parchment);
    transform: translateY(-50%) scale(1.08);
}
.prev-btn {
    left: 0;
}
.next-btn {
    right: 0;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 3rem;
}
.indicator {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--parchment-deep);
    cursor: pointer;
    transition: all 0.3s;
}
.indicator:hover {
    background: var(--sepia-light);
}
.indicator.active {
    background: var(--sepia);
    width: 2.8rem;
    border-radius: 1rem;
}

/* ═══════════════════════════════════════════════
   ABOUT — JOURNAL
═══════════════════════════════════════════════ */
.about {
    background: var(--letter-bg);
    border: 1px solid var(--parchment-deep);
    box-shadow: 0 2px 20px rgba(44, 36, 22, 0.08);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: flex-start;
}

.about-journal {
    border-left: 3px solid var(--sepia-light);
    padding-left: 2.5rem;
}
.journal-date {
    font-family: var(--font-stamp);
    font-size: 1.3rem;
    color: var(--sepia);
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    margin-top: 2rem;
}
.journal-date:first-child {
    margin-top: 0;
}
.about-journal p {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    line-height: 1.9;
    color: var(--ink-light);
    margin-bottom: 1.5rem;
}

.about-skills {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}
.skills-section h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--ink);
    margin-bottom: 1.2rem;
    font-weight: 400;
    border-bottom: 1px solid var(--rule-color);
    padding-bottom: 0.5rem;
}
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}
.skills-tags span {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--ink-light);
    border: 1px solid var(--parchment-deep);
    padding: 0.6rem 1.4rem;
    border-radius: 2px;
    background: var(--parchment);
    transition: all 0.25s ease;
}
.skills-tags span:hover {
    background: var(--sepia);
    color: var(--parchment);
    border-color: var(--sepia);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════ */
.contact {
    background: var(--parchment-dark);
    border: 1px solid var(--parchment-deep);
    box-shadow: 0 2px 20px rgba(44, 36, 22, 0.08);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    background: var(--letter-bg);
    padding: 4rem;
    border-radius: 4px;
    border: 1px solid var(--parchment-deep);
    box-shadow: 0 2px 12px rgba(44, 36, 22, 0.06);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.contact-item {
    display: flex;
    gap: 1.8rem;
    align-items: flex-start;
}
.contact-item i {
    font-size: 2rem;
    color: var(--sepia);
    margin-top: 0.4rem;
}
.contact-item h4 {
    font-family: var(--font-stamp);
    font-size: 1.5rem;
    color: var(--ink);
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em;
}
.contact-item p {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--ink-light);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.contact-form input,
.contact-form textarea {
    padding: 1.2rem 1.5rem;
    background: var(--parchment);
    border: 1px solid var(--parchment-deep);
    border-radius: 3px;
    color: var(--ink);
    font-size: 1.5rem;
    font-family: var(--font-mono);
    transition: all 0.25s ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--ink-faint);
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--sepia);
    background: var(--letter-bg);
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.1);
}

/* ═══════════════════════════════════════════════
   BACK TO TOP
═══════════════════════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 4.8rem;
    height: 4.8rem;
    background: var(--wax-red);
    color: var(--parchment);
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s var(--ease-spring);
    z-index: 999;
    box-shadow: 0 4px 16px rgba(139, 32, 32, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 24px rgba(139, 32, 32, 0.45);
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s var(--ease-out),
        transform 0.6s var(--ease-out);
}
.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    .contact-content {
        grid-template-columns: 1fr;
    }
    .hero-letter {
        padding: 5rem 4rem;
    }
    .letter-sender {
        left: 4rem;
    }
    .letter-stamp {
        right: 4rem;
        width: 15rem;
    }
    .letter-stamp img {
        height: 12rem;
    }
    .spotify-player-fixed {
        width: 28rem;
        right: 3%;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 55%;
    }
    header {
        padding: 1.4rem 4%;
    }
    nav {
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(245, 240, 232, 0.98);
        padding: 0;
        gap: 0.4rem;
        max-height: 0;
        overflow: hidden;
        transition:
            max-height 0.3s ease,
            padding 0.3s ease,
            opacity 0.3s;
        border: none;
        border-radius: 4px;
        margin: 0.5rem;
        opacity: 0;
        visibility: hidden;
    }
    nav.active {
        max-height: 400px;
        padding: 1.5rem;
        border: 1px solid var(--rule-color);
        opacity: 1;
        visibility: visible;
    }
    .hamburger {
        display: flex;
    }
    section {
        padding: 8rem 4% 4rem;
        margin-bottom: 2rem;
    }
    .hero-letter {
        padding: 5rem 2.5rem 3rem;
    }
    .letter-sender {
        left: 2.5rem;
    }
    .letter-stamp {
        right: 2.5rem;
        width: 11rem;
    }
    .letter-stamp img {
        height: 9rem;
    }
    .spotify-player-fixed {
        display: none;
    }
    .letter-recipient {
        margin-top: 9rem;
    }
    .recipient-name {
        font-size: 2.4rem;
    }
    .letter-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .social-icons {
        margin-left: 0;
    }
    .carousel-container {
        padding: 0 4.5rem;
    }
    .projects-carousel {
        height: 480px;
    }
    .section-header h2 {
        font-size: 2.8rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 50%;
    }
    .hero-letter {
        padding: 5rem 2rem 2.5rem;
    }
    .letter-sender {
        left: 2rem;
    }
    .letter-stamp {
        right: 2rem;
        width: 10rem;
    }
    .letter-stamp img {
        height: 8rem;
    }
    .spotify-player-fixed {
        display: none;
    }
    .letter-recipient {
        margin-top: 8.5rem;
    }
    .carousel-container {
        padding: 0 3.5rem;
    }
    .projects-carousel {
        height: 440px;
    }
    .contact-content {
        padding: 2.5rem;
    }
    .env-stamp {
        width: 6.5rem;
    }
    .env-stamp img {
        height: 5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
