:root {
  color-scheme: dark;
  --bg: #030304;
  --ink: #fff6e8;
  --muted: rgba(255, 246, 232, 0.68);
  --faint: rgba(255, 246, 232, 0.42);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --gold: #f5c66a;
  --amber: #d98b4d;
  --blue: #9bdce8;
  --panel: rgba(8, 8, 12, 0.72);
  --panel-solid: rgba(8, 8, 12, 0.94);
  --shadow: 0 38px 130px rgba(0, 0, 0, 0.62);
  --serif: "Iowan Old Style", "Songti SC", "Noto Serif SC", "STSong", serif;
  --sans: "Avenir Next", "Gill Sans", "Trebuchet MS", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  width: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 48%, rgba(245, 198, 106, 0.08), transparent 22%),
    radial-gradient(circle at 18% 82%, rgba(85, 132, 178, 0.12), transparent 34%),
    linear-gradient(180deg, #010102 0%, #08080d 54%, #020203 100%);
  color: var(--ink);
  font-family: var(--sans);
}

body.is-gate-open .gift-gate {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.gift-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(245, 198, 106, 0.11), transparent 24%),
    radial-gradient(circle at 28% 70%, rgba(155, 220, 232, 0.08), transparent 34%),
    rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(18px);
  transition:
    opacity 520ms ease,
    transform 520ms cubic-bezier(0.2, 0.86, 0.22, 1);
}

.gift-gate-card {
  display: grid;
  width: min(560px, 100%);
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 38px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(8, 8, 12, 0.86);
  box-shadow: var(--shadow);
  padding: clamp(26px, 4vw, 46px);
}

.gift-gate-card h1 {
  font-size: clamp(46px, 7vw, 78px);
}

.gift-gate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.gift-gate-card label {
  display: grid;
  gap: 9px;
  color: var(--muted);
}

.gift-gate-card input {
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  padding: 14px 15px;
}

.gift-gate-card small {
  min-height: 18px;
  color: rgba(255, 172, 132, 0.86);
}

body.is-timeline-mode {
  background:
    radial-gradient(circle at 58% 48%, rgba(255, 255, 255, 0.035), transparent 24%),
    radial-gradient(circle at 18% 42%, rgba(52, 93, 76, 0.08), transparent 34%),
    linear-gradient(180deg, #010202 0%, #030505 54%, #000 100%);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

#memoryCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  outline: 0;
  cursor: grab;
}

#memoryCanvas.is-grabbing {
  cursor: grabbing;
}

#memoryCanvas.is-pointing {
  cursor: pointer;
}

.vignette,
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.vignette {
  z-index: 1;
  background:
    radial-gradient(circle at 54% 45%, transparent 0%, rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), transparent 24%, transparent 72%, rgba(0, 0, 0, 0.42));
}

.grain {
  z-index: 2;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 54% 48%, #000 0%, transparent 84%);
}

.shell {
  pointer-events: none;
  position: relative;
  z-index: 3;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.shell > * {
  pointer-events: auto;
}

.topbar {
  position: fixed;
  top: 24px;
  right: 28px;
  left: 28px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    filter 420ms ease;
}

.shell.is-timeline .topbar {
  opacity: 0;
  pointer-events: none;
  filter: blur(6px);
  transform: translateY(-10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.06em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(245, 198, 106, 0.46);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.95), rgba(245, 198, 106, 0.46) 18%, transparent 44%),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 42px rgba(245, 198, 106, 0.2);
}

.brand-mark::after {
  content: "";
  width: 24px;
  height: 8px;
  border: 1px solid rgba(255, 246, 232, 0.52);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(18px);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(245, 198, 106, 0.72);
}

.hero-copy {
  position: fixed;
  z-index: 12;
  top: 50%;
  left: clamp(24px, 6vw, 92px);
  width: min(520px, calc(100vw - 48px));
  transform: translateY(-50%);
  transition:
    opacity 560ms ease,
    transform 560ms cubic-bezier(0.2, 0.82, 0.2, 1),
    filter 560ms ease;
}

.shell.is-entered .hero-copy,
.shell.is-focused .hero-copy {
  opacity: 0.12;
  filter: blur(1px);
  transform: translateY(-50%) translateX(-34px) scale(0.94);
}

.shell.is-timeline .hero-copy {
  opacity: 0;
  pointer-events: none;
  filter: blur(8px);
  transform: translateY(-50%) translateX(-70px) scale(0.88);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.055em;
}

