/* ==========================================================================
   Eloy De Cort — portfolio
   Design system: ink black + amber, audio-motif linework, CJK-aware type.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fonts — re-registered with real weights so Latin (Poppins) and CJK
   fallbacks both resolve to the correct weight.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins/poppins-light-webfont.woff2") format("woff2"),
       url("../fonts/poppins/poppins-light-webfont.woff") format("woff");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins/poppins-regular-webfont.woff2") format("woff2"),
       url("../fonts/poppins/poppins-regular-webfont.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins/poppins-medium-webfont.woff2") format("woff2"),
       url("../fonts/poppins/poppins-medium-webfont.woff") format("woff");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins/poppins-semibold-webfont.woff2") format("woff2"),
       url("../fonts/poppins/poppins-semibold-webfont.woff") format("woff");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins/poppins-bold-webfont.woff2") format("woff2"),
       url("../fonts/poppins/poppins-bold-webfont.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --ink:        #06080B;
  --ink-2:      #090C11;
  --ink-3:      #0C1016;
  --panel:      #0F141C;
  --panel-2:    #131926;
  --line:       rgba(255, 255, 255, 0.075);
  --line-mid:   rgba(255, 255, 255, 0.12);
  --line-strong:rgba(255, 255, 255, 0.2);

  --fg:         #E9EDF3;
  --fg-2:       #A2AEBD;
  --fg-3:       #7C8A99;
  --steel:      #DCE3EA;
  --steel-dim:  #93A0AD;

  --accent:       #F2CC78;
  --accent-bright:#FFE6B4;
  --accent-dim:   #B8934A;
  --accent-glow:  rgba(242, 204, 120, 0.12);
  --gold:         #FFEFD2;

  --f-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --f-sans: "Poppins", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
            "Noto Sans SC", "Source Han Sans SC", ui-sans-serif, system-ui,
            -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1240px;
  --gutter: 4rem;
  --radius: 1.6rem;
  --ease: cubic-bezier(0.22, 0.68, 0.16, 1);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 62.5%; /* 1rem = 10px */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg-2);
  font-family: var(--f-sans);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--fg);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; border: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
strong, b { font-weight: 600; color: var(--fg); }
em, i { font-style: italic; }

::selection { background: var(--accent); color: #1A1206; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 1.2rem 2rem;
  border-radius: 0 0 1rem 0;
  background: var(--accent);
  color: #1A1206;
  font-size: 1.3rem;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  pointer-events: none;
}

/* language switching ------------------------------------------------------ */
.l-zh { letter-spacing: 0.02em; }

html[data-lang="en"] .l-zh { display: none !important; }
html[data-lang="zh"] .l-en { display: none !important; }

html[data-lang="zh"] body {
  font-weight: 400;
  line-height: 1.85;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding: 12rem 0;
}

.section-alt {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

section { scroll-margin-top: 9rem; }

/* section header ---------------------------------------------------------- */
.sec-head { max-width: 76rem; margin-bottom: 5.6rem; }

.sec-kicker {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.8rem;
  color: var(--steel);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sec-kicker .k-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  height: 2.2rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line-mid);
  border-radius: 0.5rem;
  color: var(--fg-2);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.sec-title {
  font-size: clamp(3.2rem, 4.6vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 2rem;
}

.sec-lede {
  max-width: 62rem;
  font-size: 1.7rem;
  line-height: 1.8;
  color: var(--fg-2);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  height: 5.2rem;
  padding: 0 2.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease),
              color .3s var(--ease), box-shadow .3s var(--ease),
              transform .3s var(--ease);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1A1206;
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 0.5rem var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-mid);
  color: var(--fg);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-sm { height: 4.4rem; padding: 0 1.9rem; font-size: 1.25rem; }
.btn-lg { height: 6rem; padding: 0 3.2rem; font-size: 1.5rem; }

.btn-ico, .btn-arrow { width: 1.6rem; height: 1.6rem; flex: none; }
.btn-arrow { transition: transform .3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(0.4rem); }

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 2.2rem 0;
  transition: background .4s var(--ease), padding .4s var(--ease),
              border-color .4s var(--ease), backdrop-filter .4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  padding: 1.2rem 0;
  background: rgba(6, 8, 11, 0.82);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  flex: none;
  position: relative;
  z-index: 95;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  color: var(--accent);
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-text { display: flex; flex-direction: column; gap: 0.15rem; }

.brand-name {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand-role {
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-dim);
  line-height: 1.2;
}
html[data-lang="zh"] .brand-role { color: var(--fg-3); letter-spacing: 0.14em; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.nav > a {
  position: relative;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--fg-2);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav > a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.04); }

.nav > a.is-active { color: var(--accent); }
.nav > a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: -0.2rem;
  border-radius: 50%;
  background: var(--accent);
}

