:root {
  --night: #03050C;
  --stone-light: #EBCB9C;
  --ivory: rgba(242, 235, 221, 0.82);
  --ivory-soft: rgba(242, 235, 221, 0.5);
  --glass-fill: rgba(255, 255, 255, 0.07);
  --glass-edge: rgba(255, 255, 255, 0.16);
  --brass: #E0A63F;
  --brass-hi: #F0C06A;
  --on-brass: #17120A;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --px: 0;
  --py: 0;
  --mx: 50%;
  --my: 0%;
  --screen-h: 100vh;
  --ramparts-ratio: 2.1674;
  --crest-share: 0.253;
  --store: 52px;
}

@supports (height: 100dvh) {
  :root { --screen-h: 100dvh; }
}

@media (orientation: landscape) {
  :root { --ramparts-ratio: 0.5625; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.layer {
  position: absolute;
  inset: -3%;
  transform: translate3d(calc(var(--px) * var(--depth) * -18px), calc(var(--py) * var(--depth) * -12px), 0);
  will-change: transform;
}

.layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  display: block;
}

.layer--sky { --depth: 0.25; }
.layer--shooting { --depth: 0.25; }
.layer--ramparts { --depth: 0.6; }

.shooting-star {
  position: absolute;
  top: 0;
  left: 0;
  width: 26vmax;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(184, 214, 255, 0), rgba(214, 229, 255, 0.55) 70%, #FFFFFF);
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform-origin: 100% 50%;
}

.stage {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  --crest: calc(var(--crest-share) * max(var(--screen-h) * 1.06, 106vw * var(--ramparts-ratio)) - var(--screen-h) * 0.03);
  --sky: calc(var(--screen-h) - var(--crest));
  --top: max(env(safe-area-inset-top), calc(var(--sky) * 0.06));
  --m-title: clamp(10px, calc(var(--sky) * 0.03), 28px);
  --title-w: min(70vw, 420px, calc(var(--sky) * 0.55));
  --m-tag: clamp(8px, calc(var(--sky) * 0.022), 18px);
  --tag-size: clamp(11px, calc(var(--sky) * 0.021), 14px);
  --m-cta: clamp(18px, calc(var(--sky) * 0.04), 48px);
  --m-stores: clamp(22px, calc(var(--sky) * 0.045), 32px);
  --clear: 16px;
  --ring-room: calc(var(--sky) - var(--top) - var(--m-title) - var(--title-w) * 0.289 - var(--m-tag) - var(--tag-size) * 1.7 - var(--m-cta) - 48px - var(--m-stores) - var(--store) - var(--clear));
  --ring: min(62vw, 300px, max(120px, var(--ring-room)));
  padding: var(--top) 24px 0;
  text-align: center;
  perspective: 900px;
}

.ring {
  --depth: 1;
  width: var(--ring);
  aspect-ratio: 1;
  transform:
    translate3d(calc(var(--px) * var(--depth) * 22px), calc(var(--py) * var(--depth) * 14px), 40px)
    rotateY(calc(var(--px) * 9deg))
    rotateX(calc(var(--py) * -9deg));
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  will-change: transform;
}

.ring img {
  width: 100%;
  height: 100%;
  display: block;
}

.title {
  margin-top: var(--m-title);
  width: var(--title-w);
  line-height: 0;
}

.title img {
  width: 100%;
  height: auto;
}

.tagline {
  margin-top: var(--m-tag);
  font-size: var(--tag-size);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ivory);
  max-width: min(88vw, 34em);
  text-wrap: balance;
  line-height: 1.7;
}

.glass {
  --depth: 1.3;
  position: relative;
  margin-top: var(--m-cta);
  padding: 14px 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), var(--glass-fill));
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  transform:
    translate3d(calc(var(--px) * var(--depth) * 26px), calc(var(--py) * var(--depth) * 16px), 80px)
    rotateY(calc(var(--px) * 6deg))
    rotateX(calc(var(--py) * -6deg));
  will-change: transform;
}

button.glass {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.glass:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), var(--glass-edge) 35%, rgba(255, 255, 255, 0.05) 60%, rgba(255, 255, 255, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(180px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.soon {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  white-space: nowrap;
  text-transform: uppercase;
  color: #FFFFFF;
}

.stores {
  margin-top: var(--m-stores);
  display: flex;
  justify-content: center;
  gap: 16px;
}

.store {
  position: relative;
  width: var(--store);
  height: var(--store);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), var(--glass-fill));
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s;
}