h1 {
  font-size: clamp(58px, 7.2vw, 108px);
  line-height: 0.92;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.hero-copy p:not(.eyebrow) {
  max-width: 500px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.78;
}

.command-panel {
  position: fixed;
  z-index: 18;
  right: 28px;
  bottom: 28px;
  display: grid;
  width: min(320px, calc(100vw - 56px));
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(7, 7, 10, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 110px rgba(0, 0, 0, 0.44);
  padding: 20px;
  backdrop-filter: blur(28px) saturate(1.15);
  transition:
    opacity 420ms ease,
    transform 420ms cubic-bezier(0.2, 0.86, 0.22, 1),
    filter 420ms ease;
}

.shell.is-timeline .command-panel {
  opacity: 0;
  pointer-events: none;
  filter: blur(8px);
  transform: translateY(28px) scale(0.96);
}

.command-panel h2 {
  font-size: 34px;
  line-height: 0.98;
}

.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-action,
.secondary-action,
.filter,
.text-action {
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.primary-action {
  border: 1px solid rgba(245, 198, 106, 0.55);
  background: linear-gradient(135deg, #f5c66a, #df8d4c);
  color: #180f07;
  font-weight: 850;
  padding: 13px 16px;
  box-shadow: 0 18px 46px rgba(223, 141, 76, 0.22);
}

.secondary-action,
.filter,
.text-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.secondary-action {
  padding: 13px 16px;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  padding: 9px 13px;
  color: var(--muted);
}

.filter.is-active {
  border-color: rgba(245, 198, 106, 0.5);
  background: rgba(245, 198, 106, 0.13);
  color: var(--ink);
}

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.text-action {
  flex: 1;
  padding: 10px 12px;
  color: var(--faint);
  font-size: 13px;
}

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

.gesture-hint {
  position: fixed;
  z-index: 14;
  bottom: 32px;
  left: 34px;
  margin: 0;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.13em;
}

.floating-add {
  position: fixed;
  top: 86px;
  right: 28px;
  z-index: 22;
  display: none;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(245, 198, 106, 0.5);
  border-radius: 50%;
  background: rgba(245, 198, 106, 0.13);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  backdrop-filter: blur(18px);
}

.galaxy-title {
  position: fixed;
  z-index: 19;
  top: 32px;
  left: 32px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition:
    opacity 460ms ease,
    transform 460ms cubic-bezier(0.2, 0.86, 0.22, 1);
}

.shell.is-timeline .galaxy-title {
  opacity: 1;
  transform: translateY(0);
}

.galaxy-title p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.34em;
}

.galaxy-title h2 {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.galaxy-title span {
  display: block;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 10px;
  letter-spacing: 0.32em;
}

.timeline-hud {
  position: fixed;
  z-index: 19;
  top: 132px;
  left: 32px;
  display: grid;
  width: 148px;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(8, 12, 12, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.52);
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px) scale(0.97);
  transition:
    opacity 420ms ease,
    transform 420ms cubic-bezier(0.2, 0.86, 0.22, 1);
  backdrop-filter: blur(24px) saturate(1.08);
}

.shell.is-timeline .timeline-hud {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.back-action {
  justify-self: start;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.62);
  padding: 8px 9px;
  text-align: left;
  font-size: 11px;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.back-action:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.galaxy-menu-card {
  display: grid;
  gap: 8px;
}

.galaxy-menu-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 8px;
  color: rgba(255, 255, 255, 0.5);
}

.galaxy-menu-row.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
}

.galaxy-menu-row span {
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.galaxy-menu-row strong {
  overflow: hidden;
  max-width: 64px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timeline-hud p {
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.3);
  padding: 10px 8px 0;
  font-size: 10px;
  line-height: 1.55;
}

.timeline-meter {
  overflow: hidden;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.86));
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 300ms ease;
}

.timeline-rail {
  position: fixed;
  top: 148px;
  right: 38px;
  z-index: 18;
  --timeline-progress: 0;
  --timeline-pulse: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition:
    opacity 460ms ease,
    transform 460ms cubic-bezier(0.2, 0.86, 0.22, 1);
}

.shell.is-timeline .timeline-rail {
  opacity: 1;
  transform: translateX(0);
}

.timeline-rail::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 28px;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.timeline-rail::after {
  content: "";
  position: absolute;
  top: calc(30px + var(--timeline-progress) * (100% - 58px));
  left: 50%;
  width: calc(6px + var(--timeline-pulse) * 3px);
  height: calc(6px + var(--timeline-pulse) * 3px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 calc(18px + var(--timeline-pulse) * 12px) rgba(255, 255, 255, 0.48),
    0 0 calc(44px + var(--timeline-pulse) * 20px) rgba(245, 198, 106, 0.22);
  transform: translate(-50%, -50%);
  transition:
    top 220ms cubic-bezier(0.18, 0.82, 0.22, 1),
    width 180ms ease,
    height 180ms ease;
}

.timeline-rail span,
.timeline-rail strong,
.timeline-rail small,
.timeline-rail em {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  writing-mode: vertical-rl;
}

.timeline-rail em {
  color: rgba(255, 255, 255, 0.68);
  font-style: normal;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
}

.timeline-rail i {
  position: relative;
  z-index: 1;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
  transition:
    background 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease;
}

.timeline-rail i.is-hot {
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.48),
    0 0 30px rgba(245, 198, 106, 0.18);
  transform: scale(1.5);
}

.galaxy-corner {
  position: fixed;
  top: 32px;
  right: 34px;
  z-index: 19;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.52);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(18px);
  transition: opacity 420ms ease;
}

