/* ============================================
   滕王阁序 · Moebius 风格视觉演绎
   参考 shader.se 布局 · 遵循 Emil Kowalski 动画原则
   ============================================ */

/* --- Design Tokens --- */
:root {
    /* Moebius 色板 — 暖色调沙漠美学 */
    --bg-deep: #0d0a07;
    --bg-warm: #14100a;
    --bg-card: #1a1410;
    --fg-primary: #e8dcc4;
    --fg-secondary: #c4b896;
    --fg-muted: #8a7e6a;
    --accent-amber: #c8843a;
    --accent-amber-bright: #e09b48;
    --accent-teal: #3a7574;
    --accent-rust: #a8552a;
    --line-color: rgba(200, 132, 58, 0.15);

    /* 字体 */
    --font-serif: "Noto Serif SC", "STIX Two Text", Georgia, serif;
    --font-latin: "Cormorant Garamond", Georgia, serif;

    /* 缓动曲线 — 来自 Emil Kowalski skills */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

    /* 尺寸 */
    --nav-height: 64px;
    --max-width: 960px;
    --section-padding: clamp(80px, 15vh, 160px);
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-deep);
    color: var(--fg-primary);
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

::selection {
    background: var(--accent-amber);
    color: var(--bg-deep);
}

/* --- Progress Bar --- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-rust), var(--accent-amber-bright));
    width: 0%;
    z-index: 1000;
    transition: width 100ms linear;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 5vw, 48px);
    z-index: 100;
    background: rgba(13, 10, 7, 0);
    backdrop-filter: blur(0px);
    transition: background 400ms var(--ease-out), backdrop-filter 400ms var(--ease-out), border-color 400ms var(--ease-out);
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: rgba(13, 10, 7, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid var(--line-color);
}

.nav-logo {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--fg-primary);
    transition: opacity 200ms var(--ease-out);
    cursor: pointer;
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--fg-secondary);
    transition: color 200ms var(--ease-out), transform 160ms var(--ease-out);
    cursor: pointer;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-amber);
    transition: width 200ms var(--ease-out);
}

.nav-link:hover {
    color: var(--fg-primary);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent-amber-bright);
}

.nav-link.active::after {
    width: 100%;
    background: var(--accent-amber-bright);
}

.nav-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-menu-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--fg-primary);
    transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out);
}

.nav-menu-toggle.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-menu-toggle.active span:nth-child(2) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* --- Mobile Menu --- */
.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms var(--ease-out);
}

.mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-link {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--fg-primary);
    transition: color 200ms var(--ease-out);
}

.mobile-link:hover {
    color: var(--accent-amber-bright);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100svh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    will-change: transform;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13, 10, 7, 0.5) 0%,
        rgba(13, 10, 7, 0.3) 40%,
        rgba(13, 10, 7, 0.6) 70%,
        rgba(13, 10, 7, 0.95) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 24px;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 800ms var(--ease-out) 200ms forwards;
}

.hero-dynasty, .hero-author {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--fg-secondary);
}

.hero-divider {
    width: 1px;
    height: 14px;
    background: var(--accent-amber);
    opacity: 0.5;
}

.hero-title {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 2vw, 20px);
    margin-bottom: 24px;
}

.hero-title-char {
    font-size: clamp(60px, 12vw, 120px);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--fg-primary);
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    animation: heroCharIn 1000ms var(--ease-out) forwards;
    animation-delay: calc(400ms + var(--i) * 120ms);
    text-shadow: 0 4px 30px rgba(200, 132, 58, 0.3);
}

.hero-subtitle {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 300;
    letter-spacing: 0.3em;
    color: var(--accent-amber-bright);
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 800ms var(--ease-out) 1200ms forwards;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: heroFadeUp 800ms var(--ease-out) 1600ms forwards;
}

.scroll-text {
    font-size: 12px;
    letter-spacing: 0.25em;
    color: var(--fg-muted);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent-amber), transparent);
    animation: scrollLinePulse 2s var(--ease-in-out) infinite;
}

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

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

@keyframes scrollLinePulse {
    0%, 100% { transform: scaleY(1); opacity: 0.6; }
    50% { transform: scaleY(1.3); opacity: 1; }
}

/* --- Section Base --- */
.section {
    position: relative;
    padding: var(--section-padding) clamp(24px, 6vw, 48px);
    overflow: hidden;
}

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

.section-inner--centered {
    text-align: center;
}

.section-inner--two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}

.section-label {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 48px;
}

.section-inner--centered .section-label {
    justify-content: center;
}

.section-num {
    font-size: 14px;
    font-weight: 400;
    color: var(--accent-amber);
    letter-spacing: 0.1em;
}

.section-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--fg-muted);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* --- Text Blocks --- */
.text-block {
    margin-bottom: 48px;
}

