:root {
  --bg: #181a20;
  --bg-elev: #21242d;
  --surface: rgba(33, 36, 45, 0.88);
  --surface-hover: rgba(41, 45, 56, 0.96);
  --line: rgba(242, 238, 230, 0.095);
  --line-strong: rgba(214, 177, 112, 0.42);
  --text: #f2eee6;
  --muted: #a2a7b8;
  --dim: #73788b;
  --gold: #d6b170;
  --gold-soft: rgba(214, 177, 112, 0.14);
  --sage: #6bb8a8;
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--mono); }
::selection { background: rgba(214, 177, 112, 0.3); color: #fff; }
.accent-txt { color: var(--gold); }
.wrap { max-width: 1220px; margin: 0 auto; padding: 0 36px; }
section { position: relative; }

/* Top reading progress hairline */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0); z-index: 160;
  background: linear-gradient(90deg, var(--gold), var(--sage));
}

/* Floating Navigation */
nav {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; align-items: center; justify-content: space-between;
  width: min(1156px, calc(100% - 36px)); padding: 8px 8px 8px 24px;
  background: rgba(24, 26, 32, 0.66);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 14px 36px -18px rgba(0, 0, 0, 0.55);
  transition: transform 0.45s var(--ease);
}
nav.hide { transform: translate(-50%, -140%); }
.brand { font-family: var(--serif); font-weight: 700; letter-spacing: 0.12em; font-size: 16px; color: var(--text); }
.brand span { color: var(--gold); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 7px 15px; font-size: 13.5px; color: var(--muted);
  border-radius: 999px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(242, 238, 230, 0.08); }
.nav-cta {
  padding: 8px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--gold); color: #161410; transition: background 0.25s;
}
.nav-cta:hover { background: #e3c286; }

/* Section Headers */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px; font-weight: 700;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.eyebrow.center { display: flex; justify-content: center; }
h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.2vw, 54px); line-height: 1.18;
  font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-wrap: balance;
}
.sec-head { margin-bottom: 56px; }
.sec-head.center { text-align: center; }
.sec-head.center .eyebrow { display: flex; justify-content: center; }
.sec-sub { margin-top: 12px; color: var(--muted); font-size: 16px; }

/* ============ FULL-SCREEN 100VW × 100VH 3D STUDY ROOM ============ */
.room-hero {
  position: relative; width: 100%; height: 100vh; min-height: 680px;
  overflow: hidden; background: #1b1d23;
}
.room-stage {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
#roomCanvas { width: 100%; height: 100%; display: block; }

/* Subtle soft vignette at edges so floating HUD is effortlessly legible */
.room-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(24, 26, 32, 0.35) 0%, transparent 18%, transparent 76%, rgba(24, 26, 32, 0.88) 100%);
}

/* Floating top-left nameplate over the 3D space */
.room-plate {
  position: absolute; top: 96px; left: max(36px, calc((100vw - 1220px) / 2 + 36px));
  z-index: 10; max-width: 290px; pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
body.book-opened .room-plate,
body.book-opened .room-dock {
  opacity: 0; pointer-events: none; transform: translateY(10px);
}
body.book-opened .room-dock { transform: translate(-50%, 10px); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  color: #a9e5cf; background: rgba(24, 26, 32, 0.62);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(107, 184, 168, 0.28); margin-bottom: 14px;
}
.badge i {
  width: 6px; height: 6px; border-radius: 50%; background: #4cd4a3;
  box-shadow: 0 0 0 0 rgba(76, 212, 163, 0.55); animation: pulse 2.6s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(76, 212, 163, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 212, 163, 0); } }

.plate-name {
  font-family: var(--serif); font-size: clamp(38px, 4vw, 54px);
  line-height: 1.06; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text); text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.plate-role {
  margin-top: 8px; font-size: 15px; font-weight: 600; color: #e2ddd3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.plate-role span { color: var(--gold); margin: 0 4px; }
.plate-sub {
  margin-top: 6px; font-size: 13px; color: var(--muted);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Bottom-center spatial dock */
.room-dock {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(980px, calc(100% - 32px));
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.shelf-hud {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px; max-width: 100%;
  background: rgba(24, 26, 32, 0.72); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); font-size: 12.5px; color: #dcd7cc;
  transition: border-color 0.25s;
}
.shelf-hud.active { border-color: var(--line-strong); color: #fff; }
.hud-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.hud-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.vol-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.vol-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(28, 31, 39, 0.76); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); color: #c7cbd8;
  transition: all 0.25s var(--ease);
}
.vol-pill i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); }
.vol-pill:hover, .vol-pill.is-hover, .vol-pill.is-active {
  color: #fff; border-color: var(--line-strong);
  background: rgba(214, 177, 112, 0.16); transform: translateY(-2px);
}

