:root {
  --midnight: #091126;
  --temple: #17110c;
  --stone: #3a2c22;
  --sand: #c9964a;
  --papyrus: #ead59f;
  --papyrus-light: #e2c98d;
  --gold: #f2c75c;
  --amber: #e58d2e;
  --ink: #2c2018;
  --soft: rgba(214, 187, 126, .72);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--midnight);
  color: var(--papyrus-light);
  font-family: Marcellus, Georgia, serif;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(6, 10, 25, .94), rgba(18, 12, 7, .96)),
    repeating-linear-gradient(90deg, rgba(255, 217, 127, .04) 0 2px, transparent 2px 34px);
}

button { font: inherit; }

a { color: inherit; }

.is-hidden { display: none !important; }

.temple-page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.sample-gift-nav {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: calc(100% - 32px);
  padding: 8px;
  border: 1px solid rgba(242, 199, 92, .18);
  background: rgba(6, 10, 25, .68);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.sample-gift-brand {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border: 1px solid rgba(242, 199, 92, .24);
  color: var(--papyrus-light);
  font-family: Cinzel, Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(255, 242, 211, .08);
}

.sample-gift-brand img {
  width: 32px;
  aspect-ratio: 1;
  display: block;
  border-radius: 50%;
  background: #fff8e8;
  object-fit: cover;
  object-position: center;
  padding: 2px;
}

.sample-gift-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(242, 199, 92, .34);
  color: var(--papyrus-light);
  font-family: Cinzel, Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.sample-gift-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(242, 199, 92, .18);
}

.sample-gift-link.primary {
  background: linear-gradient(180deg, #f0c666, #9d6226);
  color: #160f09;
}

.temple-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 50% 18%, rgba(242, 199, 92, .22), transparent 18rem),
    linear-gradient(90deg, rgba(6, 10, 25, .98), rgba(35, 23, 12, .55) 47%, rgba(6, 10, 25, .98)),
    linear-gradient(180deg, #071025 0%, #111326 42%, #1d120a 100%);
}

.temple-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: .24;
  background:
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(242, 199, 92, .08) 29px 30px),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(234, 213, 159, .06) 43px 44px);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 78%, transparent);
}

.sand-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255, 220, 142, .48) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(229, 141, 46, .28) 0 1px, transparent 1.5px);
  background-position: 0 0, 38px 26px;
  background-size: 96px 96px, 132px 132px;
  animation: drift 18s linear infinite;
  opacity: .28;
}

.start-screen,
.journey-screen {
  min-height: 100svh;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.start-screen {
  display: grid;
  grid-template-columns: minmax(280px, .96fr) minmax(300px, 1.04fr);
  gap: 40px;
  align-items: center;
  padding: 38px 0;
}

.temple-door {
  position: relative;
  min-height: 620px;
  border: 1px solid rgba(242, 199, 92, .28);
  background:
    linear-gradient(90deg, rgba(4, 7, 17, .6), transparent 24%, transparent 76%, rgba(4, 7, 17, .6)),
    linear-gradient(180deg, #2a211a, #0c0b0b);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .72), 0 34px 120px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.temple-door::before {
  content: "";
  position: absolute;
  inset: 5%;
  border: 2px solid rgba(242, 199, 92, .44);
  background:
    linear-gradient(90deg, transparent 48%, rgba(242, 199, 92, .28) 49% 51%, transparent 52%),
    repeating-linear-gradient(90deg, rgba(234, 213, 159, .08) 0 3px, transparent 3px 44px);
}

.door-wing {
  position: absolute;
  inset-block: 0;
  width: 50%;
  background:
    linear-gradient(180deg, rgba(242, 199, 92, .12), transparent 28%, rgba(0, 0, 0, .32)),
    repeating-linear-gradient(0deg, rgba(255, 229, 160, .06) 0 8px, transparent 8px 28px);
  transition: transform .85s cubic-bezier(.2, .8, .2, 1);
}

.door-wing.left { left: 0; transform-origin: left center; border-right: 1px solid rgba(242, 199, 92, .34); }
.door-wing.right { right: 0; transform-origin: right center; border-left: 1px solid rgba(242, 199, 92, .34); }

.door-seal {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 130px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 199, 92, .62);
  border-radius: 50%;
  color: var(--gold);
  font-size: 54px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 70px rgba(242, 199, 92, .24), inset 0 0 32px rgba(242, 199, 92, .1);
}

.opening .door-wing.left { transform: perspective(900px) rotateY(-34deg) translateX(-18%); }
.opening .door-wing.right { transform: perspective(900px) rotateY(34deg) translateX(18%); }
.opening .door-seal { animation: sealOpen .85s ease forwards; }

.start-copy {
  max-width: 640px;
}

.temple-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-family: Cinzel, Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.recipient-name {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 0 0 16px;
  color: #cfb374;
  font-family: Cinzel, Georgia, serif;
  font-size: 76px;
  font-weight: 700;
  line-height: .95;
  text-shadow: 0 2px 0 rgba(242, 199, 92, .24), 0 14px 36px rgba(0, 0, 0, .32);
}

.recipient-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 360px);
  height: 7px;
  background:
    linear-gradient(90deg, rgba(242, 199, 92, .92), rgba(229, 141, 46, .86), transparent),
    repeating-linear-gradient(90deg, rgba(255, 240, 191, .28) 0 10px, transparent 10px 18px);
}

