/* 🎨 FONT LOADING — MontrealSerial custom font family */
@font-face {
  font-family: 'MontrealSerial';
  src: url('/static/fonts/MontrealSerial.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MontrealSerial';
  src: url('/static/fonts/MontrealSerialBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #9c88b1;
  --accent-soft: rgba(156, 136, 177, 0.22);
  --accent-strong: #c5b4de;
  --highlight: #f5c84c;
  --highlight-strong: #ffe27a;
  --surface-0: #050508;
  --text-strong: #f7f7fb;
  --text-primary: rgba(245, 245, 247, 0.92);
  --text-muted: rgba(200, 200, 210, 0.72);
  --text-soft: rgba(170, 170, 185, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --midnight-bg-layers:
    radial-gradient(180% 150% at 50% -25%, rgba(64, 60, 74, 0.12) 0%, rgba(46, 43, 56, 0.06) 38%, transparent 70%),
    radial-gradient(220% 110% at 50% 10%, rgba(76, 68, 92, 0.08) 0%, rgba(44, 40, 55, 0.04) 36%, transparent 58%),
    linear-gradient(180deg, rgba(16, 15, 20, 0.96) 0%, rgba(10, 9, 14, 0.97) 52%, rgba(6, 6, 10, 0.99) 74%, #030305 100%);
}

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

body {
  font-family: 'MontrealSerial', sans-serif;
  background-color: var(--surface-0);
  background-image: var(--midnight-bg-layers);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(156, 136, 177, 0.2), rgba(12, 12, 18, 0.92));
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.landing-shell {
  position: relative;
  z-index: 1;
  width: min(940px, 92vw);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 120px) 0 clamp(96px, 14vh, 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(48px, 10vh, 64px);
  min-height: 100vh;
  justify-content: center;
}

.landing-header {
  width: 100%;
  display: flex;
  justify-content: center;
}

.logo {
  height: clamp(37px, 5.1vw, 48px);
  width: auto;
}

.gradient-logo {
  animation: none;
  filter: none;
}

.main-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(32px, 8vh, 48px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 28px);
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-headline {
  max-width: none;
  font-size: clamp(2.6rem, 7.2vw, 4.3rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  white-space: nowrap;
}

.hero-description {
  max-width: 720px;
  font-size: clamp(1.1rem, 2.7vw, 1.45rem);
  line-height: 1.32;
  color: var(--text-muted);
}

.hero-highlight {
  color: rgba(181, 164, 206, 0.92);
}

.auth-buttons {
  display: inline-flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(12px, 2vh, 18px);
}

.auth-btn {
  padding: 16px 34px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  min-width: 150px;
}

.auth-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

.signup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border: 1px solid rgba(245, 200, 76, 0.42);
  background: rgba(245, 200, 76, 0.12);
  color: rgba(245, 200, 76, 0.92);
  text-transform: none;
  letter-spacing: 0.08em;
  box-shadow: none;
}

.signup-btn:hover {
  border-color: rgba(245, 200, 76, 0.6);
  background: rgba(245, 200, 76, 0.2);
  color: #fff3c2;
  transform: translateY(-2px);
}

.login-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
  border-color: rgba(156, 136, 177, 0.38);
  box-shadow: 0 18px 34px rgba(5, 5, 12, 0.32);
}

.login-btn:hover {
  border-color: rgba(156, 136, 177, 0.6);
  background: rgba(156, 136, 177, 0.12);
  transform: translateY(-3px);
}

.session-message {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 72, 88, 0.65);
  background: rgba(255, 72, 88, 0.18);
  color: #ff5058;
  font-size: 0.95rem;
}

.hero-media {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: clamp(36px, 5vh, 50px);
  position: relative;
}

.media-frame {
  position: relative;
  width: min(1100px, 96vw);
  aspect-ratio: 16 / 9;
  min-height: clamp(320px, 56vw, 640px);
  border-radius: 40px;
  overflow: visible;
}

.media-tilt {
  --tilt-rotate: 24deg;
  --tilt-scale: 1;
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 100%;
  padding: clamp(10px, 1.6vw, 22px);
  transform-origin: center top;
  transform: perspective(1200px) rotateX(var(--tilt-rotate)) scale(var(--tilt-scale));
  will-change: transform;
  border-radius: 44px;
  overflow: visible;
  transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.media-surface {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(12, 10, 18, 0.88);
  box-shadow: 0 40px 120px rgba(5, 5, 12, 0.55);
}

.media-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 16, 0.12) 0%, rgba(8, 8, 16, 0.5) 100%);
  pointer-events: none;
}

.media-tilt.is-resting .media-surface {
  box-shadow: 0 32px 90px rgba(5, 5, 12, 0.42);
}

.media-surface img,
.media-surface video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #0b0a13;
  display: block;
  pointer-events: none;
}

.footer-links {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px clamp(12px, 3vh, 28px);
  display: flex;
  justify-content: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.92rem;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.82);
}

.footer-divider {
  color: rgba(255, 255, 255, 0.28);
}