.dock-scroll {
  font-size: 11.5px; letter-spacing: 0.14em; color: var(--dim);
  padding: 2px 10px; transition: color 0.2s;
}
.dock-scroll:hover { color: var(--gold); }

/* ============ MANIFESTO ============ */
.manifesto {
  padding: 130px 0 110px;
  border-top: 1px solid var(--line);
}
.manifesto-text {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 48px); line-height: 1.48;
  font-weight: 700; letter-spacing: -0.015em; max-width: 1020px;
}
.manifesto-text .m-ch {
  color: var(--text); opacity: 0.18; transition: opacity 0.15s;
}

/* ============ METRICS ============ */
.metrics-sec { padding: 20px 0 110px; }
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(33, 36, 45, 0.45);
}
.metric-box { padding: 44px 28px; border-right: 1px solid var(--line); }
.metric-box:last-child { border-right: none; }
.metric-box b {
  font-family: var(--serif); display: block;
  font-size: clamp(40px, 5vw, 66px); line-height: 1;
  font-weight: 700; letter-spacing: -0.03em; color: var(--gold);
}
.metric-box span { display: block; margin-top: 12px; color: var(--muted); font-size: 14.5px; }

/* ============ ARCHITECTURE ============ */
.arch { padding: 90px 0 120px; }
.arch-map { position: relative; display: flex; flex-direction: column; gap: 36px; padding: 12px 0; }
.arch-rail {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: var(--line); transform: translateX(-50%);
}
.arch-rail i {
  position: absolute; inset: 0;
  background: linear-gradient(var(--gold), var(--sage));
  transform-origin: 50% 0; transform: scaleY(0);
}
.arch-rail b {
  position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 5px rgba(214, 177, 112, 0.2);
}
.arch-row { display: flex; position: relative; }
.arch-row.left { justify-content: flex-start; padding-right: calc(50% + 44px); }
.arch-row.right { justify-content: flex-end; padding-left: calc(50% + 44px); }
.arch-row::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--gold);
}
.arch-card {
  width: 100%; padding: 26px 28px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.arch-card:hover {
  border-color: var(--line-strong); transform: translateY(-3px);
  background: var(--surface-hover);
}
.ac-tag { font-size: 11px; letter-spacing: 0.18em; color: var(--gold); font-weight: 600; }
.arch-card h3 { font-family: var(--serif); font-size: 21px; margin: 7px 0 8px; color: var(--text); }
.arch-card p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
  font-size: 12px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(242, 238, 230, 0.04); color: #d4d8e4;
}

/* ============ SELECTED WORKS GRID ============ */
.works { padding: 90px 0 120px; border-top: 1px solid var(--line); }
.works-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.work-card {
  display: flex; flex-direction: column; padding: 32px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s, background 0.3s;
}
.work-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--book-color, var(--gold));
}
.work-card:hover {
  transform: translateY(-5px); border-color: var(--line-strong);
  background: var(--surface-hover);
}
.wc-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12px; color: var(--dim); margin-bottom: 14px;
}
.wc-metric {
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  color: var(--gold); background: var(--gold-soft);
}
.work-card h3 { font-family: var(--serif); font-size: 25px; margin-bottom: 4px; color: var(--text); }
.wc-sub { font-size: 13.5px; color: var(--dim); margin-bottom: 14px; }
.wc-desc { font-size: 14.5px; color: var(--muted); margin-bottom: 20px; }
.wc-foot {
  margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.wc-open {
  font-size: 13.5px; font-weight: 600; color: var(--gold);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}

/* ============ EXPERIENCE TIMELINE ============ */
.exp { padding: 90px 0 110px; border-top: 1px solid var(--line); }
.tl { position: relative; }
.tl-rail { position: absolute; left: 210px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.tl-rail i { position: absolute; inset: 0; background: linear-gradient(var(--gold), var(--sage)); transform-origin: 50% 0; transform: scaleY(0); }
.tl-item { display: grid; grid-template-columns: 210px 1fr; padding: 26px 0; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 210px; top: 38px;
  width: 10px; height: 10px; margin-left: -4.5px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--gold); transition: background 0.35s, box-shadow 0.35s;
}
.tl-item.on::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(214, 177, 112, 0.22); }
.tl-when { font-size: 13px; color: var(--dim); padding-top: 8px; }
.tl-body { padding-left: 44px; }
.tl-body h3 { font-family: var(--serif); font-size: 23px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; color: var(--text); }
.tl-body h3 small { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--gold); }
.tl-body p { margin-top: 10px; color: var(--muted); font-size: 15px; max-width: 760px; }