h1,
h2 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 42px;
}

.temple-subtitle {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 21px;
  line-height: 1.6;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.temple-button {
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid rgba(242, 199, 92, .48);
  color: var(--papyrus-light);
  background: rgba(13, 17, 34, .72);
  cursor: pointer;
  font-family: Cinzel, Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.temple-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(242, 199, 92, .18);
}

.temple-button.primary {
  background: linear-gradient(180deg, #f0c666, #9d6226);
  color: #160f09;
}

.journey-screen {
  position: relative;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.temple-depth {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 8, 18, .9) 0 10%, transparent 24% 76%, rgba(5, 8, 18, .9) 90%),
    radial-gradient(circle at 50% 48%, rgba(242, 199, 92, .28), transparent 24rem);
}

.journey-panel {
  width: min(860px, 100%);
  display: grid;
  gap: 24px;
  justify-items: center;
}

.progress-symbols {
  display: flex;
  gap: 12px;
  justify-content: center;
  min-height: 34px;
}

.progress-symbols span {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 199, 92, .22);
  color: rgba(234, 213, 159, .48);
  background: rgba(6, 10, 25, .46);
}

.progress-symbols span.active {
  color: var(--gold);
  border-color: rgba(242, 199, 92, .72);
  box-shadow: 0 0 18px rgba(242, 199, 92, .22);
}

.message-scroll {
  position: relative;
  width: min(780px, 100%);
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 42px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(73, 45, 20, .18), transparent 12%, transparent 88%, rgba(73, 45, 20, .18)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .28), transparent 16rem),
    repeating-linear-gradient(0deg, rgba(70, 40, 18, .08) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #f8e4ac, #d2a768);
  border: 1px solid rgba(242, 199, 92, .58);
  box-shadow: 0 0 80px rgba(242, 199, 92, .16), inset 0 0 44px rgba(92, 52, 20, .22);
}

.message-scroll::before,
.message-scroll::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7b4a20, #f1c46d, #7b4a20);
  box-shadow: 0 8px 22px rgba(48, 25, 9, .28);
}

.message-scroll::before { top: -9px; }
.message-scroll::after { bottom: -9px; }

.scroll-content {
  max-width: 640px;
  text-align: center;
}

.gift-language-ar .start-copy,
.gift-language-ar .scroll-content,
.gift-language-ar .final-reveal,
.gift-language-ar .artifact-signature {
  font-family: "Noto Naskh Arabic", Marcellus, Georgia, serif;
}

.gift-language-ar .scroll-content {
  text-align: right;
}

.gift-language-ar .scroll-content h2 {
  font-family: "Noto Naskh Arabic", Marcellus, Georgia, serif;
  font-weight: 700;
  line-height: 1.45;
}

.gift-language-ar .details-message,
.gift-language-ar .voice-reveal-note,
.gift-language-ar .artifact-signature span {
  font-family: "Noto Naskh Arabic", Marcellus, Georgia, serif;
  line-height: 1.75;
}

.gift-language-ar .recipient-name,
.gift-language-ar .artifact-signature strong {
  font-family: "Noto Naskh Arabic", Cinzel, Georgia, serif;
  line-height: 1.2;
}