/* Modal Styles */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(6, 6, 12, 0.68);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  position: relative;
  overflow: hidden;
  background-color: var(--surface-0);
  background-image: var(--midnight-bg-layers);
  border: 1px solid rgba(156, 136, 177, 0.35);
  border-radius: 24px;
  width: min(440px, 92vw);
  box-shadow: 0 40px 100px rgba(3, 3, 8, 0.65);
}

.modal-content > * {
  position: relative;
  z-index: 1;
}

.modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 0%, rgba(156, 136, 177, 0.2), rgba(6, 5, 12, 0.9));
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.modal-header {
  position: relative;
  padding: 30px 32px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--text-strong);
}

.close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.close-btn:hover {
  color: #fff;
  border-color: rgba(245, 200, 76, 0.6);
  box-shadow: 0 0 20px rgba(245, 200, 76, 0.28);
}

.modal-body {
  position: relative;
  padding: 16px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.modal-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(220, 210, 236, 0.78);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth-form form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(245, 200, 76, 0.12);
  color: rgba(245, 200, 76, 0.92);
  border: 1px solid rgba(245, 200, 76, 0.42);
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: none;
}

.google-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 200, 76, 0.6);
  background: rgba(245, 200, 76, 0.2);
}

.google-icon {
  width: 20px;
  height: 20px;
  filter: sepia(1) saturate(8) hue-rotate(-5deg) brightness(1.3);
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(210, 198, 228, 0.72);
  font-size: 0.86rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(156, 136, 177, 0), rgba(156, 136, 177, 0.4), rgba(156, 136, 177, 0));
}

.divider span {
  white-space: nowrap;
}


.form-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group input {
  padding: 15px 18px;
  background: rgba(17, 16, 24, 0.88);
  border: 1px solid rgba(156, 136, 177, 0.32);
  border-radius: 12px;
  color: var(--text-strong);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: rgba(235, 235, 245, 0.45);
}

.form-group input:focus {
  outline: none;
  border-color: rgba(156, 136, 177, 0.5);
  box-shadow: none;
}

.auth-form-btn {
  padding: 14px 20px;
  background: rgba(156, 136, 177, 0.16);
  color: #f6f2ff;
  border: 1px solid rgba(156, 136, 177, 0.32);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
  box-shadow: none;
  margin-top: 6px;
}

.auth-form-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(156, 136, 177, 0.38);
}

.auth-form-btn:disabled {
  background: rgba(156, 136, 177, 0.16);
  border-color: rgba(156, 136, 177, 0.28);
  box-shadow: none;
  cursor: not-allowed;
}

.modal-footnote {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(210, 198, 228, 0.75);
  display: flex;
  justify-content: center;
  gap: 6px;
}

.modal-link {
  background: none;
  border: none;
  color: rgba(245, 200, 76, 0.85);
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s ease;
}

.modal-link:hover {
  color: rgba(255, 226, 140, 0.95);
  text-decoration: underline;
}

.forgot-password-container {
  text-align: center;
  margin-top: 8px;
}

.forgot-password-link {
  color: rgba(245, 200, 76, 0.85);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: rgba(255, 226, 140, 0.95);
  text-decoration: underline;
}

/* Policy window */
#policy-window {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.82);
  color: #ffffff;
  font-family: 'MontrealSerial', sans-serif;
  font-size: 1.2rem;
  padding: clamp(48px, 8vh, 64px);
  overflow-y: auto;
  z-index: 1100;
}

#policy-window::-webkit-scrollbar {
  width: 6px;
}

#policy-window::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#back-button {
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 30px;
  opacity: 0.8;
}

#back-button:hover {
  opacity: 1;
}

/* Responsiveness */
@media (max-width: 900px) {
  .hero-headline {
    font-size: clamp(2.6rem, 8vw, 4.4rem);
    white-space: normal;
  }

  .hero-description {
    font-size: clamp(1.05rem, 3vw, 1.3rem);
  }

  .media-frame {
    border-radius: 28px;
  }

  .hero-media {
    margin-top: clamp(48px, 8vh, 90px);
  }
}

@media (max-width: 620px) {
  .landing-shell {
    padding-top: 72px;
    gap: 48px;
  }

  .auth-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  .auth-btn {
    width: 100%;
  }

  .media-frame {
    min-height: clamp(260px, 72vw, 420px);
  }

  .media-tilt {
    border-radius: 28px;
  }

  .hero-media {
    margin-top: clamp(40px, 12vh, 80px);
  }
}

@media (max-width: 420px) {
  .hero-headline {
    font-size: 2.4rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .session-message {
    border-radius: 12px;
    padding: 12px 16px;
    text-align: left;
  }
}

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

  .media-tilt {
    transform: perspective(1200px) translateY(0) rotateX(0) scale(1);
    box-shadow: 0 40px 90px rgba(5, 5, 12, 0.45);
  }

  .hero-media {
    margin-top: clamp(40px, 8vh, 80px);
  }
}