/* ============ CONTACT ============ */
.contact { padding: 80px 0 0; }
.contact-card {
  text-align: center; padding: 72px 32px 56px; border-radius: 30px;
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(214, 177, 112, 0.14), transparent 72%),
    var(--bg-elev);
  border: 1px solid var(--line);
}
.contact-card h2 { margin-bottom: 14px; }
.contact-sub { color: var(--muted); font-size: 16px; margin-bottom: 36px; }
.contact-items { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.citem {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 16px 24px; min-width: 224px; border-radius: 16px; text-align: left;
  background: rgba(242, 238, 230, 0.04); border: 1px solid var(--line);
  color: var(--text); font-size: 15.5px; font-weight: 500;
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}
.citem small { font-size: 10.5px; letter-spacing: 0.16em; color: var(--dim); font-weight: 600; }
.citem:hover { border-color: var(--line-strong); background: rgba(242, 238, 230, 0.08); transform: translateY(-2px); }
.back-top-wrap { margin-top: 32px; }
.back-top { font-size: 13.5px; font-weight: 600; color: var(--gold); }
.back-top:hover { text-decoration: underline; }

footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 44px 36px 36px; color: var(--dim); font-size: 13px;
}

/* ============ MINIMAL FLOATING HUD WHILE HOLDING A 3D BOOK ============ */
.reader-hud {
  position: fixed; inset: 0; z-index: 220;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: 20px 28px 22px;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.reader-hud.open { opacity: 1; visibility: visible; }
.rh-top {
  pointer-events: auto;
  width: min(1100px, 100%); display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.rh-bottom {
  pointer-events: auto;
  display: flex; align-items: center; gap: 16px;
  padding: 7px 10px; border-radius: 999px;
  background: rgba(20, 22, 29, 0.78); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
.bm-vol-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-vtab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(24, 27, 35, 0.85); border: 1px solid var(--line); color: var(--muted);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s;
}
.bm-vtab i { width: 6px; height: 6px; border-radius: 50%; }
.bm-vtab:hover, .bm-vtab.active {
  color: #fff; border-color: var(--line-strong); background: rgba(214, 177, 112, 0.2);
}
.bm-close-top {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(24, 27, 35, 0.88); border: 1px solid var(--line); color: var(--text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s;
}
.bm-close-top span { font-size: 10px; color: var(--dim); padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,0.06); }
.bm-close-top:hover { border-color: var(--line-strong); background: var(--gold-soft); }

.bm-ctrl-btn {
  padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text);
  transition: all 0.2s;
}
.bm-ctrl-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--gold-soft); }
.bm-ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.bm-ctrl-info { font-size: 12px; color: #cfc9be; padding: 0 6px; }
body.book-opened nav { opacity: 0; pointer-events: none; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 16px);
  padding: 10px 20px; border-radius: 12px; background: var(--bg-elev);
  border: 1px solid var(--line-strong); color: var(--text); font-size: 13.5px;
  opacity: 0; transition: 0.3s; z-index: 260; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .room-plate { top: 88px; left: 20px; max-width: calc(100% - 40px); }
  .plate-sub { display: none; }
}

@media (max-width: 820px) {
  .wrap { padding: 0 20px; }
  .nav-links { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-box { padding: 28px 18px; }
  .metric-box:nth-child(2) { border-right: none; }
  .metric-box:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .arch-rail { left: 8px; }
  .arch-row.left, .arch-row.right { padding: 0 0 0 32px; }
  .arch-row::after { left: 8px; }
  .works-grid { grid-template-columns: 1fr; }
  .tl-rail { left: 6px; }
  .tl-item { grid-template-columns: 1fr; padding-left: 30px; }
  .tl-item::before { left: 6px; top: 34px; }
  .tl-body { padding-left: 0; }
  .tl-when { padding-top: 0; }
  .book-modal { padding: 10px; }
  .bm-vol-tabs { display: none; }
  .flipbook { width: 100%; height: calc(100vh - 120px); }
  .flipbook.is-closed { transform: scale(0.94); }
  .fb-board { padding: 8px; }
  .fb-pages { grid-template-columns: 1fr; overflow-y: auto; }
  .fb-gutter, .fb-sheet, .fb-corner { display: none !important; }
  .fb-page { height: auto; }
  .fb-left { border-right: none; border-bottom: 1px solid rgba(50, 40, 26, 0.14); border-radius: 6px 6px 0 0; }
  .fb-right { border-radius: 0 0 6px 6px; }
  .pg-body { overflow-y: visible; padding: 16px 18px; }
  .pg-head, .pg-foot { padding: 10px 18px; }
  .bm-ctrl-info { display: none; }
  .bm-stats { grid-template-columns: 1fr; }
  .contact-items { flex-direction: column; align-items: stretch; max-width: 340px; margin: 0 auto; }
  .citem { min-width: 0; }
  footer { flex-direction: column; gap: 6px; text-align: center; }
}
