/* =========================================================
   Mechanical Structure Engineer Portfolio — restrained UI
   ========================================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Surface colors — deep blue-black, restrained */
    --bg-0: #0a0d12;
    --bg-1: #10141c;
    --bg-2: #161b25;
    --bg-3: #1d2330;
    --line: #1f2532;
    --line-strong: #2a3140;

    /* Text */
    --text: #ecedef;       /* near white */
    --text-dim: #c2c6d0;   /* secondary text — high contrast */
    --text-mute: #8a92a3;  /* meta / labels — softer but readable */

    /* Accents */
    --accent: #14b8a6;
    --accent-2: #2dd4bf;
    --accent-fg: #061211;
    --accent-dim: rgba(20, 184, 166, 0.10);
    --rose: #f43f5e;
    --rose-dim: rgba(244, 63, 94, 0.10);

    /* Typography stacks */
    --font-display: 'Space Grotesk', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-cn: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'SF Mono', Consolas,
        'Microsoft YaHei', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: #2a3140; }
::-webkit-scrollbar-thumb:hover { background: #3a4252; }

::selection { background: var(--accent); color: var(--accent-fg); }

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* ===== Top Nav ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 13, 18, 0.78);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}

.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 24px;
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--text);
    flex-shrink: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    transition: color 0.15s;
}

.nav-logo-sub {
    font-family: var(--font-cn);
    font-size: 10.5px;
    color: var(--text-mute);
    letter-spacing: 0.5px;
    font-weight: 400;
}

.nav-logo:hover { color: var(--accent); }
.nav-logo:hover .nav-logo-sub { color: var(--text-dim); }

.nav-links {
    display: flex;
    gap: 2px;
    list-style: none;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    color: var(--text-dim);
    font-size: 14px;
    padding: 7px 14px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-2);
}

.nav-links a.active {
    color: var(--accent);
}

.nav-resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 13.5px;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
}

.nav-resume-btn:hover {
    background: var(--accent);
    color: var(--accent-fg);
}

/* Hamburger button (mobile only) */
.nav-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
}

.nav-menu-btn span {
    width: 16px;
    height: 1.5px;
    background: var(--text-dim);
    transition: transform 0.18s, opacity 0.18s;
}

.nav-menu-btn.open span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}
.nav-menu-btn.open span:nth-child(2) {
    opacity: 0;
}
.nav-menu-btn.open span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

/* Mobile menu drawer */
.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 13, 18, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(-4px);
}

.mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.mobile-menu ul {
    list-style: none;
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu a {
    display: block;
    padding: 14px 12px;
    font-size: 16px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--line);
    transition: color 0.15s, background 0.15s;
}

.mobile-menu a:hover {
    color: var(--accent);
}

.nav-resume-btn .arrow {
    transition: transform 0.15s;
}

.nav-resume-btn:hover .arrow {
    transform: translateY(1px);
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Section ===== */
.section {
    padding: 88px 0 16px;
}

.section-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 40px;
}

.section-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-right: 8px;
}

.section-title .accent {
    color: var(--accent);
}

/* ===== Hero ===== */
.hero {
    padding: 132px 0 48px;
    min-height: 0;
    max-height: 90vh;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
    gap: 56px;
    align-items: center;
}

.hero-left {
    min-width: 0;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-cn);
    font-size: 11px;
    letter-spacing: 0.5px;
    border-radius: 999px;
    margin-bottom: 28px;
    text-transform: uppercase;
    font-weight: 500;
}

.hero-name {
    font-family: var(--font-display);
    font-size: 68px;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -2px;
    margin-bottom: 22px;
}

.hero-name-cn {
    display: block;
}

.hero-name-en {
    display: block;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.32em;
    letter-spacing: 6px;
    margin-top: 16px;
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-cn);
    font-size: 20px;
    color: var(--text);
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.45;
}

.hero-title-en {
    font-size: 13px;
    color: var(--text-mute);
    font-family: var(--font-mono);
    letter-spacing: 2px;
    margin-bottom: 26px;
    text-transform: uppercase;
}