.text-vertical-intro {
    font-size: clamp(18px, 2.4vw, 22px);
    font-weight: 500;
    line-height: 2;
    letter-spacing: 0.08em;
    color: var(--fg-primary);
    margin-bottom: 12px;
}

.text-annotation {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.9;
    letter-spacing: 0.03em;
    color: var(--fg-muted);
    padding-left: 20px;
    border-left: 1px solid var(--line-color);
}

.section-inner--centered .text-annotation {
    text-align: left;
}

/* --- Quote Divider --- */
.quote-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 64px;
    padding: 24px 0;
}

.quote-mark {
    font-size: 24px;
    color: var(--accent-amber);
    opacity: 0.4;
}

.quote-text {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--accent-amber-bright);
}

/* --- Scenery Section --- */
.section-scenery {
    background: var(--bg-warm);
}

.parallax-image-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.parallax-image-wrapper--bottom {
    bottom: 0;
    top: auto;
    height: 60%;
}

.parallax-image {
    width: 100%;
    height: 120%;
    object-fit: cover;
    will-change: transform;
}

.parallax-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        var(--bg-warm) 0%,
        rgba(20, 16, 10, 0.85) 30%,
        rgba(20, 16, 10, 0.7) 50%,
        rgba(20, 16, 10, 0.85) 70%,
        var(--bg-warm) 100%
    );
}

.parallax-overlay--light {
    background: linear-gradient(
        180deg,
        var(--bg-deep) 0%,
        rgba(13, 10, 7, 0.5) 50%,
        var(--bg-deep) 100%
    );
}

.section-scenery .section-inner,
.section-reflection .section-inner {
    position: relative;
    z-index: 1;
}

.scenery-hero-text {
    margin-bottom: 64px;
}

.scenery-line {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.15em;
    color: var(--fg-primary);
    text-shadow: 0 2px 20px rgba(200, 132, 58, 0.2);
}

/* --- Gathering Section --- */
.section-gathering {
    background: var(--bg-deep);
}

.col-image {
    position: relative;
}

.section-image {
    width: 100%;
    border-radius: 2px;
    filter: brightness(0.85) sepia(0.15);
    transition: filter 400ms var(--ease-out);
}

.section-image:hover {
    filter: brightness(1) sepia(0.05);
}

.image-caption {
    margin-top: 16px;
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--fg-muted);
    text-align: center;
}

/* --- Reflection Section --- */
.section-reflection {
    background: var(--bg-warm);
}

.reflection-hero {
    margin-bottom: 64px;
}

.reflection-line {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 600;
    line-height: 1.8;
    letter-spacing: 0.2em;
    color: var(--accent-amber-bright);
}

.reflection-line:nth-child(odd) {
    color: var(--fg-primary);
}

/* --- Closing Section --- */
.section-closing {
    background: var(--bg-deep);
    padding-bottom: 120px;
}

.closing-hero {
    margin-bottom: 64px;
}

.closing-line {
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0.15em;
    color: var(--fg-secondary);
}

.closing-line--emphasized {
    color: var(--accent-amber-bright);
    font-weight: 600;
}

.closing-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--line-color);
}

.signature-seal {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-rust);
    color: var(--bg-deep);
    font-size: 24px;
    font-weight: 700;
    border-radius: 4px;
    font-family: var(--font-serif);
}

.signature-info {
    text-align: left;
}

.signature-name {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--fg-primary);
}

.signature-date {
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    margin-top: 4px;
}

.signature-note {
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    opacity: 0.7;
    margin-top: 2px;
}

/* --- Footer --- */
.footer {
    background: var(--bg-deep);
    padding: 60px 24px 40px;
    text-align: center;
    border-top: 1px solid var(--line-color);
}

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

.footer-quote {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--accent-amber);
    margin-bottom: 24px;
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    margin-bottom: 8px;
}

.footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--fg-muted);
}

.footer-credit {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    opacity: 0.5;
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

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

/* --- Autumn Leaves Canvas --- */
.leaves-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
}

/* --- Custom Cursor --- */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-amber-bright);
    margin: -3px 0 0 -3px;
    transition: opacity 200ms var(--ease-out);
}

.cursor-ring {
    width: 32px;
    height: 32px;
    border: 1px solid var(--accent-amber);
    margin: -16px 0 0 -16px;
    opacity: 0.5;
    transition: width 200ms var(--ease-out), height 200ms var(--ease-out), opacity 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.cursor-ring.hovering {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    opacity: 0.8;
    border-color: var(--accent-amber-bright);
}

@media (hover: none), (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* --- Side Section Indicator --- */
.side-indicator {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 50;
    opacity: 0;
    transition: opacity 600ms var(--ease-out) 1000ms;
}

.side-indicator.visible {
    opacity: 1;
}

.side-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fg-muted);
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), background 200ms var(--ease-out);
}

