:root {
  --putty: #c4c3b6;
  --paper: #f2eee7;
  --parchment: #f6f0e1;
  --bone: #e7e5df;
  --vellum: #d7d2ca;
  --ink: #201714;
  --brown: #59463b;
  --muted: #6c625b;
  --cherry: #760014;
  --oxblood: #4a0c12;
  --white: #fffdfa;
  --rule: rgba(32, 23, 20, 0.22);
  --display: "Playfair Display", Georgia, serif;
  --utility: "Archivo", "Helvetica Neue", Helvetica, sans-serif;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(22px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  color: var(--ink);
  font-family: var(--utility);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  z-index: 50;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

button {
  color: inherit;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -64px;
  left: 8px;
  display: grid;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  transform: none;
  transition: top 120ms ease;
  place-items: center;
}

.skip-link:focus-visible {
  top: 8px;
}

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--putty);
  overflow: hidden;
}

.view {
  display: none;
  min-height: 100svh;
}

.view.is-active {
  display: block;
  animation: view-in 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes view-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.minimal-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: var(--safe-top) 20px 0;
  font-size: 13px;
}

.minimal-header p {
  margin: 0;
}

.monogram {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 18px;
  place-items: center;
}

.chapter-mark,
.sequence-number {
  margin: 0;
  font-family: var(--utility);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lock-view {
  position: relative;
  min-height: 100svh;
  padding-bottom: calc(var(--safe-bottom) + 22px);
  background: var(--putty);
  overflow: hidden;
}

.lock-copy {
  position: relative;
  z-index: 2;
  padding: clamp(54px, 10svh, 90px) 24px 0;
}

.lock-copy h1 {
  max-width: 340px;
  margin: 20px 0 16px;
  font-family: var(--display);
  font-size: clamp(48px, 13vw, 70px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.93;
  text-wrap: balance;
}

.lock-hint {
  max-width: 270px;
  margin: 0;
  color: var(--brown);
  font-size: 15px;
  line-height: 1.55;
}

.pin-panel {
  position: relative;
  z-index: 2;
  margin-top: clamp(36px, 6svh, 64px);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.pin-dots span {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.pin-dots span.is-filled {
  border-color: var(--cherry);
  background: var(--cherry);
  transform: scale(1.08);
}

.pin-dots.is-error {
  animation: shake 360ms ease both;
}

@keyframes shake {
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(3px);
  }
}

.pin-status {
  min-height: 18px;
  margin: 13px 0 4px;
  color: var(--brown);
  font-size: 12px;
  text-align: center;
}

.pin-status.is-error {
  color: var(--cherry);
}

.keypad {
  display: grid;
  width: min(100%, 330px);
  margin: 13px auto 0;
  padding: 0 20px;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px 28px;
}

.keypad button,
.keypad-spacer {
  display: grid;
  min-width: 64px;
  min-height: 58px;
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  place-items: center;
  transition:
    color 140ms ease,
    background-color 140ms ease;
}

.keypad button:active {
  color: var(--white);
  background: var(--cherry);
}

.keypad button:focus-visible,
.text-action:focus-visible,
.icon-action:focus-visible,
.surprise-item--available:focus-visible,
.begin-button:focus-visible,
.spotify-button:focus-visible {
  outline: 2px solid var(--cherry);
  outline-offset: 4px;
}

.keypad svg {
  width: 25px;
  height: 25px;
}

.lock-footnote {
  position: relative;
  z-index: 2;
  margin: 16px 0 0;
  color: var(--brown);
  font-family: var(--display);
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

.oversized-word {
  position: absolute;
  z-index: 0;
  right: -34px;
  bottom: -36px;
  color: rgba(32, 23, 20, 0.055);
  font-family: var(--display);
  font-size: clamp(138px, 43vw, 230px);
  font-weight: 500;
  letter-spacing: -0.09em;
  line-height: 0.72;
  pointer-events: none;
}

.unlock-curtain {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  color: var(--white);
  background: var(--cherry);
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 48px);
  font-style: italic;
  text-align: center;
  pointer-events: none;
  place-items: center;
  transform: translateY(105%);
  visibility: hidden;
}

.unlock-curtain.is-opening {
  animation: curtain-open 1450ms cubic-bezier(0.77, 0, 0.18, 1) both;
  pointer-events: auto;
  visibility: visible;
}

@keyframes curtain-open {
  0% {
    transform: translateY(105%);
  }
  38%,
  64% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-105%);
  }
}

.vault-view {
  padding-bottom: var(--safe-bottom);
  background: var(--paper);
}

.vault-header {
  border-bottom: 1px solid var(--rule);
}

.text-action,
.icon-action {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-action {
  min-width: 48px;
  min-height: 44px;
  padding: 0;
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.vault-intro {
  padding: clamp(70px, 12svh, 120px) 22px 72px;
  background: var(--putty);
}

.vault-intro h1 {
  max-width: 430px;
  margin: 25px 0 24px;
  font-family: var(--display);
  font-size: clamp(50px, 14vw, 76px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.92;
  text-wrap: balance;
}

.vault-intro > p:last-child {
  max-width: 315px;
  margin: 0 0 0 auto;
  color: var(--brown);
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

.surprise-list {
  border-top: 1px solid var(--ink);
}

.surprise-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 132px;
  margin: 0;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  text-align: left;
  grid-template-columns: 34px 1fr auto;
  gap: 15px;
  align-items: center;
}

button.surprise-item {
  cursor: pointer;
}

.surprise-item--available {
  min-height: 168px;
  grid-template-columns: 34px 94px 1fr 26px;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.surprise-item--available:active {
  color: var(--white);
  background: var(--cherry);
}

.surprise-number {
  align-self: start;
  padding-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.surprise-item--available:active .surprise-number,
.surprise-item--available:active .surprise-copy span {
  color: rgba(255, 253, 250, 0.72);
}

.surprise-thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}

.surprise-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.surprise-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.surprise-copy strong {
  font-family: var(--display);
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
}

.surprise-copy span {
  color: var(--muted);
  font-size: 12px;
}

.arrow-icon {
  width: 24px;
  height: 24px;
}

.surprise-item--sealed {
  color: rgba(32, 23, 20, 0.72);
}

.seal-mark {
  display: grid;
  width: 48px;
  height: 48px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  font-style: italic;
  place-items: center;
  transform: rotate(-8deg);
}

.vault-footer {
  display: flex;
  min-height: 180px;
  padding: 30px 20px var(--safe-bottom);
  color: var(--muted);
  background: var(--bone);
  font-size: 12px;
  line-height: 1.5;
  justify-content: space-between;
  align-items: flex-end;
}

.vault-footer p {
  max-width: 210px;
  margin: 0;
}

.album-view {
  background: var(--paper);
}

.story-progress {
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(32, 23, 20, 0.12);
}

.story-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cherry);
  transform-origin: left center;
}

.album-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  display: grid;
  width: 100%;
  min-height: 76px;
  padding: var(--safe-top) 16px 0;
  color: var(--ink);
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
}

.album-header p {
  margin: 0;
  font-size: 12px;
  text-align: center;
}

.icon-action {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
}

.icon-action svg {
  width: 24px;
  height: 24px;
}

.story-section {
  position: relative;
  min-height: 100svh;
}

.cover-scene {
  display: flex;
  padding: calc(var(--safe-top) + 104px) 22px calc(var(--safe-bottom) + 24px);
  background: var(--putty);
  flex-direction: column;
  justify-content: center;
}

.cover-frame {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(32, 23, 20, 0.44);
  background: var(--bone);
  overflow: hidden;
}

.album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 9px;
  color: var(--white);
  background: var(--oxblood);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cover-meta {
  display: grid;
  width: min(100%, 430px);
  margin: 22px auto 0;
  grid-template-columns: 1fr;
  gap: 10px;
}

.cover-meta h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(45px, 12vw, 66px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.cover-meta p {
  max-width: 300px;
  margin: 0;
  color: var(--brown);
  font-size: 13px;
  line-height: 1.5;
}

.begin-button {
  display: flex;
  min-height: 48px;
  margin: 30px auto 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  gap: 12px;
  align-items: center;
}

.begin-button svg {
  width: 18px;
  height: 18px;
}

.declaration {
  display: flex;
  min-height: 115svh;
  padding: 84px 22px 70px;
  flex-direction: column;
  justify-content: space-between;
}

.declaration--ink {
  color: var(--white);
  background: var(--ink);
}

.declaration--red {
  min-height: 100svh;
  color: var(--white);
  background: var(--cherry);
}

.declaration blockquote {
  max-width: 520px;
  margin: auto 0;
  font-family: var(--display);
  font-size: clamp(52px, 14vw, 82px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.94;
  text-wrap: balance;
}

.declaration > p:last-child {
  max-width: 315px;
  margin: 0 0 0 auto;
  color: rgba(255, 253, 250, 0.7);
  font-size: 14px;
  line-height: 1.65;
}

.vignette-section {
  display: grid;
  min-height: 100svh;
  padding: 82px 20px;
  background: var(--parchment);
  place-items: center;
}

.vignette-section--dark {
  color: var(--white);
  background: var(--ink);
}

.motion-vignette {
  width: 100%;
  margin: 0;
}

.motion-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--brown);
  overflow: hidden;
}

.motion-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: slow-drift 11s ease-in-out infinite alternate;
}

@keyframes slow-drift {
  from {
    transform: scale(1.015) translate3d(-0.4%, 0, 0);
  }
  to {
    transform: scale(1.075) translate3d(0.7%, -0.7%, 0);
  }
}

.film-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.16;
  animation: grain-shift 650ms steps(2) infinite;
}