.nav > a.nav-cv {
  margin-left: 1rem;
  border: 1px solid var(--line-mid);
  color: var(--fg);
  font-weight: 500;
}
.nav > a.nav-cv:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-glow);
}
.nav > a.nav-cv.is-active::after { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.lang-opt {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--fg-3);
  line-height: 1;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.lang-opt:hover { color: var(--fg); }

html[data-lang="en"] .lang-opt[data-lang-opt="en"],
html[data-lang="zh"] .lang-opt[data-lang-opt="zh"] {
  background: var(--accent);
  color: #1A1206;
}

.nav-toggle {
  display: none;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 1.7rem;
  height: 1.5px;
  margin-left: -0.85rem;
  background: var(--fg);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .2s;
}
.nav-toggle span:nth-child(1) { top: 1.75rem; }
.nav-toggle span:nth-child(2) { top: 2.35rem; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(0.3rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-0.3rem) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  /* the wave is anchored to the bottom, so the content is kept clear of it */
  --wave-h: 13rem;
  padding: 12rem 0 calc(var(--wave-h) + 2.4rem);
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: var(--ink) url("../images/banner.jpg") center 32% / cover no-repeat;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(101deg, rgba(6, 8, 11, 0.97) 4%, rgba(6, 8, 11, 0.9) 34%,
                    rgba(6, 8, 11, 0.52) 62%, rgba(6, 8, 11, 0.78) 100%),
    linear-gradient(to top, var(--ink) 1%, rgba(6, 8, 11, 0.55) 26%, transparent 55%);
}

/* audio waveform strip across the full hero width */
.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  height: var(--wave-h, 13rem);
  color: rgba(242, 204, 120, 0.9);
  pointer-events: none;
  animation: waveIn 1.6s var(--ease) 0.25s both;
}
.hero-wave svg { display: block; width: 100%; height: 100%; overflow: visible; opacity: 0.5; }
@keyframes waveIn {
  from { opacity: 0; transform: translateY(1.4rem); }
  to   { opacity: 1; transform: none; }
}

/* hero content lifts and fades as you scroll past it */
.hero-inner {
  will-change: transform, opacity;
}

.hero-inner { position: relative; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.2rem;
  padding: 0.8rem 1.7rem 0.8rem 1.4rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: rgba(9, 12, 17, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--fg-2);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
html[data-lang="zh"] .hero-badge { letter-spacing: 0.06em; }

.pulse {
  position: relative;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -0.35rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

.hero-title {
  font-size: clamp(5rem, 10.5vw, 12.4rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-bottom: 2rem;
  color: #fff;
  background: linear-gradient(178deg, #FFFFFF 34%, #96A6B8 122%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title-line { display: block; }

.hero-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.7rem;
  color: var(--steel);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
html[data-lang="zh"] .hero-role { letter-spacing: 0.14em; font-size: 1.5rem; }

.hero-role .sep { color: var(--fg-3); font-weight: 300; }

.hero-lede {
  max-width: 62rem;
  font-size: 1.8rem;
  line-height: 1.85;
  color: var(--fg-2);
}
.hero-lede strong { color: var(--fg); font-weight: 600; }
.hero-lede em { color: var(--fg); font-style: normal; border-bottom: 1px solid var(--accent-dim); }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 3.2rem;
}

/* glass dock — kept as a subtle surface now that it clears the wave */
.hero-social {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 3.4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  max-width: 34rem;
}
.hero-social li a {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 50%;
  color: var(--fg-3);
  font-size: 1.5rem;
  transition: color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.hero-social li a:hover {
  color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 3.4rem;
  width: 1px;
  height: 7rem;
  background: linear-gradient(to bottom, transparent, var(--line-strong));
  overflow: hidden;
}
.hero-scroll span {
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: scrollLine 2.4s var(--ease) infinite;
}
@keyframes scrollLine {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

/* --------------------------------------------------------------------------
   7. Stats band
   -------------------------------------------------------------------------- */
.stats-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}

.stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); }

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 3.4rem 3rem;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }

.stat-num {
  font-size: 3.8rem;
  font-weight: 500;
  line-height: 1;
  color: var(--fg);
  letter-spacing: -0.03em;
}
.stat-num b { font-weight: inherit; color: inherit; }
.stat-plus { color: var(--accent); font-weight: 400; }

.stat-label {
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  line-height: 1.5;
}
html[data-lang="zh"] .stat-label { letter-spacing: 0.04em; font-size: 1.3rem; }

/* --------------------------------------------------------------------------
   8. Marquee
   -------------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #070A0E;
  padding: 1.7rem 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 44s linear infinite;
}
.marquee-group { display: flex; }
.marquee-track span {
  display: block;
  padding-right: 3.2rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}
.marquee-track span.dot { color: var(--accent-dim); letter-spacing: 0; font-size: 0.9rem; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   9. Work cards
   -------------------------------------------------------------------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.4rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .45s var(--ease), transform .45s var(--ease),
              box-shadow .45s var(--ease);
}
/* level-meter sweep along the top edge */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width .7s var(--ease);
}
.card:hover::after,
.card:focus-visible::after { width: 100%; }
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(242, 204, 120, 0.34);
  box-shadow: 0 2.4rem 5rem rgba(0, 0, 0, 0.45);
}

