:root {
  --background: #e7e9e5;
  --foreground: #171816;
  --line: rgba(23, 24, 22, 0.17);
  --muted: rgba(23, 24, 22, 0.56);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

button,
input {
  font: inherit;
}

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

.experience {
  --accent: #a64e44;
  --soft-accent: rgba(166, 78, 68, 0.2);
  --range-progress: 40%;
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 47%, rgba(255, 255, 255, 0.42), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 44%),
    var(--background);
}

.experience::before,
.experience::after {
  position: absolute;
  z-index: -1;
  display: block;
  content: "";
  pointer-events: none;
}

.experience::before {
  inset: 0;
  opacity: 0.22;
  background-image: linear-gradient(rgba(23, 24, 22, 0.03) 1px, transparent 1px);
  background-size: 100% 5px;
  mix-blend-mode: multiply;
}

.experience::after {
  top: 16%;
  left: 50%;
  width: min(76vw, 920px);
  height: min(76vw, 920px);
  border: 1px solid rgba(23, 24, 22, 0.06);
  border-radius: 50%;
  transform: translateX(-50%);
}

.center-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1240px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 32px clamp(24px, 4.1vw, 64px) 20px;
  flex-direction: column;
}

.ambient-orb {
  position: absolute;
  z-index: -1;
  width: 17rem;
  height: 17rem;
  border-radius: 50%;
  background: var(--soft-accent);
  filter: blur(42px);
  opacity: 0.38;
  pointer-events: none;
  transition: background 450ms ease;
}

.ambient-orb--one {
  top: 5rem;
  right: -8rem;
}

.ambient-orb--two {
  bottom: 5rem;
  left: -10rem;
  opacity: 0.2;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

h1 {
  margin: 0;
  color: var(--foreground);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(3.25rem, 5.8vw, 4.65rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.level-meter {
  display: grid;
  min-width: 5.3rem;
  padding-top: 0.05rem;
  justify-items: end;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: right;
}

.level-output {
  margin-top: 0.08rem;
  color: var(--accent);
  font-family: "Arial Narrow", "DIN Condensed", sans-serif;
  font-size: clamp(3.7rem, 6vw, 5.25rem);
  font-weight: 300;
  letter-spacing: -0.08em;
  line-height: 0.88;
  transition: color 450ms ease;
}

.portrait-zone {
  position: relative;
  display: flex;
  min-height: 0;
  padding: 10px 0 3px;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.stage-ghost {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: -1;
  margin: 0;
  color: var(--accent);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(7rem, 19vw, 14.5rem);
  font-weight: 800;
  letter-spacing: -0.12em;
  line-height: 0.78;
  opacity: 0.08;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-7deg);
  transition: color 450ms ease;
  white-space: nowrap;
}

.portrait-shell {
  position: relative;
  width: clamp(300px, 28vw, 380px);
  height: clamp(300px, 28vw, 380px);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.imperial-halo {
  position: absolute;
  inset: -5.5%;
  border: 1px solid var(--soft-accent);
  border-radius: 48% 52% 51% 49%;
  transform: rotate(-9deg);
  transition: border-color 450ms ease;
}

.imperial-halo::after {
  position: absolute;
  inset: 5%;
  border: 1px dashed rgba(23, 24, 22, 0.1);
  border-radius: 51% 49% 47% 53%;
  content: "";
  transform: rotate(22deg);
}

.photo-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 28px;
  background: #242322;
  box-shadow:
    0 22px 48px rgba(31, 27, 23, 0.19),
    0 0 0 8px rgba(255, 255, 255, 0.22),
    0 0 36px var(--soft-accent);
  isolation: isolate;
  transition: border-color 450ms ease, box-shadow 450ms ease;
}

.portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.06);
  animation: portrait-reveal 560ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.photo-vignette,
.scan-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.photo-vignette {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(20, 18, 16, 0.18), transparent 25%, transparent 75%, rgba(20, 18, 16, 0.28)),
    linear-gradient(90deg, rgba(20, 18, 16, 0.15), transparent 25%, transparent 76%, rgba(20, 18, 16, 0.16));
  mix-blend-mode: multiply;
}

.scan-grid {
  z-index: 2;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-position: center;
  background-size: 34px 34px;
  mix-blend-mode: soft-light;
}

.frame-corner {
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-color: rgba(255, 248, 238, 0.82);
  border-style: solid;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

.frame-corner--tl {
  top: 18px;
  left: 18px;
  border-width: 1px 0 0 1px;
}

.frame-corner--tr {
  top: 18px;
  right: 18px;
  border-width: 1px 1px 0 0;
}

.frame-corner--bl {
  bottom: 18px;
  left: 18px;
  border-width: 0 0 1px 1px;
}

.frame-corner--br {
  right: 18px;
  bottom: 18px;
  border-width: 0 1px 1px 0;
}

.stage-readout {
  display: grid;
  margin-top: 0.7rem;
  justify-items: center;
  line-height: 1;
}

.stage-readout > span:first-child {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
}

.stage-name {
  margin: 0.24rem 0 0.2rem;
  color: var(--foreground);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(1.7rem, 2.3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  transition: color 450ms ease;
}

.stage-index {
  color: var(--muted);
  font-family: "Arial Narrow", "DIN Condensed", sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.control-panel {
  width: min(860px, 100%);
  margin: 0 auto;
  padding-top: 0.92rem;
  border-top: 1px solid var(--line);
}

.control-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.08rem;
}

.control-heading p,
.control-heading span {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.control-heading p {
  color: var(--foreground);
  font-weight: 700;
}

.range-control {
  position: relative;
}

.range-wrap {
  position: relative;
  height: 46px;
  margin: 0 11px;
}

.tick-track {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 4px;
  transform: translateY(-50%);
}

.track-base,
.track-fill {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 100%;
  border-radius: 99px;
}

.track-base {
  width: 100%;
  background: rgba(23, 24, 22, 0.16);
}

.track-fill {
  width: var(--range-progress);
  background: linear-gradient(90deg, #b99679, var(--accent));
  box-shadow: 0 0 14px var(--soft-accent);
  transition: width 200ms ease, background 450ms ease;
}

.tick {
  position: absolute;
  top: 50%;
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--background);
  border-radius: 50%;
  background: rgba(23, 24, 22, 0.22);
  box-shadow: 0 0 0 1px rgba(23, 24, 22, 0.18);
  transform: translate(-50%, -50%);
  transition: background 220ms ease, box-shadow 450ms ease;
}

.tick.is-active {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--soft-accent);
}

.strength-slider {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 46px;
  margin: 0;
  appearance: none;
  cursor: ew-resize;
  background: transparent;
}

.strength-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.strength-slider::-moz-range-track {
  height: 4px;
  background: transparent;
}

.strength-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -8px;
  appearance: none;
  border: 4px solid var(--background);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--soft-accent);
  transition: background 450ms ease, box-shadow 450ms ease;
}

.strength-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 4px solid var(--background);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--soft-accent);
  transition: background 450ms ease, box-shadow 450ms ease;
}

