/* Custom resets and styling variables */
:root {
    --text-primary: #8c6a51;
    --text-muted: #a6846c;
    --bg-page: #fcfbfa;
    --color-apricot: #f5bda6;
    --color-apricot-hover: #e0a58d;
    --card-shadow: 0 15px 45px rgba(140, 106, 81, 0.12);
    --font-primary: 'Quicksand', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.external-link-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.12em;
}

body {
    width: 100%;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    /* Soft grid texture for page background */
    background-image: 
        radial-gradient(rgba(245, 189, 166, 0.15) 1.5px, transparent 1.5px), 
        radial-gradient(rgba(245, 189, 166, 0.15) 1.5px, var(--bg-page) 1.5px);
    background-size: 40px 40px;
    background-position: center, center;
}

/* Full screen sticky hero setup */
.scroll-hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start; /* Snap point at the top of the page */
}

.sticky-garden-wrapper {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --- Content Sections (sliding over the hero) --- */
.main-content {
    position: relative;
    z-index: 10;
    background-color: var(--bg-page);
    border-top-left-radius: clamp(24px, 4vw, 40px);
    border-top-right-radius: clamp(24px, 4vw, 40px);
    box-shadow: 0 -20px 50px rgba(0,0,0,0.1);
    margin-top: -40px; /* Slight overlap */
    padding-bottom: 60px;
}

.content-section {
    padding: clamp(48px, 6vw, 72px) clamp(16px, 4vw, 32px);
    scroll-margin-top: 76px;
    text-align: center;
}

.section-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.content-section h2 {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 4.5vw, 3rem);
    color: var(--text-primary);
    margin-bottom: 16px;
}

.content-section p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* --- Portfolio / Storybook Content --- */
/* --- Portfolio / Horizontal Carousel --- */
#projects {
    padding-inline: 0;
    padding-top: clamp(42px, 5vw, 56px);
    padding-bottom: clamp(48px, 6vw, 64px);
}

#projects > .section-kicker,
#projects > .chapter-title,
#projects > .section-intro,
#projects > .swipe-hint {
    padding-inline: clamp(16px, 4vw, 32px);
}

.section-kicker {
    margin-bottom: 8px !important;
    color: var(--color-apricot-hover) !important;
    font-family: var(--font-primary);
    font-size: 0.78rem !important;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-intro {
    max-width: 620px;
    margin: 0 auto 8px;
}

.swipe-hint {
    margin-bottom: 8px !important;
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    font-style: italic;
    text-align: center;
}

.portfolio-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 14px max(16px, 7.5vw, calc((100vw - 960px) / 2)) 32px;
    gap: clamp(16px, 3vw, 36px);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.portfolio-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
}

.carousel-arrow,
.article-carousel-arrow,
.broadcast-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(74, 59, 50, 0.15);
    color: var(--text-primary);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.carousel-arrow:hover,
.article-carousel-arrow:hover,
.broadcast-carousel-arrow:hover {
    background-color: var(--color-apricot);
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow svg,
.article-carousel-arrow svg,
.broadcast-carousel-arrow svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.prev-arrow {
    left: 20px;
}

.next-arrow {
    right: 20px;
}

.paper-card {
    flex: 0 0 min(82vw, 960px);
    width: min(82vw, 960px);
    max-width: 960px;
    scroll-snap-align: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(74, 59, 50, 0.08);
    padding: clamp(24px, 3vw, 38px);
}

.paper-card.bg-alt {
    background-color: #fcf6ef;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.carousel-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #fcf6ef;
    border: 2px solid rgba(74, 59, 50, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background-color: rgba(74, 59, 50, 0.3);
}

.carousel-dot.active {
    background-color: var(--color-apricot);
    border-color: var(--text-primary);
    transform: scale(1.3);
}

.chapter-section {
    padding: clamp(54px, 7vw, 80px) clamp(16px, 4vw, 32px);
    border-top: none;
    background-color: var(--bg-page);
    box-shadow: 0 -20px 50px rgba(74, 59, 50, 0.08);
    position: relative;
    z-index: 14; /* Ensure about/contact cast shadow over the last project page */
}

.bg-alt {
    background-color: #f2e8dd; /* Slightly darker paper */
}

.chapter-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: clamp(18px, 3vw, 32px);
}

/* Zig-zag Project Rows */
.project-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 3vw, 36px);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}



.project-row.reverse {
    flex-direction: row-reverse;
}

.project-image-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

