:root {
  color-scheme: dark;
  --background: #071d49;
  --foreground: #fffdf8;
  --accent: #8eb8ff;
  --muted: rgba(255, 253, 248, 0.68);
  --line: rgba(255, 253, 248, 0.28);
  --transition-time: 820ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  transition:
    background-color var(--transition-time) ease,
    color var(--transition-time) ease;
}

body[data-palette="blue"] {
  color-scheme: dark;
  --background: #071d49;
  --foreground: #fffdf8;
  --accent: #8eb8ff;
  --muted: rgba(255, 253, 248, 0.68);
  --line: rgba(255, 253, 248, 0.28);
}

body[data-palette="pink"] {
  color-scheme: light;
  --background: #f3c7d5;
  --foreground: #3c1020;
  --accent: #a31343;
  --muted: rgba(60, 16, 32, 0.66);
  --line: rgba(60, 16, 32, 0.24);
}

body[data-palette="green"] {
  color-scheme: dark;
  --background: #154934;
  --foreground: #fffdf8;
  --accent: #b8e3a1;
  --muted: rgba(255, 253, 248, 0.68);
  --line: rgba(255, 253, 248, 0.28);
}

body[data-palette="red"] {
  color-scheme: dark;
  --background: #781127;
  --foreground: #fffdf8;
  --accent: #ffb6c5;
  --muted: rgba(255, 253, 248, 0.72);
  --line: rgba(255, 253, 248, 0.3);
}

body[data-palette="white"] {
  color-scheme: light;
  --background: #fffdf8;
  --foreground: #111a31;
  --accent: #ad123f;
  --muted: rgba(17, 26, 49, 0.64);
  --line: rgba(17, 26, 49, 0.2);
}

button {
  color: inherit;
  font: inherit;
}

button:disabled {
  cursor: default;
  opacity: 0.32;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

[hidden] {
  display: none !important;
}

.experience,
.gate,
.player {
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
}

.gate {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 72px 8vw 64px;
  position: relative;
}

.gate__content {
  max-width: 980px;
  position: relative;
  text-align: center;
  z-index: 2;
}

.gate__kicker,
.scene__kicker {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 0 0 24px;
  text-transform: uppercase;
}

.gate h1,
.scene__title {
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
  margin: 0;
}

.gate h1 {
  font-size: 7.25rem;
  line-height: 0.72;
  text-transform: uppercase;
}

.gate h1 span {
  display: block;
}

.gate h1 span:last-child {
  color: var(--accent);
  font-style: italic;
  margin-left: 1.4em;
}

.gate__copy {
  color: var(--muted);
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: 1.35rem;
  margin: 40px auto 0;
  max-width: 440px;
}

.gate__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  justify-content: center;
  margin-top: 42px;
}

.start-button,
.end-button {
  align-items: center;
  background: var(--foreground);
  border: 1px solid var(--foreground);
  border-radius: 0;
  color: var(--background);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 34px;
  justify-content: center;
  min-height: 52px;
  padding: 14px 20px;
  text-transform: uppercase;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.start-button:hover,
.end-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--background);
  transform: translateY(-2px);
}

.quiet-button,
.end-button--quiet {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 10px 0 8px;
  text-transform: uppercase;
}

.quiet-button:hover,
.end-button--quiet:hover {
  color: var(--foreground);
}

.gate__frame {
  bottom: 48px;
  color: var(--accent);
  display: flex;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: 14rem;
  justify-content: space-between;
  left: 4vw;
  opacity: 0.1;
  pointer-events: none;
  position: absolute;
  right: 4vw;
  top: 28px;
}

.gate__frame span:last-child {
  align-self: end;
}

.player__hud {
  align-items: center;
  display: flex;
  font-size: 0.66rem;
  font-weight: 700;
  justify-content: space-between;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.player {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 94px 7vw 110px;
  position: relative;
}

.player__hud {
  color: var(--muted);
  left: 30px;
  position: absolute;
  right: 30px;
  top: 26px;
  z-index: 8;
}

.player__mark {
  color: var(--foreground);
}

.total-progress {
  background: var(--line);
  height: 1px;
  left: 30px;
  position: absolute;
  right: 30px;
  top: 52px;
  z-index: 8;
}

.total-progress span {
  background: var(--accent);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
}

.scene {
  margin: 0 auto;
  max-width: 1000px;
  position: relative;
  text-align: center;
  width: 100%;
  z-index: 4;
}

.player.has-flower .scene {
  margin-left: 0;
  margin-right: auto;
  max-width: min(54vw, 620px);
  text-align: left;
}

.player.has-flower .scene__body {
  margin-left: 0;
}

.scene__kicker {
  opacity: 1;
}

.scene__title {
  font-size: 5.25rem;
  line-height: 0.98;
  opacity: 1;
  overflow-wrap: anywhere;
}

.scene__body {
  color: var(--muted);
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: 1.5rem;
  line-height: 1.45;
  margin: 34px auto 0;
  max-width: 690px;
}

.scene__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  justify-content: center;
  margin-top: 44px;
  position: relative;
  z-index: 12;
}