.hero-sub {
    color: var(--text-dim);
    font-family: var(--font-cn);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.hero-desc {
    color: var(--text-dim);
    line-height: 1.75;
    margin-bottom: 30px;
    font-size: 16px;
    max-width: 560px;
}

.hero-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    letter-spacing: 0.8px;
    font-weight: 500;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-mute);
    background: var(--bg-2);
}

/* ===== Hero Right: Profile Photo ===== */
.hero-right {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-photo {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: var(--bg-1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ===== Hero Visual: Featured Project Card ===== */
.hero-visual {
    min-width: 0;
}

.project-visual-card {
    background: var(--bg-1);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    overflow: hidden;
}

.visual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-mute);
}

.visual-tag {
    color: var(--accent);
    text-transform: uppercase;
}

.visual-period {
    color: var(--text-mute);
}

.visual-canvas {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-1);
    overflow: hidden;
}

.visual-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    display: block;
}

.visual-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--line);
}

.visual-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
}

.visual-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.visual-stack span {
    padding: 3px 9px;
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10.5px;
    border-radius: 4px;
}

/* ===== Hero Stats Strip ===== */
.hero-stats {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 56px;
    padding: 22px 28px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px;
    text-align: center;
}

.stat-item:first-child { padding-left: 0; text-align: left; }
.stat-item:last-child { padding-right: 0; text-align: right; }

.stat-divider {
    width: 1px;
    background: var(--line);
    margin: 0 4px;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.6px;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-family: var(--font-cn);
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    display: inline-flex;
    flex-direction: column;
    align-items: inherit;
    gap: 3px;
}

.stat-item:first-child .stat-label { align-items: flex-start; }
.stat-item:last-child .stat-label { align-items: flex-end; }

.stat-sub {
    font-size: 10px;
    color: var(--rose);
    letter-spacing: 0.4px;
    font-weight: 500;
}

/* ===== Status dot (restrained) ===== */
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 8px;
    vertical-align: 1px;
}

/* ===== Selected Projects — Engineering Case Study ===== */
.cases {
    display: flex;
    flex-direction: column;
    gap: 96px;
}

.case-study {
    border-top: 1px solid var(--line);
    padding-top: 56px;
}

/* =========================================================
   Case Study — Header
   ========================================================= */
.cs-header {
    margin-bottom: 36px;
}

.cs-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-mute);
    margin-bottom: 14px;
}

.cs-num {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.cs-tag {
    padding: 4px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 10.5px;
    letter-spacing: 1.2px;
}

.cs-featured-tag {
    background: rgba(20, 184, 166, 0.07);
    border-color: rgba(20, 184, 166, 0.35);
    color: var(--accent);
}

.cs-spacer {
    flex: 1;
    height: 1px;
    background: var(--line);
    min-width: 16px;
}

.cs-period {
    color: var(--text-mute);
    letter-spacing: 1.2px;
}

.cs-role {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.cs-role .dot {
    color: var(--accent);
}

.cs-title-cn {
    font-family: var(--font-cn);
    font-size: 34px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.cs-title-en {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-mute);
    letter-spacing: 0.6px;
    margin-bottom: 22px;
}

.cs-summary {
    font-family: var(--font-cn);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-dim);
    max-width: 820px;
}

/* =========================================================
   Case Study — Engineering Figure (Hero Image)
   ========================================================= */
.cs-figure {
    margin: 0 0 32px;
}

.cs-figure-frame {
    position: relative;
    width: 100%;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cs-figure-frame:hover {
    border-color: var(--line-strong);
}

.cs-figure-hero .cs-figure-frame:has(.cs-figure-photo) {
    aspect-ratio: auto;
}

.cs-figure-hero .cs-figure-frame {
    aspect-ratio: 16 / 7;
}

/* When a frame holds a real photo, never lock its height — let the
   image define the height at its natural aspect ratio (no cropping). */
.cs-figure-frame:has(.cs-figure-photo) {
    aspect-ratio: auto;
    height: auto;
    max-height: none;
}

.cs-figure-secondary .cs-figure-frame {
    aspect-ratio: auto;
}

.cs-figure-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 168, 172, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 168, 172, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.cs-schematic {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Standalone caption below the image — never overlaps the figure */
.cs-figure-caption {
    display: block;
    margin-top: 10px;
    padding: 0 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.6px;
    line-height: 1.5;
    color: var(--text-mute);
    text-align: left;
}

/* =========================================================
   Case Study — Key Metrics
   ========================================================= */
.cs-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 4px;
    margin-bottom: 44px;
    overflow: hidden;
    background: var(--bg-1);
}

.cs-metric {
    padding: 28px 24px;
    border-right: 1px solid var(--line);
}

.cs-metric:last-child {
    border-right: none;
}

.cs-metric-num {
    font-family: var(--font-mono);
    font-size: 44px;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
    letter-spacing: -1.5px;
    margin-bottom: 14px;
}

.cs-metric-num span {
    font-size: 0.36em;
    color: var(--accent);
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: 4px;
}

.cs-metric-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    line-height: 1.4;
}

/* =========================================================
   Case Study — Design Modules (Project 02)
   ========================================================= */
.cs-modules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 44px;
}