.card-feature { grid-column: 1 / -1; }

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05070A;
}
.card-feature .card-media { aspect-ratio: 16 / 9; }

/* cursor-tracked light sweep over the artwork */
.card-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(38rem circle at var(--mx, 50%) var(--my, 40%),
              rgba(255, 255, 255, 0.16), transparent 62%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
.card:hover .card-media::before { opacity: 1; }

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease), filter .6s var(--ease);
  filter: saturate(0.95);
}
.card:hover .card-media img { transform: scale(1.045); filter: saturate(1.05); }

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--panel) 0%, rgba(15, 20, 28, 0.42) 34%, transparent 62%);
  pointer-events: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
  padding: 2.6rem 3rem 3rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--steel-dim);
}
html[data-lang="zh"] .card-meta { letter-spacing: 0.06em; }
.card-dot { color: var(--fg-3); }
.card-years { color: var(--fg-3); }

.card-title {
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.card-feature .card-title { font-size: clamp(3rem, 3.4vw, 4rem); }

.card-title-sub {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--fg-3);
}

.card-summary {
  font-size: 1.5rem;
  line-height: 1.8;
  color: var(--fg-2);
  max-width: 68rem;
}

.card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 1.6rem;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
html[data-lang="zh"] .card-more { letter-spacing: 0.06em; }
.card-more svg { width: 1.5rem; height: 1.5rem; transition: transform .35s var(--ease); }
.card:hover .card-more svg { transform: translateX(0.5rem); }

/* video affordance on the artwork */
.card-play {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(6, 8, 11, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  transition: background .3s var(--ease), border-color .3s var(--ease),
              color .3s var(--ease), transform .3s var(--ease);
}
.card-play svg { width: 2.2rem; height: 2.2rem; }
.card:hover .card-play {
  background: rgba(242, 204, 120, 0.22);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.07);
}

/* platform credit line */
.card-platforms {
  font-size: 1.15rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--fg-3);
}
.card-platforms span { display: block; }

/* chips ------------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.chip {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.015);
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--fg-2);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. Dracortia strip
   -------------------------------------------------------------------------- */
.dracortia {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 2.4rem;
  padding: 3.8rem 4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(242, 204, 120, 0.1), transparent 58%),
    var(--panel);
}

.dracortia-title {
  font-size: clamp(2.8rem, 3.4vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.dracortia-sub {
  max-width: 52rem;
  font-size: 1.55rem;
  line-height: 1.8;
  color: var(--fg-2);
}

.dracortia-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.title-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.title-chips li {
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--line-mid);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.025);
  color: var(--fg-2);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* release status marker inside a title chip */
.title-chips .rel {
  display: inline-block;
  margin-left: 0.7rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--line-mid);
  font-family: var(--f-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   10b. Current work — Unreal Engine 5 (generative cover, no screenshots)
   -------------------------------------------------------------------------- */
.now {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 4.4rem;
  align-items: center;
  margin-top: 2.4rem;
  padding: 3.8rem 4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(242, 204, 120, 0.1), transparent 58%),
    var(--panel);
  overflow: hidden;
}

.now-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
html[data-lang="zh"] .now-kicker { letter-spacing: 0.08em; }

.now-title {
  font-size: clamp(2.8rem, 3.4vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.now-engine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.7rem;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--fg-3);
}

.now-sub {
  max-width: 54rem;
  font-size: 1.55rem;
  line-height: 1.85;
  color: var(--fg-2);
}

.now-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2.2rem;
}
.now-tags li {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--f-mono);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--steel-dim);
  white-space: nowrap;
}

.now-note {
  margin-top: 1.9rem;
  font-size: 1.15rem;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}