.side-dot:hover {
    opacity: 1;
    transform: scale(1.3);
}

.side-dot.active {
    opacity: 1;
    background: var(--accent-amber-bright);
    transform: scale(1.2);
}

.side-dot-label {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    opacity: 0;
    transition: opacity 200ms var(--ease-out);
    white-space: nowrap;
    pointer-events: none;
}

.side-dot:hover .side-dot-label,
.side-dot.active .side-dot-label {
    opacity: 1;
}

.side-dot.active .side-dot-label {
    color: var(--accent-amber-bright);
}

/* --- Annotation Toggle Button --- */
.nav-toggle-annotation {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--line-color);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--fg-secondary);
    transition: color 200ms var(--ease-out), border-color 200ms var(--ease-out), background 200ms var(--ease-out);
    margin-left: 8px;
}

.nav-toggle-annotation:hover {
    color: var(--accent-amber-bright);
    border-color: var(--accent-amber);
    background: rgba(200, 132, 58, 0.08);
}

.nav-toggle-annotation:active {
    transform: scale(0.97);
}

.nav-toggle-annotation.active {
    color: var(--accent-amber-bright);
    border-color: var(--accent-amber);
    background: rgba(200, 132, 58, 0.12);
}

.nav-toggle-label {
    font-size: 12px;
    letter-spacing: 0.1em;
}

/* --- Annotation Hidden State --- */
body.annotations-hidden .text-annotation {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-left-color: transparent;
    transition: max-height 300ms var(--ease-out), opacity 200ms var(--ease-out), margin 300ms var(--ease-out), padding 300ms var(--ease-out);
}

body:not(.annotations-hidden) .text-annotation {
    max-height: 800px;
    opacity: 1;
    transition: max-height 400ms var(--ease-out), opacity 300ms var(--ease-out) 100ms;
}

/* --- Expandable Text Blocks --- */
[data-expandable] {
    cursor: pointer;
    transition: opacity 200ms var(--ease-out);
}

[data-expandable]:hover .text-vertical-intro {
    color: var(--accent-amber-bright);
}

body:not(.annotations-hidden) [data-expandable].collapsed .text-annotation {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
}

body:not(.annotations-hidden) [data-expandable] .text-annotation {
    max-height: 800px;
    opacity: 1;
}

[data-expandable] .text-vertical-intro {
    transition: color 200ms var(--ease-out);
}

/* --- Interactive Character Hover --- */
.interactive-text {
    cursor: default;
}

.char-span {
    display: inline-block;
    transition: color 200ms var(--ease-out), transform 200ms var(--ease-out), text-shadow 200ms var(--ease-out);
    cursor: default;
}

@media (hover: hover) and (pointer: fine) {
    .char-span:hover {
        color: var(--accent-amber-bright);
        transform: translateY(-3px);
        text-shadow: 0 4px 12px rgba(224, 155, 72, 0.4);
    }

    .scenery-line .char-span:hover,
    .reflection-line .char-span:hover,
    .closing-line .char-span:hover {
        color: var(--accent-amber-bright);
        transform: translateY(-4px) scale(1.1);
        text-shadow: 0 6px 20px rgba(224, 155, 72, 0.5);
    }

    .footer-quote .char-span:hover {
        color: var(--accent-amber-bright);
    }
}

/* --- Hero Mouse Parallax --- */
.hero-image-wrapper {
    will-change: transform;
}

