/* Exhibition layer. Loaded after the original stylesheet.
   Scroll heights, gesture surfaces, and globe phase UI are left intact. */

html.force-dark,
html.dark-mode {
    --primary-color: #f3eadc !important;
    --secondary-color: rgba(243, 234, 220, 0.64) !important;
    --accent-color: #c4553a !important;
    --background-color: #0c0b0a !important;
    --background-color-rgb: 12, 11, 10 !important;
    --light-gray: #14110e !important;
    --divider-color: rgba(243, 234, 220, 0.14) !important;
    --header-bg-color: rgba(12, 11, 10, 0.08) !important;
    --header-bg-color-rgb: 12, 11, 10 !important;
    --header-bg-scrolled: rgba(16, 14, 12, 0.78) !important;
    --header-bg-scrolled-rgb: 16, 14, 12 !important;
    --card-bg: #161310 !important;
    --card-shadow: rgba(0, 0, 0, 0.28) !important;
    --timeline-color: rgba(215, 180, 138, 0.32) !important;
    --timeline-dot-color: #d7b48a !important;
    --footprint-color: #d7b48a !important;
    --footer-bg: #100e0c !important;
    --stack-surface: #100e0c !important;
    --stack-border: rgba(243, 234, 220, 0.16) !important;
    --stack-shadow: none !important;
    --hero-code-bg: transparent !important;
    --hero-code-border: transparent !important;
    --hero-code-text: rgba(243, 234, 220, 0.84) !important;
    --hero-code-accent: #d7b48a !important;
    --code-tok-kw: #f0d7bf !important;
    --code-tok-type: #f0d7bf !important;
    --code-tok-fn: #f0d7bf !important;
    --code-tok-var: #f0d7bf !important;
    --code-tok-str: #f0d7bf !important;
    --code-tok-num: #f0d7bf !important;
    --code-tok-op: rgba(243, 234, 220, 0.7) !important;
}

html.force-light {
    --primary-color: #1c1612 !important;
    --secondary-color: rgba(28, 22, 18, 0.62) !important;
    --accent-color: #9a3b28 !important;
    --background-color: #f4efe6 !important;
    --background-color-rgb: 244, 239, 230 !important;
    --light-gray: #efe6d8 !important;
    --divider-color: rgba(28, 22, 18, 0.12) !important;
    --header-bg-color: rgba(244, 239, 230, 0.2) !important;
    --header-bg-color-rgb: 244, 239, 230 !important;
    --header-bg-scrolled: rgba(247, 241, 231, 0.86) !important;
    --header-bg-scrolled-rgb: 247, 241, 231 !important;
    --card-bg: #f7f1e7 !important;
    --timeline-color: rgba(154, 59, 40, 0.28) !important;
    --timeline-dot-color: #9a3b28 !important;
    --footprint-color: #9a3b28 !important;
    --stack-surface: #f7f1e7 !important;
    --stack-border: rgba(28, 22, 18, 0.12) !important;
    --hero-code-text: rgba(28, 22, 18, 0.82) !important;
    --hero-code-bg: transparent !important;
    --hero-code-border: transparent !important;
}

html,
body {
    background: var(--background-color);
    font-family: "Outfit", "PingFang SC", "SF Pro Display", sans-serif;
}

body:not(:has(.sidebar)) .sidebar-toggle {
    display: none;
}