.shell.is-timeline .galaxy-corner {
  opacity: 1;
  pointer-events: auto;
}

.music-toggle {
  position: fixed;
  right: 34px;
  bottom: 30px;
  z-index: 19;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.5);
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  font-size: 11px;
  letter-spacing: 0.12em;
  backdrop-filter: blur(18px);
  transition:
    opacity 420ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.shell.is-timeline .music-toggle {
  opacity: 1;
  pointer-events: auto;
}

.music-toggle:hover,
.music-toggle.is-playing {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.music-toggle.is-playing {
  box-shadow: 0 0 28px rgba(155, 220, 232, 0.14);
}

.guide-panel,
.letter-panel,
.detail-panel {
  position: fixed;
  z-index: 30;
  right: 24px;
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
  transform: translateX(calc(100% + 42px));
  transition: transform 380ms cubic-bezier(0.2, 0.86, 0.22, 1);
}

.guide-panel.is-open,
.letter-panel.is-open,
.detail-panel.is-open {
  transform: translateX(0);
}

.guide-panel,
.letter-panel {
  top: 94px;
  display: grid;
  gap: 18px;
  padding: 28px;
}

.guide-panel h2,
.letter-panel h2 {
  font-size: 39px;
  line-height: 1;
}

.guide-panel p:not(.eyebrow),
.letter-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.78;
}

.letter-body {
  display: grid;
  gap: 16px;
  border-left: 1px solid rgba(245, 198, 106, 0.36);
  padding-left: 18px;
}

.detail-panel {
  top: 24px;
  bottom: 24px;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: minmax(210px, 36vh) 1fr;
  gap: 0;
  overflow: auto;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(5, 5, 8, 0.96);
}

.detail-panel:not(.has-photo) {
  grid-template-rows: minmax(150px, 22vh) 1fr;
}