.gift-language-ar .recipient-name::after {
  right: 0;
  left: auto;
  background:
    linear-gradient(270deg, rgba(242, 199, 92, .92), rgba(229, 141, 46, .86), transparent),
    repeating-linear-gradient(270deg, rgba(255, 240, 191, .28) 0 10px, transparent 10px 18px);
}

.scroll-content .temple-kicker {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid rgba(123, 74, 32, .24);
  background: rgba(255, 240, 191, .52);
  color: #6a3f18;
  box-shadow: 0 8px 18px rgba(92, 52, 20, .08);
}

.scroll-content h2 {
  color: var(--ink);
  font-size: 36px;
}

.details-message {
  margin: 24px auto 0;
  max-width: 580px;
  color: #5f3d1f;
  font-family: "Reenie Beanie", cursive;
  font-size: 34px;
  line-height: 1.1;
}

.voice-reveal {
  gap: 1.4rem;
}

.voice-reveal-note {
  margin: 0 auto;
  max-width: 34ch;
  color: #4a2c15;
  font-size: 1.08rem;
  line-height: 1.7;
}

.enter {
  animation: scrollIn .42s ease both;
}

.leave {
  animation: scrollOut .36s ease both;
}

.message-scroll::after {
  transition: box-shadow .3s ease, filter .3s ease;
}

.message-scroll:has(.leave)::after {
  filter: brightness(1.18);
  box-shadow: 0 8px 22px rgba(48, 25, 9, .28), 0 0 36px rgba(242, 199, 92, .32);
}

.final-reveal {
  width: min(880px, 100%);
  display: grid;
  gap: 22px;
  justify-items: center;
  text-align: center;
}

.final-line {
  margin: 0;
  color: #d2b87a;
  font-family: Cinzel, Georgia, serif;
  font-size: 26px;
  line-height: 1.35;
}

.papyrus-frame {
  position: relative;
  width: min(760px, 100%);
  min-height: 520px;
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.papyrus-frame img {
  width: 100%;
  height: 520px;
  object-fit: contain;
  display: block;
  padding: 0;
  background: transparent;
  filter: sepia(.2) saturate(.94) contrast(1.02);
}

.artifact-signature {
  display: grid;
  gap: .45rem;
  justify-items: center;
  text-align: center;
  width: min(100%, 42rem);
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, rgba(247, 231, 190, .98), rgba(221, 182, 118, .99));
  border: 1px solid rgba(92, 52, 20, .34);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.artifact-signature strong {
  color: #35200f;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.08;
  text-shadow: none;
}

.artifact-signature span {
  max-width: 34ch;
  color: #452a14;
  font-family: "Reenie Beanie", cursive;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.artifact-signature em {
  color: #5a3417;
  font-family: Cinzel, Georgia, serif;
  font-size: .78rem;
  font-style: normal;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.final-reveal .temple-button.secondary {
  background: rgba(13, 17, 34, .58);
  color: var(--papyrus-light);
}

.temple-empty {
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--midnight);
  color: var(--papyrus-light);
}

.temple-empty h1 {
  font-size: 34px;
}

@keyframes drift {
  to { background-position: 96px 160px, 160px 210px; }
}

@keyframes sealOpen {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
  }
}

@keyframes scrollIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.97);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes scrollOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(-18px) scale(.97);
    filter: blur(3px);
  }
}

@media (max-width: 820px) {
  .sample-gift-nav {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
    justify-content: stretch;
  }

  .sample-gift-brand {
    flex: 1 1 100%;
    justify-content: center;
  }

  .sample-gift-link {
    flex: 1 1 0;
    padding-inline: 10px;
    text-align: center;
  }

  .start-screen {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0 92px;
  }

  .temple-door {
    min-height: 360px;
    order: 2;
  }

  h1 {
    font-size: 38px;
  }

  .recipient-name {
    font-size: 48px;
  }

  .temple-subtitle {
    font-size: 18px;
  }

  .journey-screen {
    padding: 24px 0 92px;
  }

  .message-scroll {
    min-height: 390px;
    padding: 34px 22px;
  }

  .scroll-content h2 {
    font-size: 27px;
  }

  .details-message {
    font-size: 30px;
  }

  .progress-symbols {
    gap: 8px;
  }

  .progress-symbols span {
    width: 30px;
  }

  .papyrus-frame {
    min-height: 430px;
  }

  .papyrus-frame img {
    height: 430px;
  }
}

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