:root {
  --font-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  --page-bg: #f3f0f1;
  --surface: #fffafa;
  --surface-alt: #e7f0ed;
  --text: #28252b;
  --muted: #69636b;
  --pink: #d57591;
  --mint: #3f8f81;
  --gold: #ae823d;
  --line: rgba(40, 37, 43, 0.16);
  --header-bg: rgba(25, 31, 34, 0.88);
  --header-text: #fffaf8;
  --hero-text: #fffaf8;
  --hero-muted: #e9dfdf;
  --hero-overlay: rgba(12, 18, 22, 0.13);
  --tool-bg: rgba(21, 28, 31, 0.8);
  --tool-line: rgba(255, 255, 255, 0.22);
  --tool-text: #fffaf8;
  --shadow: 0 18px 50px rgba(24, 25, 29, 0.16);
  color-scheme: light;
}

html[data-time="morning"] {
  --page-bg: #f6f5f1;
  --surface: #fffefd;
  --surface-alt: #e6f1ec;
  --text: #29262a;
  --muted: #6d6768;
  --pink: #c96f88;
  --mint: #347e71;
  --gold: #a67932;
  --line: rgba(45, 40, 42, 0.15);
  --header-bg: rgba(248, 246, 241, 0.9);
  --header-text: #29262a;
  --hero-text: #29262a;
  --hero-muted: #514b4d;
  --hero-overlay: rgba(255, 253, 248, 0.05);
  --tool-bg: rgba(255, 253, 248, 0.84);
  --tool-line: rgba(48, 43, 44, 0.2);
  --tool-text: #29262a;
}

html[data-time="night"] {
  --page-bg: #181c20;
  --surface: #20252a;
  --surface-alt: #1d302f;
  --text: #f3eeee;
  --muted: #bdb5b7;
  --pink: #ec8ea7;
  --mint: #67c2ae;
  --gold: #e0ba71;
  --line: rgba(243, 238, 238, 0.16);
  --header-bg: rgba(15, 18, 21, 0.92);
  --header-text: #fffaf8;
  --hero-text: #fffaf8;
  --hero-muted: #ddd3d3;
  --hero-overlay: rgba(8, 12, 15, 0.2);
  --tool-bg: rgba(17, 21, 24, 0.84);
  --tool-line: rgba(255, 255, 255, 0.2);
  --tool-text: #fffaf8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  transition: background-color 500ms ease, color 500ms ease;
}

button,
input,
a {
  font: inherit;
}

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

a {
  color: inherit;
}

button {
  letter-spacing: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  transform: translateY(-150%);
}

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

:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  min-height: 64px;
  color: var(--header-text);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  transition: background-color 500ms ease, color 500ms ease;
}

html[data-time="morning"] .site-header {
  border-bottom-color: var(--line);
}

.nav-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #25262a;
  background: #f0a0b5;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-weight: 800;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex: 1;
}

