/* ========================
   RESET & VARIABLES
   ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F5F0E8;
  --text: #666666;
  --text-light: #999999;
  --text-dark: #444444;
  --border: rgba(0,0,0,0.08);
  --card-bg: rgba(255,255,255,0.4);
}

/* ========================
   BASE
   ======================== */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

/* ========================
   LAYOUT
   ======================== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ========================
   NAVBAR
   ======================== */
.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 34px;
}

.nav-links a {
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  transition: color 0.24s ease, transform 0.24s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-dark);
}

.nav-links a:hover {
  transform: translateY(-1px);
}

.nav-link-en {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-link-cn {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text-light);
  white-space: normal;
}

.nav-links a:hover .nav-link-cn,
.nav-links a.active .nav-link-cn {
  color: var(--text);
}

/* ========================
   FOOTER
   ======================== */
.footer {
  max-width: 1200px;
  margin: 96px auto 0;
  padding: 28px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-light);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* ========================
   HERO
   ======================== */
.hero {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-image: url('../cover.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12);
  pointer-events: none;
}

.hero-text {
  position: absolute;
  top: 47%;
  left: 57%;
  transform: translate(-50%, calc(-50% + 10px));
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-text.hero-text-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.hero-name {
  font-family: "DM Serif Display", "Georgia", serif;
  font-size: clamp(60px, 9vw, 96px);
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 12px rgba(0,0,0,0.15);
  line-height: 1.2;
}

.hero-subtitle {
  font-family: -apple-system, sans-serif;
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.2em;
  margin-top: 14px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.2);
}

.hero-divider {
  width: 60px;
  height: 0.5px;
  background: rgba(255,255,255,0.35);
  margin: 24px auto 0;
}

/* Default: Option B — double wave */
.hero-enter {
  position: relative;
  display: inline-block;
  font-family: "Caveat", cursive;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.05em;
  margin-top: 18px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.2);
  text-decoration: none;
  cursor: pointer;
  padding-bottom: 10px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: bottom 0 left 0, bottom 5px left 0;
  background-size: 20px 6px;
  transition: color 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-enter:hover {
  color: rgba(255,255,255,1);
  transform: scale(1.12);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='rgba(255,255,255,0.95)' stroke-width='1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='rgba(255,255,255,0.95)' stroke-width='1'/%3E%3C/svg%3E");
}

/* Option A — single thick wave (add this class to switch) */
.hero-enter--wave-a {
  padding-bottom: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: bottom;
}

.hero-enter--wave-a:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3' fill='none' stroke='rgba(255,255,255,0.95)' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* Sparkles */
.sparkle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-enter:hover .sparkle { opacity: 1; }

.sparkle-1 { top: -28px; right: -32px; transition-delay: 0s; }
.sparkle-2 { top: -14px; left: -36px; transition-delay: 0.04s; }
.sparkle-3 { bottom: -6px; right: -38px; transition-delay: 0.08s; }
.sparkle-4 { top: -6px; right: -8px; transition-delay: 0.06s; }
.sparkle-5 { bottom: 10px; left: -24px; transition-delay: 0.1s; }
.sparkle-6 { top: -22px; left: 30%; transition-delay: 0.05s; }

.hero-enter:hover .sparkle-1 { transform: translate(10px, -14px) rotate(25deg); }
.hero-enter:hover .sparkle-2 { transform: translate(-10px, -10px) rotate(-20deg); }
.hero-enter:hover .sparkle-3 { transform: translate(12px, 10px) rotate(30deg); }
.hero-enter:hover .sparkle-4 { transform: translate(6px, -16px) rotate(-15deg); }
.hero-enter:hover .sparkle-5 { transform: translate(-8px, 8px) rotate(15deg); }
.hero-enter:hover .sparkle-6 { transform: translate(0px, -12px) rotate(-8deg); }

/* ========================
   LOADING OVERLAY
   ======================== */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  pointer-events: all;
}

