:root {
  color-scheme: dark;
  --white: #f8fbff;
  --muted: rgba(240, 248, 255, 0.72);
  --line: rgba(255, 255, 255, 0.24);
  --glass: rgba(7, 30, 52, 0.42);
  --gold: #ffe18a;
  --cyan: #8be5ff;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
  background: #0c3f6c;
}

body.intro-active { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  animation: intro-failsafe 1ms 2.4s forwards;
}

.intro-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.2%;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(35, 106, 153, .1), transparent 34%, rgba(255, 217, 121, .06)),
    #071b2e;
  will-change: transform;
}

.intro-door::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(141, 224, 255, .52), rgba(255, 226, 145, .72), transparent);
  box-shadow: 0 0 18px rgba(117, 214, 255, .24);
}

.intro-door-left { left: 0; }
.intro-door-left::before { right: 0; }
.intro-door-right { right: 0; }
.intro-door-right::before { left: 0; }

.intro-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 47%, rgba(54, 162, 218, .22), transparent 25%),
    linear-gradient(115deg, transparent 42%, rgba(255, 221, 132, .055) 50%, transparent 58%);
  opacity: 0;
  animation: intro-ambient-in .65s ease-out .08s forwards;
}

.intro-core {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-8px);
  animation: intro-core-in .5s cubic-bezier(.2,.8,.2,1) .06s both;
}

.intro-emblem {
  position: relative;
  width: 152px;
  height: 152px;
  display: grid;
  place-items: center;
}

.intro-avatar {
  width: 102px;
  height: 102px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 50%;
  background: #102d48;
  box-shadow: 0 0 28px rgba(105, 210, 255, .34), 0 0 58px rgba(255, 218, 120, .12);
  animation: intro-avatar-in .45s cubic-bezier(.2,.8,.2,1) .16s both;
}

.intro-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

.intro-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.intro-ring::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.intro-ring-outer {
  inset: 0;
  border-top-color: rgba(255, 225, 138, .92);
  border-right-color: rgba(139, 229, 255, .32);
  animation: spin 1.8s linear infinite;
}

.intro-ring-outer::after { top: 14px; right: 17px; }

.intro-ring-middle {
  inset: 10px;
  border-bottom-color: rgba(139, 229, 255, .9);
  border-left-color: rgba(255, 225, 138, .24);
  animation: spin 1.05s linear infinite reverse;
}

.intro-ring-middle::after { left: 8px; bottom: 20px; width: 4px; height: 4px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.intro-ring-inner {
  inset: 20px;
  border-top-color: rgba(255,255,255,.78);
  animation: spin .72s linear infinite;
}

.intro-ring-inner::after { display: none; }

.intro-name {
  margin-top: 20px;
  color: var(--white);
  font-family: "Pacifico", cursive;
  font-size: 42px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(127, 218, 255, .38);
  opacity: 0;
  transform: translateY(10px);
  animation: intro-name-in .38s ease-out .42s forwards;
}

.intro-name::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  margin: 13px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 10px rgba(255, 225, 138, .72);
  animation: intro-line-in .34s ease-out .65s forwards;
}

.intro-blade {
  position: absolute;
  top: -28%;
  left: 50%;
  z-index: 4;
  width: 3px;
  height: 156%;
  background: #fff8dc;
  box-shadow: 0 0 8px #fff, 0 0 22px var(--gold), 0 0 54px rgba(255, 197, 70, .78);
  opacity: 0;
  transform: translateX(-50%) rotate(13deg) scaleY(0);
  transform-origin: center top;
  animation: intro-blade-strike .28s cubic-bezier(.2,.75,.2,1) .94s both;
}

.intro.intro-exit .intro-core {
  animation: none;
  opacity: 0;
  transform: translateY(-8px) scale(.96);
  transition: opacity .16s ease, transform .16s ease;
}

.intro.intro-exit .intro-ambient { animation: none; opacity: 0; transition: opacity .2s ease; }
.intro.intro-exit .intro-door-left { transform: translateX(-101%); transition: transform .78s cubic-bezier(.645,.045,.355,1); }
.intro.intro-exit .intro-door-right { transform: translateX(101%); transition: transform .78s cubic-bezier(.645,.045,.355,1); }

body.intro-active .background,
body.intro-active .sky-wash,
body.intro-active #particles {
  filter: blur(9px) brightness(.72);
}

body.intro-active .page-shell {
  opacity: 0;
  transform: scale(1.035);
  filter: blur(10px);
}

body.intro-active .hero,
body.intro-active .dashboard,
body.intro-active .about {
  opacity: 0;
  transform: translateY(22px);
}

