/* ==========================================================================
   Zhuge Yunyi — personal site
   A quiet paper-and-ink visual language. No frameworks, no external assets.
   ========================================================================== */

:root {
  --paper: #f2ede4;
  --paper-raised: #faf7f1;
  --paper-deep: #e7ded0;
  --ink: #1c1a17;
  --ink-soft: #47423b;
  --muted: #7c7467;
  --line: rgba(28, 26, 23, 0.13);
  --line-strong: rgba(28, 26, 23, 0.27);
  --accent: #b4452e;
  --accent-deep: #8d3220;
  --accent-wash: #ecd6ca;
  --accent-mist: rgba(180, 69, 46, 0.09);
  --shadow-soft: 0 18px 55px rgba(46, 36, 25, 0.08);
  --shadow-lift: 0 26px 70px rgba(46, 36, 25, 0.13);
  --max-width: 1180px;
  --header-height: 78px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Avenir Next", "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: var(--paper-raised);
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

button,
select,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.file-protocol-warning {
  display: none;
}

html[data-file-protocol="true"] .file-protocol-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 700;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  background: #241f1a;
  color: #fbf5ea;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 5px 20px rgba(20, 16, 12, 0.22);
}

.file-protocol-warning strong {
  color: #ffd3c2;
  font-weight: 600;
}

@media (max-width: 620px) {
  html[data-file-protocol="true"] .file-protocol-warning {
    display: block;
    padding: 9px 14px;
    font-size: 0.72rem;
  }
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 500;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-raised);
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Atmosphere
   -------------------------------------------------------------------------- */

.page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.65;
}

.glow--one {
  top: -28vw;
  right: -16vw;
  width: 64vw;
  height: 64vw;
  background: radial-gradient(circle, rgba(196, 152, 112, 0.22), transparent 66%);
}

.glow--two {
  bottom: -38vw;
  left: -24vw;
  width: 72vw;
  height: 72vw;
  background: radial-gradient(circle, rgba(180, 69, 46, 0.1), transparent 64%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(28, 26, 23, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 26, 23, 0.035) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(ellipse at 50% 38%, black 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 38%, black 0%, transparent 76%);
  opacity: 0.75;
}

.page-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: multiply;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  padding: 0 clamp(20px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(242, 237, 228, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff8ef;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 239, 0.26);
  transition: transform 420ms var(--ease), background 220ms ease;
}

.brand:hover .brand-seal {
  transform: rotate(-7deg);
  background: var(--accent-deep);
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.57rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  margin-left: auto;
}

.site-nav a {
  position: relative;
  padding: 7px 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 320ms var(--ease);
}

.site-nav a:hover,
.site-nav a.is-current {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a.is-current::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.lang-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(250, 247, 241, 0.48);
  transition: border-color 180ms ease, background 180ms ease;
}

.lang-switch:hover,
.lang-switch:focus-within {
  border-color: var(--ink);
  background: var(--paper-raised);
}

.lang-switch svg {
  flex: 0 0 auto;
  pointer-events: none;
}

.lang-globe {
  width: 15px;
  height: 15px;
}

.lang-chevron {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 116px;
  height: 100%;
  padding: 0 1px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.lang-switch select option {
  background: var(--paper-raised);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-height) + 54px) 24px 100px;
  overflow: hidden;
  text-align: center;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(780px, 100%);
  margin: 0 auto;
  animation: hero-arrive 1050ms var(--ease) both;
}

