:root {
  color-scheme: dark;
  --bg: #171025;
  --ink: #fff8ec;
  --muted: #cbb8d8;
  --panel: rgba(48, 31, 72, 0.82);
  --panel-solid: #2f2146;
  --line: rgba(255, 240, 214, 0.16);
  --gold: #ffc857;
  --mint: #64f0c8;
  --rose: #ff79b5;
  --violet: #8f78ff;
  --plum: #211532;
  --shadow: 0 24px 70px rgba(5, 2, 12, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 5%, rgba(255, 200, 87, 0.24), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(100, 240, 200, 0.2), transparent 24rem),
    linear-gradient(145deg, #160f22 0%, #241839 52%, #130f21 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 248, 236, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 248, 236, 0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(from 30deg, var(--gold), var(--rose), var(--violet), var(--mint), var(--gold));
  color: #1b1027;
  box-shadow: 0 10px 28px rgba(255, 200, 87, 0.28);
}

.site-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.site-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}

main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.72fr);
  gap: 26px;
  align-items: stretch;
  min-height: calc(100vh - 92px);
  padding: 42px 0 28px;
}

.hero-copy,
.timekeeper-panel,
.rift-strip,
.cookie-card,
.reward-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.12), transparent 38%),
    rgba(34, 22, 52, 0.86);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.25rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-text {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.primary-link,
.claim-button,
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  color: #23140d;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(255, 200, 87, 0.24);
}

.primary-link:hover,
.claim-button:hover,
.submit-button:hover {
  filter: brightness(1.07);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 900;
}

.status-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 7px rgba(255, 121, 181, 0.15);
}

.timekeeper-panel {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 560px;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 200, 87, 0.28), transparent 18rem),
    linear-gradient(180deg, rgba(143, 120, 255, 0.28), rgba(47, 33, 70, 0.92));
}

.clock-ring {
  position: absolute;
  inset: 8%;
  border: 2px dashed rgba(255, 248, 236, 0.25);
  border-radius: 50%;
  animation: rotate 24s linear infinite;
}

.clock-ring::before,
.clock-ring::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(255, 200, 87, 0.36);
  border-radius: 50%;
}

.clock-ring::after {
  inset: 34%;
  border-color: rgba(100, 240, 200, 0.34);
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

.timekeeper-art {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(88%, 430px);
  max-height: 440px;
  object-fit: contain;
  filter: drop-shadow(0 28px 24px rgba(0, 0, 0, 0.42));
}

.character-card {
  position: relative;
  z-index: 2;
  padding: 20px;
  border-radius: 8px;
  background: rgba(20, 13, 32, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.character-card span,
.cookie-card span,
.reward-info span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.character-card strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.character-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.rift-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 20px 0 48px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.07);
}

.rift-strip h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.step-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.step-row span {
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(100, 240, 200, 0.11);
  border: 1px solid rgba(100, 240, 200, 0.25);
  color: var(--mint);
  font-weight: 950;
}

.cookies-section,
.rewards-section {
  padding: 16px 0 56px;
}

.section-heading {
  margin-bottom: 22px;
}

.cookie-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.cookie-card {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 258px;
  padding: 20px;
  background: var(--panel);
}

.cookie-card:not(.main-cookie) {
  grid-template-rows: 180px 1fr;
}

.main-cookie {
  grid-column: span 2;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
}

.cookie-card img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.34));
}

.cookie-card:not(.main-cookie) img {
  height: 180px;
  align-self: end;
}

.cookie-card h3,
.reward-info h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.05;
  overflow-wrap: normal;
}

.cookie-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.reward-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 16px;
  min-height: 220px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.1), transparent 55%),
    var(--panel-solid);
  transition: transform 160ms ease, border-color 160ms ease;
}

.reward-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 200, 87, 0.48);
}

.reward-card img {
  width: 100%;
  max-height: 134px;
  object-fit: contain;
  align-self: center;
  filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.34));
}

.reward-info {
  align-self: center;
  min-width: 0;
}

.claim-button {
  grid-column: 1 / -1;
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 8, 24, 0.78);
}

.claim-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(35, 20, 13, 0.1);
  border-radius: 8px;
  background: #fff6dd;
  color: #241626;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #ead9b4;
  color: #241626;
  cursor: pointer;
  font-weight: 950;
}

.claim-panel h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.claim-panel p:not(.eyebrow) {
  color: #68556f;
  line-height: 1.55;
}

.claim-panel label {
  display: block;
  margin: 20px 0 8px;
  font-weight: 950;
}

.claim-panel input {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 2px solid #ddc896;
  border-radius: 7px;
  background: #fffaf0;
  color: #241626;
  outline: none;
}

.claim-panel input:focus {
  border-color: #8b6dff;
}

.form-error {
  min-height: 22px;
  margin: 8px 0 14px;
  color: #ba2e56;
  font-size: 0.92rem;
  font-weight: 900;
}

.submit-button {
  width: 100%;
}

.site-footer {
  padding: 0 0 34px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    min-height: 500px;
  }

  .cookie-grid,
  .rewards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
  }

  .brand span:last-child {
    display: none;
  }

  .site-nav {
    max-width: calc(100vw - 92px);
    overflow-x: auto;
  }

  .hero {
    padding-top: 26px;
  }

  .hero-copy {
    min-height: 460px;
  }

  h1 {
    font-size: 3rem;
  }

  .timekeeper-panel {
    min-height: 480px;
  }

  .rift-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .step-row {
    justify-content: flex-start;
  }

  .main-cookie {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .rewards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  main,
  .site-header,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy {
    min-height: 430px;
    padding: 24px;
  }

  .cookie-grid,
  .rewards-grid {
    grid-template-columns: 1fr;
  }

  .reward-card {
    grid-template-columns: 86px minmax(0, 1fr);
    min-height: 196px;
  }
}