/* Paper Cut Frame Style */
.paper-frame {
    background: #fff;
    padding: 14px;
    border-radius: 4px;
    /* Outer drop shadow (lifting the frame off the page) */
    box-shadow: 0 15px 30px rgba(74, 59, 50, 0.15), 0 5px 15px rgba(74, 59, 50, 0.1);
    position: relative;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.paper-frame::after {
    content: '';
    position: absolute;
    top: 14px; left: 14px; right: 14px; bottom: 14px;
    /* Inner shadow to make the image look recessed (cut out hole) */
    box-shadow: inset 0 8px 15px rgba(0,0,0,0.2), inset 0 0 5px rgba(0,0,0,0.1);
    pointer-events: none;
    border-radius: 2px;
}

.paper-frame img {
    display: block;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 2px;
}

.paper-frame:hover {
    transform: scale(1.05) rotate(-2deg) translateY(-10px);
    box-shadow: 0 25px 40px rgba(74, 59, 50, 0.2), 0 10px 20px rgba(74, 59, 50, 0.12);
}

.project-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.project-text h3 {
    font-family: var(--font-primary);
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    margin-bottom: 10px;
    color: var(--text-primary);
}

.project-text p {
    font-size: clamp(0.98rem, 1.8vw, 1.1rem);
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.project-source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    text-underline-offset: 5px;
}

.project-label {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--color-apricot-hover);
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.tech-list li {
    padding: 7px 11px;
    border: 1px solid rgba(140, 106, 81, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.project-art {
    position: relative;
    display: block;
    width: min(28vw, 300px);
    max-width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 2px;
}

.project-art-jod {
    background: linear-gradient(145deg, #dcfce7 0%, #f0fdf4 48%, #dbeafe 100%);
}

.jod-phone {
    position: absolute;
    inset: 11% 25% 10%;
    padding: 32% 10% 10%;
    border: 4px solid #28543c;
    border-radius: 24px;
    background: #fff;
    box-shadow: 12px 14px 0 rgba(22, 163, 74, 0.14);
}

.jod-phone::before {
    content: '฿4,000';
    position: absolute;
    top: 12%;
    left: 0;
    width: 100%;
    color: #166534;
    font-family: var(--font-primary);
    font-size: clamp(15px, 2.4vw, 28px);
    font-weight: 700;
    text-align: center;
}

.jod-progress {
    display: block;
    height: 8px;
    margin-bottom: 18%;
    overflow: hidden;
    border-radius: 999px;
    background: #dcfce7;
}

.jod-progress::after {
    content: '';
    display: block;
    width: 64%;
    height: 100%;
    border-radius: inherit;
    background: #22c55e;
}

.jod-entry {
    display: block;
    height: 10%;
    margin-bottom: 12%;
    border-radius: 6px;
    background: #e5e7eb;
    box-shadow: 0 13px 0 #f3f4f6;
}

.jod-entry-two {
    width: 72%;
    margin-top: 18%;
}

.jod-badge,
.jod-coin {
    position: absolute;
    display: grid;
    place-items: center;
    border: 3px solid #28543c;
    color: #28543c;
    font-family: var(--font-primary);
    font-weight: 700;
}

.jod-badge {
    top: 13%;
    right: 7%;
    width: 27%;
    height: 15%;
    border-radius: 999px;
    background: #fef08a;
    font-size: clamp(10px, 1.6vw, 18px);
    transform: rotate(7deg);
}

.jod-coin {
    bottom: 12%;
    left: 9%;
    width: 20%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #86efac;
    font-size: clamp(18px, 3vw, 34px);
    transform: rotate(-8deg);
}

.project-art-ai {
    background: linear-gradient(145deg, #f8cdbb 0%, #e3d8f3 54%, #c4e6df 100%);
}

.art-window {
    position: absolute;
    inset: 18% 14%;
    border: 3px solid #8c6a51;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 10px 12px 0 rgba(140, 106, 81, 0.13);
}

.art-window::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 12%;
    width: 54%;
    height: 8px;
    border-radius: 10px;
    background: #d8b4a3;
    box-shadow: 0 28px 0 #e8d5ca, 0 56px 0 #e8d5ca, 0 84px 0 #e8d5ca;
}

.art-search {
    position: absolute;
    right: 12%;
    bottom: 13%;
    width: 29%;
    aspect-ratio: 1;
    border: 8px solid #8c6a51;
    border-radius: 50%;
    background: #fffaf6;
}

.art-search::after {
    content: '';
    position: absolute;
    right: -38%;
    bottom: -22%;
    width: 48%;
    height: 8px;
    border-radius: 8px;
    background: #8c6a51;
    transform: rotate(45deg);
}

.art-spark {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff7c7;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.art-spark-one { top: 10%; right: 12%; }
.art-spark-two { bottom: 12%; left: 9%; transform: scale(0.7); }

.project-art-bill {
    background: linear-gradient(155deg, #f5ead8, #f4c5ae);
}

.bill-receipt {
    position: absolute;
    top: 13%;
    left: 24%;
    width: 52%;
    height: 72%;
    padding: 28% 13% 0;
    border: 3px solid #8c6a51;
    border-radius: 10px 10px 24px 24px;
    background: #fffdf9;
    box-shadow: 12px 14px 0 rgba(140, 106, 81, 0.13);
    transform: rotate(-4deg);
}

.bill-receipt::before {
    content: 'SHARE';
    position: absolute;
    top: 10%;
    left: 0;
    width: 100%;
    color: #8c6a51;
    font-family: var(--font-primary);
    font-size: clamp(12px, 2vw, 22px);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-align: center;
}

.bill-receipt span {
    display: block;
    height: 6px;
    margin-bottom: 18px;
    border-radius: 5px;
    background: #e8d5ca;
}

.bill-coin {
    position: absolute;
    display: grid;
    width: 20%;
    aspect-ratio: 1;
    place-items: center;
    border: 3px solid #8c6a51;
    border-radius: 50%;
    background: #ffe6a7;
    color: #8c6a51;
    font-family: var(--font-primary);
    font-size: clamp(16px, 3vw, 30px);
    font-weight: 700;
}

.bill-coin-one { right: 9%; bottom: 12%; }
.bill-coin-two { left: 9%; top: 18%; transform: scale(0.75); }

.project-art-terminal {
    padding: 20% 10% 10%;
    background: #3f3a3b;
    color: #f8e7d8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-align: left;
}

.terminal-bar {
    position: absolute;
    top: 8%;
    left: 8%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f5bda6;
    box-shadow: 22px 0 0 #ffe6a7, 44px 0 0 #bfe0d5;
}

.terminal-prompt,
.terminal-time,
.terminal-weather {
    display: block;
}

.terminal-prompt {
    color: #bfe0d5;
    font-size: clamp(11px, 1.5vw, 18px);
}

.terminal-time {
    margin-top: 18%;
    font-family: var(--font-primary);
    font-size: clamp(42px, 7vw, 82px);
    font-weight: 700;
    line-height: 1;
}

.terminal-weather {
    margin-top: 12%;
    color: #f5bda6;
    font-size: clamp(11px, 1.5vw, 17px);
}

.project-art-retro {
    display: flex;
    align-items: stretch;
    gap: 4%;
    padding: 18% 7% 10%;
    background: linear-gradient(145deg, #dfe9ff, #f8e6d8);
}

.retro-column {
    display: flex;
    width: 31%;
    padding: 9% 5%;
    flex-direction: column;
    gap: 10%;
    border: 2px solid rgba(74, 59, 50, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 5px 7px 0 rgba(74, 59, 50, 0.08);
}

.retro-column strong {
    min-height: 20%;
    color: #66564c;
    font-size: clamp(8px, 1.1vw, 13px);
    line-height: 1.25;
}

.retro-column i {
    display: block;
    width: 100%;
    height: 24%;
    border-radius: 5px;
    background: #fff1a8;
    box-shadow: 0 2px 5px rgba(74, 59, 50, 0.12);
    transform: rotate(-2deg);
}

.retro-column-two i { background: #ffc8bf; transform: rotate(2deg); }
.retro-column-three i { background: #bfe5d7; }

.project-art-se {
    padding: 24% 10% 10%;
    background: linear-gradient(150deg, #12264a 0%, #1d5a9b 60%, #55b6c8 100%);
    color: #fff;
    text-align: left;
}

.se-browser-bar {
    position: absolute;
    top: 8%;
    left: 7%;
    width: 86%;
    height: 9%;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
}

.se-browser-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffb3a7;
    box-shadow: 14px 0 #ffe49d, 28px 0 #aee1c9;
    transform: translateY(-50%);
}

.se-code-mark {
    display: block;
    color: #8de3dc;
    font-size: clamp(18px, 3vw, 34px);
    font-weight: 700;
}

.se-headline {
    display: block;
    margin-top: 8%;
    font-size: clamp(20px, 3.2vw, 38px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.se-grid {
    position: absolute;
    right: 8%;
    bottom: 8%;
    width: 36%;
    height: 22%;
    opacity: 0.55;
    background-image: linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 14px 14px;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 4vw, 42px);
    max-width: 1000px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.02rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.about-text {
    text-align: left;
}

.about-text strong {
    color: var(--text-primary);
}

.founder-note {
    color: var(--color-apricot-hover);
    font-size: 0.92em;
    font-style: italic;
    font-weight: 700;
}

.personal-quote {
    margin: 16px 0 0;
    padding: 12px 16px;
    border-left: 4px solid var(--color-apricot);
    border-radius: 0 14px 14px 0;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    font-size: 1rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.6;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 16px;
}

.profile-links a,
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-underline-offset: 5px;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.about-detail-card {
    background: #fff;
    padding: 18px;
    border-radius: 20px;
    text-align: left;
    box-shadow: 0 10px 20px rgba(74, 59, 50, 0.08);
}

.about-detail-label {
    display: block;
    font-family: var(--font-primary);
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.about-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.about-tech-list li {
    padding: 5px 8px;
    border-radius: 999px;
    background: #fcf6ef;
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.about-detail-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.achievement-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.achievement-strip > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 6px 16px rgba(74, 59, 50, 0.06);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    text-align: left;
    transition: color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.achievement-strip > a:hover {
    color: var(--text-primary);
    box-shadow: 0 10px 22px rgba(74, 59, 50, 0.1);
    transform: translateY(-3px);
}

/* Latest articles */
.article-section,
.youtube-section {
    overflow: hidden;
    padding-inline: 0;
}

.article-section > .section-container,
.youtube-section > .section-container {
    padding-inline: clamp(16px, 4vw, 32px);
}

.article-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-top: 16px;
}

.article-carousel {
    display: flex;
    gap: clamp(16px, 2.4vw, 30px);
    padding: 12px max(72px, 8vw, calc((100vw - 1080px) / 2 + 72px)) 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.article-carousel::-webkit-scrollbar {
    display: none;
}

.article-card {
    flex: 0 0 min(78vw, 340px);
    width: min(78vw, 340px);
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(140, 106, 81, 0.12);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(74, 59, 50, 0.1);
    scroll-snap-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    box-shadow: 0 20px 42px rgba(74, 59, 50, 0.15);
    transform: translateY(-7px);
}

.article-card-link {
    display: flex;
    height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.article-image-wrap {
    position: relative;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: #f2e8dd;
}

.article-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.article-card:hover .article-image-wrap img {
    transform: scale(1.04);
}

.article-image-placeholder {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.72) 0 8%, transparent 9%),
        linear-gradient(145deg, #171717, #4b423d 58%, #8c6a51);
}

.article-placeholder-mark {
    color: #fff7f1;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.05em;
}

.article-source {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(74, 59, 50, 0.12);
}

.article-card-content {
    display: flex;
    flex: 1;
    padding: 18px;
    flex-direction: column;
    text-align: left;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 9px !important;
    color: var(--color-apricot-hover) !important;
    font-size: 0.72rem !important;
    font-weight: 700;
}

.article-card h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1.12rem;
    line-height: 1.35;
}

.article-description {
    display: -webkit-box;
    margin-bottom: 14px !important;
    overflow: hidden;
    color: var(--text-muted) !important;
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.article-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.article-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 8px 22px rgba(74, 59, 50, 0.16);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.article-carousel-arrow:hover {
    background: var(--color-apricot);
    transform: translateY(-50%) scale(1.07);
}

.article-carousel-arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.article-prev-arrow {
    left: 22px;
}

.article-next-arrow {
    right: 22px;
}

.article-carousel-dots {
    display: flex;
    min-height: 14px;
    justify-content: center;
    gap: 10px;
}

.article-carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.article-carousel-dot.active {
    background: var(--color-apricot);
    transform: scale(1.25);
}

.article-empty {
    max-width: 620px;
    margin: 28px auto 0 !important;
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem !important;
}

/* Chapter 4: On YouTube. Videos from both channels, newest first (live pinned to
   front); the carousel auto-advances and loops -- see setupCarousel's autoplay option. */
.broadcast-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-top: 16px;
}

.broadcast-carousel {
    display: flex;
    gap: clamp(16px, 2.4vw, 30px);
    padding: 12px max(72px, 8vw, calc((100vw - 1080px) / 2 + 72px)) 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.broadcast-carousel::-webkit-scrollbar {
    display: none;
}

.broadcast-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 8px 22px rgba(74, 59, 50, 0.16);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.broadcast-carousel-arrow:hover {
    background: var(--color-apricot);
    transform: translateY(-50%) scale(1.07);
}

.broadcast-carousel-arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.broadcast-prev-arrow {
    left: 22px;
}

.broadcast-next-arrow {
    right: 22px;
}

.article-carousel-arrow,
.broadcast-carousel-arrow {
    width: 60px;
    height: 60px;
    box-shadow: 0 5px 15px rgba(74, 59, 50, 0.15);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.article-carousel-arrow:hover,
.broadcast-carousel-arrow:hover {
    transform: translateY(-50%) scale(1.1);
}

.article-carousel-arrow svg,
.broadcast-carousel-arrow svg {
    width: 24px;
    height: 24px;
}

.broadcast-carousel-dots {
    display: flex;
    min-height: 14px;
    justify-content: center;
    gap: 10px;
}

.broadcast-carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.broadcast-carousel-dot.active {
    background: var(--color-apricot);
    transform: scale(1.25);
}

.broadcast-card {
    flex: 0 0 min(78vw, 340px);
    width: min(78vw, 340px);
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(140, 106, 81, 0.12);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(74, 59, 50, 0.1);
    scroll-snap-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.broadcast-card:hover {
    box-shadow: 0 20px 42px rgba(74, 59, 50, 0.15);
    transform: translateY(-7px);
}

.broadcast-card[data-state="live"] {
    border-color: rgba(224, 80, 58, 0.35);
    box-shadow: 0 14px 34px rgba(224, 80, 58, 0.16);
}

.broadcast-card-link {
    display: flex;
    height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.broadcast-thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f2e8dd;
}

.broadcast-channel {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(74, 59, 50, 0.12);
}

.broadcast-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.broadcast-card:hover .broadcast-thumb-wrap img {
    transform: scale(1.04);
}

.broadcast-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(74, 59, 50, 0.12);
}

.broadcast-card[data-state="live"] .broadcast-badge {
    color: #b8341f;
}

/* Real semantic state (channel is streaming right now), not decoration. */
.broadcast-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
}

.broadcast-card[data-state="live"] .broadcast-badge::before {
    background: #e0503a;
    opacity: 1;
    animation: broadcast-pulse 1.6s ease-in-out infinite;
}

@keyframes broadcast-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .broadcast-card[data-state="live"] .broadcast-badge::before {
        animation: none;
    }
}

@media (max-width: 800px) {
    .portfolio-carousel,
    .article-carousel,
    .broadcast-carousel {
        overflow-x: auto !important;
        touch-action: pan-x pan-y;
        -webkit-overflow-scrolling: touch;
    }
}

.broadcast-card-content {
    display: flex;
    flex: 1;
    min-width: 0;
    padding: 18px 20px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: left;
}

.broadcast-card-content h3 {
    color: var(--text-primary);
    font-size: 1.08rem;
    line-height: 1.35;
}

.broadcast-meta {
    color: var(--color-apricot-hover) !important;
    font-size: 0.78rem !important;
    font-weight: 700;
}

.broadcast-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.broadcast-empty {
    max-width: 620px;
    margin: 28px auto 0 !important;
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem !important;
    text-align: center;
}

.contact-links {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: clamp(10px, 1.6vw, 14px);
    margin-top: clamp(20px, 3vw, 28px);
}

.contact-links.is-detail-open .contact-link {
    display: none;
}

.contact-link {
    min-width: 0;
    display: flex;
    min-height: 104px;
    padding: clamp(14px, 2vw, 18px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    border: 1px solid rgba(140, 106, 81, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(74, 59, 50, 0.07);
    color: var(--text-primary);
    text-align: left;
    text-decoration: none;
    transition: grid-column 0.25s ease, min-height 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.contact-link:nth-of-type(-n + 4) {
    grid-column: span 3;
}

.contact-link:nth-of-type(n + 5):nth-of-type(-n + 7) {
    grid-column: span 4;
}

.contact-link:hover {
    background-color: #fff8f3;
    box-shadow: 0 16px 30px rgba(74, 59, 50, 0.12);
    transform: translateY(-5px);
}

.contact-github:hover {
    border-color: rgba(36, 41, 47, 0.28);
    background-color: #f6f8fa;
}

.contact-bso:hover {
    border-color: rgba(245, 189, 166, 0.6);
    background-color: #fff4ed;
}

.contact-linkedin:hover {
    border-color: rgba(10, 102, 194, 0.3);
    background-color: #eef6ff;
    color: #0a66c2;
}

.contact-mail:hover {
    border-color: rgba(224, 80, 58, 0.28);
    background-color: #fff1ed;
    color: #b84a36;
}

.contact-instagram:hover {
    border-color: rgba(193, 53, 132, 0.28);
    background-color: #fff0f7;
    color: #c13584;
}

.contact-medium:hover {
    border-color: rgba(25, 25, 25, 0.22);
    background-color: #f5f5f2;
    color: #292929;
}

.contact-youtube:hover {
    border-color: rgba(255, 0, 0, 0.24);
    background-color: #fff0f0;
    color: #c00;
}

.contact-youtube-preview {
    display: grid;
    width: 100%;
    max-height: 0;
    grid-template-columns: minmax(96px, 150px) minmax(0, 1fr);
    gap: 14px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: max-height 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.contact-youtube.is-expanded .contact-youtube-preview {
    max-height: 118px;
    opacity: 1;
    transform: translateY(0);
}

.youtube-preview-thumb {
    display: block;
    min-height: 84px;
    border-radius: 12px;
    background: #f4d8d0 center / cover no-repeat;
    box-shadow: inset 0 0 0 1px rgba(140, 106, 81, 0.1);
}

.youtube-preview-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.youtube-preview-label {
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 0, 0, 0.08);
    color: #c00;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.youtube-preview-title {
    color: var(--text-primary);
    font-size: clamp(0.94rem, 1.6vw, 1.18rem);
    font-weight: 800;
    line-height: 1.25;
}

.youtube-preview-meta {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.contact-link-featured {
    grid-column: span 8;
    min-height: 132px;
    background: linear-gradient(135deg, #fff 0%, #fff4ed 100%);
}

.contact-link:last-child {
    grid-column: span 4;
    min-height: 132px;
}

.contact-detail-panel {
    position: relative;
    z-index: 5;
    grid-column: 1 / -1;
    display: grid;
    min-height: var(--contact-grid-height, 0px);
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid rgba(140, 106, 81, 0.14);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(74, 59, 50, 0.12);
    text-align: left;
    animation: contact-detail-in 0.24s ease both;
}

.contact-detail-panel[hidden] {
    display: none;
}

.contact-detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(140, 106, 81, 0.16);
    border-radius: 999px;
    background: #fffaf6;
    box-shadow: 0 8px 20px rgba(74, 59, 50, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.contact-detail-content {
    display: grid;
    min-height: 100%;
    width: 100%;
    grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(16px, 3vw, 28px);
    align-items: center;
}

.contact-detail-media {
    min-width: 0;
    min-height: min(320px, 42vw);
    border-radius: 16px;
    background: #f5e4d8;
    overflow: hidden;
}

.contact-detail-media.article-image-placeholder {
    position: relative;
    min-height: min(320px, 42vw);
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.72) 0 8%, transparent 9%),
        linear-gradient(145deg, #171717, #4b423d 58%, #8c6a51);
}

.contact-detail-media.article-image-placeholder .article-placeholder-mark {
    max-width: min(76%, 520px);
    text-align: center;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.05;
}

.contact-detail-media.article-image-placeholder .article-source {
    top: 14px;
    left: 14px;
}

.contact-detail-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: min(320px, 42vw);
    object-fit: cover;
}

.contact-detail-media-contain {
    display: grid;
    place-items: center;
    padding: 18px;
}

.contact-detail-media-contain img {
    height: auto;
    min-height: 0;
    object-fit: contain;
}

.contact-detail-media-avatar {
    display: grid;
    min-height: 180px;
    place-items: center;
    padding: 22px;
}

.contact-detail-media-avatar img {
    width: min(180px, 70%);
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(74, 59, 50, 0.12);
}

.contact-detail-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.contact-detail-kicker {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contact-detail-title {
    color: var(--text-primary);
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
}

.contact-detail-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.55;
}

.contact-detail-actions,
.contact-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-contribution-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(140, 106, 81, 0.12);
    border-radius: 14px;
    padding: 10px;
    background: #fbfaf8;
}

.contact-contribution-card img {
    display: block;
    width: 100%;
    height: auto;
}

.contact-detail-chip,
.contact-detail-action {
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff5ee;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.contact-detail-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-apricot);
}

.contact-detail-form {
    display: grid;
    flex: 1;
    gap: 8px;
}

.contact-detail-form input,
.contact-detail-form textarea {
    width: 100%;
    border: 1px solid rgba(140, 106, 81, 0.18);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fffaf6;
    color: var(--text-primary);
    font: inherit;
}

.contact-detail-form textarea {
    min-height: 92px;
    resize: vertical;
}

@keyframes contact-detail-in {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

::view-transition-group(contact-bento) {
    animation-duration: 0.32s;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (orientation: portrait) and (max-width: 1100px) {
    .contact-detail-content {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .contact-detail-media,
    .contact-detail-media img {
        min-height: 0;
    }

    .contact-detail-media.article-image-placeholder {
        min-height: clamp(170px, 42vw, 260px);
    }

    .contact-detail-media-contain img {
        min-height: 0;
    }

    .contact-detail-copy {
        justify-content: flex-start;
    }

    .contact-detail-panel[data-detail-type="email"] .contact-detail-content {
        grid-template-rows: 1fr;
    }

    .contact-detail-panel[data-detail-type="email"] .contact-detail-media {
        display: none;
    }

    .contact-detail-panel[data-detail-type="email"] .contact-detail-copy {
        min-height: 100%;
    }

    .contact-detail-panel[data-detail-type="email"] .contact-detail-form {
        grid-template-rows: auto minmax(180px, 1fr) auto;
    }

    .contact-detail-panel[data-detail-type="email"] .contact-detail-form textarea {
        min-height: 180px;
        height: 100%;
    }
}

.contact-detail-panel[data-detail-type="email"] .contact-detail-content {
    grid-template-columns: 1fr;
}

.contact-detail-panel[data-detail-type="email"] .contact-detail-media {
    display: none;
}

.contact-detail-panel[data-detail-type="email"] .contact-detail-copy {
    min-height: 100%;
}

.contact-detail-panel[data-detail-type="email"] .contact-detail-form {
    grid-template-rows: auto minmax(140px, 1fr) auto;
}

.contact-detail-panel[data-detail-type="email"] .contact-detail-form textarea {
    height: 100%;
    min-height: 140px;
}

.contact-platform {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.contact-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contact-description {
    margin: 10px 0 18px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.55;
}

.contact-handle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .project-row,
    .project-row.reverse {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

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

    .project-art {
        width: min(54vw, 300px);
    }

    .tech-list,
    .project-actions {
        justify-content: center;
    }

    .carousel-arrow {
        width: 48px;
        height: 48px;
    }
}

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

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

    .profile-links {
        justify-content: center;
    }
}

@media (max-width: 800px) {
    .paper-card {
        flex-basis: 90vw;
        width: 90vw;
        padding: clamp(20px, 5vw, 28px);
        scroll-snap-stop: always;
    }

    .project-art {
        width: min(58vw, 260px);
    }

    .contact-links {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .contact-link,
    .contact-link:nth-of-type(-n + 4),
    .contact-link:nth-of-type(n + 5):nth-of-type(-n + 7),
    .contact-link:last-child {
        grid-column: span 3;
    }

    .contact-link-featured {
        grid-column: span 6;
    }

    .contact-detail-content {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .contact-detail-media,
    .contact-detail-media img {
        min-height: 0;
    }

    .contact-detail-media.article-image-placeholder {
        min-height: 180px;
    }

    .contact-detail-copy {
        justify-content: flex-start;
    }

    .article-card,
    .broadcast-card {
        scroll-snap-stop: always;
    }

    .carousel-arrow {
        display: none;
    }

    .article-carousel-arrow,
    .broadcast-carousel-arrow {
        display: none;
    }

    .achievement-strip > a {
        flex: 1 1 280px;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .chapter-section {
        padding: 40px 16px;
    }

    .chapter-title {
        margin-bottom: 14px !important;
        font-size: 1.85rem;
    }

    .section-intro {
        font-size: 0.94rem !important;
        line-height: 1.5 !important;
    }

    .contact-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .contact-link,
    .contact-link:nth-of-type(-n + 4),
    .contact-link:nth-of-type(n + 5):nth-of-type(-n + 7),
    .contact-link:last-child {
        grid-column: span 1;
        min-height: 78px;
        padding: 11px 10px;
    }

    .contact-link-featured,
    .contact-link:nth-child(4),
    .contact-link:nth-child(5) {
        grid-column: span 2;
    }

    .contact-youtube-preview {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .contact-youtube.is-expanded .contact-youtube-preview {
        max-height: 170px;
    }

    .youtube-preview-thumb {
        min-height: 96px;
    }

    .contact-detail-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .contact-detail-media,
    .contact-detail-media img {
        min-height: 0;
    }

    .contact-detail-title {
        font-size: 1.2rem;
    }

    .contact-detail-text {
        font-size: 0.86rem;
    }

    .contact-platform {
        font-size: 0.8rem;
    }

    .contact-description {
        margin: 7px 0 10px;
        font-size: 0.68rem;
        line-height: 1.4;
    }

    .contact-handle {
        font-size: 0.64rem;
    }

    .portfolio-carousel {
        padding-inline: 5vw;
        gap: 5vw;
    }

    .article-carousel,
    .broadcast-carousel {
        padding-inline: 5vw;
        gap: 5vw;
    }

    .article-card,
    .broadcast-card {
        flex-basis: 90vw;
        width: 90vw;
    }

    .article-card-content,
    .broadcast-card-content {
        padding: 17px;
    }

    .paper-card {
        border-radius: 16px;
        padding: 16px;
    }

    .paper-frame {
        padding: 14px;
    }

    .paper-frame::after {
        inset: 14px;
    }

    .project-art {
        width: min(40vw, 150px);
    }

    .project-row,
    .project-row.reverse {
        gap: 12px;
    }

    .project-label {
        margin-bottom: 6px;
        font-size: 0.64rem;
    }

    .project-text h3 {
        margin-bottom: 6px;
        font-size: 1.35rem;
    }

    .project-text p {
        display: -webkit-box;
        margin-bottom: 10px;
        overflow: hidden;
        font-size: 0.86rem;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .tech-list {
        gap: 5px;
        margin-bottom: 10px;
    }

    .tech-list li {
        padding: 5px 8px;
        font-size: 0.62rem;
    }

    .tech-list li:nth-child(n + 4) {
        display: none;
    }

    .project-actions {
        flex-direction: row;
        gap: 10px;
    }

    .cta-button {
        width: auto;
        max-width: none;
        padding: 9px 14px;
        font-size: 0.76rem;
    }

    .about-detail-card {
        padding: 16px;
    }

    .about-details {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .about-detail-label {
        font-size: 0.67rem;
        letter-spacing: 0.08em;
    }

    .about-tech-list {
        gap: 5px;
    }

    .about-tech-list li {
        padding: 4px 6px;
        font-size: 0.61rem;
    }

    .about-tech-list li:nth-child(n + 7) {
        display: none;
    }

    .about-detail-card p {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.76rem;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 6;
    }

    .achievement-strip > a {
        flex: 0 0 min(78vw, 280px);
    }

    .achievement-strip {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        margin-inline: -16px;
        padding-inline: 16px;
        scrollbar-width: none;
    }

    .achievement-strip::-webkit-scrollbar {
        display: none;
    }
}

/* --- Header & Navigation --- */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: clamp(16px, 3vw, 28px) clamp(18px, 5vw, 64px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        backdrop-filter 0.35s ease;
}

.fixed-header.is-scrolled {
    background: rgba(252, 251, 250, 0.9);
    border-bottom-color: rgba(140, 106, 81, 0.08);
    box-shadow: 0 8px 24px rgba(74, 59, 50, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-mark {
    color: var(--text-primary);
    font-size: clamp(14px, 1.6vw, 18px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.nav {
    display: flex;
    max-width: 100%;
    gap: clamp(14px, 3vw, 34px);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    font-family: var(--font-primary);
    font-size: clamp(12px, 1.4vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 4px;
    position: relative;
    text-shadow: 0 1px 8px rgba(255, 255, 255, 0.58);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.fixed-header.is-scrolled .nav-link {
    text-shadow: none;
}

.fixed-header.is-scrolled .site-mark {
    text-shadow: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background-color: var(--text-primary);
    opacity: 0;
    transform: translateX(-50%) translateY(3px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-link.active::after,
.nav-link:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-link:hover {
    color: #61402a;
}

.header-cta {
    color: var(--text-primary);
    border: 1px solid rgba(140, 106, 81, 0.28);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(252, 251, 250, 0.32);
    box-shadow: 0 10px 30px rgba(140, 106, 81, 0.08);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.header-cta:hover {
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 36px rgba(140, 106, 81, 0.14);
    transform: translateY(-1px);
}

/* --- Hero Branding Content --- */
.hero-content {
    position: absolute;
    top: 43%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50; /* Above rabbits (z-index: 4-10), below curtains (z-index: 100) */
    width: 90%;
    max-width: 720px;
    pointer-events: none;
}

.logo-title {
    font-family: var(--font-primary);
    font-size: clamp(58px, 11vw, 112px);
    font-weight: 700;
    letter-spacing: -0.075em;
    color: var(--text-primary);
    line-height: 0.86;
    text-shadow: 0 10px 36px rgba(255, 255, 255, 0.44);
    user-select: none;
    text-wrap: balance;
}

.scroll-indicator {
    display: none;
    position: absolute;
    bottom: clamp(44px, 5vw, 68px);
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-primary);
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.82;
    z-index: 105; /* Above curtains so it's visible */
    animation: bounce 2s infinite;
    pointer-events: none;
}

.scroll-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(140, 106, 81, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.36);
    box-shadow: 0 10px 30px rgba(140, 106, 81, 0.12);
}

.scroll-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-15px) translateX(-50%);
    }
    60% {
        transform: translateY(-7px) translateX(-50%);
    }
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    background-color: var(--color-apricot);
    border: none;
    border-radius: 25px;
    padding: 12px 32px;
    cursor: pointer;
    pointer-events: auto; /* Re-enable clicks */
    box-shadow: 0 4px 15px rgba(245, 189, 166, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}

.cta-button:hover {
    background-color: var(--color-apricot-hover);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(245, 189, 166, 0.6);
}

.cta-button:active {
    transform: translateY(0) scale(0.98);
}

/* --- Interactive Heaven Garden with Paper Craft Background --- */
.garden-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none; /* Removed auto because clicks shouldn't spawn bunnies anymore */
}

.garden-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 35%, rgba(252, 251, 250, 0.38), rgba(252, 251, 250, 0) 38%),
        linear-gradient(to bottom, rgba(252, 251, 250, 0.18), rgba(252, 251, 250, 0) 45%, rgba(140, 106, 81, 0.08));
    pointer-events: none;
}

.parallax-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1); /* Ultra-smooth mouse response */
}

/* Layer 1: AI Generated Heavenly Background */
.layer-ai-bg {
    position: absolute;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    object-position: center bottom;
    z-index: 1;
}

/* Layer 3: AI Generated Transparent Foreground (Split Curtains via Clip-Path) */
.fg-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    filter: drop-shadow(0 -5px 15px rgba(0,0,0,0.25));
}

.left-fg {
    object-position: left 82%;
}

.right-fg {
    object-position: right 82%;
}

.layer-ai-fg-left {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    z-index: 100;
}

.layer-ai-fg-right {
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
    z-index: 100;
}

/* Layer 3: Far Hills */
.layer-hills-far {
    z-index: 3;
}

/* Layer 4: Mid Hills */
.layer-hills-mid {
    z-index: 4;
}

/* Layer 5: Near Hills */
.layer-hills-near {
    z-index: 5;
}

/* Layer 6: Foreground Sway Details */
.layer-foreground {
    z-index: 6;
}

/* Responsive Hill SVG Base */
.hill-svg {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 -8px 12px rgba(0,0,0,0.15));
}

.foreground-elements-svg {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Swaying Flowers / Grass in Foreground */
.swaying-plant {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: plant-sway 6s ease-in-out infinite alternate;
}

.plant-left-2 { animation-delay: -1.5s; animation-duration: 5s; }
.plant-left-3 { animation-delay: -3s; animation-duration: 7s; }
.plant-right-1 { animation-delay: -0.5s; animation-duration: 6.5s; }
.plant-right-2 { animation-delay: -2s; animation-duration: 5.5s; }
.plant-right-3 { animation-delay: -4s; animation-duration: 7.2s; }

@keyframes plant-sway {
    0% { transform: rotate(-3deg) skewX(-1deg); }
    100% { transform: rotate(3deg) skewX(1deg); }
}

/* --- Rabbit Anatomy & Animations --- */
.rabbit-container {
    position: absolute;
    pointer-events: auto; /* Active for click and hover */
}

/* Rabbit Base Styling & Core Parts */
.rabbit {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.rabbit-group {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: rabbit-breathe 3s ease-in-out infinite;
}

.ear-left, .ear-right, .leg-front-1, .leg-front-2, .leg-back-1, .leg-back-2, .head-group, .tail {
    transform-box: fill-box;
}

/* Soft breathing animation */
@keyframes rabbit-breathe {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.02, 0.97) translateY(0.5px); }
}

/* Ear wiggle loops */
@keyframes ear-wiggle-left {
    0%, 92%, 100% { transform: rotate(0deg); }
    94% { transform: rotate(-10deg); }
    96% { transform: rotate(8deg); }
}
@keyframes ear-wiggle-right {
    0%, 90%, 100% { transform: rotate(0deg); }
    92% { transform: rotate(10deg); }
    95% { transform: rotate(-8deg); }
}

/* 1. White Fluffy Bunny (Bottom Right) */
.near-white-bunny {
    right: 14%;
    bottom: 8%;
    width: 110px;
    height: 80px;
    z-index: 10;
}

.near-white-bunny .ear-left {
    transform-origin: 88px 38px;
    animation: ear-wiggle-left 5.2s ease-in-out infinite;
}

.near-white-bunny .ear-right {
    transform-origin: 94px 34px;
    animation: ear-wiggle-right 4.8s ease-in-out infinite;
}

.near-white-bunny:hover .head-group {
    transform: rotate(-3deg) translateY(-1px);
    transition: transform 0.2s ease;
}

/* Trigger Happy Hop on White Bunny */
.near-white-bunny.happy-hop {
    animation: white-happy-hop 0.8s cubic-bezier(0.25, 0.8, 0.25, 1.2);
}

.near-white-bunny.happy-hop .leg-front-1,
.near-white-bunny.happy-hop .leg-front-2 {
    animation: paw-stretch 0.8s ease-in-out;
}

.near-white-bunny.happy-hop .leg-back-1,
.near-white-bunny.happy-hop .leg-back-2 {
    animation: kick-back 0.8s ease-in-out;
}

@keyframes white-happy-hop {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-38px) scale(0.95, 1.05) rotate(-5deg); }
    50% { transform: translateY(-42px) scale(1) rotate(0deg); }
    70% { transform: translateY(-15px) scale(1) rotate(2deg); }
    85% { transform: translateY(0) scale(1.08, 0.9) rotate(0deg); } /* squish */
}

/* 2. Spotted Bunny (Bottom Left) */
.near-spotted-bunny {
    left: 10%;
    bottom: 12%;
    width: 115px;
    height: 85px;
    z-index: 10;
}

.near-spotted-bunny .ear-left {
    transform-origin: 102px 41px;
    animation: ear-wiggle-left 4.5s ease-in-out infinite;
}

.near-spotted-bunny .ear-right {
    transform-origin: 108px 43px;
    animation: ear-wiggle-right 4.2s ease-in-out infinite;
}

/* Spotted Bunny Run Animation (Leaps forward and back on click) */
.near-spotted-bunny.happy-hop {
    animation: spotted-dash-hop 1s cubic-bezier(0.25, 0.8, 0.25, 1.1);
}

.near-spotted-bunny.happy-hop .leg-front-1 { animation: run-front-leg 0.5s ease-in-out 2; }
.near-spotted-bunny.happy-hop .leg-front-2 { animation: run-front-leg-delay 0.5s ease-in-out 2; }
.near-spotted-bunny.happy-hop .leg-back-1 { animation: run-back-leg 0.5s ease-in-out 2; }
.near-spotted-bunny.happy-hop .leg-back-2 { animation: run-back-leg-delay 0.5s ease-in-out 2; }

@keyframes spotted-dash-hop {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(30px, -30px) rotate(8deg); }
    40% { transform: translate(55px, -35px) rotate(4deg); }
    60% { transform: translate(80px, -20px) rotate(-3deg); }
    80% { transform: translate(35px, 0) scale(1.08, 0.92); } /* squish slide back */
}

/* Paw stretching & leg animations */
@keyframes paw-stretch {
    0%, 100% { transform: rotate(0deg); }
    30%, 60% { transform: rotate(35deg) translate(3px, -2px); }
}

@keyframes kick-back {
    0%, 100% { transform: rotate(0deg); }
    35%, 65% { transform: rotate(-40deg) translate(-4px, 2px); }
}

@keyframes run-front-leg {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(35deg) translate(2px, -3px); }
}
@keyframes run-front-leg-delay {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-25deg) translate(-1px, 2px); }
}
@keyframes run-back-leg {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-40deg) translate(-3px, 1px); }
}
@keyframes run-back-leg-delay {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg) translate(2px, -1px); }
}

/* 3. Orange Bunnies in Mid-ground (Hopping paths) */
.mid-orange-bunny-1 {
    width: 60px;
    height: 48px;
    z-index: 5;
    /* Move along hill shape natively using offset-path */
    offset-path: path("M -50 280 Q 250 330, 600 270 T 1250 300");
    animation: orange-move-1 15s linear infinite;
}

.mid-orange-bunny-2 {
    width: 60px;
    height: 48px;
    z-index: 5;
    offset-path: path("M 1250 300 Q 950 270, 600 290 T -50 280");
    animation: orange-move-2 18s linear infinite;
    animation-delay: -5s;
}

/* Orange bunny running animation cycles */
.mid-orange-bunny-1 .rabbit {
    animation: orange-hop-cycle 0.7s infinite;
}
.mid-orange-bunny-1 .leg-front-1 { animation: run-front-leg 0.35s infinite; }
.mid-orange-bunny-1 .leg-front-2 { animation: run-front-leg-delay 0.35s infinite; }
.mid-orange-bunny-1 .leg-back-1 { animation: run-back-leg 0.35s infinite; }
.mid-orange-bunny-1 .leg-back-2 { animation: run-back-leg-delay 0.35s infinite; }

.mid-orange-bunny-2 .rabbit {
    animation: orange-hop-cycle 0.8s infinite;
}
.mid-orange-bunny-2 .leg-front-1 { animation: run-front-leg 0.4s infinite; }
.mid-orange-bunny-2 .leg-front-2 { animation: run-front-leg-delay 0.4s infinite; }
.mid-orange-bunny-2 .leg-back-1 { animation: run-back-leg 0.4s infinite; }
.mid-orange-bunny-2 .leg-back-2 { animation: run-back-leg-delay 0.4s infinite; }

/* Move along path animations */
@keyframes orange-move-1 {
    0% { offset-distance: 0%; transform: scaleX(1); }
    49% { transform: scaleX(1); }
    50% { offset-distance: 100%; transform: scaleX(-1); }
    99% { transform: scaleX(-1); }
    100% { offset-distance: 0%; transform: scaleX(1); }
}

@keyframes orange-move-2 {
    0% { offset-distance: 0%; transform: scaleX(1); }
    49% { transform: scaleX(1); }
    50% { offset-distance: 100%; transform: scaleX(-1); }
    99% { transform: scaleX(-1); }
    100% { offset-distance: 0%; transform: scaleX(1); }
}

@keyframes orange-hop-cycle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(4deg); }
}

/* Follow-Click Magic Bunny (Created via JS when user clicks hills) */
.click-magic-bunny {
    position: absolute;
    width: 45px;
    height: 36px;
    z-index: 8;
    pointer-events: none;
    transition: left 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), bottom 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.click-magic-bunny .rabbit {
    animation: magic-bunny-hop 0.5s ease-in-out infinite;
}

@keyframes magic-bunny-hop {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-18px) scaleY(1.08) rotate(3deg); }
}

/* --- Butterflies --- */
.butterfly {
    position: absolute;
    pointer-events: none;
}

.butterfly-blue {
    top: 55%;
    left: 20%;
    animation: float-butterfly-1 12s ease-in-out infinite;
}

.butterfly-orange {
    top: 48%;
    right: 22%;
    animation: float-butterfly-2 15s ease-in-out infinite;
}

/* Butterfly wing-flap animation */
.wing-left {
    transform-origin: 20px 20px;
    animation: wing-flap-left 0.15s linear infinite alternate;
}

.wing-right {
    transform-origin: 20px 20px;
    animation: wing-flap-right 0.15s linear infinite alternate;
}

@keyframes wing-flap-left {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0.1); }
}

@keyframes wing-flap-right {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0.1); }
}

/* Butterfly flight loops */
@keyframes float-butterfly-1 {
    0%, 100% { transform: translate(0, 0) scale(0.9); }
    25% { transform: translate(80px, -30px) scale(1); }
    50% { transform: translate(140px, 10px) scale(0.8); }
    75% { transform: translate(60px, 40px) scale(0.95); }
}

@keyframes float-butterfly-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-90px, 40px) scale(0.85); }
    66% { transform: translate(-40px, -30px) scale(0.95); }
}

/* --- Magical Sparkle overlay --- */
.sparkles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6; /* Floating above hills and rabbits */
}