#loading-overlay.fade-out {
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

#loading-name {
  font-family: "DM Serif Display", "Georgia", serif;
  font-size: clamp(36px, 6vw, 56px);
  color: #fff;
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

#loading-cursor {
  display: inline-block;
  margin-left: 3px;
  animation: blink 0.6s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

#loading-subtitle {
  font-family: -apple-system, sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.15em;
  margin-top: 20px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#loading-subtitle.visible {
  opacity: 1;
}

/* ========================
   CLICK SPARKLE
   ======================== */
.click-sparkle {
  position: absolute;
  pointer-events: none;
  transform-origin: center center;
  animation: sparkle-pop 0.8s ease-out forwards;
}

@keyframes sparkle-pop {
  0%   { opacity: 1; transform: scale(0.3) rotate(var(--r)) translateY(0); }
  100% { opacity: 0; transform: scale(1.2) rotate(var(--r)) translateY(-20px); }
}

/* ========================
   ABOUT PAGE
   ======================== */
.about-section {
  padding: 72px 0 96px;
}

.about-title {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.subpage-cn.about-title-cn {
  margin-bottom: 42px;
}

.about-tagline {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.9;
  max-width: 560px;
  margin-bottom: 56px;
}

.about-bio {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 2;
  color: var(--text);
  max-width: 560px;
  margin-bottom: 48px;
}

.about-bio p + p {
  margin-top: 18px;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 64px;
}

.skill-tag {
  font-size: 12px;
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 6px 16px;
  letter-spacing: 0.04em;
}

.about-actions {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.game-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--modal-overlay, rgba(0,0,0,0.4));
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  padding: 20px;
}

.game-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.game-modal {
  background: var(--modal-bg, #fff);
  max-width: 620px;
  width: 100%;
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--modal-border, var(--border));
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(52, 48, 38, 0.16);
  overflow: hidden;
  transform: translateY(6px);
  transition: transform 0.24s ease;
}

.game-modal-overlay.active .game-modal {
  transform: translateY(0);
}

.game-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 34px 22px;
  border-bottom: 1px solid var(--border-soft, var(--border));
  flex-shrink: 0;
}

.game-modal-title {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.game-modal-subtitle {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}

.game-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.game-modal-close:hover {
  color: var(--text-dark);
  transform: translateY(-1px);
}

.game-modal-body {
  overflow-y: auto;
  padding: 30px 34px 36px;
  -webkit-overflow-scrolling: touch;
}

.game-group + .game-group {
  margin-top: 28px;
}

.game-group-title {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  line-height: 1.7;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.game-group-title::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--grass, var(--text-light));
  opacity: 0.58;
  margin-right: 10px;
  flex-shrink: 0;
}

.game-list {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 2;
  max-width: 520px;
}

.game-modal-note {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text-light);
  line-height: 2;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft, var(--border));
  max-width: 520px;
}

.action-link {
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  display: inline-block;
}

.action-link:hover {
  color: var(--text-dark);
  border-color: var(--grass, rgba(0,0,0,0.25));
  transform: translateY(-1px);
}

.method-read-link {
  display: inline-flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
  white-space: normal;
}

.method-read-link:focus-visible {
  color: var(--text-dark);
  border-color: var(--grass, rgba(0, 0, 0, 0.25));
  outline: 2px solid var(--grass, rgba(0, 0, 0, 0.35));
  outline-offset: 4px;
  transform: translateY(-1px);
}

.method-link-grass {
  display: inline-flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 2px;
  width: 21px;
  height: 10px;
  overflow: hidden;
  transform: translateY(-1px);
}