.now-visual {
  position: relative;
  padding: 1rem 0;
}
.now-visual::before {
  content: "";
  position: absolute;
  inset: -12% -6%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(62% 62% at 50% 50%, #000, transparent 76%);
  mask-image: radial-gradient(62% 62% at 50% 50%, #000, transparent 76%);
  opacity: 0.55;
  pointer-events: none;
}

/* small audio meter — the "in development" cover art */
.viz {
  position: relative;
  display: grid;
  place-items: center;
  height: 21rem;
}
.viz::before {
  content: "";
  position: absolute;
  inset: 12% 4%;
  background: radial-gradient(50% 50% at 50% 55%, rgba(242, 204, 120, 0.14), transparent 70%);
  pointer-events: none;
}

.viz-eq {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 13rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line-mid);
}

.viz-eq i {
  display: block;
  width: 6px;
  height: var(--h, 50%);
  border-radius: 3px;
  background: linear-gradient(to top, rgba(242, 204, 120, 0.22), var(--accent));
  transform-origin: 50% 100%;
  will-change: transform;
  animation: eqPulse var(--d, 1.3s) var(--ease) var(--dl, 0s) infinite alternate;
}

/* the tallest bars run warm at the top, like the peak segment of a VU meter */
.viz-eq i:nth-child(5),
.viz-eq i:nth-child(11),
.viz-eq i:nth-child(18) {
  background: linear-gradient(to top, rgba(242, 204, 120, 0.22), var(--accent) 58%, var(--gold));
}

@keyframes eqPulse {
  from { transform: scaleY(0.18); opacity: 0.45; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   11. Sub-headings
   -------------------------------------------------------------------------- */
.sub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 3rem;
  margin: 8rem 0 2.6rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}
.sub-head h3 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.sub-head p { font-size: 1.4rem; color: var(--fg-3); }

/* --------------------------------------------------------------------------
   12. About
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 33rem minmax(0, 1fr);
  gap: 6rem;
  align-items: start;
}

.about-card {
  position: sticky;
  top: 10rem;
  padding: 1.2rem 1.2rem 2.4rem;
  border: 1px solid var(--line);
  border-radius: 1.8rem;
  background: var(--panel);
}

.about-photo {
  position: relative;
  border-radius: 1.2rem;
  overflow: hidden;
  margin-bottom: 2rem;
}
.about-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.03);
  transition: transform 1s var(--ease);
}
.about-card:hover .about-photo img { transform: scale(1.03); }
.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 20, 28, 0.65), transparent 46%);
  pointer-events: none;
}

.about-card-body { padding: 0 1.4rem; }

.about-name {
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

.about-role {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--accent);
  margin-bottom: 1.4rem;
}

.fact-list li {
  display: grid;
  gap: 0.35rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
}

.fact-k {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
html[data-lang="zh"] .fact-k { letter-spacing: 0.08em; }

.fact-v { font-size: 1.4rem; color: var(--fg); line-height: 1.6; }
.fact-note { display: block; font-size: 1.2rem; color: var(--fg-3); margin-top: 0.15rem; }

.prose { max-width: 68rem; }
.prose p {
  font-size: 1.62rem;
  line-height: 1.95;
  color: var(--fg-2);
  margin-bottom: 2rem;
}
.prose .prose-lead {
  font-size: 2.1rem;
  line-height: 1.65;
  color: var(--fg);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 2.4rem;
}
.prose strong { color: var(--fg); font-weight: 600; }

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  margin-top: 4rem;
}

.focus {
  padding: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.014);
  transition: border-color .35s var(--ease), background .35s var(--ease),
              transform .35s var(--ease);
}
.focus:hover {
  border-color: rgba(242, 204, 120, 0.3);
  background: rgba(242, 204, 120, 0.035);
  transform: translateY(-2px);
}

.focus-ico {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 1.4rem;
  color: var(--accent);
}
.focus-ico svg { width: 100%; height: 100%; }

.focus h4 { font-size: 1.55rem; font-weight: 600; color: var(--fg); margin-bottom: 0.6rem; }
.focus p { font-size: 1.32rem; line-height: 1.75; color: var(--fg-3); }

/* --------------------------------------------------------------------------
   13. Experience timeline
   -------------------------------------------------------------------------- */
.timeline { display: flex; flex-direction: column; gap: 2rem; }

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 21rem minmax(0, 1fr);
  gap: 4rem;
  padding: 3.4rem 3.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: border-color .4s var(--ease);
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent 70%);
  opacity: 0.55;
}
.tl-item:hover { border-color: rgba(242, 204, 120, 0.24); }

.tl-meta { display: flex; flex-direction: column; gap: 0.7rem; }

.tl-years {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.tl-place {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  color: var(--fg-3);
}
.tl-place .fa { font-size: 1.15rem; color: var(--accent-dim); }

.tl-role {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

.tl-company {
  font-size: 1.45rem;
  color: var(--fg-2);
  margin-bottom: 1.8rem;
}
.tl-note { color: var(--fg-3); font-size: 1.25rem; }
.tl-note::before { content: "— "; }

.tl-list li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.75rem;
  font-size: 1.48rem;
  line-height: 1.8;
  color: var(--fg-2);
}
.tl-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}
.tl-body .chips { margin-top: 2rem; }

/* achievements ------------------------------------------------------------ */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-top: 2.4rem;
}

.ach {
  padding: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: linear-gradient(160deg, rgba(242, 204, 120, 0.05), transparent 55%), var(--panel);
}
.ach-k {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
html[data-lang="zh"] .ach-k { letter-spacing: 0.08em; }
.ach h4 { font-size: 1.9rem; font-weight: 600; margin-bottom: 0.8rem; }
.ach p { font-size: 1.36rem; line-height: 1.75; color: var(--fg-3); }

/* education --------------------------------------------------------------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.edu {
  padding: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--panel);
  transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.edu:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.edu-years {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.edu h4 { font-size: 1.7rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.6rem; }
.edu-school { font-size: 1.32rem; color: var(--fg-2); margin-bottom: 1.2rem; }
.edu-text { font-size: 1.33rem; line-height: 1.75; color: var(--fg-3); }

/* --------------------------------------------------------------------------
   14. Skills
   -------------------------------------------------------------------------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.skill {
  padding: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--panel);
  transition: border-color .35s var(--ease), background .35s var(--ease);
}
.skill:hover { border-color: rgba(242, 204, 120, 0.26); background: var(--panel-2); }

.skill h4 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}
html[data-lang="zh"] .skill h4 { letter-spacing: 0.1em; font-size: 1.25rem; }

.skill ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 1.45rem;
  color: var(--fg-2);
}
.skill ul li:last-child { border-bottom: 0; padding-bottom: 0; }

.skill-tag {
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--line-mid);
  border-radius: 0.4rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   15. Contact
   -------------------------------------------------------------------------- */
.contact {
  padding-bottom: 14rem;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  top: -18rem;
  left: 50%;
  width: 100rem;
  height: 64rem;
  margin-left: -50rem;
  background: radial-gradient(ellipse at center, rgba(242, 204, 120, 0.11), transparent 62%);
  pointer-events: none;
}
.contact .wrap { position: relative; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 5.6rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--panel);
  transition: border-color .35s var(--ease), transform .35s var(--ease),
              background .35s var(--ease);
}
a.contact-item:hover {
  border-color: rgba(242, 204, 120, 0.34);
  background: var(--panel-2);
  transform: translateY(-3px);
}