.sparkle {
    position: absolute;
    background: radial-gradient(circle, #ffffff 0%, rgba(254, 240, 138, 0.95) 45%, rgba(254, 240, 138, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-float 3.5s ease-out forwards;
}

@keyframes sparkle-float {
    0% {
        transform: translate(0, 0) scale(0.4);
        opacity: 0;
    }
    15% {
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--drift-x), -160px) scale(1.4);
        opacity: 0;
    }
}

/* --- Paper Mario Cutout Rabbits --- */
.paper-rabbit {
    position: absolute;
    width: 100px;
    aspect-ratio: 1 / 1;
    background-size: 300% 200%; /* Perfect 3x2 grid mapping */
    background-position: 0% 0%;
    background-repeat: no-repeat;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.35));
    transform-origin: bottom center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 5;
    --facing: 1;
    --depth-scale: 1;
    transform: scaleX(var(--facing));
    transition: left 3.5s linear, bottom 3.5s linear, width 3.5s linear, filter 0.3s ease;
}

/* Base IDs and Sizes (Scaling responsively with screen width and depth) */
#yamroll { background-image: url('../assets/images/yamroll_sprites.webp'); left: 15%; bottom: 8%; width: calc(clamp(78px, 9vw, 150px) * var(--depth-scale)); }
#snowcone { background-image: url('../assets/images/snowcone_sprites.webp'); left: 60%; bottom: 10%; width: calc(clamp(72px, 8vw, 138px) * var(--depth-scale)); }
#baby1 { background-image: url('../assets/images/baby1_sprites.webp'); left: 30%; bottom: 5%; width: calc(clamp(58px, 6.5vw, 112px) * var(--depth-scale)); z-index: 6;}
#baby2 { background-image: url('../assets/images/baby2_sprites.webp'); left: 45%; bottom: 2%; width: calc(clamp(62px, 7vw, 120px) * var(--depth-scale)); }
#baby3 { background-image: url('../assets/images/baby3_sprites.webp'); left: 75%; bottom: 12%; width: calc(clamp(58px, 6.5vw, 112px) * var(--depth-scale)); z-index: 4;}
#baby4 { background-image: url('../assets/images/baby4_sprites.webp'); left: 5%; bottom: 15%; width: calc(clamp(62px, 7vw, 120px) * var(--depth-scale)); z-index: 4;}