.hero-content {
    will-change: transform;
}

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

    .nav-menu-toggle {
        display: flex;
    }

    .side-indicator {
        display: none;
    }

    .leaves-canvas {
        opacity: 0.3;
    }

    .section-inner--two-col {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .col-image {
        order: -1;
    }

    .closing-signature {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .signature-info {
        text-align: center;
    }

    .text-vertical-intro {
        letter-spacing: 0.05em;
    }
}

@media (max-width: 480px) {
    .hero-meta {
        flex-direction: column;
        gap: 8px;
    }

    .hero-divider {
        width: 20px;
        height: 1px;
    }

    .quote-divider {
        flex-wrap: wrap;
        text-align: center;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-image {
        transform: none;
    }

    .hero-title-char,
    .hero-meta,
    .hero-subtitle,
    .hero-scroll {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* --- Hover Gating (touch devices) --- */
@media (hover: hover) and (pointer: fine) {
    .nav-link:active {
        transform: scale(0.97);
    }

    .nav-logo:active {
        transform: scale(0.97);
    }
}

/* ============================================
   新增：章节背景图 · 卷轴展开 · 墨迹晕染 · 印章
   ============================================ */

/* --- Section Background Images --- */
.section-opening,
.section-autumn,
.section-ambition,
.section-closing {
    position: relative;
}

.section-bg-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.section-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
    filter: brightness(0.6) saturate(0.8);
    will-change: transform;
}

.section-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        var(--bg-deep) 0%,
        rgba(13, 10, 7, 0.85) 30%,
        rgba(13, 10, 7, 0.85) 70%,
        var(--bg-deep) 100%
    );
}

.section-bg-overlay--deep {
    background: linear-gradient(
        180deg,
        var(--bg-deep) 0%,
        rgba(13, 10, 7, 0.92) 40%,
        rgba(13, 10, 7, 0.92) 60%,
        var(--bg-deep) 100%
    );
}

.section-opening .section-inner,
.section-autumn .section-inner,
.section-ambition .section-inner,
.section-closing .section-inner {
    position: relative;
    z-index: 1;
}

/* --- Scroll Unfurl (卷轴展开) --- */
.scroll-unfurl {
    position: relative;
    margin: 64px auto;
    max-width: 700px;
    overflow: hidden;
    padding: 48px 64px;
    background: linear-gradient(
        180deg,
        rgba(26, 20, 16, 0.95) 0%,
        rgba(20, 16, 10, 0.98) 100%
    );
    border-top: 1px solid var(--line-color);
    border-bottom: 1px solid var(--line-color);
    clip-path: inset(0 50% 0 50%);
    transition: clip-path 1200ms var(--ease-drawer);
}

.scroll-unfurl.unfurled {
    clip-path: inset(0 0 0 0);
}

.scroll-rod {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(
        90deg,
        var(--accent-rust) 0%,
        var(--accent-amber) 50%,
        var(--accent-rust) 100%
    );
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(200, 132, 58, 0.3);
    z-index: 2;
    transition: transform 1200ms var(--ease-drawer);
}

.scroll-rod::before,
.scroll-rod::after {
    content: '';
    position: absolute;
    left: -4px;
    width: 20px;
    height: 20px;
    background: var(--accent-amber);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.scroll-rod::before {
    top: -8px;
}

.scroll-rod::after {
    bottom: -8px;
}

.scroll-rod--left {
    left: 0;
    transform: translateX(0);
}

.scroll-rod--right {
    right: 0;
    transform: translateX(0);
}

.scroll-unfurl:not(.unfurled) .scroll-rod--left {
    transform: translateX(calc(50vw - 6px));
}

.scroll-unfurl:not(.unfurled) .scroll-rod--right {
    transform: translateX(calc(-50vw + 6px));
}

.scroll-unfurl-content {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 600ms var(--ease-out) 400ms, transform 600ms var(--ease-out) 400ms;
}

.scroll-unfurl.unfurled .scroll-unfurl-content {
    opacity: 1;
    transform: scale(1);
}

.scroll-unfurl--poem {
    max-width: 640px;
    padding: 56px 64px;
    background: linear-gradient(
        180deg,
        rgba(26, 20, 16, 0.97) 0%,
        rgba(16, 12, 8, 0.99) 100%
    );
}

.scroll-unfurl--poem .poem-line {
    font-size: clamp(18px, 2.8vw, 26px);
    font-weight: 500;
    line-height: 2.2;
    letter-spacing: 0.15em;
    color: var(--fg-primary);
    text-align: center;
    margin-bottom: 8px;
}

.scroll-unfurl--poem .poem-line:last-child {
    color: var(--accent-amber-bright);
    margin-bottom: 0;
}

/* --- Ink Reveal (墨迹晕染) --- */
.ink-reveal {
    margin: 56px 0;
    text-align: center;
}

.ink-reveal--ambition {
    margin: 48px 0;
}

.ink-text {
    font-size: clamp(22px, 3.5vw, 34px);
    font-weight: 600;
    line-height: 1.8;
    letter-spacing: 0.2em;
    color: var(--accent-amber-bright);
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.05);
    transition: opacity 1000ms var(--ease-out), filter 1000ms var(--ease-out), transform 1000ms var(--ease-out);
}

.ink-text:nth-child(2) {
    transition-delay: 300ms;
    color: var(--fg-primary);
}

.ink-text:nth-child(3) {
    transition-delay: 600ms;
}

.ink-text:nth-child(4) {
    transition-delay: 900ms;
    color: var(--fg-primary);
}

.ink-reveal.ink-revealed .ink-text {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.ink-text--large {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 700;
}

/* --- Mobile Adjustments for New Elements --- */
@media (max-width: 768px) {
    .scroll-unfurl {
        padding: 40px 36px;
        margin: 48px auto;
    }

    .scroll-rod {
        width: 8px;
    }

    .scroll-rod::before,
    .scroll-rod::after {
        width: 16px;
        height: 16px;
        left: -4px;
    }

    .ink-text {
        letter-spacing: 0.1em;
    }
}