.contact-ico {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line-mid);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.4rem;
}
.contact-k {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
html[data-lang="zh"] .contact-k { letter-spacing: 0.08em; }
.contact-v { font-size: 1.45rem; color: var(--fg); word-break: break-word; }

.contact-note {
  margin-top: 3.4rem;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--fg-3);
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.footer-copy { font-size: 1.2rem; color: var(--fg-3); }

.footer-top {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--line-mid);
  border-radius: 50%;
  color: var(--fg-2);
  font-size: 1.3rem;
  transition: color .25s var(--ease), border-color .25s var(--ease),
              background .25s var(--ease), transform .25s var(--ease);
}
.footer-top:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   17. Modals
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 4rem 2.4rem;
}
.modal[hidden] { display: none; }
/* progressive enhancement: deep-link to a project without JS */
.modal:target { display: grid; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, 0.84);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn .3s var(--ease);
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(108rem, 100%);
  max-height: 90svh;
  border: 1px solid var(--line-mid);
  border-radius: 1.8rem;
  background: var(--ink-3);
  box-shadow: 0 4rem 12rem rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: panelIn .45s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(2.4rem) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.modal-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.modal-scroll::-webkit-scrollbar { width: 8px; }
.modal-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}

.modal-media-wrap { position: relative; }

.modal-media {
  display: flex;
  gap: 1px;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: #000;
  scrollbar-width: none;
}
.modal-media::-webkit-scrollbar { display: none; }

.media-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  margin-top: -2.2rem;
  border: 1px solid var(--line-mid);
  border-radius: 50%;
  background: rgba(9, 12, 17, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--fg);
  transition: background .25s var(--ease), border-color .25s var(--ease),
              color .25s var(--ease), opacity .25s var(--ease);
}
.media-nav svg { width: 1.8rem; height: 1.8rem; }
.media-nav[data-media-prev] { left: 1.5rem; }
.media-nav[data-media-next] { right: 1.5rem; }
.media-nav:hover {
  background: rgba(242, 204, 120, 0.22);
  border-color: var(--accent-dim);
  color: var(--accent);
}
.media-nav.is-hidden { opacity: 0; pointer-events: none; }

.media-count {
  position: absolute;
  right: 1.6rem;
  bottom: 1.5rem;
  z-index: 3;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: rgba(6, 8, 11, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--fg-2);
}
.media-count:empty { display: none; }

.media-frame {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 16 / 9;
  scroll-snap-align: start;
  background: #000;
  overflow: hidden;
}
.media-frame iframe,
.media-frame img {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}

.modal-body { padding: 3.6rem 4rem 4.6rem; }

.modal-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--steel-dim);
}
html[data-lang="zh"] .modal-kicker { letter-spacing: 0.06em; }

.modal-title {
  font-size: clamp(2.4rem, 3.2vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.8rem;
}

.modal-text {
  max-width: 78rem;
  font-size: 1.58rem;
  line-height: 1.9;
  color: var(--fg-2);
  margin-bottom: 2.2rem;
}

.modal-list { margin-bottom: 2.4rem; }
.modal-list li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.8rem;
  font-size: 1.48rem;
  line-height: 1.8;
  color: var(--fg-2);
}
.modal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.modal-subtitle {
  margin: 4rem 0 1.8rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
html[data-lang="zh"] .modal-subtitle { letter-spacing: 0.1em; }

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2.6rem;
  border-top: 1px solid var(--line);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 4;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px solid var(--line-mid);
  border-radius: 50%;
  background: rgba(9, 12, 17, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.modal-close:hover { background: rgba(242, 204, 120, 0.14); border-color: var(--accent-dim); }
.modal-close span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.6rem;
  height: 1.5px;
  margin-left: -0.8rem;
  background: var(--fg);
  border-radius: 2px;
}
.modal-close span:nth-child(1) { transform: rotate(45deg); }
.modal-close span:nth-child(2) { transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   18. Code blocks (Prism overrides for the dark theme)
   -------------------------------------------------------------------------- */
.code-block {
  margin-bottom: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: #070A0F;
  overflow: hidden;
}

.code-title {
  padding: 1.8rem 2.2rem 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fg);
}

.code-desc {
  padding: 0.5rem 2.2rem 1.6rem;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--fg-3);
}

