:root {
  --green: #101c18;
  --pink: #ef97d9; /* brand pink, sampled from the logo file */
  --ink: #101c18;
  --text: #f4f1f3;
  --muted: rgba(244, 241, 243, 0.64);
  --line: rgba(255, 255, 255, 0.14);
  --sky-pink: color-mix(in srgb, var(--pink) 72%, white);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  --footer-h: clamp(64px, 11dvh, 104px);
  --d: min(100dvh, 92vw);
  --ring: calc(var(--d) * 0.0165);
  --photo-scale: 1.08;
  --photo-y: -0.17;

  --sparkle-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='1' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 15 -8.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --sparkle-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='230' height='230'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.36 0 0 0 0 0.2 0 0 0 0 0.34 0 0 0 13 -7.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (max-aspect-ratio: 1/1) {
  :root {
    --photo-scale: 1.06;
    --photo-y: -0.05;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--green);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font-family: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───────────── Gate (login) ───────────── */

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: 62fr 38fr;
}

.gate-top {
  background: var(--green);
  display: grid;
  place-items: center;
  min-height: 0;
}

.logo-glitter {
  --logo-h: min(41dvh, 400px);
  width: min(80vw, calc(var(--logo-h) * 1.244));
  aspect-ratio: 423 / 340;
  margin: 0;
  -webkit-mask: url("assets/logo-white.png") center / contain no-repeat;
  mask: url("assets/logo-white.png") center / contain no-repeat;
  background-image:
    var(--sparkle-light),
    var(--sparkle-dark),
    linear-gradient(115deg, #cdb4cb 0%, #f6ebf3 18%, #b58fb1 34%, #efdbe9 50%, #c29dc0 66%, #f8eef5 82%, #cdb4cb 100%);
  background-size: 190px 190px, 230px 230px, 260% 100%;
  animation: shimmer 12s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 0 0, 0 0, 0% 50%;
  }
  to {
    background-position: 0 0, 0 0, 260% 50%;
  }
}

.gate-bottom {
  background: var(--pink);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
}

.gate-bottom form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2dvh, 18px);
}

.gate-bottom label {
  font-size: clamp(11px, 1.6dvh, 14px);
  font-weight: 500;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  text-transform: uppercase;
}

.gate-bottom input {
  width: min(78vw, 300px);
  padding: 0.85em 1em;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font: 500 clamp(15px, 2.2dvh, 18px) var(--font);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

.gate-bottom input::placeholder {
  color: rgba(16, 28, 24, 0.52);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

.gate-bottom input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.gate-error {
  margin: 0;
  min-height: 1.3em;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.gate-error.shake {
  animation: shake 0.4s ease;
}

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

/* ───────────── Vault (donor view) ───────────── */

.vault {
  position: fixed;
  inset: 0;
  background: var(--green);
  overflow: hidden;
}

.back-button {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  z-index: 8;
  padding: 0.55em 1.1em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-button:hover {
  color: #fff;
  border-color: var(--pink);
}

.vault-circle {
  position: absolute;
  left: 50%;
  top: max(calc(var(--ring) + 1.2dvh), calc((100dvh - var(--footer-h) - var(--d)) / 2));
  width: var(--d);
  height: var(--d);
  translate: -50% 0;
  border-radius: 50%;
  background: #4c92d6 url("assets/photo-sky.webp") no-repeat;
  background-size: calc(var(--photo-scale) * 100%) auto;
  background-position: 50% calc(var(--d) * var(--photo-y));
  box-shadow:
    0 0 0 var(--ring) var(--pink),
    0 calc(var(--d) * 0.04) calc(var(--d) * 0.12) rgba(0, 0, 0, 0.5),
    inset 0 0 calc(var(--d) * 0.09) rgba(8, 24, 48, 0.28);
  opacity: 0;
  scale: 0.94;
  transition: opacity 0.9s ease, scale 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vault-circle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: var(--grain);
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.vault.is-ready .vault-circle {
  opacity: 1;
  scale: 1;
}

.vault-sky {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--d) * 0.085);
  font-size: max(11px, calc(var(--d) * 0.025));
}

.vault-greeting {
  margin: 0;
  max-width: 56%;
  font-size: max(10px, calc(var(--d) * 0.0165));
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(10, 40, 90, 0.35);
}

.vault-nav {
  width: 82%;
  margin-top: calc(var(--d) * 0.04);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em 0.5em;
}

.vault-nav button,
.footer-nav button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-transform: uppercase;
}

.vault-nav button {
  width: 6.4em;
  font-size: 1em;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  text-wrap: balance;
  color: var(--sky-pink);
  text-shadow: 0 1px 16px rgba(10, 40, 90, 0.32);
}

.vault-nav button:hover,
.vault-nav button:focus-visible {
  color: #fff;
}

.vault-nav button:focus-visible,
.footer-nav button:focus-visible,
.sheet-close:focus-visible,
.back-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.vault-greeting,
.vault-nav button {
  opacity: 0;
  translate: 0 10px;
  transition:
    opacity 0.7s ease calc(0.45s + var(--i, 0) * 0.09s),
    translate 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) calc(0.45s + var(--i, 0) * 0.09s),
    color 0.2s ease 0s;
}

.vault.is-ready .vault-greeting,
.vault.is-ready .vault-nav button {
  opacity: 1;
  translate: 0 0;
}

.vault-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  height: var(--footer-h);
  padding: 0 clamp(16px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--pink);
  color: var(--ink);
}