body.intro-revealing .background,
body.intro-revealing .sky-wash,
body.intro-revealing #particles {
  filter: blur(0) brightness(1);
  transition: filter 1.15s cubic-bezier(.25,.46,.45,.94);
}

body.intro-revealing .page-shell {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition: opacity .95s ease, transform 1.05s cubic-bezier(.25,.46,.45,.94), filter .9s ease;
}

body.intro-revealing .hero,
body.intro-revealing .dashboard,
body.intro-revealing .about {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .72s ease, transform .82s cubic-bezier(.2,.75,.2,1);
}

body.intro-revealing .hero { transition-delay: .08s; }
body.intro-revealing .dashboard { transition-delay: .18s; }
body.intro-revealing .about { transition-delay: .28s; }

.background {
  position: fixed;
  inset: 0;
  z-index: -4;
  background: url("assets/background-sunset.jpg?v=2") center / cover no-repeat;
}

.sky-wash {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(8, 10, 27, 0.78) 0%, rgba(18, 13, 35, 0.46) 43%, rgba(13, 12, 29, 0.1) 70%, rgba(7, 8, 22, 0.28) 100%),
    linear-gradient(0deg, rgba(5, 7, 18, 0.76) 0%, transparent 42%, rgba(20, 9, 31, 0.16) 100%);
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page-shell {
  width: min(1120px, calc(100% - 72px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(54px, 8vh, 96px) 0 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  display: flex;
  align-items: center;
  gap: clamp(34px, 5vw, 72px);
  margin-bottom: 42px;
}

.avatar-wrap {
  position: relative;
  width: clamp(146px, 16vw, 206px);
  height: clamp(146px, 16vw, 206px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 241, 178, 0.72);
  box-shadow: 0 0 38px rgba(132, 222, 255, 0.28), inset 0 0 22px rgba(255,255,255,.12);
}

.avatar {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.9);
  object-fit: cover;
  object-position: 50% 28%;
  box-shadow: 0 22px 64px rgba(2, 18, 33, 0.55);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  animation: spin 16s linear infinite;
}

.orbit::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.orbit-one { inset: -22px; border-left-color: transparent; border-bottom-color: transparent; }
.orbit-one::after { right: 18px; top: 9px; }
.orbit-two { inset: -36px; border-right-color: transparent; border-top-color: transparent; animation-direction: reverse; animation-duration: 22s; }
.orbit-two::after { left: 17px; bottom: 20px; width: 4px; height: 4px; }

.online-dot {
  position: absolute;
  right: 8%;
  bottom: 8%;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid #153a56;
  background: #9bf6a8;
  box-shadow: 0 0 18px rgba(155,246,168,.9);
}

.hero-copy { min-width: 0; }

.eyebrow, .panel-label, .timezone, .scroll-hint {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255,255,255,.7);
}

.eyebrow span {
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 10px 3px 0;
  background: var(--gold);
}

h1 {
  margin: 0;
  font-family: "Pacifico", "Ma Shan Zheng", cursive;
  font-size: clamp(54px, 6.5vw, 88px);
  line-height: 1.05;
  font-weight: 400;
  text-shadow: 0 8px 36px rgba(0, 23, 45, 0.4);
  white-space: nowrap;
}

h1 strong { color: var(--gold); font-weight: 400; }
h1 i { color: var(--cyan); font-style: normal; }

.identity {
  margin: 14px 0 0 5px;
  font-size: 17px;
  font-weight: 500;
  color: rgba(255,255,255,.88);
}

.identity b { margin: 0 9px; color: var(--gold); }

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 18px 54px rgba(1, 16, 29, 0.28);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.11), transparent 34%);
}

.quote-panel, .time-panel {
  min-height: 218px;
  padding: 27px 31px 25px;
}

.panel-label { color: rgba(255,255,255,.6); }

.time-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zone-control {
  position: relative;
  flex: 0 1 auto;
}

.zone-control::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 9px;
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-58%);
}

#timezone-select {
  width: 132px;
  height: 32px;
  padding: 0 27px 0 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 4px;
  outline: none;
  appearance: none;
  color: rgba(255,255,255,.9);
  background: rgba(3, 25, 45, .46);
  font: 500 12px/1 "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
}

#timezone-select:hover,
#timezone-select:focus-visible {
  border-color: rgba(255,225,138,.72);
  box-shadow: 0 0 0 2px rgba(255,225,138,.1);
}

#timezone-select option {
  color: #13293c;
  background: #f7fbff;
}

.diamond {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 10px 1px 0;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 9px rgba(255,225,138,.7);
}

blockquote { margin: 33px 0 0; }