/* Paper-cutout portfolio avatar */
.paper-person {
    position: absolute;
    left: 64%;
    bottom: 5%;
    width: calc(clamp(82px, 8vw, 140px) * var(--depth-scale));
    aspect-ratio: 320 / 444;
    cursor: pointer;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.35));
    pointer-events: auto;
    transform-origin: bottom center;
    transition: left 3.5s linear, bottom 3.5s linear, width 3.5s linear, filter 0.3s ease;
    --facing: 1;
    --avatar-facing: 1;
    --depth-scale: 1;
}

.paper-person-frame {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    opacity: 1;
}

.paper-person.pose-walking {
    animation: person-walk-bob 0.7s ease-in-out infinite;
}

.paper-person.pose-sleeping {
    animation: person-rest 2.8s ease-in-out infinite alternate;
}

@keyframes person-walk-bob {
    0%, 49.99% {
        transform: scaleX(var(--avatar-facing)) translateY(0);
    }
    50%, 100% {
        transform: scaleX(var(--avatar-facing)) translateY(-3px);
    }
}

@keyframes person-rest {
    0% { transform: translateY(0) rotateZ(-0.5deg); }
    100% { transform: translateY(2px) rotateZ(0.5deg); }
}

/* State Machine Poses (Percentage Mapping) */
.pose-walk1 { background-position: 0% 0%; }
.pose-walk2 { background-position: 50% 0%; }
.pose-sitting { background-position: 100% 0%; }
.pose-sleeping { background-position: 0% 100%; }
.pose-jumping { background-position: 50% 100%; }
.pose-standing { background-position: 100% 100%; }