@keyframes grain-shift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1%, 1%);
  }
  50% {
    transform: translate(1%, -1%);
  }
  75% {
    transform: translate(1%, 1%);
  }
}

.motion-vignette figcaption {
  max-width: 330px;
  margin: 18px 0 0 auto;
  font-family: var(--display);
  font-size: 20px;
  font-style: italic;
  line-height: 1.35;
  text-align: right;
  text-wrap: pretty;
}

.letter-scene {
  display: flex;
  min-height: 110svh;
  padding: 84px 22px 72px;
  background: var(--paper);
  flex-direction: column;
}

.large-letter {
  max-width: 520px;
  margin: auto 0;
  font-family: var(--display);
  font-size: clamp(48px, 13vw, 76px);
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-wrap: balance;
}

.letter-body {
  max-width: 315px;
  margin: 0 0 0 auto;
  color: var(--brown);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: pretty;
}

.letter-scene--final {
  background: var(--putty);
}

.finale-scene {
  display: flex;
  min-height: 130svh;
  padding: 86px 22px calc(var(--safe-bottom) + 34px);
  color: var(--white);
  background: var(--ink);
  flex-direction: column;
  justify-content: center;
}

.finale-kicker {
  margin: 0 auto 28px;
  font-family: var(--display);
  font-size: 22px;
  font-style: italic;
}