.end-button--quiet {
  color: var(--muted);
}

.advance-hitarea {
  background: transparent;
  border: 0;
  bottom: 78px;
  cursor: e-resize;
  left: 0;
  position: absolute;
  right: 0;
  top: 54px;
  z-index: 5;
}

.player__controls {
  align-items: center;
  bottom: 32px;
  display: flex;
  gap: 10px;
  left: 50%;
  opacity: 0.32;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 200ms ease;
  z-index: 14;
}

.player:hover .player__controls,
.player__controls:focus-within,
.player.is-paused .player__controls {
  opacity: 1;
}

.player.is-transitioning .advance-hitarea,
.player.is-transitioning .player__controls {
  pointer-events: none;
}

.player.is-transitioning .scene,
.player.is-transitioning .flower-visual,
.player.is-transitioning .credit-flower {
  will-change: opacity, transform;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--foreground);
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  height: 42px;
  justify-content: center;
  padding: 0;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
  width: 42px;
}

.icon-button:hover {
  background: var(--foreground);
  color: var(--background);
  transform: scale(1.06);
}

.icon-button--primary {
  background: var(--foreground);
  color: var(--background);
  height: 50px;
  width: 50px;
}

.scene-progress {
  bottom: 0;
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 12;
}

.scene-progress span {
  background: var(--accent);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
}

.flower-visual {
  height: min(68vh, 560px);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 5vw;
  top: 50%;
  transform: translate(42px, -45%);
  width: min(34vw, 390px);
  z-index: 3;
}

.player.has-flower .flower-visual {
  opacity: 1;
  transform: translate(0, -50%);
}

.botanical {
  display: block;
  height: 100%;
  overflow: visible;
  width: 100%;
}

.botanical__stem {
  fill: none;
  stroke-linecap: round;
  stroke-width: 8;
}

.botanical__leaf {
  stroke: rgba(4, 57, 37, 0.72);
  stroke-linejoin: round;
  stroke-width: 2;
}

.botanical__leaf-vein {
  fill: none;
  opacity: 0.56;
  stroke: rgba(235, 255, 241, 0.92);
  stroke-linecap: round;
  stroke-width: 2.4;
}

.botanical__petal-shadow {
  opacity: 0.22;
}

.botanical__petal {
  fill-opacity: 0.97;
  stroke-opacity: 0.48;
  stroke-linejoin: round;
  stroke-width: 1.15;
}

.botanical__petal-wash {
  mix-blend-mode: multiply;
  opacity: 0.2;
}