.code-block pre[class*="language-"],
.code-block pre {
  margin: 0;
  padding: 1.8rem 2.2rem 2.2rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #05080C;
  overflow-x: auto;
  text-shadow: none;
}

.code-block code[class*="language-"],
.code-block code {
  font-family: "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.36rem;
  line-height: 1.78;
  color: #C3D0DE;
  background: none;
  text-shadow: none;
  white-space: pre;
}

.code-block .token.comment,
.code-block .token.prolog,
.code-block .token.doctype,
.code-block .token.cdata { color: #5C6B7A; font-style: italic; }

.code-block .token.punctuation { color: #8A99A9; }

.code-block .token.property,
.code-block .token.tag,
.code-block .token.constant,
.code-block .token.symbol,
.code-block .token.deleted { color: #7FD1F0; }

.code-block .token.boolean,
.code-block .token.number { color: #E6B980; }

.code-block .token.selector,
.code-block .token.attr-name,
.code-block .token.string,
.code-block .token.char,
.code-block .token.builtin,
.code-block .token.inserted { color: #8FE3B4; }

.code-block .token.operator,
.code-block .token.entity,
.code-block .token.url,
.code-block .language-css .token.string,
.code-block .style .token.string { color: #A8B6C6; background: none; }

.code-block .token.atrule,
.code-block .token.attr-value,
.code-block .token.keyword { color: #7FB6FF; }

.code-block .token.function,
.code-block .token.class-name { color: #E8C57E; }

.code-block .token.regex,
.code-block .token.important,
.code-block .token.variable { color: #D69BF0; }

/* --------------------------------------------------------------------------
   19. Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(2.4rem);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 1100px) {
  :root { --gutter: 3rem; }
  .brand-role { display: none; }
  .about-grid { grid-template-columns: 28rem minmax(0, 1fr); gap: 4rem; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media only screen and (max-width: 900px) {
  .nav {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.4rem;
    padding: 10rem 3rem 6rem;
    background: rgba(6, 8, 11, 0.97);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1rem);
    transition: opacity .35s var(--ease), visibility .35s, transform .35s var(--ease);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }

  .nav > a {
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 2.2rem;
    color: var(--fg);
  }
  .nav > a:hover { background: none; padding-left: 0.6rem; }
  .nav > a.is-active::after { display: none; }
  .nav > a.nav-cv {
    margin: 2.4rem 0 0;
    border: 1px solid var(--line-mid);
    border-radius: 999px;
    padding: 1.4rem 2rem;
    text-align: center;
    font-size: 1.5rem;
  }

  .nav-toggle { display: block; z-index: 100; }
  .header-actions { margin-left: auto; position: relative; z-index: 96; }

  /* a filtered header traps fixed children — drop the blur while the menu is open */
  body.is-locked .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(6, 8, 11, 0.97);
  }

  .hero { padding-top: 13rem; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 2.6rem; }
  .stat:first-child { padding-left: 2.6rem; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .about-grid { grid-template-columns: 1fr; gap: 3.6rem; }
  .about-card { position: static; max-width: 42rem; }

  .tl-item { grid-template-columns: 1fr; gap: 1.6rem; padding: 2.8rem; }
  .tl-meta { flex-direction: row; align-items: center; gap: 1.6rem; }

  .ach-grid, .edu-grid { grid-template-columns: 1fr; }
  .dracortia { grid-template-columns: 1fr; gap: 2.4rem; padding: 3rem; }
  .now { grid-template-columns: 1fr; gap: 2.6rem; padding: 3rem; }
  .now-visual { max-width: 44rem; width: 100%; margin: 0 auto; padding: 0; }
  .hero-scroll { display: none; }
}

@media only screen and (max-width: 700px) {
  :root { --gutter: 2.2rem; }
  .section { padding: 8rem 0; }
  .hero { padding-top: 11rem; padding-bottom: 5rem; }
  .hero-bg { background-image: url("../images/banner-sm.jpg"); }
  .sec-head { margin-bottom: 3.6rem; }
  .sec-lede { font-size: 1.55rem; }
  .work-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .card-feature .card-media { aspect-ratio: 16 / 9; }
  .card-body { padding: 2.2rem 2.2rem 2.6rem; }
  .focus-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .prose .prose-lead { font-size: 1.85rem; }
  .hero-badge { font-size: 1.08rem; padding: 0.7rem 1.4rem 0.7rem 1.2rem; }
  .hero-title { letter-spacing: -0.035em; }
  .hero-wave { display: none; }
  .hero-lede { font-size: 1.6rem; }
  .hero-social { margin-top: 3.6rem; }
  .hero-cta .btn { flex: 1 1 auto; }
  .contact-actions .btn { width: 100%; }
  .now-tags { margin-top: 1.8rem; }
  .now-note { margin-top: 1.4rem; }
  .viz { height: 15rem; }
  .viz-eq { height: 9.5rem; gap: 5px; }
  .viz-eq i { width: 4px; border-radius: 2px; }
  .modal { padding: 0; }
  .modal-panel { max-height: 100svh; height: 100svh; border-radius: 0; border: 0; }
  .modal-media { max-height: none; }
  .modal-body { padding: 2.6rem 2.2rem 4rem; }
  .sub-head { margin-top: 5.6rem; }
  .brand-role { display: none; }
}

@media only screen and (max-width: 430px) {
  .hero-title { font-size: 4.6rem; }
  .stats-inner { grid-template-columns: 1fr; }
  .stat { border-left: 0; padding: 2.2rem 0; }
  .stat:nth-child(n + 2) { border-top: 1px solid var(--line); }
  .stat:first-child { padding-left: 0; }
  .btn { padding: 0 2rem; font-size: 1.25rem; }
}

/* short laptop screens: keep the whole hero above the fold */
@media only screen and (min-width: 901px) and (max-height: 899px) {
  .hero { --wave-h: 8rem; padding-top: 11rem; padding-bottom: calc(var(--wave-h) + 1.8rem); }
  .hero-title { font-size: clamp(4.6rem, 8.4vw, 9.6rem); }
  .hero-lede { font-size: 1.65rem; line-height: 1.75; }
  .hero-social { margin-top: 2.6rem; padding-top: 1.6rem; }
  .hero-cta { margin-top: 2.6rem; }
}

/* --------------------------------------------------------------------------
   21. Motion / print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

@media print {
  .site-header, .hero-scroll, .hero-social, .marquee, .modal, .footer-top { display: none !important; }
  body { background: #fff; color: #111; }
  .hero { min-height: auto; padding: 2rem 0; }
  .hero-bg, .hero-scrim, .hero-wave { display: none; }
  .hero-title { -webkit-text-fill-color: #111; color: #111; background: none; }
  .section { padding: 2rem 0; }
  .card, .tl-item, .skill, .edu, .ach { border-color: #ccc; background: none; }
  .l-zh { display: none !important; }
  .hero::before, .hero::after { display: none !important; }
}

/* --------------------------------------------------------------------------
   22. Technical layer
   A measurement grid, corner registration marks and monospaced data labels —
   instrument detailing rather than decoration. Purely presentational.
   -------------------------------------------------------------------------- */

/* monospaced readouts: anything that behaves like data */
.k-idx,
.stat-label,
.card-platforms,
.media-count,
.now-engine {
  font-family: var(--f-mono);
  font-feature-settings: "tnum" 1;
}

.k-idx { letter-spacing: 0; }

/* measurement grid, only over the artwork side of the hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 7.4rem 7.4rem;
  -webkit-mask-image: linear-gradient(to right, transparent 14%, #000 62%, #000 100%);
  mask-image: linear-gradient(to right, transparent 14%, #000 62%, #000 100%);
}

/* corner registration marks */
.hero::after {
  content: "";
  position: absolute;
  inset: 2.8rem;
  z-index: 2;
  pointer-events: none;
  --c: rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 1.6rem 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 1px 1.6rem no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1.6rem 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1px 1.6rem no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 1.6rem 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 1px 1.6rem no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1.6rem 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1px 1.6rem no-repeat;
}

@media only screen and (max-width: 700px) {
  .hero::after { display: none; }
  .hero::before { background-size: 5rem 5rem; }
}

/* radial instrument discs — compositional elements, not overlays */
.disc {
  position: absolute;
  pointer-events: none;
  aspect-ratio: 1;
}
.disc svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: discSpin 140s linear infinite;
}
@keyframes discSpin {
  to { transform: rotate(360deg); }
}

#skills { overflow: hidden; }

.disc-skills {
  top: 50%;
  right: -12rem;
  width: min(58rem, 54vw);
  color: rgba(255, 255, 255, 0.15);
  transform: translateY(-50%);
}

.disc-hero {
  top: 1.5rem;
  right: -9rem;
  width: min(46rem, 44vw);
  z-index: 1;
  color: rgba(255, 255, 255, 0.17);
}

.disc-contact {
  top: 50%;
  left: 50%;
  width: min(62rem, 88vw);
  z-index: 0;
  color: rgba(255, 255, 255, 0.10);
  transform: translate(-50%, -50%);
}

/* line motifs — contour and crosshair grids, same family as the discs */
.motif {
  position: absolute;
  pointer-events: none;
  aspect-ratio: 1;
}
.motif svg { display: block; width: 100%; height: 100%; }

.motif-contour {
  top: 0;
  right: -7rem;
  width: min(40rem, 38vw);
  color: rgba(255, 255, 255, 0.16);
  -webkit-mask-image: radial-gradient(72% 72% at 58% 42%, #000 30%, transparent 78%);
  mask-image: radial-gradient(72% 72% at 58% 42%, #000 30%, transparent 78%);
}

#work, #experience { overflow: hidden; }

.disc-about {
  bottom: 2rem;
  right: -6rem;
  width: min(34rem, 32vw);
  color: rgba(255, 255, 255, 0.13);
}

/* clipping wrapper for sections that must not be overflow:hidden (sticky child) */
.disc-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.motif-plus {
  top: 2rem;
  right: -4rem;
  width: min(30rem, 28vw);
  color: rgba(255, 255, 255, 0.14);
  -webkit-mask-image: radial-gradient(70% 70% at 62% 40%, #000 25%, transparent 74%);
  mask-image: radial-gradient(70% 70% at 62% 40%, #000 25%, transparent 74%);
}

@media only screen and (max-width: 1100px) {
  .disc-skills { right: -18rem; width: 54rem; color: rgba(255, 255, 255, 0.10); }
  .disc-hero { width: 34rem; top: -7rem; right: -10rem; }
  .disc-contact { width: 46rem; }
}

@media only screen and (max-width: 700px) {
  .disc-hero, .disc-contact, .disc-about, .disc-skills, .motif-contour, .motif-plus { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .disc svg { animation: none; }
}

/* --------------------------------------------------------------------------
   23. Floating audio player
   -------------------------------------------------------------------------- */
.player {
  position: fixed;
  left: clamp(1.2rem, 2.4vw, 2.4rem);
  bottom: clamp(1.2rem, 2.4vw, 2.4rem);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 6.2rem;
  padding: 0.8rem 1.4rem 0.8rem 0.8rem;
  border: 1px solid var(--line-mid);
  border-radius: 1.2rem;
  background: rgba(8, 11, 16, 0.84);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1.4rem 3.6rem rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transition: width .5s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}

/* collapsed to a single button, opens on hover or keyboard focus */
.player:hover,
.player:focus-within {
  width: min(44rem, calc(100vw - 2.4rem));
  border-color: rgba(242, 204, 120, 0.35);
  box-shadow: 0 1.8rem 4.2rem rgba(0, 0, 0, 0.6);
}

.pl-info,
.pl-ctrl,
.pl-time,
.pl-vol {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.player:hover .pl-info,
.player:hover .pl-ctrl,
.player:hover .pl-time,
.player:hover .pl-vol,
.player:focus-within .pl-info,
.player:focus-within .pl-ctrl,
.player:focus-within .pl-time,
.player:focus-within .pl-vol {
  opacity: 1;
  pointer-events: auto;
}

.pl-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--accent);
  color: #1A1206;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.pl-btn:hover { background: var(--accent-bright); transform: scale(1.05); }
.pl-btn svg { width: 1.7rem; height: 1.7rem; fill: currentColor; }
.pl-ico-pause { display: none; }
.player.is-playing .pl-ico-play { display: none; }
.player.is-playing .pl-ico-pause { display: block; }

.pl-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 1; }
.pl-title {
  font-size: 1.24rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-sub {
  font-family: var(--f-mono);
  font-size: .95rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-ctrl { display: flex; gap: .2rem; flex: none; }
.pl-ctrl button {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  color: var(--fg-3);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.pl-ctrl button:hover { color: var(--accent); background: var(--accent-glow); }
.pl-ctrl svg { width: 1.4rem; height: 1.4rem; fill: currentColor; }

.pl-time {
  flex: none;
  font-family: var(--f-mono);
  font-size: 1rem;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.pl-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
}
.pl-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width .35s linear;
}

/* the YouTube frame stays in the corner, invisible but still rendered */
.pl-mount {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 320px;
  height: 180px;
  opacity: 0.001;
  pointer-events: none;
  border: 0;
}

@media only screen and (max-width: 600px) {
  .player { width: calc(100vw - 2.4rem); }
  .pl-ctrl { display: none; }
  .pl-title { font-size: 1.18rem; }
}

.player.is-error .pl-btn { background: rgba(255, 255, 255, 0.10); color: var(--fg-2); }
.player.is-error .pl-sub { color: var(--accent); }

/* playing while collapsed: a quiet pulse so you know audio is running */
.player.is-playing:not(:hover):not(:focus-within) .pl-btn::after {
  content: "";
  position: absolute;
  inset: -0.3rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: plPulse 2.4s var(--ease) infinite;
}
@keyframes plPulse {
  0% { transform: scale(0.92); opacity: 0.85; }
  70%, 100% { transform: scale(1.38); opacity: 0; }
}

/* no hover on touch: keep it open */
@media (hover: none) {
  .player { width: min(44rem, calc(100vw - 2.4rem)); }
  .pl-info, .pl-ctrl, .pl-time, .pl-vol { opacity: 1; pointer-events: auto; }
}

/* volume */
.pl-vol { display: flex; align-items: center; gap: 0.2rem; flex: none; }
.pl-mute {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  color: var(--fg-3);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.pl-mute:hover { color: var(--accent); background: var(--accent-glow); }
.pl-mute svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.pl-vol-off { display: none; }
.player.is-muted .pl-vol-on { display: none; }
.player.is-muted .pl-vol-off { display: block; }

.pl-range {
  -webkit-appearance: none;
  appearance: none;
  width: 6.4rem;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}
.pl-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 204, 120, 0.18);
}
.pl-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.pl-range:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