.method-link-grass span {
  width: 2px;
  border-radius: 1px 1px 0 0;
  background: var(--grass, #93a66d);
  opacity: 0.66;
  transform-origin: bottom center;
  transition: opacity 0.24s ease, background-color 0.24s ease, transform 0.28s ease;
}

.method-link-grass span:nth-child(1) {
  height: 5px;
  transform: scaleY(0.9) rotate(-8deg);
}

.method-link-grass span:nth-child(2) {
  height: 8px;
  transform: scaleY(0.9) rotate(-2deg);
}

.method-link-grass span:nth-child(3) {
  height: 6px;
  transform: scaleY(0.9) rotate(5deg);
}

.method-link-grass span:nth-child(4) {
  height: 9px;
  transform: scaleY(0.9) rotate(-4deg);
}

.method-link-grass span:nth-child(5) {
  height: 5px;
  transform: scaleY(0.9) rotate(7deg);
}

.method-read-link:hover .method-link-grass span,
.method-read-link:focus-visible .method-link-grass span {
  background: var(--grass-strong, var(--grass, #7f9360));
  opacity: 0.88;
  transform: translateY(-1px) scaleY(1.08) rotate(0deg);
}

.method-read-link:hover .method-link-grass span:nth-child(1),
.method-read-link:focus-visible .method-link-grass span:nth-child(1) {
  transform: translateY(-1px) scaleY(1.08) rotate(-8deg);
}

.method-read-link:hover .method-link-grass span:nth-child(2),
.method-read-link:focus-visible .method-link-grass span:nth-child(2) {
  transform: translateY(-1px) scaleY(1.08) rotate(-2deg);
}

.method-read-link:hover .method-link-grass span:nth-child(3),
.method-read-link:focus-visible .method-link-grass span:nth-child(3) {
  transform: translateY(-1px) scaleY(1.08) rotate(5deg);
}

.method-read-link:hover .method-link-grass span:nth-child(4),
.method-read-link:focus-visible .method-link-grass span:nth-child(4) {
  transform: translateY(-1px) scaleY(1.08) rotate(-4deg);
}

.method-read-link:hover .method-link-grass span:nth-child(5),
.method-read-link:focus-visible .method-link-grass span:nth-child(5) {
  transform: translateY(-1px) scaleY(1.08) rotate(7deg);
}

.action-link-featured {
  font-size: 14px;
  color: var(--text-dark);
  border-bottom-color: rgba(0,0,0,0.2);
}

.action-link-featured:hover {
  border-color: rgba(0,0,0,0.45);
}

/* ========================
   WORK PAGE
   ======================== */
.work-section {
  padding: 72px 0 96px;
}

.work-intro {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text-light);
  max-width: 480px;
  margin-bottom: 72px;
  line-height: 2;
}

.work-cards {
  display: flex;
  flex-direction: column;
}

.work-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 44px 0;
  border-top: 1px solid var(--border-soft, var(--border));
  gap: 32px;
  outline: 0;
  transition: transform 0.28s ease, border-color 0.28s ease;
  cursor: pointer;
}

.work-card:last-child {
  border-bottom: 1px solid var(--border-soft, var(--border));
}

.work-card:hover,
.work-card:focus-visible {
  transform: translateX(4px);
  border-color: rgba(147, 166, 109, 0.26);
}

.work-card:focus-visible {
  outline: 1px solid rgba(147, 166, 109, 0.34);
  outline-offset: 8px;
  border-radius: 2px;
}

.work-card-left {
  flex-shrink: 0;
}

.work-card-en {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  line-height: 1.2;
  display: block;
  margin-bottom: 8px;
  transition: color 0.28s ease;
}

.work-card-cn {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  transition: color 0.28s ease;
}

.work-grass {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 23px;
  height: 10px;
  overflow: hidden;
  transform: translateY(-2px);
}

.work-grass span {
  width: 2px;
  height: 8px;
  border-radius: 1px 1px 0 0;
  background: var(--grass, #93a66d);
  opacity: 0;
  transform: translateY(4px) scaleY(0.4);
  transform-origin: bottom center;
  transition: opacity 0.24s ease, transform 0.32s ease;
}

.work-grass span:nth-child(1) {
  height: 6px;
  transform: translateY(4px) scaleY(0.4) rotate(-8deg);
  transition-delay: 0ms;
}

.work-grass span:nth-child(2) {
  height: 9px;
  transform: translateY(4px) scaleY(0.4) rotate(-2deg);
  transition-delay: 45ms;
}

.work-grass span:nth-child(3) {
  height: 7px;
  transform: translateY(4px) scaleY(0.4) rotate(5deg);
  transition-delay: 90ms;
}

.work-grass span:nth-child(4) {
  height: 10px;
  transform: translateY(4px) scaleY(0.4) rotate(-4deg);
  transition-delay: 135ms;
}

.work-grass span:nth-child(5) {
  height: 6px;
  transform: translateY(4px) scaleY(0.4) rotate(7deg);
  transition-delay: 180ms;
}

.work-card-desc {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text-light);
  max-width: 340px;
  line-height: 1.8;
  text-align: right;
  transition: color 0.28s ease;
}

.work-card:hover .work-card-en,
.work-card:focus-visible .work-card-en {
  color: var(--text-dark);
}

.work-card:hover .work-card-cn,
.work-card:hover .work-card-desc,
.work-card:focus-visible .work-card-cn,
.work-card:focus-visible .work-card-desc {
  color: var(--text);
}

.work-card:hover .work-grass span,
.work-card:focus-visible .work-grass span,
.work-card:active .work-grass span {
  opacity: 0.82;
  transform: translateY(0) scaleY(1) rotate(0deg);
}

.work-card:hover .work-grass span:nth-child(1),
.work-card:focus-visible .work-grass span:nth-child(1),
.work-card:active .work-grass span:nth-child(1) {
  transform: translateY(0) scaleY(1) rotate(-8deg);
}

.work-card:hover .work-grass span:nth-child(2),
.work-card:focus-visible .work-grass span:nth-child(2),
.work-card:active .work-grass span:nth-child(2) {
  transform: translateY(0) scaleY(1) rotate(-2deg);
}

.work-card:hover .work-grass span:nth-child(3),
.work-card:focus-visible .work-grass span:nth-child(3),
.work-card:active .work-grass span:nth-child(3) {
  transform: translateY(0) scaleY(1) rotate(5deg);
}

.work-card:hover .work-grass span:nth-child(4),
.work-card:focus-visible .work-grass span:nth-child(4),
.work-card:active .work-grass span:nth-child(4) {
  transform: translateY(0) scaleY(1) rotate(-4deg);
}

.work-card:hover .work-grass span:nth-child(5),
.work-card:focus-visible .work-grass span:nth-child(5),
.work-card:active .work-grass span:nth-child(5) {
  transform: translateY(0) scaleY(1) rotate(7deg);
}

/* ========================
   CONTACT PAGE
   ======================== */
.contact-section {
  padding: 64px 0 96px;
}

.contact-signature {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text-light);
  max-width: 400px;
  line-height: 1.9;
  margin-top: 82px;
}