.botanical__petal-vein {
  fill: none;
  opacity: 0.26;
  stroke: rgba(61, 28, 46, 0.68);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.botanical__petal-light {
  fill: none;
  opacity: 0.55;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-width: 5;
}

.botanical__petal-art {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.botanical__disc-base {
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 2;
}

.botanical__disc-seed {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1;
}

.botanical__flower-branch {
  fill: none;
  stroke-linecap: round;
  stroke-width: 5;
}

.botanical__cup-shadow {
  opacity: 0.23;
}

.botanical__beard {
  fill: none;
  stroke: #f4c95b;
  stroke-linecap: round;
  stroke-width: 10;
}

.botanical__lily-spot {
  opacity: 0.67;
}

.botanical__rose-calyx {
  opacity: 0.96;
  stroke: rgba(4, 57, 37, 0.8);
  stroke-linejoin: round;
  stroke-width: 2;
}

.botanical__rose-petal-shadow {
  opacity: 0.24;
}

.botanical__rose-petal {
  fill-opacity: 0.99;
  stroke-opacity: 0.72;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.botanical__rose-petal-fold {
  fill: none;
  opacity: 0.52;
  stroke: rgba(255, 235, 239, 0.9);
  stroke-linecap: round;
  stroke-width: 3.2;
}

.botanical__rose-petal-crease {
  fill: none;
  opacity: 0.38;
  stroke: #740d24;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.botanical__rose-heart {
  fill: none;
  opacity: 0.9;
  stroke-linecap: round;
  stroke-width: 5;
}

.botanical__center-wash {
  opacity: 0.78;
}

.botanical__center {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2;
}

.botanical__stamen {
  fill: none;
  stroke: #087743;
  stroke-linecap: round;
  stroke-width: 3.2;
}

.botanical__anther {
  stroke: #075431;
  stroke-width: 1.4;
}

.botanical__orchid-lip {
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes petal-breathe {
  0%, 100% { transform: rotate(-0.18deg) scaleX(0.998); }
  50% { transform: rotate(0.28deg) scaleX(1.009); }
}

@keyframes botanical-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(0.34deg); }
}

.player.has-flower .botanical__petal-art {
  animation: petal-breathe 7.4s ease-in-out infinite;
  animation-delay: var(--petal-phase);
}

.player.has-flower .botanical__stem-group {
  animation: botanical-sway 7.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.credits-field {
  display: grid;
  gap: 3.6vh 2vw;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  inset: 78px 5vw 92px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

.credits-field.is-visible {
  opacity: 1;
  visibility: visible;
}

.credit-flower {
  align-items: center;
  display: grid;
  gap: 3px;
  justify-items: center;
  opacity: 0.22;
  text-align: center;
}

.credit-flower span {
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: 0.78rem;
}

.credit-flower:nth-child(4n + 1) {
  color: #2454a5;
}

.credit-flower:nth-child(4n + 2) {
  color: #b31240;
}

.credit-flower:nth-child(4n + 3) {
  color: #26714d;
}

.credit-flower:nth-child(4n) {
  color: #ce6689;
}

.botanical--mini {
  height: 62px;
  width: 54px;
}

.botanical--mini .botanical__stem {
  stroke-width: 12;
}

.botanical--mini .botanical__leaf-vein,
.botanical--mini .botanical__petal-light,
.botanical--mini .botanical__petal-vein,
.botanical--mini .botanical__stamen,
.botanical--mini .botanical__anther,
.botanical--mini .botanical__lily-spot {
  display: none;
}

.botanical--mini .botanical__petal-art {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .player.has-flower .botanical__petal-art,
  .player.has-flower .botanical__stem-group {
    animation: none;
  }
}

@media (max-width: 900px) {
  .gate h1 {
    font-size: 5.2rem;
  }

  .gate__frame {
    font-size: 10rem;
  }

  .scene__title {
    font-size: 3.9rem;
  }

  .scene__body {
    font-size: 1.3rem;
  }

  .flower-visual {
    right: 2vw;
    width: min(38vw, 300px);
  }

  .player.has-flower .scene {
    max-width: 56vw;
  }
}

@media (max-width: 600px) {
  .gate {
    padding: 68px 24px 74px;
  }

  .gate h1 {
    font-size: 4rem;
    line-height: 0.8;
  }

  .gate h1 span:last-child {
    margin-left: 0.75em;
  }

  .gate__copy {
    font-size: 1.12rem;
    margin-top: 32px;
  }

  .gate__actions {
    flex-direction: column;
    margin-top: 36px;
  }

  .start-button {
    min-width: 190px;
  }

  .gate__frame {
    bottom: 82px;
    font-size: 7rem;
    left: 18px;
    right: 18px;
    top: 20px;
  }

  .player {
    padding: 84px 24px 102px;
  }

  .player__hud {
    left: 20px;
    right: 20px;
    top: 21px;
  }

  .total-progress {
    left: 20px;
    right: 20px;
    top: 47px;
  }

  .scene__kicker {
    margin-bottom: 18px;
  }

  .scene__title {
    font-size: 2.8rem;
    line-height: 1.02;
  }

  .scene__body {
    font-size: 1.14rem;
    line-height: 1.42;
    margin-top: 26px;
  }

  .scene__actions {
    flex-direction: column;
    margin-top: 34px;
  }

  .flower-visual {
    height: 430px;
    left: 50%;
    right: auto;
    top: 58px;
    transform: translate(-50%, -12px) scale(0.78);
    transform-origin: top center;
    width: 300px;
  }

  .player.has-flower .flower-visual {
    opacity: 0.88;
    transform: translate(-50%, 0) scale(0.78);
  }

  .player.has-flower .scene {
    margin-left: auto;
    max-width: 100%;
    text-align: center;
    transform: translateY(92px);
  }

  .player.has-flower .scene__body {
    margin-left: auto;
  }

  .player__controls {
    bottom: 26px;
    opacity: 0.65;
  }

  .advance-hitarea {
    bottom: 72px;
  }

  .credits-field {
    gap: 2.2vh 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    inset: 72px 12px 84px;
  }

  .credit-flower span {
    display: none;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .gate {
    padding-bottom: 44px;
    padding-top: 46px;
  }

  .gate h1 {
    font-size: 4rem;
  }

  .gate__copy {
    font-size: 1rem;
    margin-top: 24px;
  }

  .gate__actions {
    margin-top: 24px;
  }

  .player {
    padding-bottom: 72px;
    padding-top: 64px;
  }

  .scene__title {
    font-size: 3rem;
  }

  .scene__body {
    font-size: 1.05rem;
    margin-top: 18px;
  }

  .player__controls {
    bottom: 12px;
  }

  .flower-visual {
    height: 340px;
    left: auto;
    right: 2vw;
    top: 50%;
    transform: translate(20px, -46%) scale(0.66);
    transform-origin: center;
    width: 240px;
  }

  .player.has-flower .flower-visual {
    transform: translate(0, -50%) scale(0.66);
  }

  .player.has-flower .scene {
    margin-left: 0;
    max-width: 62vw;
    text-align: left;
    transform: none;
  }

  .player.has-flower .scene__body {
    margin-left: 0;
  }
}

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

  .scene__kicker,
  .scene__title {
    opacity: 1;
    transform: none;
  }
}