.hero-orbit {
  position: absolute;
  z-index: 0;
  top: 48%;
  left: 50%;
  border: 1px solid rgba(28, 26, 23, 0.09);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.hero-orbit::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.hero-orbit--outer {
  width: min(1040px, 112vw);
  height: min(720px, 78vw);
  animation: orbit-breathe 13s ease-in-out infinite alternate;
}

.hero-orbit--inner {
  width: min(720px, 82vw);
  height: min(520px, 60vw);
  border-style: dashed;
  opacity: 0.75;
  animation: orbit-breathe 10s 1.2s ease-in-out infinite alternate-reverse;
}

.hero-ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  transform: translate(-50%, -50%);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(300px, 43vw, 620px);
  line-height: 0.78;
  opacity: 0.026;
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-eyebrow {
  margin-bottom: clamp(30px, 5vw, 45px);
}

.eyebrow-line {
  display: inline-block;
  width: clamp(22px, 4vw, 48px);
  height: 1px;
  background: var(--line-strong);
}

.avatar-shell {
  position: relative;
  width: clamp(132px, 16vw, 170px);
  height: clamp(132px, 16vw, 170px);
  margin: 0 auto 28px;
}

.avatar-halo {
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(180, 69, 46, 0.22);
  border-radius: 50%;
  animation: halo-spin 24s linear infinite;
}

.avatar-halo::before,
.avatar-halo::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.avatar-halo::before {
  top: 12%;
  right: 12%;
}

.avatar-halo::after {
  bottom: 9%;
  left: 17%;
  width: 4px;
  height: 4px;
  opacity: 0.55;
}

.avatar-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 7px solid rgba(250, 247, 241, 0.92);
  border-radius: 50%;
  background: var(--paper-deep);
  box-shadow:
    0 0 0 1px var(--line),
    0 20px 50px rgba(47, 35, 22, 0.17);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: avatar-in 900ms 120ms var(--ease) both;
}

.avatar-frame img.is-missing {
  display: none;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--paper-raised);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #3e3a33, #1c1a17);
  font-family: var(--serif);
  font-size: 3.4rem;
}

.avatar-frame img.is-missing + .avatar-fallback {
  display: grid;
}

.avatar-status {
  position: absolute;
  right: 12px;
  bottom: 15px;
  width: 16px;
  height: 16px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: #637b50;
  box-shadow: 0 0 0 1px rgba(28, 26, 23, 0.12);
}

.hero-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 8.2vw, 6.3rem);
  font-weight: 500;
  letter-spacing: 0.055em;
  line-height: 1.05;
  text-indent: 0.055em;
}

.hero-eng:empty {
  display: none;
}

.hero-eng {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: clamp(0.66rem, 1.1vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.37em;
  text-transform: uppercase;
  text-indent: 0.37em;
}

.hero-intro {
  width: min(590px, 100%);
  margin: 30px auto 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(0.96rem, 1.4vw, 1.07rem);
  line-height: 2.05;
  letter-spacing: 0.025em;
}

.hero-intro:empty {
  display: none;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 33px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 21px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(250, 247, 241, 0.4);
  color: var(--ink-soft);
  font-size: 0.79rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition:
    color 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    transform 320ms var(--ease);
}

.social-link:hover {
  color: var(--paper-raised);
  border-color: var(--ink);
  background: var(--ink);
  transform: translateY(-2px);
}

.social-link__icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.social-link:hover .social-link__icon {
  filter: invert(1);
}

.social-link--email:hover {
  border-color: #0f6cbd;
  background: var(--paper-raised);
  color: #0f6cbd;
}

.social-link--email:hover .social-link__icon {
  filter: none;
}

.social-link__icon.is-missing {
  display: none;
}

.email-note {
  width: min(570px, 100%);
  margin: 17px auto 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(0.76rem, 1.05vw, 0.84rem);
  line-height: 1.85;
  letter-spacing: 0.025em;
}

.email-note[hidden] {
  display: none;
}

.scroll-cue {
  position: absolute;
  bottom: 25px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.scroll-cue:hover {
  color: var(--accent);
}

.scroll-cue svg {
  width: 17px;
  height: 17px;
  animation: cue-drop 2.2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  position: relative;
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(76px, 10vw, 128px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 66px minmax(220px, 0.9fr) minmax(240px, 1.1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 58px);
}

.section-index {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: start;
  padding-top: 9px;
  color: var(--muted);
}

.section-index span {
  font-family: var(--serif);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
}

.section-index i {
  display: block;
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.59rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.1vw, 3.1rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.22;
}

.section-desc {
  max-width: 390px;
  margin: 0 0 5px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.93rem;
  line-height: 1.9;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 26px);
  align-items: start;
}

/* --------------------------------------------------------------------------
   Bilibili featured strip
   -------------------------------------------------------------------------- */

.section--bilibili {
  isolation: isolate;
}

.section--bilibili::before {
  content: "";
  position: absolute;
  inset: 20px -28px;
  z-index: -1;
  border-radius: 40px;
  background:
    radial-gradient(circle at 92% 12%, rgba(251, 114, 153, 0.11), transparent 34%),
    radial-gradient(circle at 8% 88%, rgba(0, 174, 236, 0.1), transparent 38%);
  pointer-events: none;
}

.bili-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bili-title-line h2 {
  margin: 0;
}

.bili-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(135deg, #00aeec, #fb7299);
  box-shadow: 0 8px 22px rgba(0, 174, 236, 0.2);
}

.bili-mark img {
  width: 21px;
  height: 21px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.bili-select-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 6px;
  background: #fb7299;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: translateY(2px);
}

.section--bilibili .section-kicker {
  color: #00a1d6;
}

.bili-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 22px);
  align-items: start;
}