.store::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), var(--glass-edge) 40%, rgba(255, 255, 255, 0.05) 65%, rgba(255, 255, 255, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.store img {
  width: 45%;
  height: 45%;
}

.store:hover {
  transform: translateY(-2px);
}

.store:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.sheet {
  margin: auto;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ivory);
  background: linear-gradient(180deg, rgba(20, 28, 60, 0.82), rgba(8, 12, 30, 0.9));
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sheet::backdrop {
  background: rgba(3, 5, 12, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sheet__form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 28px 24px 24px;
  text-align: left;
}

.sheet__form[hidden],
.sheet__done[hidden] {
  display: none;
}

.sheet__done {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 28px 24px 24px;
  text-align: left;
}

.sheet__icon {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--brass-hi);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sheet__done .sheet__lead strong {
  color: #FFFFFF;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sheet__hint {
  font-size: 13px;
  color: var(--ivory-soft);
  margin-bottom: 4px;
}

.sheet__title:focus {
  outline: none;
}

.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ivory);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.sheet__title {
  font-size: 20px;
  font-weight: 600;
  color: #FFFFFF;
  padding-right: 40px;
}

.sheet__lead {
  font-size: 14px;
  color: var(--ivory-soft);
  margin-bottom: 4px;
}

.field {
  font-size: 13px;
  font-weight: 600;
  color: var(--ivory);
}

.field__input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font: inherit;
  font-size: 16px;
}

.field__input::placeholder {
  color: rgba(242, 235, 221, 0.4);
}

.field__input:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ivory);
}

.consent input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--brass);
}

.consent a {
  color: var(--brass-hi);
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.brass {
  margin-top: 6px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brass);
  color: var(--on-brass);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.brass:hover {
  background: var(--brass-hi);
}

.brass:focus-visible {
  outline: 2px solid var(--brass-hi);
  outline-offset: 3px;
}

.brass:disabled {
  opacity: 0.6;
  cursor: progress;
}

.sheet__message {
  min-height: 1.4em;
  font-size: 14px;
  color: var(--ivory);
}

.sheet__message[data-tone="error"] {
  color: #FFB4A8;
}

.toast {
  position: fixed;
  left: 50%;
  top: max(20px, env(safe-area-inset-top));
  z-index: 2;
  translate: -50% 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(10, 16, 40, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .sheet {
    margin: auto auto 0;
    width: 100%;
    max-width: 100%;
    border-radius: 28px 28px 0 0;
  }

  .sheet__form,
  .sheet__done {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1;
  display: grid;
  gap: 4px;
  padding-inline: 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ivory-soft);
}

.footer a {
  color: inherit;
  text-underline-offset: 3px;
}

.legal-page {
  overflow: auto;
}

.legal {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 32px));
  margin: max(32px, env(safe-area-inset-top)) auto 48px;
  padding: 28px 24px 32px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 28, 60, 0.72), rgba(8, 12, 30, 0.82));
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  line-height: 1.6;
  font-size: 15px;
}

.legal h1 {
  font-size: 26px;
  color: #FFFFFF;
  margin-top: 12px;
}

.legal h2 {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-light);
  margin: 24px 0 6px;
}

.legal p {
  max-width: 65ch;
}

.legal a {
  color: var(--brass-hi);
}

.legal__back {
  font-size: 14px;
  text-decoration: none;
}

.legal__date {
  font-size: 13px;
  color: var(--ivory-soft);
}

@media (orientation: portrait) and (max-height: 740px) {
  :root { --store: 44px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .stage {
    --ring: min(240px, calc(var(--sky) - var(--top) - var(--clear)));
    --title-w: min(30vw, 220px);
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: repeat(4, auto);
    justify-content: center;
    align-content: start;
    justify-items: center;
    column-gap: clamp(24px, 6vw, 64px);
    padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right));
  }

  .ring {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: start;
  }

  .title,
  .tagline,
  .glass,
  .stores {
    grid-column: 2;
  }

  .title {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ring,
  .title,
  .tagline,
  .glass,
  .stores {
    animation: rise 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .title { animation-delay: 0.15s; }
  .tagline { animation-delay: 0.3s; }
  .glass { animation-delay: 0.45s; }
  .stores { animation-delay: 0.6s; }

  @media (hover: none) {
    .scene .layer--sky { animation: drift 24s ease-in-out infinite alternate; }
    .scene .layer--ramparts { animation: drift-near 24s ease-in-out infinite alternate; }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes drift {
  from { translate: -6px 2px; }
  to { translate: 6px -2px; }
}

@keyframes drift-near {
  from { translate: -14px 3px; }
  to { translate: 14px -3px; }
}