.detail-media {
  position: relative;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px 26px 18px 18px;
  background:
    radial-gradient(circle at 50% 34%, rgba(245, 198, 106, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    #0b0b0e;
  background-position: center;
  background-size: cover;
  box-shadow:
    inset 0 -90px 120px rgba(0, 0, 0, 0.36),
    0 18px 60px rgba(0, 0, 0, 0.26);
}

.detail-media.is-empty {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 198, 106, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #09090c;
  box-shadow: inset 0 0 90px rgba(255, 255, 255, 0.03);
}

.detail-media-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.detail-media.is-empty .detail-media-actions {
  position: static;
  justify-content: center;
}

.detail-media-action {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 246, 232, 0.82);
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  backdrop-filter: blur(18px);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.detail-media-action:hover {
  border-color: rgba(245, 198, 106, 0.48);
  background: rgba(245, 198, 106, 0.16);
  color: rgba(255, 246, 232, 0.98);
  transform: translateY(-1px);
}

.detail-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px 14px 10px;
}

.detail-panel h2 {
  max-width: 10em;
  color: rgba(255, 246, 232, 0.98);
  font-size: clamp(34px, 4.2vw, 48px);
  line-height: 1.05;
}

.detail-panel p:not(.eyebrow):not(.detail-section-label) {
  margin: 0;
  color: rgba(255, 246, 232, 0.72);
  font-size: 16px;
  line-height: 1.9;
}

.detail-section-label {
  margin: 6px 0 -5px;
  color: rgba(245, 198, 106, 0.62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.detail-note {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.detail-message {
  display: none;
  margin: 2px 0 0;
  border: 1px solid rgba(245, 198, 106, 0.18);
  border-left: 3px solid rgba(245, 198, 106, 0.5);
  border-radius: 20px;
  background: rgba(245, 198, 106, 0.045);
  color: rgba(255, 246, 232, 0.9);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.85;
  padding: 16px 18px;
}

.detail-message.is-visible {
  display: block;
}

.detail-panel audio {
  display: none;
  width: 100%;
  height: 38px;
  margin-top: 2px;
  filter: invert(0.92) saturate(0.62);
}

.detail-panel audio.has-audio {
  display: block;
}

.detail-panel dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 0;
}

.detail-panel dl div {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.028);
  padding: 13px;
}

.detail-panel dt {
  color: var(--faint);
  font-size: 12px;
}

.detail-panel dd {
  margin: 8px 0 0;
  color: rgba(255, 246, 232, 0.88);
  font-size: 14px;
  line-height: 1.35;
}

.icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.memory-dialog {
  width: min(690px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  background: rgba(8, 8, 12, 0.96);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.memory-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.memory-form {
  display: grid;
  gap: 17px;
  padding: 28px;
}

.dialog-head {
  position: relative;
  padding-right: 48px;
}

.dialog-head h2 {
  font-size: 42px;
}

.dialog-intro {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.memory-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.memory-form input,
.memory-form textarea,
.memory-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  padding: 13px 14px;
}

.memory-form select option {
  background: #101014;
}

.memory-form textarea {
  resize: vertical;
}

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

.form-note {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
}

.memory-form menu {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding: 4px 0 0;
}

@media (max-width: 920px) {
  body {
    overflow: hidden;
  }

  .topbar {
    top: 14px;
    right: 14px;
    left: 14px;
  }

  .brand {
    font-size: 22px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 15px;
  }

  .live-status {
    display: none;
  }

  .hero-copy {
    top: 104px;
    left: 14px;
    width: calc(100vw - 28px);
    transform: none;
  }

  .shell.is-entered .hero-copy,
  .shell.is-focused .hero-copy {
    opacity: 0.08;
    transform: translateY(-18px) scale(0.96);
  }

  .shell.is-timeline .hero-copy {
    opacity: 0;
    transform: translateY(-42px) scale(0.92);
  }

  h1 {
    max-width: 360px;
    font-size: clamp(44px, 12.6vw, 60px);
  }

  h1 span {
    white-space: normal;
  }

  .hero-copy p:not(.eyebrow) {
    max-width: 360px;
    font-size: 15px;
  }

  .command-panel {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    gap: 13px;
    border-radius: 26px;
    padding: 15px;
  }

  .shell.is-timeline .command-panel {
    transform: translateY(38px) scale(0.95);
  }

  .command-panel h2 {
    font-size: 28px;
  }

  .filter-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .filter {
    flex: 0 0 auto;
  }

  .panel-meta {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .floating-add {
    display: grid;
  }

  .gesture-hint {
    left: 16px;
    bottom: 174px;
    max-width: calc(100vw - 32px);
    font-size: 11px;
  }

  .timeline-hud {
    top: 118px;
    right: auto;
    bottom: auto;
    left: 14px;
    width: 140px;
    gap: 9px;
    border-radius: 17px;
    padding: 9px;
  }

  .galaxy-title {
    top: 18px;
    left: 16px;
  }

  .galaxy-title h2 {
    font-size: 26px;
  }

  .timeline-rail {
    right: 16px;
  }

  .galaxy-corner {
    top: 18px;
    right: 16px;
  }

  .music-toggle {
    right: 16px;
    bottom: 16px;
  }

  .shell.is-timeline .gesture-hint {
    bottom: 58px;
  }

  .detail-panel,
  .guide-panel,
  .letter-panel {
    right: 14px;
    left: 14px;
    width: auto;
  }

  .detail-panel {
    top: auto;
    bottom: 14px;
    max-height: 76vh;
    transform: translateY(calc(100% + 30px));
  }

  .detail-panel.is-open {
    transform: translateY(0);
  }

  .guide-panel,
  .letter-panel {
    top: 80px;
  }

  .detail-media {
    min-height: 210px;
  }

  .detail-panel dl,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

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