header {
    top: 18px;
    width: min(1180px, calc(100% - 32px));
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

header.scrolled {
    background: rgba(var(--header-bg-scrolled-rgb), 0.78);
    border-color: rgba(215, 180, 138, 0.22);
    border-radius: 999px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: none;
}

.nav-logo-text,
.logo {
    font-family: "Cormorant Garamond", "Songti SC", serif;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.nav-link {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.72;
}

.nav-link.active {
    background: transparent;
    color: var(--primary-color);
    padding: 0;
    border-radius: 0;
    opacity: 1;
    box-shadow: inset 0 -1px 0 var(--accent-color);
}

#language-toggle {
    border: 0;
    background: transparent;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 11px;
    font-family: "Outfit", sans-serif;
}

.hero {
    min-height: 100svh;
    padding: 0;
    overflow: hidden;
    color: var(--primary-color);
    background: #0c0b0a;
}

html.force-light .hero {
    background: #efe6d6;
}

.hero-bg,
.hero .container::before {
    display: none;
}

.atelier-field,
.atelier-grain,
.atelier-veil,
.atelier-watermark,
.atelier-rail {
    position: absolute;
    pointer-events: none;
}

.atelier-field {
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

html.atelier-static .hero {
    background:
        radial-gradient(ellipse at 68% 38%, rgba(228, 199, 162, 0.42), transparent 42%),
        radial-gradient(ellipse at 30% 70%, rgba(110, 52, 36, 0.28), transparent 46%),
        #0c0b0a;
}

.atelier-grain {
    inset: -20%;
    z-index: 1;
    opacity: 0.18;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}

.atelier-veil {
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(8, 7, 6, 0.42), transparent 24%, transparent 62%, rgba(8, 7, 6, 0.28)),
        linear-gradient(180deg, rgba(8, 7, 6, 0.28), transparent 22%, transparent 68%, rgba(8, 7, 6, 0.62));
}

html.force-light .atelier-veil {
    background:
        linear-gradient(90deg, rgba(244, 239, 230, 0.35), transparent 28%, transparent 70%, rgba(244, 239, 230, 0.2)),
        linear-gradient(180deg, rgba(244, 239, 230, 0.2), transparent 20%, transparent 72%, rgba(244, 239, 230, 0.72));
}

.atelier-watermark {
    right: -2vw;
    top: 7vh;
    z-index: 1;
    font-family: "Cormorant Garamond", "Songti SC", serif;
    font-size: clamp(120px, 18vw, 280px);
    line-height: 0.78;
    letter-spacing: -0.06em;
    color: rgba(243, 234, 220, 0.09);
    writing-mode: vertical-rl;
}

html.force-light .atelier-watermark {
    color: rgba(28, 22, 18, 0.08);
}

.atelier-rail {
    left: 28px;
    top: 18vh;
    bottom: 18vh;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: rgba(243, 234, 220, 0.72);
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.atelier-rail i {
    flex: 1;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(215, 180, 138, 0.85), transparent);
}

.atelier-rail span:last-child {
    writing-mode: vertical-rl;
}

.hero .container {
    z-index: 2;
    align-items: flex-end;
    padding-top: 16vh;
    padding-bottom: 12vh;
    min-height: 100svh;
}

.hero-content {
    width: min(1180px, calc(100% - 120px));
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
    align-items: end;
    gap: clamp(28px, 5vw, 84px);
    text-align: left;
    transform: translate3d(0, calc(var(--atelier-p, 0) * -36px), 0);
}

.atelier-portrait {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.hero .avatar-container {
    flex: none;
    justify-content: flex-start;
}

.hero .avatar-outer-circle {
    width: 292px;
    height: 292px;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    position: relative;
}

.hero .avatar-outer-circle::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: conic-gradient(from 20deg, transparent 0 18%, rgba(228, 199, 162, 0.95) 32%, transparent 48%, rgba(196, 85, 58, 0.75) 62%, transparent 78%, rgba(243, 234, 220, 0.7) 90%, transparent);
    -webkit-mask: radial-gradient(circle, transparent 61%, #000 63% 68%, transparent 70%);
    mask: radial-gradient(circle, transparent 61%, #000 63% 68%, transparent 70%);
    animation: atelier-spin 28s linear infinite;
}

.hero .avatar-outer-circle::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 2px;
    border: 1px solid rgba(243, 234, 220, 0.28);
    transform: rotate(8deg);
    pointer-events: none;
}

.hero .avatar-inner-circle {
    width: 264px;
    height: 264px;
    border: 0;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.hero .avatar-outer-circle {
    transform: translate3d(calc((var(--atelier-px, 0.68) - 0.68) * 18px), calc((var(--atelier-py, 0.4) - 0.4) * 14px), 0);
}

.atelier-plate {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(243, 234, 220, 0.7);
}

html.force-light .atelier-plate,
html.force-light .atelier-rail {
    color: rgba(28, 22, 18, 0.62);
}

.hero-info {
    position: relative;
    text-shadow: 0 1px 18px rgba(8, 7, 6, 0.45);
}

.hero-info::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -28% -18% -36% -14%;
    pointer-events: none;
    background: radial-gradient(ellipse at 28% 46%, rgba(8, 7, 6, 0.42), transparent 70%);
}

html.force-light .hero-info {
    text-shadow: none;
}

html.force-light .hero-info::before {
    background: radial-gradient(ellipse at 18% 42%, rgba(244, 239, 230, 0.72), rgba(244, 239, 230, 0.2) 48%, transparent 74%);
}

.hero-kicker {
    letter-spacing: 0.34em;
    font-size: 11px;
    font-weight: 500;
    color: rgba(243, 234, 220, 0.66);
}

.hero-kicker-dot {
    width: 7px;
    height: 7px;
    background: #c4553a;
    box-shadow: none;
}

.hero .name {
    font-family: "Cormorant Garamond", "Songti SC", Georgia, serif;
    font-weight: 500;
    font-size: clamp(68px, 7.4vw, 124px);
    line-height: 0.86;
    letter-spacing: -0.045em;
    margin: 8px 0 18px;
    background: none;
    -webkit-text-fill-color: #f6efe4;
    color: #f6efe4;
}

html.force-light .hero .name {
    -webkit-text-fill-color: #1c1612;
    color: #1c1612;
}

.hero .location-info,
.hero .contact-info {
    font-size: 13px;
    letter-spacing: 0.08em;
    color: rgba(243, 234, 220, 0.72);
}

.hero .contact-info a {
    color: #e7cbb0;
    border-bottom: 1px solid rgba(231, 203, 176, 0.35);
}

.hero-summary {
    max-width: 38rem;
    margin-top: 22px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: "Cormorant Garamond", "Songti SC", Georgia, serif;
    font-size: clamp(20px, 1.7vw, 28px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.35;
    color: rgba(243, 234, 220, 0.88);
}

.hero-summary .code-tok-kw,
.hero-summary .code-tok-type,
.hero-summary .code-tok-fn,
.hero-summary .code-tok-var,
.hero-summary .code-tok-str,
.hero-summary .code-tok-num,
.hero-summary .code-tok-op {
    color: #f0d7bf !important;
    font-weight: 500;
    font-style: italic;
}

html.force-light .hero-summary,
html.force-light .hero .location-info,
html.force-light .hero .contact-info,
html.force-light .hero-kicker {
    color: rgba(28, 22, 18, 0.78);
}

html.force-light .hero .contact-info a,
html.force-light .hero-summary .code-tok-kw,
html.force-light .hero-summary .code-tok-type,
html.force-light .hero-summary .code-tok-fn,
html.force-light .hero-summary .code-tok-var,
html.force-light .hero-summary .code-tok-str,
html.force-light .hero-summary .code-tok-num,
html.force-light .hero-summary .code-tok-op {
    color: #9a3b28 !important;
}

.hero-cta {
    margin-top: 28px;
    gap: 22px;
}

.hero-btn {
    height: auto;
    padding: 0 0 6px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: "Outfit", sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.hero-btn-primary,
.hero-btn-ghost {
    color: #f6efe4;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(243, 234, 220, 0.45);
}

.hero-btn-primary::after,
.hero-btn-ghost::after {
    content: " →";
}

.hero-btn-primary:hover,
.hero-btn-ghost:hover {
    transform: none;
    box-shadow: none;
    border-bottom-color: #c4553a;
}

html.force-light .hero-btn-primary,
html.force-light .hero-btn-ghost {
    color: #1c1612;
    border-bottom-color: rgba(28, 22, 18, 0.35);
}

.atelier-scroll {
    position: absolute;
    left: 36px;
    bottom: 36px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    color: rgba(243, 234, 220, 0.78);
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    text-decoration: none;
}

.atelier-scroll i {
    width: 1px;
    height: 54px;
    background: linear-gradient(180deg, rgba(215, 180, 138, 0.1), #e4c7a2);
    transform-origin: top;
    animation: atelier-drop 1.8s ease-in-out infinite;
}

html.force-light .atelier-scroll {
    color: rgba(28, 22, 18, 0.7);
}

.content-stack {
    margin-top: 0;
    padding-top: 0;
}

.section-overlay,
#education,
#experience,
#papers {
    background: #100e0c;
    color: #f3eadc;
}

html.force-light .section-overlay,
html.force-light #education,
html.force-light #experience,
html.force-light #papers {
    background: #f4efe6;
    color: #1c1612;
}

.section-overlay {
    border-radius: 0;
    border-top: 1px solid rgba(243, 234, 220, 0.16);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.section-background,
.section-background::before {
    background: transparent;
    background-image: none;
}

.section {
    padding: 112px 0 96px;
}

.section-title,
.subsection-title {
    font-family: "Cormorant Garamond", "Songti SC", serif;
    font-weight: 500;
    font-size: clamp(46px, 5vw, 78px);
    letter-spacing: -0.04em;
    text-align: left;
    line-height: 0.92;
    margin-bottom: 48px;
}

.section-title::before {
    display: block;
    margin-bottom: 14px;
    font-family: "Outfit", sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(215, 180, 138, 0.9);
}

#education .section-title::before { content: "01  —  Study"; }
#experience .section-title::before { content: "02  —  Practice"; }
#papers .section-title::before { content: "03  —  Pages"; }
#awards .section-title::before { content: "04  —  Recognition"; }
#social .section-title::before { content: "06  —  Correspondence"; }

.education-header h3,
.experience-header h3,
.timeline-content h3,
.project-info h3 {
    font-family: "Cormorant Garamond", "Songti SC", serif;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.education-header h3,
.experience-header h3 {
    font-size: clamp(28px, 3vw, 40px);
}

.education-item {
    padding-bottom: 8px;
}

.divider {
    background: rgba(243, 234, 220, 0.12);
    margin: 36px 0;
}

.experience-logo {
    width: 72px;
    height: 72px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 1px solid rgba(243, 234, 220, 0.16);
}

.experience-logo:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(215, 180, 138, 0.7);
}

.experience-toggle {
    color: #e4c7a2;
    background-color: rgba(228, 199, 162, 0.1);
}

.experience-toggle:hover {
    background-color: rgba(228, 199, 162, 0.2);
}

.project-item {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: 1px solid rgba(243, 234, 220, 0.14);
}

.project-info,
.project-item:hover {
    background: transparent;
    box-shadow: none;
}

.project-item:hover {
    transform: translateY(-6px);
}

.project-info h3 {
    font-size: 26px;
    line-height: 1.05;
}

.view-project,
.project-item:hover .project-info h3 {
    color: #e4c7a2;
}

.carousel-prev,
.carousel-next {
    background: rgba(16, 14, 12, 0.72);
    color: #f3eadc;
    border: 1px solid rgba(215, 180, 138, 0.28);
}

.timeline-date {
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.12em;
    font-size: 12px;
}

.footprints-story #map-container::before {
    background:
        radial-gradient(ellipse at 50% 46%, #3a2a1c 0%, #1a140f 38%, #070605 76%);
}

.footprints-story #awards {
    --timeline-color: rgba(215, 180, 138, 0.32);
    --timeline-dot-color: #e4c7a2;
    color: #f6efe4;
}

.footprints-story #awards .timeline-date::after {
    background-color: #e4c7a2;
}

.footprints-story #social .social-icon {
    background: rgba(228, 199, 162, 0.1);
    border: 1px solid rgba(228, 199, 162, 0.18);
}

.earth-chapter {
    position: absolute;
    top: 108px;
    left: clamp(24px, 5vw, 72px);
    z-index: 4;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    color: #f6efe4;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.footprints-story[data-phase="1"] .earth-chapter {
    opacity: 1;
    transform: none;
}

.earth-chapter-index,
.earth-chapter-title {
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 11px;
}

.earth-chapter-title {
    font-family: "Cormorant Garamond", serif;
    font-size: 42px;
    letter-spacing: -0.04em;
    text-transform: none;
    line-height: 0.9;
}

.earth-chapter-note {
    font-size: 14px;
    line-height: 1.45;
    color: rgba(243, 234, 220, 0.74);
}

.floating-chat-button {
    border: 1px solid rgba(228, 199, 162, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
    .atelier-portrait,
    .hero-kicker,
    .hero .name,
    .hero-summary,
    .hero-cta {
        animation: atelier-in 1.25s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    .atelier-scroll {
        animation: atelier-fade 1.25s ease 0.9s both;
    }
    .hero-kicker { animation-delay: 0.18s; }
    .hero .name { animation-delay: 0.28s; }
    .hero-summary { animation-delay: 0.48s; }
    .hero-cta { animation-delay: 0.62s; }
}

@keyframes atelier-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

@keyframes atelier-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

html[lang^="zh"] #education .section-title::before { content: "01  —  学业"; }
html[lang^="zh"] #experience .section-title::before { content: "02  —  实践"; }
html[lang^="zh"] #papers .section-title::before { content: "03  —  论文"; }
html[lang^="zh"] #awards .section-title::before { content: "04  —  奖项"; }
html[lang^="zh"] #social .section-title::before { content: "06  —  联络"; }
html[lang="zh-TW"] #education .section-title::before { content: "01  —  學業"; }
html[lang="zh-TW"] #experience .section-title::before { content: "02  —  實踐"; }
html[lang="zh-TW"] #papers .section-title::before { content: "03  —  論文"; }
html[lang="zh-TW"] #awards .section-title::before { content: "04  —  獎項"; }
html[lang="zh-TW"] #social .section-title::before { content: "06  —  聯絡"; }

@keyframes atelier-spin {
    to { transform: rotate(1turn); }
}

@keyframes atelier-drop {
    0%, 100% { transform: scaleY(0.35); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 900px) {
    main,
    .hero {
        margin-top: 0;
    }
    header {
        top: 0;
        width: 100%;
        left: 0;
        transform: none;
        background: linear-gradient(180deg, rgba(8, 7, 6, 0.45), transparent);
        border: 0;
        border-radius: 0;
    }
    header.scrolled {
        transform: none;
        border-radius: 0;
    }
    .atelier-rail { display: none; }
    .hero-content {
        width: min(100% - 36px, 640px);
        grid-template-columns: 1fr;
        gap: 28px;
        align-items: start;
    }
    .hero .container {
        align-items: center;
        padding-top: 96px;
        padding-bottom: 88px;
    }
    .hero .avatar-outer-circle,
    .hero .avatar-inner-circle {
        width: 168px;
        height: 168px;
    }
    .hero .avatar-inner-circle { width: 150px; height: 150px; }
    .hero .name { font-size: clamp(58px, 16vw, 84px); }
    .atelier-watermark { font-size: 34vw; top: 16vh; }
    .atelier-scroll {
        left: 50%;
        bottom: 18px;
        transform: translateX(-50%);
        align-items: center;
    }
    .section { padding: 72px 0 64px; }
    .earth-chapter { top: 84px; max-width: 210px; }
    .earth-chapter-title { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero .avatar-outer-circle::before,
    .atelier-scroll i,
    .atelier-portrait,
    .hero-kicker,
    .hero .name,
    .hero-summary,
    .hero-cta,
    .atelier-scroll {
        animation: none;
    }
    .hero-content { transform: none; }
}