.cs-module {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 22px 22px 24px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    align-items: start;
}

.cs-module-mark {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(20, 184, 166, 0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
}

.cs-module-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.cs-module-body p {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-dim);
    margin: 0;
}

.cs-module-body strong {
    color: var(--text);
    font-weight: 500;
}

/* =========================================================
   Case Study — 5 Sections (Challenge / Design / ... / Validation)
   ========================================================= */
.cs-sections {
    margin-bottom: 40px;
}

.cs-section {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 48px;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}

.cs-section:last-child {
    border-bottom: none;
}

.cs-section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    padding-top: 6px;
    border-left: 2px solid var(--accent);
    padding-left: 12px;
    height: fit-content;
}

.cs-section-content {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.75;
    max-width: 780px;
}

.cs-section-content strong {
    color: var(--text);
    font-weight: 500;
}

/* =========================================================
   Case Study — Engineering Gallery
   ========================================================= */
.cs-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.cs-gallery-item {
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-1);
    margin: 0;
    transition: border-color 0.2s, transform 0.2s;
}

.cs-gallery-item:hover {
    border-color: var(--line-strong);
}

.cs-gallery-img {
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.2px;
    color: var(--text-mute);
    position: relative;
}

.cs-gallery-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 168, 172, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 168, 172, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.cs-gallery-img span {
    display: block;
    font-size: 9px;
    color: var(--accent);
    margin-top: 6px;
    opacity: 0.7;
}

.cs-gallery-item figcaption {
    padding: 9px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    border-top: 1px solid var(--line);
    text-align: center;
    letter-spacing: 0.5px;
}

/* =========================================================
   Case Study — Real Media (Hero photo, design / process / video / results / aux)
   ========================================================= */

/* Shared sub-block header (A · B · C · D · E · F) */
.cs-block-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.cs-block-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    border-radius: 4px;
    flex-shrink: 0;
}

.cs-block-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.2px;
    line-height: 1.2;
    margin: 0;
}

.cs-block-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.8px;
    margin-left: auto;
}

/* Hero figure photo (Project 01 top image) */
.cs-figure-photo {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-1);
}

/* DESIGN block — 2-column grid (exploded + mechanism detail) */
.cs-design-block,
.cs-process-block,
.cs-video-block,
.cs-results-block,
.cs-aux-block {
    margin: 36px 0 12px;
}

.cs-design-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.cs-design-figure {
    margin: 0;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cs-design-figure:hover {
    border-color: var(--line-strong);
}

.cs-design-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
}

.cs-design-figure figcaption {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    border-top: 1px solid var(--line);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* PROCESS block — Sensing + Prototype side-by-side */
.cs-process-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cs-process-figure {
    margin: 0;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cs-process-figure:hover {
    border-color: var(--line-strong);
}

.cs-process-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}

.cs-process-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    flex-shrink: 0;
}

