:root {
  color-scheme: dark;
  --paper: #f0f0eb;
  --muted: rgba(222, 227, 223, 0.58);
  --mono: "Space Mono", "Courier New", monospace;
  --serif: "Cormorant Garamond", "Baskerville", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #030506;
}

body {
  overflow: hidden;
  color: var(--paper);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button {
  color: inherit;
  font: inherit;
}

.scene {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 19%, rgba(77, 100, 104, 0.12), transparent 46%),
    #030506;
}

#architecture,
.film-grain,
.edge-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#architecture {
  z-index: -3;
  display: block;
}

.film-grain {
  z-index: -2;
  pointer-events: none;
  opacity: 0.13;
  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='.32'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.edge-shade {
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 4, 5, 0.02) 0%, transparent 35%, rgba(2, 4, 5, 0.34) 57%, #030506 100%),
    radial-gradient(ellipse at 50% 44%, transparent 28%, rgba(1, 3, 4, 0.32) 100%);
}

.title-lockup {
  position: absolute;
  top: 66.3%;
  left: 50%;
  width: min(94vw, 660px);
  transform: translate(-50%, 0);
  text-align: center;
  user-select: none;
  animation: arrive 1.5s cubic-bezier(0.2, 0.65, 0.25, 1) both;
}

.day-count {
  margin: 0;
  color: #f0f1ec;
  font-family: var(--serif);
  font-size: clamp(5.6rem, 15.1vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.79;
  text-shadow: 0 0 35px rgba(230, 237, 234, 0.13), 0 2px 22px rgba(0, 0, 0, 0.8);
}

.together {
  margin: 0.18em 0 0;
  color: rgba(244, 242, 234, 0.92);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 4.2vw, 2.05rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.8);
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  margin: clamp(1.55rem, 4.7vh, 3.1rem) 0 0;
  color: rgba(230, 233, 227, 0.72);
  font-family: var(--mono);
  font-size: clamp(0.49rem, 1.2vw, 0.68rem);
  font-weight: 400;
  letter-spacing: 0.24em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 12px #000;
}

.date-line time {
  color: rgba(242, 244, 236, 0.9);
}

.divider {
  margin: 0 -0.45em;
  color: rgba(237, 224, 210, 0.76);
}

.enter-button {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-top: clamp(1.8rem, 5vh, 3.2rem);
  padding: 0.5rem 0.85rem 1rem;
  border: 0;
  background: transparent;
  color: rgba(246, 246, 238, 0.92);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.45em;
  line-height: 1;
  text-transform: uppercase;
  transition: color 240ms ease, transform 240ms ease;
  pointer-events: auto;
}

.enter-button i {
  display: block;
  width: 26px;
  height: 1px;
  background: rgba(226, 231, 222, 0.72);
  transform-origin: center;
  transition: width 260ms ease, background 260ms ease;
}

.enter-button:hover,
.enter-button:focus-visible {
  color: #fff;
  outline: none;
  transform: translateY(2px);
}

.enter-button:hover i,
.enter-button:focus-visible i {
  width: 46px;
  background: #f1e6d4;
}

.enter-button:focus-visible::after,
.close-button:focus-visible::after,
.return-button:focus-visible::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(236, 223, 205, 0.65);
  border-radius: 2px;
  content: "";
  pointer-events: none;
}

.memory-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(2rem, 9vw, 8rem);
  border: 0;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(52, 74, 79, 0.35), transparent 45%),
    linear-gradient(180deg, #05090b, #020304 76%);
  color: var(--paper);
  opacity: 0;
  text-align: center;
  transition: opacity 420ms ease;
}

.memory-dialog[open] {
  display: grid;
  align-content: center;
  justify-items: center;
  opacity: 1;
}

.memory-dialog::backdrop {
  background: #030506;
}

.close-button {
  position: absolute;
  top: clamp(1.3rem, 4vw, 3rem);
  right: clamp(1.3rem, 4vw, 3rem);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(221, 230, 226, 0.24);
  border-radius: 50%;
  background: transparent;
  color: rgba(235, 239, 232, 0.82);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.close-button:hover {
  border-color: rgba(240, 224, 204, 0.7);
  color: #fff;
  transform: rotate(90deg);
}

.dialog-eyebrow,
.dialog-date,
.return-button {
  font-family: var(--mono);
  text-transform: uppercase;
}

.dialog-eyebrow {
  margin: 0 0 2rem;
  color: rgba(224, 231, 225, 0.58);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
}

.memory-dialog h1 {
  margin: 0;
  font-size: clamp(3.25rem, 10vw, 7.5rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

.dialog-copy {
  max-width: 35rem;
  margin: 2rem auto 0;
  color: rgba(232, 234, 226, 0.68);
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  font-style: italic;
  line-height: 1.35;
}

.dialog-date {
  margin: 2.6rem 0 0;
  color: rgba(224, 231, 225, 0.76);
  font-size: 0.59rem;
  letter-spacing: 0.24em;
}

.return-button {
  position: relative;
  margin-top: 2.8rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid rgba(222, 228, 219, 0.35);
  background: transparent;
  color: rgba(245, 243, 235, 0.9);
  cursor: pointer;
  font-size: 0.57rem;
  letter-spacing: 0.2em;
  transition: border-color 180ms ease, background 180ms ease;
}

.return-button:hover {
  border-color: rgba(239, 226, 208, 0.75);
  background: rgba(237, 228, 210, 0.06);
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 600px) {
  .scene {
    min-height: 580px;
  }

  .title-lockup {
    top: 64.5%;
    width: 100%;
  }

  .day-count {
    font-size: clamp(5.4rem, 25vw, 8rem);
  }

  .date-line {
    gap: 0.58em;
    font-size: clamp(0.44rem, 2.25vw, 0.62rem);
    letter-spacing: 0.15em;
  }

  .enter-button {
    margin-top: 1.6rem;
  }

  .memory-dialog {
    padding: 2rem 1.35rem;
  }

  .dialog-eyebrow {
    font-size: 0.48rem;
    letter-spacing: 0.22em;
  }
}

@media (min-aspect-ratio: 4/3) {
  .title-lockup {
    top: 64.5%;
    width: min(92vw, 49vh);
  }

  .day-count {
    font-size: clamp(4.3rem, 12vh, 8rem);
  }

  .together {
    font-size: clamp(1.3rem, 3.3vh, 2.05rem);
  }

  .date-line {
    gap: 0.72em;
    font-size: clamp(0.47rem, 0.72vh, 0.68rem);
    letter-spacing: 0.19em;
  }

  .enter-button {
    margin-top: clamp(1rem, 3vh, 2rem);
  }
}

@media (max-height: 690px) and (min-width: 601px) {
  .title-lockup {
    top: 60%;
  }

  .day-count {
    font-size: clamp(4.5rem, 12vw, 7rem);
  }

  .date-line {
    margin-top: 1.15rem;
  }

  .enter-button {
    margin-top: 1.2rem;
  }
}

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