.bili-card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

a.bili-card {
  cursor: pointer;
}

.bili-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, #dcebf1, #f2e7ea);
  box-shadow: 0 8px 24px rgba(41, 50, 65, 0.08);
  transition: box-shadow 350ms var(--ease), transform 350ms var(--ease);
}

.bili-card:hover .bili-cover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(41, 50, 65, 0.14);
}

.bili-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(14, 20, 30, 0.34), transparent 42%);
  opacity: 0.8;
}

.bili-cover img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}

.bili-card:hover .bili-cover img {
  transform: scale(1.035);
}

.bili-cover-empty {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(0, 174, 236, 0.15), rgba(251, 114, 153, 0.14)),
    var(--paper-raised);
}

.bili-cover.is-missing .bili-cover-empty {
  display: grid;
}

.bili-cover-empty__icon {
  width: 43px;
  height: 43px;
  opacity: 0.38;
}

.bili-top-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #fb7299;
  color: #fff;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.32);
}

.bili-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 44px;
  height: 44px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 250ms ease, transform 300ms var(--ease);
}

.bili-play svg {
  width: 100%;
  height: 100%;
}

.bili-card:hover .bili-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bili-cover-brand {
  position: absolute;
  right: 9px;
  bottom: 7px;
  z-index: 4;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.bili-info {
  padding: 10px 2px 2px;
}

.bili-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.91rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.015em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bili-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.bili-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 174, 236, 0.1);
  color: #0088b3;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bili-item-id {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.bili-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 16px;
  min-height: 250px;
  padding: 46px 24px;
  border: 1px dashed rgba(0, 174, 236, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(0, 174, 236, 0.045), rgba(251, 114, 153, 0.05)),
    rgba(250, 247, 241, 0.35);
  text-align: center;
}

.bili-empty__mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #00aeec, #fb7299);
  box-shadow: 0 10px 25px rgba(0, 174, 236, 0.2);
}

.bili-empty__icon {
  width: 27px;
  height: 27px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.bili-empty p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(0.98rem, 1.7vw, 1.12rem);
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Project cards
   -------------------------------------------------------------------------- */

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(250, 247, 241, 0.62);
  box-shadow: 0 8px 30px rgba(51, 39, 26, 0.03);
  transition:
    transform 480ms var(--ease),
    box-shadow 480ms var(--ease),
    border-color 220ms ease,
    background 220ms ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  background: rgba(250, 247, 241, 0.9);
  box-shadow: var(--shadow-lift);
}

.project-card--featured {
  grid-column: 1 / -1;
  background:
    linear-gradient(120deg, rgba(180, 69, 46, 0.1), rgba(250, 247, 241, 0.64) 52%),
    rgba(250, 247, 241, 0.76);
  border-color: rgba(180, 69, 46, 0.25);
}

.project-card--featured::before {
  content: "FEATURED";
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  opacity: 0.72;
}

.project-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.6;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(140deg, var(--paper-deep), #d9cbb8);
}

.project-card--featured .project-media {
  aspect-ratio: 21 / 7.2;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease);
}

.project-card:hover .project-media img {
  transform: scale(1.025);
}

.project-media.is-missing {
  display: none;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: clamp(22px, 2.8vw, 30px);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.project-meta::before {
  content: "";
  width: 17px;
  height: 1px;
  background: var(--accent);
}

.project-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.3vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-excerpt {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.project-excerpt.is-empty {
  display: none;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.pill-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  padding: 11px 42px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    transform 300ms var(--ease);
}

.pill-btn:hover {
  border-color: var(--ink);
  background: rgba(28, 26, 23, 0.055);
}

.pill-btn:active {
  transform: scale(0.985);
}

.pill-btn--solid {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-raised);
}

.pill-btn--solid:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf3;
}