.cover-frame--final {
  border-color: rgba(255, 253, 250, 0.4);
}

.finale-copy {
  width: min(100%, 430px);
  margin: 22px auto 0;
}

.finale-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 12vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.finale-copy p {
  margin: 12px 0 0;
  color: rgba(255, 253, 250, 0.7);
  font-size: 13px;
}

.spotify-button {
  display: flex;
  width: min(100%, 430px);
  min-height: 54px;
  margin: 34px auto 0;
  padding: 0 20px;
  border: 1px solid var(--white);
  border-radius: 28.8px;
  color: var(--ink);
  background: var(--white);
  font-size: 14px;
  text-decoration: none;
  gap: 12px;
  justify-content: center;
  align-items: center;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.spotify-button svg {
  width: 23px;
  height: 23px;
}

.spotify-button:not(.is-disabled):active {
  color: var(--white);
  background: transparent;
}

.spotify-button.is-disabled {
  color: rgba(255, 253, 250, 0.58);
  background: transparent;
  cursor: not-allowed;
}

.sign-off {
  margin: 55px auto 0;
  color: rgba(255, 253, 250, 0.56);
  font-family: var(--display);
  font-size: 15px;
  font-style: italic;
  text-align: center;
}

.reveal-on-scroll > * {
  opacity: 0.001;
  transform: translateY(14px);
  transition:
    opacity 850ms ease,
    transform 850ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: calc(var(--safe-bottom) + 12px);
  left: 18px;
  padding: 13px 16px;
  color: var(--white);
  background: var(--oxblood);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 620px) {
  .app-shell {
    max-width: 560px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .story-progress,
  .album-header {
    right: 0;
    left: 50%;
    width: min(560px, 100%);
    transform: translateX(-50%);
  }

  .unlock-curtain {
    right: auto;
    left: 50%;
    width: min(560px, 100%);
    transform: translate(-50%, 105%);
  }

  .unlock-curtain.is-opening {
    animation-name: curtain-open-wide;
  }

  @keyframes curtain-open-wide {
    0% {
      transform: translate(-50%, 105%);
    }
    38%,
    64% {
      transform: translate(-50%, 0);
    }
    100% {
      transform: translate(-50%, -105%);
    }
  }
}

@media (max-height: 710px) {
  .lock-copy {
    padding-top: 36px;
  }

  .lock-copy h1 {
    font-size: 42px;
  }

  .pin-panel {
    margin-top: 24px;
  }

  .keypad button,
  .keypad-spacer {
    min-height: 48px;
  }

  .lock-footnote {
    margin-top: 8px;
  }
}

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

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

  .reveal-on-scroll > * {
    opacity: 1;
    transform: none;
  }
}