.desktop-nav a,
.mobile-nav a {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.desktop-nav a {
  padding: 20px 0 18px;
  font-size: 14px;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 13px;
  left: 0;
  height: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="location"]::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.small-icon-button,
.player-main-button,
.rotation-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-color: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

html[data-time="morning"] .icon-button {
  border-color: var(--line);
}

.icon-button:hover,
.icon-button[aria-expanded="true"] {
  color: #25262a;
  background: var(--mint);
  border-color: var(--mint);
}

.icon-button svg,
.small-icon-button svg,
.player-main-button svg,
.rotation-button svg,
.scene-button svg,
.scroll-cue svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-main-button svg use[href="#icon-play"] {
  fill: currentColor;
  stroke: none;
}

.menu-toggle {
  display: none;
}

.mobile-nav {
  width: 100%;
  padding: 8px 20px 18px;
  background: var(--header-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav a {
  display: block;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.music-panel {
  position: absolute;
  top: 72px;
  right: max(20px, calc((100% - 1180px) / 2));
  width: min(380px, calc(100vw - 40px));
  padding: 18px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

.track-heading,
.progress-row,
.volume-row {
  display: flex;
  align-items: center;
}

.track-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.track-heading strong,
.track-heading span {
  display: block;
}

.track-heading strong {
  font-size: 18px;
}

.track-heading span {
  color: var(--muted);
  font-size: 13px;
}

.player-main-button {
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--pink);
  border-color: var(--pink);
  border-radius: 50%;
}

.progress-row {
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.progress-row input,
.volume-row input {
  min-width: 0;
  accent-color: var(--mint);
}

.progress-row input {
  flex: 1;
}

.volume-row {
  gap: 10px;
  margin-top: 12px;
}

.small-icon-button {
  width: 32px;
  height: 32px;
  border: 0;
}

.volume-row input {
  width: 86px;
}

.license-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.license-note a:hover {
  color: var(--mint);
}

.player-status {
  min-height: 0;
  margin: 8px 0 0;
  color: #b9425f;
  font-size: 12px;
}

.player-status:empty {
  display: none;
}

.hero {
  position: relative;
  height: 82svh;
  min-height: 650px;
  max-height: 840px;
  overflow: hidden;
  color: var(--hero-text);
  background: #18252c;
}

.hero-media,
.hero-image,
.hero-tint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 750ms ease;
}

.hero-image.is-active {
  opacity: 1;
}

.hero-tint {
  background: var(--hero-overlay);
  transition: background-color 500ms ease;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  padding-top: 116px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.hero-copy {
  width: min(540px, 46%);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--mint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0 20px;
  font-size: 72px;
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.18);
}

html[data-time="morning"] .hero h1 {
  text-shadow: none;
}

.hero-intro {
  margin: 0;
  color: var(--hero-muted);
  font-size: 19px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: 1px solid;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  color: #fff;
  background: var(--pink);
  border-color: var(--pink);
}

.secondary-action {
  color: var(--hero-text);
  background: rgba(16, 20, 22, 0.2);
  border-color: currentColor;
}

html[data-time="morning"] .secondary-action {
  background: rgba(255, 255, 255, 0.5);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.scene-tool {
  width: min(540px, 46%);
  margin-top: 34px;
  color: var(--tool-text);
  background: var(--tool-bg);
  border: 1px solid var(--tool-line);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

.scene-tool-heading {
  min-height: 40px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tool-line);
  font-size: 12px;
}

.scene-tool-heading span {
  color: color-mix(in srgb, currentColor 72%, transparent);
}

.scene-tool-body {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-group,
.hair-control {
  display: flex;
  align-items: center;
}

.scene-button,
.hair-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: inherit;
  background: transparent;
  border: 1px solid var(--tool-line);
  cursor: pointer;
}

.scene-button {
  min-width: 68px;
  padding: 6px 9px;
  font-size: 12px;
}

.scene-button + .scene-button {
  border-left: 0;
}

.scene-button:first-child {
  border-radius: 5px 0 0 5px;
}

.scene-button:nth-child(3) {
  border-radius: 0 5px 5px 0;
}

.scene-button.is-selected,
.hair-button.is-selected {
  color: #202427;
  background: var(--mint);
  border-color: var(--mint);
}

.scene-button svg {
  width: 16px;
  height: 16px;
}

.rotation-button {
  width: 38px;
  height: 38px;
  margin-left: 7px;
  border-color: var(--tool-line);
  border-radius: 5px;
}

.rotation-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hair-button {
  padding: 6px 9px;
  border-radius: 0;
  font-size: 12px;
}

.hair-button:first-child {
  border-radius: 5px 0 0 5px;
}

.hair-button:last-child {
  margin-left: -1px;
  border-radius: 0 5px 5px 0;
}

.hair-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.dark-swatch {
  background: #20252a;
  box-shadow: inset -5px 0 0 #78c7b6;
}

.silver-swatch {
  background: #ede9e8;
  box-shadow: inset -5px 0 0 #8bd0c0;
}

.scroll-cue {
  position: absolute;
  z-index: 3;
  right: 32px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hero-text);
  font-size: 12px;
  text-decoration: none;
}

.scroll-cue svg {
  width: 17px;
  height: 17px;
}

.section {
  scroll-margin-top: 64px;
  padding: 104px 0;
}

.section-shell,
.footer-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.chapter-section,
.projects-section {
  background: var(--surface);
}

.records-section {
  background: var(--page-bg);
}

.about-section {
  background: var(--surface-alt);
}

.chapter-layout,
.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.45fr);
  gap: 88px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.compact-heading {
  margin-bottom: 56px;
}

.section-number {
  min-width: 48px;
  margin: 4px 0 0;
  color: var(--pink);
  font-size: 14px;
  font-weight: 800;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-size: 36px;
  line-height: 1.25;
  letter-spacing: 0;
}

.chapter-copy > p,
.about-copy > p {
  max-width: 680px;
}

.chapter-copy > p {
  color: var(--muted);
  font-size: 17px;
}

.chapter-copy .chapter-lead {
  margin-top: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
}

.focus-list {
  margin: 42px 0 0;
  border-top: 1px solid var(--line);
}

.focus-list div {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.focus-list dt {
  color: var(--muted);
  font-size: 13px;
}

.focus-list dd {
  margin: 0;
  font-weight: 700;
}

.record-list {
  border-top: 1px solid var(--line);
}

.record-item {
  display: grid;
  grid-template-columns: 160px minmax(220px, 0.72fr) minmax(320px, 1fr);
  gap: 36px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.record-meta {
  color: var(--muted);
  font-size: 13px;
}

.record-meta time,
.record-meta span {
  display: block;
}

.record-meta span {
  margin-top: 6px;
  color: var(--mint);
  font-weight: 700;
}

.record-item h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
}

.record-item p {
  margin: 0;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  min-height: 330px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.featured-project {
  border-top: 4px solid var(--mint);
  padding-top: 27px;
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.project-topline strong {
  color: var(--pink);
}

.project-card h3 {
  margin: 38px 0 16px;
  font-size: 25px;
  line-height: 1.4;
}

.project-card p {
  margin: 0;
  color: var(--muted);
}

.project-card .project-note {
  margin-top: auto;
  padding-top: 34px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 700;
}

.about-copy {
  max-width: 720px;
}

.about-copy p {
  margin: 0;
  font-size: 24px;
  line-height: 1.85;
}

.about-copy .about-closing {
  margin-top: 24px;
  color: var(--pink);
  font-size: 18px;
  font-weight: 700;
}

.site-footer {
  padding: 26px 0;
  color: var(--muted);
  background: var(--page-bg);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-shell p {
  margin: 0;
}

.footer-shell a:hover {
  color: var(--mint);
}

@media (max-width: 960px) {
  .desktop-nav {
    gap: 18px;
  }

  .hero h1 {
    font-size: 56px;
  }

  .hero-copy,
  .scene-tool {
    width: min(540px, 54%);
  }

  .scene-tool-body {
    align-items: stretch;
    flex-direction: column;
  }

  .hair-control {
    width: 100%;
  }

  .hair-button {
    flex: 1;
  }

  .record-item {
    grid-template-columns: 120px minmax(220px, 0.8fr) minmax(260px, 1fr);
    gap: 24px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 64px;
  }

  .nav-shell {
    width: calc(100% - 28px);
    gap: 12px;
  }

  .desktop-nav {
    display: none;
  }

  .brand {
    margin-right: auto;
  }

  .menu-toggle {
    display: grid;
  }

  .music-panel {
    top: 70px;
    right: 14px;
    width: calc(100vw - 28px);
  }

  .hero {
    height: 82svh;
    min-height: 680px;
    max-height: 760px;
  }

  .hero-image {
    object-position: 69% center;
  }

  .hero-tint {
    background: rgba(12, 16, 19, 0.48);
  }

  html[data-time="morning"] .hero-tint {
    background: rgba(255, 252, 247, 0.5);
  }

  .hero-inner {
    width: calc(100% - 32px);
    padding-top: 82px;
    justify-content: flex-start;
  }

  .hero-copy,
  .scene-tool {
    width: 100%;
  }

  .hero h1 {
    margin: 8px 0 10px;
    font-size: 40px;
    line-height: 1.12;
  }

  .hero-intro {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero-actions {
    margin-top: 16px;
  }

  .primary-action,
  .secondary-action {
    min-height: 42px;
    padding: 8px 14px;
    font-size: 14px;
  }

  .scene-tool {
    margin-top: 18px;
  }

  .scene-tool-heading {
    min-height: 34px;
  }

  .scene-tool-body {
    padding: 8px;
    gap: 8px;
  }

  .control-group {
    width: 100%;
  }

  .scene-button {
    min-width: 0;
    flex: 1;
  }

  .scroll-cue {
    right: 18px;
    bottom: 12px;
  }

  .section {
    padding: 76px 0;
  }

  .section-shell,
  .footer-shell {
    width: calc(100% - 32px);
  }

  .chapter-layout,
  .about-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .compact-heading {
    margin-bottom: 38px;
  }

  .section-heading h2 {
    font-size: 30px;
  }

  .chapter-copy .chapter-lead {
    font-size: 23px;
  }

  .focus-list div {
    grid-template-columns: 95px 1fr;
    gap: 16px;
  }

  .record-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 28px 0;
  }

  .record-meta {
    display: flex;
    gap: 12px;
  }

  .record-meta span {
    margin-top: 0;
  }

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

  .project-card {
    min-height: 300px;
    padding: 24px;
  }

  .project-card h3 {
    margin-top: 30px;
    font-size: 22px;
  }

  .about-copy p {
    font-size: 20px;
  }

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

@media (max-width: 390px) {
  .brand span:last-child {
    display: none;
  }

  .hero h1 {
    font-size: 36px;
  }

  .scene-button span,
  .hair-button span:last-child {
    font-size: 11px;
  }

  .license-note {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