.cs-process-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.cs-process-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
}

.cs-process-figure figcaption {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    border-top: 1px solid var(--line);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* VALIDATION — video full-width */
.cs-video-block .cs-block-title {
    color: var(--text);
}

.cs-video-frame {
    position: relative;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.cs-video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    aspect-ratio: 16 / 9;
}

.cs-video-caption {
    display: block;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.5px;
    border-top: 1px solid var(--line);
}

/* RESULTS — two-column */
.cs-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cs-results-figure {
    margin: 0;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cs-results-figure:hover {
    border-color: var(--line-strong);
}

.cs-results-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
}

.cs-results-figure figcaption {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
}

.cs-results-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: 10.5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cs-results-name {
    font-family: var(--font-display);
    font-size: 12.5px;
    color: var(--text);
    font-weight: 500;
    letter-spacing: 0;
    flex-shrink: 0;
}

.cs-results-meta {
    color: var(--text-mute);
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* AUX block — workflow process images */
.cs-aux-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cs-aux-figure {
    margin: 0;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cs-aux-figure:hover {
    border-color: var(--line-strong);
}

.cs-aux-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
}

.cs-aux-figure figcaption {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    border-top: 1px solid var(--line);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* =========================================================
   Case Study — Keywords / Tags
   ========================================================= */
.cs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cs-tags span {
    padding: 5px 11px;
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11.5px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.cs-tags span.key {
    color: var(--accent);
    border-color: rgba(20, 184, 166, 0.3);
}

/* =========================================================
   Case Study — Secondary (Project 03)
   NOTE: the project NAME (h3.cs-title-cn) is deliberately NOT
   styled here. All three projects must render an identical
   title (family / size / weight / line-height / letter-spacing
   / colour / margins), and the responsive sizes live in the
   media queries next to the base .cs-title-cn rule. Adding a
   font-size override here would win on specificity (0,2,0 over
   0,1,0) and silently shrink Project 03 at every breakpoint.
   The project level is communicated by the .cs-tag label only.
   ========================================================= */
.case-study.cs-secondary {
    opacity: 0.88;
}

.cs-secondary .cs-title-en {
    font-size: 12px;
    margin-bottom: 14px;
}

.cs-secondary .cs-summary {
    font-size: 14.5px;
    line-height: 1.65;
    margin-bottom: 24px;
}

.cs-secondary-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 28px;
    border-top: 1px solid var(--line);
}

.cs-secondary-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 32px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cs-secondary-key {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.3px;
    padding-top: 4px;
}

.cs-secondary-val {
    color: var(--text-dim);
    font-size: 14.5px;
    line-height: 1.65;
}

.cs-secondary-val strong {
    color: var(--text);
    font-weight: 500;
}

.section-lead {
    color: var(--text-dim);
    font-size: 15px;
    margin-top: 12px;
    max-width: 600px;
    line-height: 1.6;
}

/* ===== Engineering Skills — Capability Groups ===== */
.caps {
    border-top: 1px solid var(--line);
}

.caps-group {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.caps-h {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
}

.caps-num {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.caps-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.2px;
}

.caps-rule {
    flex: 1;
    height: 1px;
    background: var(--line);
    align-self: center;
    min-width: 16px;
}

.caps-meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-mute);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.caps-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.caps-tag {
    padding: 4px 11px;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    transition: color 0.15s, border-color 0.15s;
}

.caps-tag:hover {
    color: var(--accent);
    border-color: rgba(20, 184, 166, 0.35);
}

/* Other Tools — reduced visual weight */
.caps-other {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0 6px;
    flex-wrap: wrap;
}

.caps-other-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border: 1px solid var(--line);
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg-1);
}

.caps-other-text {
    font-size: 13px;
    color: var(--text-mute);
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
    line-height: 1.6;
}

/* ===== Research & Awards — Formal Tables ===== */
.dtable-wrap {
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-1);
}

.dtable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dtable thead th {
    background: var(--bg-2);
    border-bottom: 1px solid var(--line-strong);
    padding: 12px 18px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 1px;
    white-space: nowrap;
}

