/* ============================================
   LINYEPING_OS — Nothing glyph × Claude FM ASCII
   ============================================ */

@font-face {
    font-family: 'Ndot47';
    src: url('fonts/ndot47.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Ndot45';
    src: url('fonts/ndot45.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'NType82';
    src: url('fonts/ntype82.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'FusionPixel';
    src: url('fonts/fusion-pixel-zh.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'DepartureMono';
    src: url('fonts/departure-mono.woff2') format('woff2');
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --bg-panel: rgba(16, 16, 16, 0.88);
    --fg: #e8e8e8;
    --fg-dim: #8a8a8a;
    --red: #d71920;
    --red-dim: rgba(215, 25, 32, 0.35);
    --line: #2a2a2a;
    --header-bg: rgba(10, 10, 10, 0.9);
    --mono: 'DepartureMono', 'FusionPixel', 'Courier New', 'Consolas', monospace;
    --dot: 'Ndot47', 'Ndot45', 'FusionPixel', var(--mono);
    --ndot: 'Ndot47', 'Ndot45', 'FusionPixel', var(--mono);
    --ntype: 'NType82', 'FusionPixel', var(--mono);
    --zh: 'FusionPixel', var(--mono);
    --body: 'Ndot47', 'Ndot45', 'FusionPixel', var(--mono);
    --r-card: 20px;
    --r-pill: 999px;
}

[data-theme="light"] {
    --bg: #f4f4f2;
    --bg-panel: rgba(255, 255, 255, 0.9);
    --fg: #161616;
    --fg-dim: #6a6a6a;
    --red: #d71920;
    --red-dim: rgba(215, 25, 32, 0.25);
    --line: #d4d4d0;
    --header-bg: rgba(244, 244, 242, 0.9);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.7;
    font-size: 17px;
    letter-spacing: 0.04em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 1.4s cubic-bezier(0.25, 1, 0.4, 1), color 1.4s cubic-bezier(0.25, 1, 0.4, 1);
}

header,
.hero-panel,
.ascii-box,
.achievement-card,
.project-card,
.tech-category,
.publication-item,
.contact-link,
.status-bar,
footer {
    transition: background-color 1.4s cubic-bezier(0.25, 1, 0.4, 1),
                border-color 1.4s cubic-bezier(0.25, 1, 0.4, 1),
                color 1.4s cubic-bezier(0.25, 1, 0.4, 1),
                box-shadow 1.4s cubic-bezier(0.25, 1, 0.4, 1);
}

::selection {
    background: var(--red);
    color: #fff;
}

/* animated dot-wave background */
#dotCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.doto {
    font-family: var(--dot);
    letter-spacing: 0.12em;
}

.red { color: var(--red); }

.cursor {
    display: inline-block;
    color: var(--red);
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.prompt { color: var(--red); }

/* ---------- header ---------- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    border-bottom: 1px dashed var(--line);
    backdrop-filter: blur(4px);
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-family: var(--ndot);
    font-size: 1.35rem;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--red);
    animation: blink 2s steps(1) infinite;
}

.logo-red { color: var(--red); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.2rem;
}

.mobile-nav-item,
.menu-btn,
.menu-close-icon { display: none; }

.nav-links a {
    font-family: var(--ntype);
    text-decoration: none;
    color: var(--fg-dim);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--red);
    text-shadow: 0 0 6px var(--red-dim);
}

.nav-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.weather-btn,
.theme-btn,
.language-btn,
.menu-btn {
    font-family: var(--ntype);
    background: transparent;
    border: 1px solid var(--fg-dim);
    border-radius: var(--r-pill);
    color: var(--fg);
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.15s;
}

.theme-btn {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.weather-btn:hover,
.theme-btn:hover,
.language-btn:hover,
.menu-btn:hover {
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 10px var(--red-dim);
}

/* ---------- weather layer ---------- */
.weather-container {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    contain: layout paint;
}

/* Weather never receives clicks and stays below readable content panels. */
.weather-scene { position: absolute; inset: 0; pointer-events: none; animation: weather-arrive 900ms ease-out both; }
.weather-scene.is-immediate { animation: none; }
.weather-scene.is-leaving { animation: weather-leave 900ms ease-in both; }
@keyframes weather-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes weather-leave { from { opacity: 1; } to { opacity: 0; } }
.weather-particle {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    font-family: 'DepartureMono', 'FusionPixel', monospace;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: pre;
    color: #d2d6d8;
    transition: color 1.4s ease;
}
.wx-cloud { color: #c2c9d1; line-height: 1; }
.wx-leaf { color: #c8c6b8; }
.wx-gust { color: #aab4b8; }
.wx-dust { color: #dacb9f; }
.wx-scene-sunny {
    --sun-top: 104px;
    --sun-right: clamp(30px, 6vw, 110px);
    --sun-size: 120px;
}
.weather-sun {
    --sun-radius: 45px;
    position: absolute;
    top: var(--sun-top); right: var(--sun-right);
    width: var(--sun-size); height: var(--sun-size);
    color: #d8ca9d; opacity: .7;
    font-family: 'DepartureMono', monospace;
    transition: color 1.4s ease;
}
.weather-sun::before {
    content: ''; position: absolute; inset: -55%; border-radius: 50%;
    background: radial-gradient(circle, rgb(235 198 119 / .13), rgb(232 177 81 / .045) 38%, transparent 69%);
}
.weather-lens-flare {
    position: absolute;
    top: calc(var(--sun-top) + var(--sun-size) / 2);
    right: calc(var(--sun-right) + var(--sun-size) / 2);
    width: 0; height: 0; pointer-events: none;
}
.weather-flare-ring {
    position: absolute; top: 0; left: 0;
    margin: 0; padding: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none;
    font-family: 'DepartureMono', 'FusionPixel', monospace;
    font-weight: 400; line-height: 1; letter-spacing: 0;
    white-space: pre; color: #cbbd97;
    pointer-events: none;
}
.weather-flare-ring.is-cool { color: #a7b9ae; }
[data-theme="light"] .weather-flare-ring { color: #89672f; }
[data-theme="light"] .weather-flare-ring.is-cool { color: #4f7767; }
.weather-sun-core {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font: 18px/1 'DepartureMono', monospace; letter-spacing: 0;
}
.weather-sun-rays { position: absolute; inset: 0; }
.weather-sun-rays span {
    position: absolute; left: 50%; top: 50%;
    margin-top: -.5em; transform-origin: 0 50%;
    font: 17px/1 'DepartureMono', monospace;
}
[data-theme="light"] .weather-particle { color: #4a5662; }
[data-theme="light"] .wx-leaf { color: #666344; }
[data-theme="light"] .wx-dust, [data-theme="light"] .weather-sun { color: #9a7737; }
.weather-btn { min-width: 7.2em; white-space: nowrap; }
.weather-btn[data-weather="off"] { color: var(--fg-dim); border-style: dashed; }
.weather-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[data-page-hidden] .weather-scene { animation-play-state: paused; }
@media (max-width: 767px) {
    .wx-scene-sunny { --sun-size: 70px; --sun-top: 84px; --sun-right: 20px; }
    .weather-sun { --sun-radius: 24px; }
    .weather-sun-core { font-size: 12px; }
    .weather-sun-rays span { font-size: 10px; }
}

/* ---------- hero ---------- */
main {
    position: relative;
    z-index: 2;
    padding-top: 56px;
}

.hero {
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.hero-doto {
    font-family: var(--ndot);
    font-size: clamp(3rem, 11vw, 8.5rem);
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--fg);
    margin-bottom: 2.5rem;
    user-select: none;
    text-align: center;
    text-shadow: 0 0 24px var(--red-dim);
}

.hero-panel {
    max-width: 760px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--bg-panel);
    padding: 2.5rem;
    position: relative;
}

.hero-panel::before {
    content: "● SESSION_START";
    position: absolute;
    top: -0.65em;
    left: 1.4rem;
    background: var(--bg);
    border-radius: var(--r-pill);
    padding: 0 0.8rem;
    color: var(--fg-dim);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.term-line {
    color: var(--fg-dim);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.hero-name {
    font-family: var(--ndot);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
}

.zh-inline {
    font-family: var(--zh);
    font-size: 0.55em;
    color: var(--fg-dim);
    letter-spacing: 0.3em;
}

.hero-sub {
    font-family: 'Ndot45', var(--ndot);
    color: var(--red);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px var(--red-dim);
}

.hero-desc {
    color: var(--fg-dim);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.social-link {
    font-family: var(--mono);
    text-decoration: none;
    color: var(--fg);
    border: 1px solid var(--fg-dim);
    border-radius: var(--r-pill);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    transition: all 0.15s;
    background: transparent;
}

.social-link:hover {
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 12px var(--red-dim), inset 0 0 8px rgba(215, 25, 32, 0.08);
}

/* ---------- sections ---------- */
.section {
    padding: 5.5rem 1.5rem;
}

.section:nth-of-type(even) {
    background: linear-gradient(180deg, transparent, rgba(127, 127, 127, 0.04), transparent);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--ntype);
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    font-weight: 400;
    color: var(--fg);
    margin-bottom: 3rem;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::after {
    content: "";
    flex: 1;
    border-bottom: 1px dashed var(--line);
}

.ascii-box {
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--bg-panel);
    padding: 2rem;
}

/* about */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 1.5rem;
}

.achievement-card {
    border: 1px dashed var(--line);
    border-radius: var(--r-card);
    padding: 1.5rem;
    transition: all 0.15s;
}

.achievement-card:hover {
    border: 1px solid var(--red);
    box-shadow: 0 0 14px var(--red-dim);
}

.card-tag {
    color: var(--red);
    font-size: 1rem;
    display: block;
    margin-bottom: 0.8rem;
}

.achievement-card p {
    font-size: 0.95rem;
    color: var(--fg-dim);
}

.achievement-card strong { color: var(--fg); }

/* projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
}

.project-shot {
    display: block;
    position: relative;
    margin: -0.6rem -0.6rem 1.4rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.project-shot img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1) brightness(0.95);
    transition: filter 0.4s ease, transform 0.25s ease;
}

.project-shot:hover img {
    filter: grayscale(0) saturate(1.15) contrast(1);
    transform: scale(1.02);
}

.shot-label {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: var(--r-pill);
    padding: 0.15rem 0.7rem;
}

.project-card {
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--bg-panel);
    padding: 1.8rem;
    transition: all 0.15s;
}

.project-card:hover {
    border-color: var(--red);
    box-shadow: 0 0 16px var(--red-dim);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.card-header .doto {
    font-family: var(--ndot);
}

.card-status {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--red);
    letter-spacing: 0.1em;
}

.card-ascii {
    color: var(--fg-dim);
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 1.2rem;
    user-select: none;
}

.project-card p {
    color: var(--fg-dim);
    font-size: 0.9rem;
    margin-bottom: 1.4rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    color: var(--fg-dim);
    border: 1px dashed var(--line);
    border-radius: var(--r-pill);
    padding: 0.25rem 0.7rem;
    letter-spacing: 0.08em;
    transition: all 0.15s;
}

.project-card:hover .tag {
    border-color: var(--red);
    color: var(--fg);
}

/* experience */
.experience-timeline {
    max-width: 820px;
    margin: 0 auto;
}

.experience-item {
    display: flex;
    gap: 2rem;
    padding: 1.2rem 0;
    border-bottom: 1px dashed var(--line);
    align-items: baseline;
}

.experience-item:last-child { border-bottom: none; }

.experience-date {
    min-width: 220px;
    color: var(--red);
    font-size: 0.95rem;
}

.experience-content h3 {
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.experience-content p { color: var(--fg-dim); }

/* tech */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
}

.tech-category {
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--bg-panel);
    padding: 1.5rem;
    transition: all 0.15s;
}

.tech-category:hover {
    border-color: var(--red);
    box-shadow: 0 0 14px var(--red-dim);
}

.tech-category h3 {
    font-size: 1.1rem;
    color: var(--red);
    margin-bottom: 1rem;
}

.tech-category ul { list-style: none; }

.tech-category li {
    padding: 0.3rem 0;
    color: var(--fg-dim);
    font-size: 0.9rem;
}

/* publications */
.publications-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--bg-panel);
    margin-bottom: 1.2rem;
    transition: all 0.15s;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.publication-item:hover {
    border-color: var(--red);
    box-shadow: 0 0 14px var(--red-dim);
    transform: translateX(4px);
}

.pub-thumb {
    flex: 0 0 100px;
    width: 100px;
    height: 126px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg);
    display: block;
}

.pub-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: saturate(0.85);
    transition: filter 0.2s ease;
}

.pub-thumb.contain img {
    object-fit: contain;
    padding: 6px;
}

.publication-item:hover .pub-thumb img {
    filter: saturate(1.05);
}

.publication-content {
    flex: 1;
    min-width: 0;
}

.pub-meta {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
}

.publication-number {
    color: var(--red);
    font-size: 1.05rem;
}

.pub-year {
    color: var(--fg-dim);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    border: 1px dashed var(--line);
    border-radius: var(--r-pill);
    padding: 0 0.6rem;
}

.publication-content h3 {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.55;
    margin-bottom: 0.4rem;
}

.publication-venue {
    color: var(--fg-dim);
    font-size: 0.85rem;
}

/* contact */
.contact-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.contact-content > p {
    font-family: var(--zh);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    color: var(--fg-dim);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
}

.contact-link {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    column-gap: 0.75rem;
    align-items: baseline;
    width: 100%;
    max-width: 420px;
    padding: 0.9rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    text-decoration: none;
    color: var(--fg);
    font-size: 0.95rem;
    transition: all 0.15s;
    text-align: left;
    overflow-wrap: anywhere;
}

.contact-link .doto { color: var(--red); }
.contact-label { display: flex; justify-content: space-between; width: 5.75rem; white-space: nowrap; }
.contact-value { min-width: 0; overflow-wrap: anywhere; }

.contact-link:hover {
    border-color: var(--red);
    box-shadow: 0 0 12px var(--red-dim);
}

/* footer */
footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 1rem;
    border-top: 1px dashed var(--line);
    color: var(--fg-dim);
    background: var(--bg);
}

.footer-ascii {
    max-width: 100%;
    overflow: hidden;
    color: var(--line);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    user-select: none;
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-panel { padding: 1.5rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .experience-item { flex-direction: column; gap: 0.3rem; }
    .experience-date { min-width: auto; }
    .publication-item { gap: 0.9rem; padding: 1rem; }
    .pub-thumb { flex: 0 0 74px; width: 74px; height: 94px; }
}


/* ==============================================
   VISUAL UPGRADE — 12 IDEAS
   ============================================== */

/* ─── Pixel Matrix Theme Transition Canvas ─── */
#themeTransitionCanvas {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

/* ─── 💡5  CRT scanline overlay (dark only) ─── */
.crt-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.035) 2px,
        rgba(0, 0, 0, 0.035) 4px
    );
    mix-blend-mode: multiply;
    transition: opacity 0.35s ease;
}

[data-theme="light"] .crt-overlay {
    opacity: 0;
}

/* ─── 💡6  Hero glitch effect ─── */
.hero-doto {
    animation: glitch 8s ease-in-out infinite;
}

@keyframes glitch {
    0%, 93%, 100% {
        transform: none;
        text-shadow: 0 0 24px var(--red-dim);
    }
    94% {
        transform: translate(-3px, 1px) skewX(-0.5deg);
        text-shadow: -3px 0 rgba(255, 0, 64, 0.7), 3px 0 rgba(0, 255, 255, 0.5), 0 0 24px var(--red-dim);
    }
    95.5% {
        transform: translate(3px, -1px) skewX(0.5deg);
        text-shadow: 3px 0 rgba(255, 0, 64, 0.7), -3px 0 rgba(0, 255, 255, 0.5), 0 0 24px var(--red-dim);
    }
    97% {
        transform: translate(-2px, 2px);
        text-shadow: -2px 0 rgba(255, 0, 64, 0.5), 2px 0 rgba(0, 255, 255, 0.35), 0 0 24px var(--red-dim);
    }
    98.5% {
        transform: translate(1px, -1px) skewX(-0.3deg);
        text-shadow: 1px 0 rgba(255, 0, 64, 0.3), -1px 0 rgba(0, 255, 255, 0.2), 0 0 24px var(--red-dim);
    }
}

/* ─── 💡12  Identity card / AKA bridge ─── */
.id-card {
    border-left: 2px solid var(--red);
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
}

.id-aka {
    font-size: 0.8rem;
    color: var(--fg-dim);
    letter-spacing: 0.15em;
    margin-top: 0.3rem;
}

/* ─── 💡1  Project card window chrome ─── */
.card-chrome {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px dashed var(--line);
}

.chrome-dots {
    display: flex;
    gap: 0.4rem;
}

.chrome-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
    font-style: normal;
}

.dot-close {
    background: var(--red);
    box-shadow: 0 0 4px var(--red-dim);
}

.dot-min {
    background: #f5a623;
}

.dot-max {
    background: var(--fg-dim);
    opacity: 0.5;
}

[data-theme="light"] .dot-min {
    background: #d49000;
}

.chrome-title {
    flex: 1;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
}

/* ─── 💡2  Experience timeline pipe ─── */
.experience-timeline {
    position: relative;
}

/* Vertical connecting line */
.experience-timeline::before {
    content: '';
    position: absolute;
    left: calc(2rem + 5px);
    top: 3.8rem;
    bottom: 4rem;
    width: 0;
    border-left: 1px dashed var(--line);
    z-index: 0;
}

/* Override existing experience item styles */
.experience-item {
    border-bottom: none;
    align-items: flex-start;
    position: relative;
}

.experience-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--red-dim);
    margin-top: 0.35rem;
    position: relative;
    z-index: 1;
}

.timeline-dot.hollow {
    background: transparent;
    border: 2px dashed var(--fg-dim);
    box-shadow: none;
}

.timeline-next {
    opacity: 0.6;
}

.next-label {
    color: var(--fg-dim);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    animation: blink 2.5s steps(1) infinite;
}

/* ─── 💡3  Section ASCII dividers ─── */
.section[data-hex] {
    position: relative;
}

.section[data-hex]::after {
    content: "// ──────────── [END: " attr(data-hex) "] ──────────── //";
    display: block;
    text-align: center;
    color: var(--line);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-top: 3rem;
    user-select: none;
}

/* ─── 💡4  Contact ping animation ─── */
.ping-visual {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.ping-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--red);
    font-size: 1.2rem;
    text-shadow: 0 0 8px var(--red-dim);
}

.ping-ring {
    position: absolute;
    inset: 0;
    border: 1px solid var(--red);
    border-radius: 50%;
    opacity: 0;
    animation: ping-expand 3s ease-out infinite;
}

.ping-ring.delay-1 {
    animation-delay: 1s;
}

.ping-ring.delay-2 {
    animation-delay: 2s;
}

@keyframes ping-expand {
    0% {
        transform: scale(0.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* ─── 💡8  Nav scroll active indicator ─── */
.nav-links a {
    position: relative;
}

.nav-links a.active {
    color: var(--fg);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--red);
}

/* ─── 💡7  Typing cursor for section titles ─── */
.typing-cursor {
    display: inline-block;
    color: var(--red);
    animation: blink 0.8s steps(1) infinite;
    margin-left: 1px;
    font-weight: normal;
}

.typing-cursor.typed-done {
    animation: blink 0.8s steps(1) 3;
    animation-fill-mode: forwards;
    opacity: 0;
}

/* ─── 💡9  Status bar ─── */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    background: var(--header-bg);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(4px);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--fg-dim);
    transition: background-color 0.35s ease;
}

.sb-sep {
    color: var(--line);
    user-select: none;
}

.sb-sys {
    color: var(--red);
}

#sbSection {
    color: var(--fg);
}

/* Extra bottom padding so footer isn't hidden behind status bar */
footer {
    padding-bottom: 3.5rem;
}

/* ─── 💡11  Publication citation badge ─── */
.pub-cited {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--red);
    border: 1px solid var(--red-dim);
    border-radius: var(--r-pill);
    padding: 0 0.5rem;
    line-height: 1.8;
}

/* ─── 💡10  Section content reveal on scroll ─── */
.reveal-target {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-target.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Responsive overrides for new elements ─── */
@media (max-width: 768px) {
    /* Timeline: keep dots on left even in mobile */
    .experience-item {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem 1rem;
    }

    .experience-date {
        flex: 1;
    }

    .experience-content {
        flex-basis: 100%;
        padding-left: calc(12px + 1rem);
    }

    .experience-timeline::before {
        left: calc(2rem + 5px);
    }

    /* Status bar */
    .status-bar {
        font-size: 0.58rem;
        gap: 0.35rem;
        padding: 0.35rem 0.6rem;
    }

    /* Ping visual */
    .ping-visual {
        width: 60px;
        height: 60px;
        margin-bottom: 1.5rem;
    }

    /* Card chrome */
    .card-chrome {
        gap: 0.5rem;
    }

    .chrome-title {
        font-size: 0.9rem;
    }

    .chrome-dots i {
        width: 8px;
        height: 8px;
    }

    /* Identity card */
    .id-card {
        padding-left: 0.8rem;
    }

    /* Section dividers */
    .section[data-hex]::after {
        font-size: 0.6rem;
        margin-top: 2rem;
    }
}

/* Language controls use the same pixel fonts and capsule outline as WX/theme. */
.language-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.65rem;
    font-family: 'DepartureMono', 'FusionPixel', monospace;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.language-option { color: var(--fg-dim); }
.language-option.is-active { color: var(--red); }
.language-separator { color: var(--fg-dim); opacity: 0.55; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Collapse a little earlier so the additional desktop control never crowds nav. */
@media (max-width: 900px) {
    nav { padding: 0.75rem 1rem; gap: 0.5rem; }
    .hero { scroll-margin-top: 65px; }
    .logo { font-size: 1.1rem; letter-spacing: 0.08em; gap: 0.25rem; flex-shrink: 0; }
    .nav-controls { gap: 0.35rem; }
    .weather-btn { padding: 0.35rem 0.5rem; font-size: 0.7rem; letter-spacing: 0.08em; min-height: 40px; }
    .theme-btn { width: 40px; height: 40px; flex-shrink: 0; }
    .menu-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex-shrink: 0; }
    .mobile-nav-item { display: block; }
    .header-language-btn { display: inline-flex; min-height: 40px; flex-shrink: 0; padding: 0.35rem 0.5rem; font-size: 0.7rem; }
    .menu-btn[aria-expanded="true"] .menu-open-icon { display: none; }
    .menu-btn[aria-expanded="true"] .menu-close-icon { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem 1rem 1rem;
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--bg);
        border-bottom: 1px dashed var(--line);
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
    }
    header[data-menu-open] .nav-links { display: grid; }
    .nav-links a { display: flex; align-items: center; min-height: 44px; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; }
    .nav-links a.active::after { left: auto; right: 0.75rem; top: 50%; bottom: auto; transform: translateY(-50%); }
    .nav-links a:hover { border-color: var(--red); }
}

.menu-btn:focus-visible,
.language-btn:focus-visible,
.nav-links a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Stack every contact row consistently rather than wrapping labels unpredictably. */
@media (max-width: 480px) {
    /* Keep every top-bar control visible even on a 320px-wide phone. */
    nav { padding-inline: 0.5rem; gap: 0.25rem; }
    .logo { font-size: 0.9rem; gap: 0.15rem; letter-spacing: 0.04em; }
    .nav-controls { gap: 0.2rem; }
    .header-language-btn { min-width: 48px; padding-inline: 0.35rem; gap: 0.2rem; font-size: 0.68rem; }
    .nav-controls .weather-btn { padding-inline: 0.35rem; font-size: 0.65rem; letter-spacing: 0.03em; flex-shrink: 0; }
    .contact-link { grid-template-columns: minmax(0, 1fr); row-gap: 0.25rem; }
}

/* Keep full email addresses readable even on narrow phones. */
@media (max-width: 400px) {
    .contact-content { padding: 1.25rem; }
    .contact-link { padding: 0.9rem 1rem; }
}

/* The default visual design stays animated. Respect an explicit OS preference. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal-target { opacity: 1; transform: none; }
    .typing-cursor { display: none; }
}

/* Stop decorative CSS animation along with the JS loops in background tabs. */
html[data-page-hidden] *,
html[data-page-hidden] *::before,
html[data-page-hidden] *::after {
    animation-play-state: paused !important;
}

/* Language switching changes text, not typography. The shared font stacks
   preserve Latin faces and use FusionPixel only for unsupported CJK glyphs. */
.email-disclosure { position: relative; min-width: 0; }
.email-disclosure > [data-email] { width: 100%; }
.social-links .email-disclosure { display: inline-flex; }
.email-panel {
    position: absolute; z-index: 20; top: calc(100% + 0.5rem); left: 0;
    width: max-content; max-width: min(22rem, calc(100vw - 3rem));
    padding: 1rem; background: var(--bg); border: 1px dashed var(--fg-dim);
    border-radius: var(--r-card); box-shadow: 0 8px 24px #0004;
    text-align: left; color: var(--fg); font-family: var(--mono); font-size: 0.8rem;
}
.email-panel[hidden] { display: none; }
.contact-links .email-panel { position: relative; top: auto; margin-top: 0.5rem; width: 100%; max-width: 100%; }
.email-address { display: block; width: 100%; min-width: 0; border: 0; padding: 0; background: transparent; color: var(--fg); font: inherit; }
.email-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.email-copy, .email-send {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    min-height: 44px; padding: 0.4rem 0.8rem; border: 1px solid var(--fg-dim);
    border-radius: var(--r-pill); background: transparent; color: var(--fg);
    font: inherit; letter-spacing: 0.04em; cursor: pointer; text-decoration: none;
    transition: color .15s, border-color .15s, box-shadow .15s;
}
.email-copy:hover, .email-send:hover { color: var(--red); border-color: var(--red); box-shadow: 0 0 10px var(--red-dim); }
.email-copy:focus-visible, .email-send:focus-visible, [data-email]:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.email-copy:disabled { cursor: wait; opacity: 0.7; }
.email-feedback { display: block; color: var(--fg-dim); margin-top: 0.5rem; overflow-wrap: anywhere; }
.email-feedback:empty { display: none; }
@media (max-width: 480px) {
    .social-links .email-disclosure { position: static; }
    .social-links { position: relative; }
    .social-links .email-panel { left: 0; max-width: 100%; width: 100%; }
    .weather-btn { letter-spacing: 0.03em; padding-inline: 0.55rem; }
}
html[lang="zh-CN"] .hero-panel::before { content: "● 会话开始"; }
html[lang="zh-CN"] .section[data-hex]::after { content: "// ──────────── [结束: " attr(data-hex) "] ──────────── //"; }

.email-panel { scroll-margin-top: 6rem; scroll-margin-bottom: 3rem; }
