:root {
  color-scheme: dark;
  font-family: "Montserrat", sans-serif;
  background: #030303;
  color: #f6eee3;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030303;
}

body {
  min-height: 100svh;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  width: 100%;
  height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(89, 7, 13, 0.17) 0, transparent 34%),
    linear-gradient(180deg, #050505 0%, #010101 100%);
}

.experience::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), transparent 31%, transparent 69%, rgba(0, 0, 0, 0.35)),
    radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.62) 100%);
}

.experience::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  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='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

#rose-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  touch-action: none;
}

.ambient-glow {
  position: absolute;
  z-index: -1;
  top: 17%;
  left: 50%;
  width: min(47vw, 650px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(126, 0, 13, 0.18);
  filter: blur(90px);
  animation: breathe 5s ease-in-out infinite;
}

.rose-flash {
  position: absolute;
  z-index: 1;
  width: min(85vw, 720px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fff2d9cc 0%, #ffc49088 9%, #f05a6b55 25%, #bd183222 45%, transparent 68%);
  mix-blend-mode: screen;
  filter: blur(12px);
}

.hero-copy {
  position: absolute;
  z-index: 2;
  top: clamp(40px, 8vh, 90px);
  left: clamp(28px, 7vw, 110px);
  max-width: 420px;
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  color: #b69a75;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 34px;
  height: 1px;
  content: "";
  background: #8e7352;
}

.eyebrow--quote {
  font-size: 9px;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(56px, 7vw, 108px);
  font-weight: 400;
  line-height: 0.72;
  letter-spacing: -0.055em;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.8);
}

h1 em {
  position: relative;
  left: clamp(30px, 4vw, 66px);
  color: #bc1829;
  font-weight: 400;
}

h1.dedication {
  font-size: clamp(46px, 5.4vw, 82px);
  line-height: 0.8;
}

h1.dedication em {
  left: clamp(24px, 3vw, 48px);
}

.countdown {
  width: 360px;
  margin: 34px 0 0 4px;
  padding-top: 13px;
  border-top: 1px solid rgba(182, 154, 117, 0.22);
}

.countdown__caption {
  margin: 0 0 9px;
  color: rgba(182, 154, 117, 0.58);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.countdown__values {
  display: flex;
  align-items: center;
  gap: 13px;
}

.countdown__values p {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
}

.countdown__values strong {
  min-width: 30px;
  color: rgba(246, 238, 227, 0.86);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown__values span {
  color: rgba(246, 238, 227, 0.34);
  font-size: 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.countdown__values i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #8e7352;
  box-shadow: 0 0 7px rgba(182, 154, 117, 0.65);
}

.interaction-hint {
  position: absolute;
  z-index: 5;
  right: clamp(24px, 5vw, 76px);
  bottom: clamp(30px, 6vh, 64px);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: opacity 500ms ease, transform 500ms ease;
  pointer-events: none;
}

.interaction-hint.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.interaction-hint p {
  margin: 0;
}

.interaction-hint strong,
.interaction-hint small {
  display: block;
}

.interaction-hint strong {
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.interaction-hint small {
  color: rgba(255, 255, 255, 0.31);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 13px;
  font-style: italic;
}

.drag-icon {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(182, 154, 117, 0.24);
  border-radius: 50%;
}

.drag-icon::before,
.drag-icon::after {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  content: "";
  border-top: 1px solid #a58a67;
  border-left: 1px solid #a58a67;
}

.drag-icon::before {
  left: 8px;
  transform: translateY(-50%) rotate(-45deg);
}

.drag-icon::after {
  right: 8px;
  transform: translateY(-50%) rotate(135deg);
}

.drag-icon span {
  width: 14px;
  height: 1px;
  background: #a58a67;
  animation: drag 1.8s ease-in-out infinite;
}

.reset-view {
  position: absolute;
  z-index: 6;
  right: clamp(24px, 5vw, 76px);
  top: clamp(28px, 6vh, 60px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: rgba(255, 255, 255, 0.47);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  background: rgba(10, 10, 10, 0.28);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.reset-view:hover,
.reset-view:focus-visible {
  color: #dec8aa;
  border-color: rgba(182, 154, 117, 0.45);
  background: rgba(34, 24, 23, 0.5);
  outline: none;
}

.reset-view svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audio-toggle {
  position: absolute;
  z-index: 6;
  top: calc(clamp(28px, 6vh, 60px) + 46px);
  right: clamp(24px, 5vw, 76px);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid rgba(182, 154, 117, 0.18);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.28);
  color: rgba(222, 200, 170, 0.5);
  backdrop-filter: blur(8px);
  cursor: pointer;
  touch-action: manipulation;
  transition: color 200ms, border-color 200ms, background 200ms;
}
.audio-toggle:hover, .audio-toggle:focus-visible {
  color: #dec8aa;
  border-color: rgba(182, 154, 117, 0.5);
  background: rgba(34, 24, 23, 0.5);
}
.audio-toggle:focus-visible { outline: 1px solid #b69a75; outline-offset: 4px; }
.audio-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.audio-toggle[data-sounding="false"] .audio-toggle__waves,
.audio-toggle[data-sounding="true"] .audio-toggle__silent { display: none; }

.loading,
.fallback {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 42px;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.38);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.06em;
  transition: opacity 600ms ease;
}

.loading.is-hidden {
  opacity: 0;
}

.fallback {
  width: min(86vw, 480px);
  text-align: center;
}

.memories {
  position: absolute;
  z-index: 6;
  left: clamp(28px, 7vw, 110px);
  bottom: clamp(35px, 7vh, 76px);
  width: min(440px, 38vw);
}

.memories__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memories__heading .eyebrow {
  margin: 0;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.memories__heading .eyebrow::before { width: 20px; }
.memories__count {
  flex-shrink: 0;
  color: #a58a67;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.memories__guide {
  margin: 12px 0 20px;
  color: #ad9785;
  font: italic 17px/1.4 "Cormorant Garamond", Georgia, serif;
}
.memories__accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.memory-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 12px 24px;
  border: 1px solid #cf92706b;
  border-radius: 7px;
  background: linear-gradient(175deg, #862438 0%, #55101d 52%, #350910 100%);
  color: #f4dfc7;
  box-shadow: inset 0 1px 0 #f4c5a652, inset 0 -1px 0 #190306, 0 5px 0 #21060b, 0 6px 0 #a1694b66, 0 10px 25px #0009, 0 0 28px #bd1a3445;
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-shadow: 0 1px 3px #21060b;
  transition: transform 180ms, box-shadow 180ms, filter 180ms;
}
.memory-button span { color: #e8b794; font-size: 20px; line-height: 1; }
.memory-button:hover { transform: translateY(-2px); filter: brightness(1.15); box-shadow: inset 0 1px 0 #f4c5a652, 0 7px 0 #21060b, 0 8px 0 #a1694b66, 0 12px 28px #0009, 0 0 42px #d72c5066; }
.memory-button:active { transform: translateY(4px); box-shadow: inset 0 1px 5px #0008, 0 1px 0 #21060b, 0 0 30px #bd1a3455; }
.memory-button:focus-visible, .memories button:focus-visible, .memory-dialog button:focus-visible {
  outline: 2px solid #dcb991;
  outline-offset: 5px;
}
.memories__status { margin: 12px 0 0; color: #b69a75; font-size: 10px; }
.memories__status:empty { display: none; }

.secret-word {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-shadow: inherit;
  pointer-events: auto;
  cursor: text;
  touch-action: manipulation;
  user-select: none;
}
.secret-word:focus-visible { outline: 1px solid #b69a75; outline-offset: 5px; }
.memory-manager__list { display: grid; gap: 10px; padding: 0; margin: 22px 0; list-style: none; }
.memory-manager__list li { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid #b69a752b; border-radius: 5px; background: #07040466; }
.memory-manager__list span { flex: 1; min-width: 0; overflow-wrap: anywhere; font: italic 19px/1.3 "Cormorant Garamond", Georgia, serif; color: #dec8aa; }
.memory-manager__list button { flex-shrink: 0; min-height: 40px; padding: 8px 12px; border: 1px solid #b85c6c66; border-radius: 4px; background: #55101d55; color: #efadbb; font-size: 10px; cursor: pointer; }
.memory-manager__list button:hover { background: #86243888; }
.memory-manager .memory-button:disabled { opacity: 0.4; cursor: default; transform: none; }
.memory-manager__tools { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.memory-manager__tools button { padding: 8px 0; border: 0; background: none; color: #b69a75; font-size: 10px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.memory-button:disabled { opacity: 0.45; cursor: wait; transform: none; }

.memory-dialog {
  width: min(480px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  padding: 38px 30px 28px;
  border: 1px solid #b69a754d;
  border-radius: 12px;
  background: radial-gradient(ellipse at top right, #53122155, transparent 70%), #100a0b;
  color: #f6eee3;
  box-shadow: 0 30px 100px #000b, 0 0 65px #86152a26;
}
.memory-dialog::backdrop { background: #000a; backdrop-filter: blur(9px); }
.memory-dialog__close { position: absolute; top: 10px; right: 14px; width: 32px; height: 32px; border: 0; background: transparent; color: #b69a75; font-size: 26px; cursor: pointer; }
.memory-dialog .eyebrow { font-size: 7px; letter-spacing: 0.15em; }
.memory-dialog h2 { margin: 14px 0; font: 400 38px/1 "Cormorant Garamond", Georgia, serif; }
.memory-dialog h2 em { color: #cf5368; }
.memory-dialog p:not(.eyebrow) { color: #b5a093; font-size: 11px; line-height: 1.7; }
.memory-dialog label { display: block; margin: 25px 0 10px; color: #dec8aa; font-size: 10px; letter-spacing: 0.08em; }
.memory-dialog input { width: 100%; min-width: 0; padding: 14px; border: 1px solid #b69a7540; border-radius: 5px; background: #06040499; color: #f6eee3; font: 16px "Cormorant Garamond", Georgia, serif; }
.memory-dialog input:focus { outline: 1px solid #c98c68; border-color: #c98c68; }
.memory-dialog input::placeholder { color: #8e7770; }
.memory-dialog__length { margin: 6px 0 22px; text-align: right; }
.memory-dialog .memory-button { width: 100%; }
.memory-dialog__note { margin: 18px 0 0; text-align: center; }
[hidden] { display: none !important; }

@keyframes breathe {
  0%,
  100% { opacity: 0.55; transform: translateX(-50%) scale(0.92); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

@keyframes drag {
  0%,
  100% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
}

@media (max-width: 720px) {
  .memories {
    left: 25px;
    bottom: 90px;
    width: calc(100% - 50px);
  }
  .memories__heading .eyebrow { font-size: 7px; }
  .memories__guide { font-size: 15px; }
  .memory-button { min-height: 42px; padding: 10px 20px; }

  .hero-copy {
    top: 34px;
    left: 25px;
  }

  .eyebrow {
    margin-bottom: 11px;
    font-size: 8px;
  }

  .eyebrow--quote {
    max-width: 275px;
    font-size: 7.5px;
    letter-spacing: 0.12em;
  }

  h1 {
    font-size: clamp(48px, 16vw, 72px);
  }

  h1.dedication {
    font-size: clamp(39px, 11vw, 53px);
    line-height: 0.84;
  }

  h1 em {
    left: 26px;
  }

  .countdown {
    width: calc(100vw - 50px);
    margin-top: 20px;
    padding-top: 10px;
  }

  .countdown__values {
    gap: 7px;
  }

  .countdown__values p {
    gap: 3px;
  }

  .countdown__values strong {
    min-width: 25px;
    font-size: 21px;
  }

  .interaction-hint {
    right: 50%;
    bottom: 24px;
    transform: translateX(50%);
  }

  .interaction-hint.is-hidden {
    transform: translate(50%, 8px);
  }

  .interaction-hint small {
    white-space: nowrap;
  }

  .reset-view {
    top: 28px;
    right: 22px;
    padding: 9px;
  }

  .audio-toggle { top: 74px; right: 22px; }

  .reset-view:not(:focus) {
    font-size: 0;
    letter-spacing: 0;
  }

  .reset-view svg {
    width: 15px;
    height: 15px;
  }
}

@media (max-height: 600px) {
  .hero-copy { top: 24px; }
  h1.dedication { font-size: 38px; }
  .countdown { margin-top: 16px; padding-top: 8px; }
  .memories { bottom: 24px; }
  .interaction-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .memory-button { transition: none; }
  .ambient-glow,
  .drag-icon span {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
