:root {
  --bg: #0b0b10;
  --yellow: #FFBF26;
  --blue: #6392EE;
  --orange: #FF9D5E;
  --red: #FF6464;
  --green: #3AC884;
  --purple: #BF67FF;
  --teal: #3AACC8;
  --black: #1B1B1B;
  --dark-gray: #666666;
  --light-gray: #A8A8A8;
  --separator-gray: #EFEFEF;
}

* {
  box-sizing: border-box;
}

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

body {
  background: #000;
  color: #fff;
  font-family: "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Grid background with scrolling thumbnails */
.grid-background {
  position: fixed;
  inset: 0;
  display: flex;
  gap: 12px;
  padding: 0 12px;
  overflow: hidden;
  z-index: 1;
}

.grid-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0.4;
  filter: blur(1px);
  animation: scrollColumn 40s linear infinite;
  will-change: transform;
}

/* Alternate animation direction for every other column */
.grid-column:nth-child(even) {
  animation-direction: reverse;
  animation-duration: 45s;
}

.grid-column:nth-child(1) { animation-delay: -5s; }
.grid-column:nth-child(2) { animation-delay: -12s; }
.grid-column:nth-child(3) { animation-delay: -8s; }
.grid-column:nth-child(4) { animation-delay: -15s; }
.grid-column:nth-child(5) { animation-delay: -3s; }
.grid-column:nth-child(6) { animation-delay: -10s; }
.grid-column:nth-child(7) { animation-delay: -18s; }
.grid-column:nth-child(8) { animation-delay: -6s; }
.grid-column:nth-child(9) { animation-delay: -14s; }
.grid-column:nth-child(10) { animation-delay: -9s; }

@keyframes scrollColumn {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

.post-thumbnail {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.post-thumbnail img.loaded {
  opacity: 1;
}

/* Scene overlay - matches index.html */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
  z-index: 10;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 10;
}

.subtitle {
  color: var(--light-gray);
  font-size: 14px;
  user-select: none;
  opacity: 1;
  white-space: nowrap;
  padding: 0 16px;
}

.subtitle a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

.subtitle a:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.waitlist-cta {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(90vw, 320px);
  opacity: 1;
  transform: translateX(-50%);
}

.waitlist-cta--enter {
  opacity: 0;
  transform: translateX(-50%);
  animation: fadeInSubtitle 1200ms ease-out 600ms forwards;
}

.preorder-button {
  display: block;
  transition: transform 160ms ease, filter 160ms ease;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
}

.preorder-button img {
  display: block;
  height: 44px;
  width: auto;
}

.preorder-button:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.preorder-button:active {
  transform: scale(0.98);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}

.beta-access-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease;
}

.beta-access-link:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.beta-access-link:active {
  color: rgba(255, 255, 255, 0.5);
}

.explore-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-weight: 400;
  transition: color 160ms ease;
}

.explore-link:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

@supports (height: 100svh) {
  body { height: 100svh; }
  .scene { height: 100svh; }
}

.logo {
  display: block;
  width: min(64vw, 400px);
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.35));
  opacity: 1;
  transform: scale(1);
}

.logo-section--enter .logo {
  opacity: 0;
  transform: scale(0.8);
  animation: fadeUp 700ms ease-out 150ms forwards;
}