.strength-slider:focus-visible {
  outline: none;
}

.strength-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--accent), 0 0 20px var(--soft-accent);
}

.strength-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--accent), 0 0 20px var(--soft-accent);
}

.stage-markers {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-markers li {
  min-width: 0;
  text-align: center;
}

.stage-markers button {
  width: 100%;
  padding: 0.32rem 0.2rem 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(0.78rem, 1.35vw, 1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 220ms ease, transform 220ms ease;
}

.stage-markers button:hover,
.stage-markers button:focus-visible,
.stage-markers button.is-current {
  color: var(--accent);
}

.stage-markers button:hover,
.stage-markers button:focus-visible {
  transform: translateY(-2px);
}

.stage-markers button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.drag-hint {
  margin: 0.76rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.drag-hint span {
  padding: 0 0.38rem;
  color: var(--accent);
  font-size: 1rem;
  transition: color 450ms ease;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  color: rgba(23, 24, 22, 0.42);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

@keyframes portrait-reveal {
  from {
    opacity: 0.15;
    transform: scale(1.035);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .center-content {
    padding: 24px 20px 18px;
  }

  .portrait-zone {
    padding-top: 18px;
  }

  .portrait-shell {
    width: min(70vw, 360px);
    height: min(70vw, 360px);
  }

  .stage-ghost {
    top: 41%;
    font-size: clamp(6.4rem, 24vw, 11rem);
  }

  .control-panel {
    padding-top: 0.78rem;
  }
}

@media (max-width: 520px) {
  .center-content {
    min-height: 100svh;
    padding: 21px 17px 17px;
  }

  .masthead {
    gap: 1rem;
  }

  .eyebrow {
    margin-bottom: 0.48rem;
    font-size: 0.56rem;
    letter-spacing: 0.15em;
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4rem);
  }

  .level-meter {
    min-width: 3.8rem;
    font-size: 0.64rem;
  }

  .level-output {
    font-size: 3.35rem;
  }

  .portrait-zone {
    padding-top: 25px;
  }

  .portrait-shell {
    width: min(76vw, 330px);
    height: min(76vw, 330px);
  }

  .stage-ghost {
    display: none;
  }

  .stage-readout {
    margin-top: 0.9rem;
  }

  .stage-name {
    margin-top: 0.28rem;
    font-size: 2rem;
  }

  .control-heading p,
  .control-heading span {
    font-size: 0.62rem;
  }

  .range-wrap {
    margin-right: 8px;
    margin-left: 8px;
  }

  .stage-markers button {
    font-size: 0.75rem;
  }

  .drag-hint {
    margin-top: 0.6rem;
    font-size: 0.6rem;
  }

  .footer-note {
    margin-top: 0.85rem;
    font-size: 0.55rem;
  }
}

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