.pill-btn--ghost {
  color: var(--ink-soft);
}

.pill-btn[aria-disabled="true"],
.pill-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pill-btn[aria-disabled="true"]:hover,
.pill-btn:disabled:hover {
  border-color: var(--line-strong);
  background: transparent;
}

.btn-icon {
  position: absolute;
  left: 17px;
  width: 17px;
  height: 17px;
  object-fit: contain;
  pointer-events: none;
}

.pill-btn--solid .btn-icon {
  filter: invert(1) brightness(1.2);
}

.btn-icon.is-missing {
  display: none;
}

.btn-label {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Empty / loading states
   -------------------------------------------------------------------------- */

.loading-line {
  grid-column: 1 / -1;
  margin: 0;
  padding: 52px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-family: var(--serif);
  text-align: center;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(250, 247, 241, 0.28);
  text-align: center;
}

.empty-state__inner {
  display: grid;
  justify-items: center;
  gap: 17px;
}

.empty-state__mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(180, 69, 46, 0.35);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.17rem);
  letter-spacing: 0.04em;
}

.section--game.is-empty {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section--game.is-empty .section-head {
  display: none;
}

.section--game.is-empty .empty-state {
  min-height: calc(100svh - var(--header-height) - 2px);
  background: transparent;
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand p {
  margin: 0;
}

.footer-seal {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.8rem;
}

.footer-note {
  margin: 0;
  text-align: right;
}

.noscript {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 400;
  padding: 15px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Detail view
   -------------------------------------------------------------------------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  background: var(--paper);
}

.detail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 10%, rgba(180, 69, 46, 0.1), transparent 30%),
    linear-gradient(to bottom, transparent 78%, rgba(231, 222, 208, 0.6));
}