.footer-logo {
  height: 66%;
  width: auto;
  flex-shrink: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px clamp(14px, 2.6vw, 40px);
}

.footer-nav button {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  font-size: clamp(11px, 1.1vw, 17px);
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: rgba(16, 28, 24, 0.62);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-nav button:hover,
.footer-nav button[aria-current="true"] {
  color: var(--ink);
}

.footer-nav button[aria-current="true"] {
  border-bottom-color: var(--ink);
  font-weight: 700;
}

/* ───────────── Reward sheet ───────────── */

.sheet {
  position: absolute;
  inset: 0 0 var(--footer-h) 0;
  z-index: 5;
  background: rgba(16, 28, 24, 0.94);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  translate: 0 28px;
  transition:
    opacity 0.35s ease,
    translate 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.5s;
}

.sheet.open {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition-delay: 0s;
}

.sheet-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 151, 217, 0.45) transparent;
  touch-action: pan-y;
}

.sheet-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(64px, 11dvh, 110px) clamp(20px, 5vw, 48px) 56px;
}

.sheet-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sheet-close:hover {
  background: var(--pink);
  color: var(--ink);
}

.sheet-name {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.sheet-note {
  max-width: 56ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

.sheet-body {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.sheet-bar[hidden] {
  display: none;
}

.sheet-count {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.swipe-hint {
  display: none;
}

@media (hover: none) {
  .swipe-hint {
    display: inline;
  }
}

.sheet-pager {
  display: flex;
  gap: 8px;
}

.pager-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.pager-btn:hover {
  background: var(--pink);
  color: var(--ink);
}

.pager-btn:disabled {
  opacity: 0.28;
  pointer-events: none;
}

.pager-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.sheet-slide {
  will-change: transform, opacity;
}

.sheet-title {
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--pink);
}

/* ───────────── Module content ───────────── */

.tab-content h3 {
  margin: 30px 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.tab-content h3:first-child {
  margin-top: 0;
}

.tab-content p {
  line-height: 1.65;
}

.tab-content video,
.tab-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
}

.pending-note {
  color: var(--muted);
  font-style: italic;
}

.video-link {
  display: inline-block;
  padding: 0.95em 1.8em;
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.video-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.download-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.download-list a {
  color: var(--pink);
}

.poster-preview {
  width: 100%;
  display: block;
  margin-bottom: 1rem;
  border-radius: 12px;
}

.carousel {
  position: relative;
  touch-action: pan-y;
}

.carousel-track {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #0b1411;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.carousel-slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.7rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.85rem;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(16, 28, 24, 0.6);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.carousel-nav:hover {
  background: var(--pink);
  color: var(--ink);
}

.carousel-prev {
  left: 0.7rem;
}

.carousel-next {
  right: 0.7rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--pink);
}

@media (prefers-reduced-motion: reduce) {
  .logo-glitter {
    animation: none;
  }

  .vault-circle,
  .vault-greeting,
  .vault-nav button,
  .sheet {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}