blockquote p {
  min-height: 64px;
  margin: 0;
  font-family: "Ma Shan Zheng", "Noto Sans SC", sans-serif;
  font-size: clamp(21px, 2.1vw, 29px);
  line-height: 1.55;
  transition: opacity 300ms ease, transform 300ms ease;
}

blockquote p.switching { opacity: 0; transform: translateY(7px); }

blockquote footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
  text-align: right;
}

.quote-progress {
  position: absolute;
  left: 31px;
  right: 31px;
  bottom: 20px;
  height: 1px;
  background: rgba(255,255,255,.13);
}

.quote-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.date { margin: 25px 0 0; font-size: 16px; color: rgba(255,255,255,.84); }

.clock {
  margin: 4px 0 0;
  font-family: "Noto Sans SC", sans-serif;
  font-size: clamp(46px, 5.5vw, 70px);
  font-weight: 600;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.clock span { font-size: .46em; margin-left: 6px; color: var(--gold); }

.timezone { display: flex; justify-content: space-between; margin: 0; color: rgba(255,255,255,.48); }
.timezone span { color: rgba(255,255,255,.48); }
.timezone strong { color: var(--cyan); font-weight: 600; }

.about {
  min-height: 110px;
  margin-top: 22px;
  padding: 24px 84px 24px 72px;
  display: flex;
  align-items: center;
}

.quote-mark {
  position: absolute;
  left: 21px;
  top: 5px;
  font-family: Georgia, serif;
  font-size: 78px;
  color: rgba(255,225,138,.85);
  line-height: 1;
}

.about-title { margin: 0 0 4px; font-family: "Pacifico", cursive; font-size: 22px; color: var(--gold); }
.about-text { margin: 0; color: rgba(255,255,255,.84); font-size: 15px; }
.about-index { position: absolute; right: 24px; top: 20px; font-size: 52px; font-weight: 700; color: rgba(255,255,255,.07); }

.scroll-hint {
  position: fixed;
  right: 28px;
  bottom: 27px;
  writing-mode: vertical-rl;
  color: rgba(255,255,255,.42);
}

.scroll-hint span { width: 1px; height: 34px; margin: 0 auto 10px; background: rgba(255,255,255,.45); }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { from { transform: scale(1.025); } to { transform: scale(1.055); } }
@keyframes intro-core-in { from { opacity: 0; transform: translateY(8px) scale(.82); filter: blur(5px); } to { opacity: 1; transform: translateY(-8px) scale(1); filter: blur(0); } }
@keyframes intro-avatar-in { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
@keyframes intro-name-in { to { opacity: 1; transform: translateY(0); } }
@keyframes intro-line-in { to { width: 94px; } }
@keyframes intro-ambient-in { to { opacity: 1; } }
@keyframes intro-blade-strike { 0% { opacity: 0; transform: translateX(-50%) rotate(13deg) scaleY(0); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) rotate(13deg) scaleY(1); } }
@keyframes page-reveal { from { opacity: 0; transform: scale(1.012); filter: blur(3px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes intro-failsafe { to { visibility: hidden; pointer-events: none; } }

@media (max-width: 760px) {
  .background { background-position: 33% center; }
  .sky-wash { background: linear-gradient(0deg, rgba(6,8,22,.84), rgba(20,10,35,.26)), linear-gradient(90deg, rgba(8,10,28,.38), transparent); }
  .page-shell { width: min(100% - 32px, 560px); padding: 58px 0 36px; justify-content: flex-start; }
  .hero { flex-direction: column; gap: 24px; margin-bottom: 30px; text-align: center; }
  .avatar-wrap { width: 145px; }
  .avatar-wrap { height: 145px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: clamp(42px, 13.5vw, 60px); }
  .identity { margin-top: 9px; }
  .dashboard { grid-template-columns: 1fr; }
  .quote-panel, .time-panel { min-height: 205px; padding: 24px; }
  #timezone-select { width: 126px; }
  blockquote { margin-top: 27px; }
  .quote-progress { left: 24px; right: 24px; }
  .about { padding: 23px 54px 23px 60px; }
  .about-text { font-size: 14px; line-height: 1.65; }
  .scroll-hint { display: none; }
  .intro-emblem { width: 138px; height: 138px; }
  .intro-avatar { width: 92px; height: 92px; }
  .intro-name { font-size: 38px; }
}

@media (max-height: 760px) and (min-width: 761px) {
  .page-shell { padding: 34px 0; }
  .hero { margin-bottom: 26px; }
  .avatar-wrap { width: 138px; height: 138px; }
  h1 { font-size: 68px; }
  .quote-panel, .time-panel { min-height: 190px; padding-top: 22px; }
  blockquote { margin-top: 22px; }
  .about { min-height: 92px; }
}

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