.detail-brand-row {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 clamp(20px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(242, 237, 228, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.brand--overlay {
  position: relative;
  z-index: 4;
}

.detail-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-container {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: calc(var(--header-height) + 58px) 0 110px;
  animation: detail-arrive 620ms var(--ease) both;
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(26px, 4vw, 42px);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.back-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-raised);
}

.back-btn svg {
  width: 17px;
  height: 17px;
}

.detail-index {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.detail-kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.detail-title {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6.6vw, 5.2rem);
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.detail-body {
  max-width: 760px;
  margin: clamp(24px, 4vw, 38px) 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(0.98rem, 1.45vw, 1.08rem);
  line-height: 2.12;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.detail-body p {
  margin: 0 0 1.1em;
}

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

.detail-body.is-empty {
  display: none;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 29px;
  margin-bottom: 48px;
}

.detail-actions .pill-btn {
  min-width: 150px;
}

.detail-media {
  width: 100%;
  margin: clamp(30px, 5vw, 58px) 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-deep);
  box-shadow: var(--shadow-soft);
}

.detail-media img {
  width: 100%;
  max-height: 72vh;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Link modal
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 21, 17, 0.54);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fade-in 220ms ease both;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(720px, calc(100svh - 44px));
  overflow-y: auto;
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 28px;
  background: var(--paper-raised);
  box-shadow: 0 30px 95px rgba(19, 15, 10, 0.32);
  animation: modal-arrive 360ms var(--ease) both;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.modal-close:hover {
  background: var(--ink);
  color: var(--paper-raised);
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.modal-kicker {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.modal-panel h2 {
  margin: 0;
  padding-right: 35px;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.modal-hint {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.75;
}

.link-list {
  display: grid;
  gap: 9px;
}

.link-item {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 13px;
  min-height: 64px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(242, 237, 228, 0.45);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    transform 280ms var(--ease);
}

.link-item:hover {
  border-color: var(--ink);
  background: var(--paper);
  transform: translateX(3px);
}

.link-item__icon-wrap {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-raised);
}

.link-item__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.link-item__icon.is-missing {
  display: none;
}

.link-item.no-icon {
  grid-template-columns: minmax(0, 1fr) 18px;
}

.link-item__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.link-item__name {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item__host {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item__arrow {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  z-index: 300;
  max-width: min(460px, calc(100vw - 36px));
  padding: 12px 21px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(28, 26, 23, 0.94);
  color: var(--paper-raised);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 240ms ease, transform 320ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Reveal / animations
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes hero-arrive {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes avatar-in {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes halo-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbit-breathe {
  from {
    transform: translate(-50%, -50%) scale(0.985);
    opacity: 0.65;
  }
  to {
    transform: translate(-50%, -50%) scale(1.015);
    opacity: 1;
  }
}

@keyframes cue-drop {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

@keyframes detail-arrive {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1040px) {
  .site-header {
    gap: 18px;
    padding-inline: 24px;
  }

  .site-nav {
    gap: 19px;
  }

  .brand-copy strong {
    font-size: 0.92rem;
  }

  .section-head {
    grid-template-columns: 48px minmax(190px, 0.9fr) minmax(210px, 1.1fr);
    gap: 24px;
  }

  .bili-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: 112px;
  }

  .site-header {
    flex-wrap: wrap;
    align-content: center;
    gap: 7px 16px;
    padding: 10px 22px 0;
  }

  .brand {
    order: 1;
  }

  .lang-switch {
    order: 2;
    margin-left: auto;
    height: 34px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin: 0;
    padding: 2px 0 9px;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    padding: 4px 0;
    font-size: 0.7rem;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .section-index {
    padding-top: 0;
    margin-bottom: 2px;
  }

  .section-desc {
    margin-top: 2px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .bili-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card--featured {
    grid-column: auto;
  }

  .project-card--featured .project-media {
    aspect-ratio: 16 / 9.6;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .footer-note {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .hero {
    padding-inline: 20px;
  }

  .hero-eyebrow {
    gap: 9px;
  }

  .eyebrow {
    font-size: 0.55rem;
    letter-spacing: 0.17em;
  }

  .hero-name {
    font-size: clamp(2.85rem, 13vw, 4.2rem);
  }

  .hero-eng {
    margin-top: 12px;
    letter-spacing: 0.26em;
    text-indent: 0.26em;
  }

  .hero-intro {
    line-height: 1.9;
  }

  .hero-orbit--outer {
    width: 122vw;
    height: 92vw;
  }

  .hero-orbit--inner {
    width: 92vw;
    height: 70vw;
  }

  .social-links {
    gap: 8px;
  }

  .social-link {
    min-height: 42px;
    padding-inline: 16px;
    font-size: 0.74rem;
  }

  .scroll-cue {
    bottom: 18px;
  }

  .section {
    width: calc(100% - 36px);
    padding-block: 72px;
  }

  .section--bilibili::before {
    inset: 12px -10px;
    border-radius: 26px;
  }

  .bili-grid {
    gap: 16px 11px;
  }

  .bili-mark {
    width: 33px;
    height: 33px;
    border-radius: 9px;
  }

  .bili-mark img {
    width: 18px;
    height: 18px;
  }

  .bili-title-line {
    gap: 9px;
  }

  .bili-title {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .bili-cover-brand {
    display: none;
  }

  .bili-play {
    width: 37px;
    height: 37px;
  }

  .bili-empty {
    min-height: 220px;
    padding: 38px 18px;
  }

  .section--game.is-empty {
    min-height: calc(100svh - var(--header-height));
  }

  .project-body {
    padding: 21px;
  }

  .card-actions {
    gap: 8px;
    padding-top: 20px;
  }

  .pill-btn {
    min-height: 46px;
    padding-inline: 28px;
    font-size: 0.73rem;
    letter-spacing: 0.04em;
  }

  .btn-icon {
    left: 13px;
    width: 15px;
    height: 15px;
  }

  .detail-container {
    width: calc(100% - 36px);
    padding-top: calc(var(--header-height) + 38px);
  }

  .detail-title {
    font-size: clamp(2.15rem, 11vw, 3.4rem);
  }

  .detail-actions {
    gap: 8px;
  }

  .detail-actions .pill-btn {
    min-width: 0;
    flex: 1 1 100%;
  }

  .modal {
    padding: 14px;
  }

  .modal-panel {
    padding: 28px 20px 24px;
    border-radius: 23px;
  }

  .brand-copy small {
    display: none;
  }

  .footer-brand {
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .site-header {
    padding-inline: 15px;
  }

  .brand-copy strong {
    font-size: 0.86rem;
  }

  .lang-switch {
    padding-inline: 9px;
  }

  .lang-switch select {
    max-width: 88px;
  }

  .brand-seal {
    width: 32px;
    height: 32px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