/* Paper Mario Animations */
/* Waddle for walking state via sprite flip-book */
.paper-rabbit.pose-walking {
    animation: flip-walk 0.35s steps(1) infinite;
}

/* Sleep breathing */
.paper-rabbit.pose-sleeping {
    animation: sleep-breathe 2.5s ease-in-out infinite alternate;
}

/* Standing sway */
.paper-rabbit.pose-standing {
    animation: paper-sway 2s ease-in-out infinite alternate;
}

/* Sitting is just still */
.paper-rabbit.pose-sitting {
    /* No animation */
}

.paper-jump {
    background-position: 50% 100% !important; /* Force jump pose */
    animation: paper-jump 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes flip-walk {
    0% { background-position: 0% 0%; }
    50% { background-position: 50% 0%; }
    100% { background-position: 0% 0%; }
}

@keyframes sleep-breathe {
    0% { transform: scaleX(var(--facing)) scaleY(0.96) scaleX(1.02) rotateZ(5deg); }
    100% { transform: scaleX(var(--facing)) scaleY(1.02) scaleX(0.98) rotateZ(-5deg); }
}

@keyframes paper-sway {
    0% { transform: scaleX(var(--facing)) rotateZ(-2deg); }
    100% { transform: scaleX(var(--facing)) rotateZ(2deg); }
}

@keyframes paper-jump {
    0%, 100% { transform: scaleX(var(--facing)) translateY(0) scaleY(1); }
    30% { transform: scaleX(var(--facing)) translateY(-60px) scaleY(1.1); }
    70% { transform: scaleX(var(--facing)) translateY(-20px) scaleY(1.05); }
    90% { transform: scaleX(var(--facing)) translateY(0) scaleY(0.85); }
}

/* --- Footer --- */
.full-width-footer {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 40px 20px;
    background-color: var(--bg-page);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-top: 2px dashed rgba(140, 106, 81, 0.2);
}

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

.footer-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

.copyright {
    font-size: 13px;
    color: rgba(166, 132, 108, 0.7);
    text-align: center;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1100px) {
    .nav {
        display: none;
    }

    .hero-content {
        top: 41%;
    }
}

@media (max-width: 900px) {
    .scroll-hero-section {
        height: 100vh;
    }

    .fixed-header {
        padding-inline: 18px;
    }

    .header-cta {
        padding: 9px 14px;
    }

    .hero-content {
        top: 39%;
        max-width: 620px;
    }

}

@media (max-width: 600px) {
    .site-mark {
        font-size: 14px;
    }

    .header-cta {
        display: none;
    }

    .hero-content {
        top: 36%;
        width: min(84%, 330px);
    }

    .logo-title {
        font-size: clamp(46px, 17vw, 64px);
        letter-spacing: -0.06em;
    }

    .scroll-indicator {
        display: none;
    }

    /* Fix curtain branches getting cut off and blocking too much on mobile */
    .left-fg {
        object-position: left bottom;
    }

    .right-fg {
        object-position: right bottom;
    }

    .layer-ai-fg-left {
        background-size: cover; /* Maintain perfect aspect ratio */
        left: -30vw; /* Push excess branches off-screen to the left */
        clip-path: none; /* Not needed, image is so wide the right branches are cropped naturally */
    }
    .layer-ai-fg-right {
        background-size: cover; /* Maintain perfect aspect ratio */
        left: 30vw; /* Push excess branches off-screen to the right */
        clip-path: none; 
    }

    .swaying-plant {
        display: none; /* Hide dense vegetation on tiny screens to improve FPS */
    }

    .full-width-footer {
        padding-inline: 16px;
    }
}

/* Accessibility settings for users preferring reduced motion */
@media (prefers-reduced-motion: reduce) {
    .parallax-layer,
    .cloud,
    .swaying-plant,
    .wing-left,
    .wing-right,
    .butterfly,
    .rabbit-group,
    .ear-left,
    .ear-right,
    .mid-orange-bunny-1,
    .mid-orange-bunny-2,
    .rabbit,
    .sparkle {
        animation: none !important;
        transition: none !important;
        offset-path: none !important;
    }
}

@media (max-width: 800px) {
    .portfolio-carousel,
    .article-carousel,
    .broadcast-carousel {
        overflow-x: auto !important;
        touch-action: pan-x pan-y !important;
        -webkit-overflow-scrolling: touch;
    }
}