.contact-signature-cn {
  color: var(--text-light);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.contact-signature-en {
  margin-top: 4px;
  color: var(--text-light);
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-value {
  font-size: 15px;
  color: var(--text);
  transition: color 0.2s;
}

.contact-value:hover {
  color: var(--text-dark);
}

/* ========================
   SUBPAGE: BACK LINK
   ======================== */
.back-link-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

.back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.06em;
  padding-top: 20px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

/* ========================
   SUBPAGE HEADER (shared)
   ======================== */
.subpage-header {
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--border-soft, var(--border));
}

.subpage-en {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.subpage-cn {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.10em;
  margin-bottom: 28px;
}

.subpage-desc {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  max-width: 480px;
  line-height: 2;
}

/* ========================
   METHOD NOTES PAGE
   ======================== */
.method-notes-section {
  padding: 0 0 96px;
}

.article-block {
  padding: 80px 0;
}

.article-block + .article-block {
  border-top: 1px solid var(--border-soft, var(--border));
}

.article-number {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 44px;
  font-weight: 400;
  color: var(--text-light);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.diagrams-intro {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  margin-top: 64px;
  margin-bottom: 32px;
}

.article-title {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.method-notes-section .article-title {
  margin-bottom: 24px;
}

.article-subtitle {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.04em;
  margin-bottom: 36px;
}

.article-core {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 15px;
  color: var(--text);
  max-width: 600px;
  line-height: 2;
  margin-bottom: 40px;
}

.diagrams-section {
  display: flex;
  flex-direction: column;
  gap: 72px;
  margin-bottom: 0;
}

.diagram-block {
  max-width: 720px;
}

.highlights-section + .diagram-block {
  margin-top: 42px;
}

.diagram-caption {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 20px;
  text-align: left;
}

.diagram-svg-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.diagram-svg-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 480px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

/* ========================
   NARRATIVE SYSTEM PAGE
   ======================== */
.narrative-section {
  padding: 0 0 96px;
}

.diagram-img-wrap {
  width: 100%;
  max-width: 720px;
}

.diagram-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.method-diagram-img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 6px;
  background: var(--paper-soft, rgba(255, 255, 255, 0.34));
  box-shadow: 0 10px 28px rgba(52, 48, 38, 0.06);
}

.diagram-img-wrap .console-preview-img {
  width: 60%;
  max-width: 100%;
  margin: 0 auto;
}

.diagram-placeholder {
  background:
    linear-gradient(180deg, var(--paper-soft, rgba(255,255,255,0.34)), rgba(255,255,255,0.18)),
    var(--grass-soft, rgba(0,0,0,0.03));
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.7;
  padding: 20px;
}

.highlights-section {
  margin-top: 56px;
}

.highlights-intro {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  margin-top: 64px;
  margin-bottom: 32px;
}

.highlight-item + .highlight-item {
  margin-top: 32px;
}

.highlight-item {
  max-width: 640px;
}

.highlight-title {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.highlight-desc {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 2;
  max-width: 600px;
}

.narrative-sample {
  border-left: 2px solid var(--border);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
}

.sample-step-label {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.sample-step-text {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}

/* ========================
   WORLDBUILDING PAGE
   ======================== */
.worldbuilding-section {
  padding: 0 0 96px;
}

.section-label {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  margin-top: 48px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.section-label::before {
  content: '';
  flex-shrink: 0;
  display: block;
  width: 18px;
  height: 1px;
  background: var(--grass, var(--text-light));
  opacity: 0.58;
  margin-right: 10px;
}

.section-body {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 2;
  max-width: 640px;
}

.section-body p + p {
  margin-top: 16px;
}

.content-section {
  max-width: 680px;
}

.derivation-chain {
  padding: 24px 0;
  max-width: 480px;
}

.derivation-step {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 400;
  line-height: 1.8;
}

.derivation-arrow {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.4;
  padding: 4px 0;
  display: block;
}

/* ========================
   FACTION & CHARACTER PAGE
   ======================== */
.faction-section {
  padding: 0 0 96px;
}

.faction-card {
  margin-top: 56px;
  max-width: 720px;
}

.faction-card + .faction-card {
  margin-top: 64px;
}

.faction-card + .grass-divider-short {
  margin: 42px auto 30px;
}

.grass-divider-short + .faction-card {
  margin-top: 0;
}

.faction-name {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.faction-tagline {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 2;
  max-width: 640px;
  margin-bottom: 32px;
}

.faction-concept {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 2;
  max-width: 640px;
  margin-bottom: 32px;
}

.faction-concept + .faction-concept {
  margin-top: -16px;
}

.faction-character-quote {
  position: relative;
  max-width: 680px;
  margin: 18px 0 0;
  padding: 14px 20px 16px 26px;
  border-left: 2px solid rgba(147, 166, 109, 0.42);
  border-radius: 0 8px 8px 0;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 248, 0.52),
      rgba(255, 255, 255, 0.22)
    );
}

.faction-character-quote .faction-tagline {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  max-width: none;
  margin-bottom: 0;
  font-size: clamp(1.08rem, 1.35vw, 1.28rem);
  font-style: italic;
  font-style: oblique 6deg;
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: #4d5f3f;
}

.faction-character-body {
  max-width: 640px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.faction-character-body .faction-concept {
  font-family: inherit;
  max-width: none;
  margin-bottom: 18px;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0;
  color: var(--text);
}

.faction-character-body .faction-concept + .faction-concept {
  margin-top: 0;
}

.faction-character-body .faction-concept:last-child {
  margin-bottom: 0;
}

.faction-card .highlight-desc {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}

.faction-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

/* ========================
   CREATIVE LAB PAGE
   ======================== */
.creative-section {
  padding: 0 0 96px;
}

.creative-project-desc {
  max-width: 600px;
}

.creative-project-desc .highlight-desc {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  margin: 0 0 1.1rem;
}

.creative-project-desc .highlight-desc:last-child {
  margin-bottom: 0;
}

.cards-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--modal-overlay, rgba(0,0,0,0.4));
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.cards-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cards-modal {
  background: var(--modal-bg, #fff);
  max-width: 640px;
  width: calc(100% - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--modal-border, var(--border));
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(52, 48, 38, 0.16);
  overflow: hidden;
}

.cards-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--border-soft, var(--border));
  flex-shrink: 0;
}

.cards-modal-title {
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.04em;
}

.cards-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
  line-height: 1;
}

.cards-modal-close:hover {
  color: var(--text-dark);
}

.cards-grid-view {
  overflow-y: auto;
  flex: 1;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 28px 32px 36px;
}

.card-item {
  cursor: pointer;
}

.card-thumb-placeholder {
  aspect-ratio: 2 / 3;
  background:
    linear-gradient(180deg, var(--paper-soft, rgba(255,255,255,0.35)), rgba(255,255,255,0.18)),
    var(--grass-soft, rgba(0,0,0,0.04));
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card-item:hover .card-thumb-placeholder {
  background: var(--grass-soft, rgba(0,0,0,0.06));
  border-color: var(--border);
  transform: translateY(-2px);
}

.card-name {
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  font-size: 13px;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.04em;
}

.card-detail-view {
  overflow-y: auto;
  flex: 1;
  padding: 28px 32px 40px;
}

.card-back-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0;
  margin-bottom: 32px;
  transition: color 0.2s;
  display: block;
}

.card-back-btn:hover {
  color: var(--text);
}

.card-detail-layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.card-detail-image {
  flex-shrink: 0;
  width: 200px;
}

.card-detail-placeholder {
  width: 100%;
  margin-bottom: 0;
}

.card-detail-info {
  flex: 1;
}

.card-detail-info p {
  margin: 0 0 1rem;
  line-height: 1.85;
}

.card-detail-info p:last-child {
  margin-bottom: 0;
}

.card-detail-name {
  font-family: "Cormorant Garamond", "Noto Serif SC", "Georgia", serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.card-detail-origin,
.card-detail-trigram,
.card-detail-motif,
.card-detail-generate {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 1.85;
}

.info-label {
  color: var(--text-light);
}

/* ========================
   SCRIPT MODAL
   ======================== */
.script-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--modal-overlay, rgba(0,0,0,0.4));
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.script-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.script-modal {
  background: var(--modal-bg, #fff);
  max-width: 560px;
  width: calc(100% - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--modal-border, var(--border));
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(52, 48, 38, 0.16);
  overflow: hidden;
}

.script-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--border-soft, var(--border));
  flex-shrink: 0;
}

.script-modal-title {
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.04em;
}

.script-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
  line-height: 1;
}

.script-modal-close:hover {
  color: var(--text-dark);
}

.script-modal-body {
  overflow-y: auto;
  padding: 32px 32px 48px;
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
}

.script-character {
  font-size: 12px;
  color: var(--text-dark);
  letter-spacing: 0.12em;
  margin-top: 32px;
  margin-bottom: 8px;
}

/* stage directions already provide 24px bottom margin, so no extra top gap needed */
.script-stage + .script-character {
  margin-top: 0;
}

.script-dialogue {
  font-size: 15px;
  color: var(--text);
  line-height: 2;
  margin-bottom: 4px;
}

.script-stage {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.9;
  margin-top: 24px;
  margin-bottom: 24px;
}

/* ========================
   PLACEHOLDER SUBPAGES
   ======================== */
.placeholder-section {
  padding: 72px 0 96px;
}

.placeholder-en {
  font-family: "Cormorant Garamond", "Georgia", serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.placeholder-cn {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 0.08em;
  margin-bottom: 48px;
}

.placeholder-wip {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 0.06em;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
  .navbar {
    padding: 28px 20px;
  }

  .nav-links {
    gap: 18px;
  }

  .nav-link-en {
    font-size: 11px;
    letter-spacing: 0.10em;
  }

  .nav-link-cn {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .container {
    padding: 0 20px;
  }

  .diagram-img-wrap .console-preview-img {
    width: 100%;
  }

  .footer {
    padding: 28px 20px;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    margin-top: 64px;
  }

  .hero-text {
    left: 50%;
    width: 90%;
  }

  .work-card {
    flex-direction: column;
    gap: 16px;
    padding: 36px 0;
  }

  .work-card:hover,
  .work-card:focus-visible {
    transform: translateX(2px);
  }

  .work-card-desc {
    text-align: left;
    max-width: 100%;
  }

  .about-section,
  .work-section,
  .contact-section {
    padding: 48px 0 72px;
  }

  .about-title {
    font-size: 36px;
    margin-bottom: 8px;
  }

  .subpage-cn.about-title-cn {
    margin-bottom: 34px;
  }

  .game-modal-overlay {
    align-items: flex-end;
    padding: 16px;
  }

  .game-modal {
    max-height: 86vh;
    border-radius: 8px;
  }

  .game-modal-header {
    padding: 24px 22px 18px;
  }

  .game-modal-title {
    font-size: 25px;
  }

  .game-modal-body {
    padding: 24px 22px 30px;
  }

  .game-group + .game-group {
    margin-top: 24px;
  }

  .back-link-wrap {
    padding: 0 20px;
  }

  .method-notes-section,
  .narrative-section,
  .worldbuilding-section,
  .faction-section,
  .creative-section,
  .placeholder-section {
    padding: 36px 0 72px;
  }

  .article-block {
    padding: 56px 0;
  }

  .faction-character-quote {
    padding: 16px 16px 18px 22px;
  }

  .faction-character-body {
    margin-top: 18px;
  }

  .faction-card + .grass-divider-short {
    margin: 36px auto 26px;
  }

  .diagrams-section {
    gap: 56px;
  }

  .diagram-svg-wrap svg {
    min-width: 400px;
  }

  .cards-modal {
    max-height: 90vh;
  }

  .cards-modal-header {
    padding: 20px 20px 16px;
  }

  .cards-grid {
    padding: 16px 20px 24px;
    gap: 12px;
  }

  .card-detail-view {
    padding: 20px 20px 32px;
  }

  .card-detail-layout {
    flex-direction: column;
    gap: 24px;
  }

  .card-detail-image {
    width: 160px;
  }

  .script-modal {
    max-height: 90vh;
    width: calc(100% - 40px);
  }

  .script-modal-header {
    padding: 20px 20px 16px;
  }

  .script-modal-body {
    padding: 24px 20px 36px;
  }
}