.dtable tbody tr {
    transition: background 0.15s;
}

.dtable tbody tr:hover {
    background: var(--bg-2);
}

.dtable tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.dtable tbody tr:last-child td {
    border-bottom: none;
}

/* Research — 4 columns: 类型 / 题目 / 期刊·编号 / 状态 */
.dtable--research .col-type { width: 104px; }
.dtable--research .col-src { width: 250px; }
.dtable--research .col-status { width: 108px; }

/* Awards — 3 columns: 级别 / 竞赛名称 / 奖项 */
.dtable--awards .col-level { width: 104px; }
.dtable--awards .col-prize { width: 220px; }

/* Cell typography */
.dt-type {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 0.2px;
}

.dt-title {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.6;
}

.dt-src {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-mute);
    line-height: 1.55;
    letter-spacing: 0.2px;
}

.dt-status,
.dt-prize {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 0.2px;
}

/* Under Review stays the single reserved accent (rose) */
.dt-status.is-review {
    color: var(--rose);
}

/* ===== Honors / Scholarship — compact tags under the awards table ===== */
.dtable-wrap + .awards-block {
    margin-top: 32px;
}

.awards-block + .awards-block {
    margin-top: 26px;
}

.awards-h {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.awards-h::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.honors-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.honors-chip {
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 13px;
    background: var(--bg-1);
    letter-spacing: 0.2px;
    transition: border-color 0.15s, color 0.15s;
}

.honors-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Education — Simple List (kept for backward compat) ===== */
.simple-list {
    border-top: 1px solid var(--line);
}

.simple-row {
    display: grid;
    align-items: baseline;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 4px;
}

.simple-row:hover {
    background: var(--bg-1);
}

.simple-row .c1 { color: var(--text); font-weight: 500; font-size: 15px; }
.simple-row .c2 { color: var(--text-dim); font-size: 14.5px; line-height: 1.55; }
.simple-row .c3 { color: var(--text-mute); font-family: var(--font-mono); font-size: 12px; }

.simple-row.edu { grid-template-columns: 1.4fr 1.4fr 152px; gap: 24px; }

/* Education: 时间列始终单行、两条经历右对齐一致 */
.simple-row.edu .c3 {
    white-space: nowrap;
}

.tag-pill {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.tag-pill.rose {
    background: var(--rose-dim);
    color: var(--rose);
}

.simple-row .c3 {
    text-align: right;
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 80px;
    align-items: start;
}

.contact-headline {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.contact-lead {
    color: var(--text-dim);
    margin-bottom: 32px;
    line-height: 1.75;
    max-width: 480px;
}

.contact-list {
    display: flex;
    flex-direction: column;
}

.contact-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}

.contact-key {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.contact-val {
    color: var(--text);
    font-size: 16px;
}

.contact-link {
    position: relative;
    transition: color 0.15s;
    word-break: break-all;
}

.contact-link:hover {
    color: var(--accent);
}

.qr-card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    padding: 28px;
    text-align: center;
    position: sticky;
    top: 88px;
}

.qr-label {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 2.5px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.qr-frame {
    background: #ffffff;
    padding: 14px;
    display: inline-block;
    margin-bottom: 18px;
    border-radius: 4px;
}

#qrcode {
    width: 180px;
    height: 180px;
}

#qrcode img, #qrcode canvas {
    width: 180px !important;
    height: 180px !important;
}

.qr-caption {
    font-family: var(--font-mono);
    color: var(--text-mute);
    font-size: 11.5px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.qr-url {
    color: var(--text-dim);
    word-break: break-all;
}

.btn-copy {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    transition: all 0.15s;
}

.btn-copy:hover {
    background: var(--accent);
    color: var(--accent-fg);
}

/* ===== Footer ===== */
.footer {
    padding: 36px 0 48px;
    border-top: 1px solid var(--line);
    margin-top: 96px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-mute);
    flex-wrap: wrap;
    gap: 12px;
}

.back-to-top {
    color: var(--accent);
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 500;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

/* Floating back-to-top (mobile / tablet) */
.back-to-top-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: var(--bg-1);
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, background 0.15s, color 0.15s;
    align-items: center;
    justify-content: center;
}

.back-to-top-fab.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top-fab:hover {
    background: var(--accent);
    color: var(--accent-fg);
}

/* ===== Section reveal (intersection observer) ===== */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */

/* ≤ 1366px — minor scaling */
@media (max-width: 1366px) {
    .container { max-width: 1180px; }
}

/* Tablet & small laptop */
@media (max-width: 1024px) {
    .nav-links {
        gap: 0;
    }
    .nav-links a { padding: 7px 10px; font-size: 13.5px; }
    .nav-logo-sub { display: none; }

    .hero-grid { gap: 48px; }
    .hero-name { font-size: 58px; }
    .cs-title-cn { font-size: 30px; }
}

@media (max-width: 980px) {
    .hero {
        max-height: none;
    }

    .hero-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-photo {
        max-width: 240px;
    }

    .qr-card {
        position: static;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .stat-divider {
        display: none;
    }

    .stat-item {
        flex: 1 1 calc(50% - 8px);
        text-align: left !important;
        padding: 12px 0 !important;
    }

    .stat-item .stat-label {
        align-items: flex-start !important;
    }

    /* Case Study — project layout */
    .cases { gap: 72px; }

    .cs-title-cn { font-size: 26px; }

    .cs-figure-hero .cs-figure-frame { aspect-ratio: 16 / 9; }
    .cs-figure-secondary .cs-figure-frame { aspect-ratio: auto; }

    .cs-metric-num { font-size: 36px; }

    .cs-modules {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cs-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cs-section-label {
        border-left: none;
        padding-left: 0;
        border-bottom: 1px solid var(--line);
        padding-bottom: 10px;
        width: fit-content;
    }

    .cs-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-secondary-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* Capability groups */
    .caps-h {
        flex-wrap: wrap;
        gap: 10px;
    }
    .caps-meta { width: 100%; }

    /* Research / Awards tables — stack into blocks on mobile */
    .dtable thead { display: none; }
    .dtable,
    .dtable tbody,
    .dtable tbody tr,
    .dtable tbody td {
        display: block;
        width: auto;
    }
    .dtable tbody tr {
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
    }
    .dtable tbody tr:last-child { border-bottom: none; }
    .dtable tbody td {
        padding: 0;
        border-bottom: none;
    }
    .dtable tbody td + td { margin-top: 5px; }
    .dt-type { margin-bottom: 6px; }
    .dt-src { font-size: 12px; }

    /* Project 01 — new media blocks */
    .cs-design-grid,
    .cs-process-grid,
    .cs-results-grid,
    .cs-aux-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cs-block-head {
        flex-wrap: wrap;
        gap: 10px;
    }
    .cs-block-meta { width: 100%; margin-left: 0; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-resume-btn { display: none; }
    .nav-menu-btn { display: flex; }
    .mobile-menu { display: block; }
    .back-to-top-fab { display: flex; }

    .nav-logo { font-size: 14px; letter-spacing: 1.5px; }
    .top-nav-inner { padding: 0 16px; }

    .container { padding: 0 16px; }

    .hero { padding: 110px 0 40px; }
    .hero-name { font-size: 46px; letter-spacing: -1.5px; line-height: 1.05; }
    .hero-name-en { font-size: 0.36em; letter-spacing: 4px; margin-top: 10px; }
    .hero-title { font-size: 17px; }
    .hero-title-en { font-size: 11.5px; }
    .hero-sub { font-size: 14px; }
    .hero-desc { font-size: 15px; }
    .hero-cta { flex-direction: column; }
    .hero-cta .btn { width: 100%; justify-content: center; }
    .hero-photo { max-width: 200px; }

    .stat-item { flex: 1 1 100%; }
    .stat-num { font-size: 24px; }
    .hero-stats { padding: 18px 18px; }

    .section { padding: 64px 0 12px; }
    .section-title { font-size: 24px; }

    .cs-figure-hero .cs-figure-frame { aspect-ratio: 4 / 3; }
    .cs-figure-secondary .cs-figure-frame { aspect-ratio: auto; }
    .cs-metrics { grid-template-columns: 1fr; }
    .cs-metric { border-right: none; border-bottom: 1px solid var(--line); padding: 20px 16px; }
    .cs-metric:last-child { border-bottom: none; }
    .cs-metric-num { font-size: 32px; }
    .cs-title-cn { font-size: 22px; }
    .cs-summary { font-size: 15px; }

    .cs-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .caps-name { font-size: 15px; }
    .caps-tag { font-size: 11px; }

    .simple-row.research,
    .simple-row.award,
    .simple-row.edu {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .simple-row .c3 {
        text-align: left;
    }

    .footer-content { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ≤ 420px — extra small phones */
@media (max-width: 420px) {
    .container { padding: 0 14px; }
    .hero-name { font-size: 38px; letter-spacing: -1px; }
    .hero-name-en { letter-spacing: 3px; }
}

/* =========================================================
   Project 01 — Compact Layout Additions
   ========================================================= */

/* Overview figure: preserve original light background, full image, no crop */
.cs-overview-figure .cs-figure-frame,
.cs-overview-figure--secondary .cs-figure-frame {
    background: #f2f3f5;
    aspect-ratio: auto;
    height: auto;
    max-height: none;
}

.cs-overview-figure .cs-figure-photo,
.cs-overview-figure--secondary .cs-figure-photo {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: #f2f3f5;
    border-radius: 0;
}

/* Core contributions bullet list */
.cs-contributions {
    margin: 32px 0 40px;
}

.cs-contributions ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cs-contributions li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dim);
}

.cs-contributions li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* =========================================================
   Unified demo-video entry
   One small button per project, sitting in the project-title
   row: 「项目名称 [▶ 观看演示]」. Clicking it opens the shared
   lightbox defined further below (.video-modal).
   ========================================================= */
.cs-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 10px;
}

/* the title keeps its own type scale; the row owns the spacing */
.cs-title-row .cs-title-cn {
    margin-bottom: 0;
}

.cs-demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 14px;
    background: var(--accent);
    color: var(--accent-fg);
    border: 1px solid var(--accent);
    border-radius: 5px;
    font-family: var(--font-cn);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.4px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.cs-demo-btn:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    transform: translateY(-1px);
}

.cs-demo-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.cs-demo-play {
    font-size: 9px;
    line-height: 1;
}

/* Video Lightbox Modal */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.video-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 18, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: min(90vw, 1280px);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

.video-modal.open .video-modal-content {
    transform: translateY(0);
}

.video-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 13, 18, 0.7);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.video-modal-close:hover {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

.video-modal video {
    display: block;
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
    border-radius: 0;
}

.video-modal-caption {
    flex: 0 0 auto;
    padding: 12px 18px;
    font-family: var(--font-cn);
    font-size: 12.5px;
    color: var(--text-dim);
    letter-spacing: 0.3px;
    border-top: 1px solid var(--line);
}

.video-modal-caption:empty {
    display: none;
}

@media (max-width: 768px) {
    .video-modal {
        padding: 16px;
    }
    .video-modal-content {
        border-radius: 6px;
        max-height: calc(100vh - 32px);
    }
    /* the demo button may drop below the title when space is tight */
    .cs-title-row {
        gap: 10px 12px;
    }
    .cs-demo-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* =========================================================
   Project 03 — Secondary Compact Layout
   ========================================================= */

/* Overview images always show in full: full width, natural height,
   no fixed aspect-ratio / height / max-height, no cover-cropping. */
.cs-overview-figure--secondary .cs-figure-frame {
    background: #f2f3f5;
    aspect-ratio: auto;
    height: auto;
    max-height: none;
    overflow: hidden;
}

.cs-overview-figure--secondary .cs-figure-photo {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
}

.cs-contributions--secondary {
    margin: 28px 0 32px;
}

.cs-contributions--secondary li {
    font-size: 14.5px;
}