.logo-section--enter .subtitle {
  opacity: 0;
  animation: fadeInSubtitle 1200ms ease-out 600ms forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeInSubtitle {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gelatineLogo {
  from, to { transform: scale(1, 1); }
  25% { transform: scale(0.9, 1.1); }
  50% { transform: scale(1.1, 0.9); }
  75% { transform: scale(0.95, 1.05); }
}

.logo.gelatine-play {
  animation: gelatineLogo 500ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .logo-section:not(.logo-section--enter) .logo:hover {
    animation: gelatineLogo 500ms ease-out;
  }
}

/* Waitlist Modal Styles */
.waitlist-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.waitlist-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.waitlist-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.waitlist-sheet {
  position: relative;
  width: 100%;
  max-width: 460px;
  border-radius: 24px 24px 0 0;
  background: rgba(14, 14, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
  padding: 32px 24px 28px;
  overflow-y: auto;
  max-height: 90vh;
  transform: translateY(12px);
  transition: transform 200ms ease;
}

.waitlist-modal[aria-hidden="false"] .waitlist-sheet {
  transform: translateY(0);
}

.waitlist-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 26px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease, color 150ms ease;
}

.waitlist-close:hover,
.waitlist-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.waitlist-header {
  padding-right: 32px;
}

.waitlist-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.waitlist-header p {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dark-gray);
}

.waitlist-form {
  display: grid;
  gap: 18px;
}

.waitlist-field {
  display: grid;
  gap: 8px;
}

.waitlist-field label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.waitlist-field input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 20, 28, 0.92);
  color: #fff;
  font-size: 16px;
  padding: 12px 15px;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.waitlist-field input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent);
}

.waitlist-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent);
  outline: none;
  background: rgba(20, 20, 28, 1);
}

.waitlist-field input::placeholder {
  color: rgba(255, 255, 255, 0.1);
}

.waitlist-actions {
  margin-top: 4px;
}

.waitlist-submit {
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.waitlist-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.waitlist-submit:active {
  transform: translateY(1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.waitlist-submit:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.waitlist-feedback {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.waitlist-feedback.error {
  color: var(--red);
  margin-bottom: 8px;
  padding: 0 16px;
}

.waitlist-feedback.success {
  color: var(--orange);
  margin-bottom: 8px;
  padding: 0 16px;
}

.waitlist-direct .waitlist-close {
  display: none;
}

.waitlist-direct .waitlist-modal {
  align-items: stretch;
}

.waitlist-direct .waitlist-sheet {
  max-width: none;
  border-radius: 0;
  max-height: none;
}

.waitlist-direct .waitlist-checkbox {
  display: none;
}

@media (min-width: 600px) {
  .waitlist-modal {
    align-items: center;
    padding: 40px;
  }
  .waitlist-sheet {
    border-radius: 24px;
    max-height: 85vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; opacity: 1; transform: scale(1); }
  .subtitle { animation: none; opacity: 1; }
  .waitlist-cta { animation: none; opacity: 1; transform: translateX(-50%); }
  .logo.gelatine-play { animation: none; }
  .logo:hover { animation: none; }
}

/* Cursor trail effect */
.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: cursorTrailAnimation 0.6s ease-out forwards;
  transform: translate(-50%, -50%);
  opacity: 0.6;
}

@keyframes cursorTrailAnimation {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .grid-background {
    gap: 8px;
    padding: 0 8px;
  }
  
  .grid-column {
    gap: 8px;
  }
  
  .post-thumbnail {
    border-radius: 16px;
  }
  
  .logo-container {
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .grid-background {
    gap: 6px;
    padding: 0 6px;
  }
  
  .grid-column {
    gap: 6px;
  }
  
  .post-thumbnail {
    border-radius: 12px;
  }
  
  .logo-container {
    gap: 20px;
    padding: 20px;
  }
  
  .logo {
    width: min(65vw, 400px);
  }
  
  .preorder-button img {
    width: min(130px, 80vw);
  }
}

/* Hide some columns on smaller screens */
@media (max-width: 1400px) {
  .grid-column:nth-child(n+9) {
    display: none;
  }
}

@media (max-width: 1200px) {
  .grid-column:nth-child(n+8) {
    display: none;
  }
}

@media (max-width: 1000px) {
  .grid-column:nth-child(n+7) {
    display: none;
  }
}

@media (max-width: 768px) {
  .grid-column:nth-child(n+6) {
    display: none;
  }
}

@media (max-width: 600px) {
  .grid-column:nth-child(n+5) {
    display: none;
  }
}

@media (max-width: 400px) {
  .grid-column:nth-child(n+4) {
    display: none;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .grid-column {
    animation: none;
  }
  
  .logo-container {
    animation: none;
  }
  
  .logo,
  .preorder-button {
    transition: none;
  }
}
