/* CSS Variables - Design Tokens */
:root {
  /* Colors */
  --color-bg-black: #000000;
  --color-bg-white: #ffffff;
  --color-bg-card: #ffffff;
  --color-text-primary: #ffffff;
  --color-text-secondary: #9c9c9c;
  --color-status-overlay: rgba(255, 255, 255, 0.2);
  --color-image-overlay: rgba(0, 0, 0, 0.2);
  
  /* Typography */
  --font-family: 'Golos Text', sans-serif;
  --font-weight-regular: 400;
  --font-weight-bold: 700;
  
  /* Desktop Typography */
  --font-size-heading-desktop: 64px;
  --line-height-heading-desktop: 48px;
  --font-size-subheading-desktop: 20px;
  --line-height-subheading-desktop: 15px;
  --font-size-body-desktop: 16px;
  --line-height-body-desktop: 12px;
  --font-size-input-desktop: 16px;
  --line-height-input-desktop: 12px;
  
  /* Mobile Typography */
  --font-size-heading-mobile: 44px;
  --line-height-heading-mobile: 33px;
  --font-size-subheading-mobile: 18px;
  --line-height-subheading-mobile: 13px;
  --font-size-body-mobile: 14px;
  --line-height-body-mobile: 10px;
  --font-size-input-mobile: 14px;
  --line-height-input-mobile: 10px;
  
  /* Spacing */
  --spacing-content-gap-desktop: 60px;
  --spacing-text-gap-desktop: 40px;
  --spacing-content-gap-mobile: 44px;
  --spacing-top-gap-mobile: 32px;
  --spacing-block-gap-mobile: 16px;
  
  /* Border Radius */
  --border-radius-input-desktop: 24px;
  --border-radius-button-desktop: 16px;
  --border-radius-input-mobile: 16px;
  --border-radius-button-mobile: 16px;
  
  /* Layout */
  --container-max-width-desktop: 500px;
  --container-max-width-mobile: 343px;
  --icon-size: 64px;
  --status-icon-size-desktop: 24px;
  --status-icon-size-mobile: 20px;
  --input-height-desktop: 76px;
  --input-height-mobile: 56px;
  --button-height-desktop: 60px;
  --button-height-mobile: 56px;
  
  /* Effects */
  --blur-background: 20px;
  --blur-status-backdrop: 15px;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-black);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utility classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link for keyboard navigation */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-bg-white);
  color: var(--color-bg-black);
  padding: 8px 16px;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  z-index: 100;
  border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
  top: 0;
}

/* Hero section */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(var(--blur-background));
  min-width: 100vw;
  min-height: 100vh;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-image-overlay);
}

/* Content container */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-content-gap-mobile);
  width: 100%;
  max-width: var(--container-max-width-mobile);
  padding: 0 16px;
  text-align: center;
}

.top-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-top-gap-mobile);
  width: 100%;
}

.logo-container {
  width: var(--icon-size);
  height: var(--icon-size);
}

.logo {
  width: 100%;
  height: 100%;
  display: block;
}

.text-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-top-gap-mobile);
  width: 100%;
}

.heading {
  font-size: var(--font-size-heading-mobile);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading-mobile);
  color: var(--color-text-primary);
}

.subheading {
  font-size: var(--font-size-subheading-mobile);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-subheading-mobile);
  color: var(--color-text-primary);
}

/* Form styles */
.waitlist-form {
  width: 100%;
}

.form-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.form-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Desktop wrapper shows on desktop only */
.form-wrapper {
  display: none;
}

/* Mobile wrapper shows on mobile only */
.mobile-wrapper {
  display: flex;
  flex-direction: column;
}

.mobile-wrapper .mobile-submit-button {
  margin-top: var(--spacing-block-gap-mobile);
}

.desktop-form {
  display: none;
}

.mobile-form {
  display: flex;
}

.input-container {
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius-input-mobile);
  padding: 24px;
  width: 100%;
  height: var(--input-height-mobile);
  display: flex;
  align-items: center;
  cursor: text;
}

.email-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: var(--font-size-input-mobile);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-input-mobile);
  color: var(--color-text-secondary);
}

.email-input:focus,
.email-input:not(:placeholder-shown) {
  color: var(--color-bg-black);
}

/* Validation error banner */
.validation-error {
  display: none;
  align-items: center;
  gap: 6px;
  background-color: #e21b1b;
  padding: 6px 24px 12px 24px;
  border-radius: 0 0 16px 16px;
  width: 100%;
}

.validation-error.show {
  display: flex;
}

.validation-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.validation-error span {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 9px;
  color: var(--color-text-primary);
}

/* Custom validation states */
.input-container.error {
  border: 2px solid #e21b1b;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-sizing: border-box;
}

.input-container.error .email-input {
  color: #1d1d1d;
}

/* Desktop form error state */
.desktop-form.error {
  border: 2px solid #e21b1b;
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-sizing: border-box;
}

.desktop-form.error .input-container {
  border: none;
  border-radius: 0;
}

.email-input::placeholder {
  color: var(--color-text-secondary);
}

.submit-button {
  background-color: var(--color-bg-black);
  color: var(--color-text-primary);
  border: none;
  border-radius: var(--border-radius-button-mobile);
  padding: 24px;
  width: 100%;
  height: var(--button-height-mobile);
  font-family: var(--font-family);
  font-size: var(--font-size-body-mobile);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-body-mobile);
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-button:hover {
  opacity: 0.9;
}

.submit-button:focus {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

/* Mobile disabled button state */
.submit-button:disabled,
.submit-button.disabled {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: rgba(255, 255, 255, 0.6);
  cursor: default;
}

.submit-button:disabled:hover,
.submit-button.disabled:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

/* Loading state takes precedence over disabled state */
.submit-button.loading,
.submit-button.loading:disabled {
  opacity: 0.8;
  cursor: wait;
  background-color: var(--color-bg-black);
  color: var(--color-text-primary);
}

/* Status messages */
.status-message {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-status-overlay);
  backdrop-filter: blur(var(--blur-status-backdrop));
  border-radius: var(--border-radius-input-mobile);
  padding: 16px;
  width: 100%;
  min-height: 56px;
  font-family: var(--font-family);
  font-size: var(--font-size-body-mobile);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-body-mobile);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  position: relative;
  overflow: hidden;
}

.status-message.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.status-message.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.status-message:hover {
  opacity: 0.9;
}

.status-message::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  animation-name: overlay-progress;
  animation-duration: 4s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-play-state: paused;
  z-index: 1;
  pointer-events: none;
}

.status-message.auto-hiding::after {
  animation-play-state: running;
}

@keyframes overlay-progress {
  0% {
    width: 100%;
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  90% {
    width: 5%;
    opacity: 0.6;
  }
  100% {
    width: 0%;
    opacity: 0;
  }
}

.status-icon {
  width: var(--status-icon-size-mobile);
  height: var(--status-icon-size-mobile);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.status-message span {
  position: relative;
  z-index: 2;
}

/* Contact */
.contact {
  font-size: var(--font-size-body-mobile);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-mobile);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.contact:hover {
  opacity: 0.8;
}

.contact:focus {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

/* Desktop styles */
@media (min-width: 640px) {
  .content {
    gap: var(--spacing-content-gap-desktop);
    max-width: var(--container-max-width-desktop);
  }
  
  .text-section {
    gap: var(--spacing-text-gap-desktop);
  }
  
  .heading {
    font-size: var(--font-size-heading-desktop);
    line-height: var(--line-height-heading-desktop);
  }
  
  .subheading {
    font-size: var(--font-size-subheading-desktop);
    line-height: var(--line-height-subheading-desktop);
  }
  
  /* Show desktop wrapper, hide mobile wrapper */
  .form-wrapper {
    display: flex;
  }

  .mobile-wrapper {
    display: none !important;
  }

  .desktop-form {
    display: flex;
    flex-direction: row;
    gap: 8px;
    background-color: var(--color-bg-card);
    border-radius: var(--border-radius-input-desktop);
    padding: 8px 8px 8px 24px;
    align-items: center;
    width: 100%;
    height: var(--input-height-desktop);
  }

  .mobile-form {
    display: none;
  }

  .mobile-submit-button {
    display: none !important;
  }
  
  .desktop-form .input-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    flex: 1;
    height: auto;
  }
  
  .desktop-form .email-input {
    font-size: var(--font-size-input-desktop);
    line-height: var(--line-height-input-desktop);
  }
  
  .desktop-form .submit-button {
    border-radius: var(--border-radius-button-desktop);
    padding: 20px 24px;
    width: auto;
    height: var(--button-height-desktop);
    font-size: var(--font-size-body-desktop);
    line-height: var(--line-height-body-desktop);
    flex-shrink: 0;
  }

  /* Desktop disabled button state */
  .desktop-form .submit-button:disabled,
  .desktop-form .submit-button.disabled {
    background-color: #e7e7e7;
    color: #9c9c9c;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .desktop-form .submit-button:disabled:hover,
  .desktop-form .submit-button.disabled:hover {
    background-color: #e7e7e7;
    color: #9c9c9c;
  }

  /* Desktop loading state */
  .desktop-form .submit-button.loading,
  .desktop-form .submit-button.loading:disabled {
    background-color: var(--color-bg-black);
    color: var(--color-text-primary);
    opacity: 0.8;
  }
  
  .status-message {
    border-radius: var(--border-radius-input-desktop);
    padding: 26px;
    font-size: var(--font-size-body-desktop);
    line-height: var(--line-height-body-desktop);
  }
  
  .status-icon {
    width: var(--status-icon-size-desktop);
    height: var(--status-icon-size-desktop);
  }
  
  .contact {
    font-size: var(--font-size-body-desktop);
    line-height: var(--line-height-body-desktop);
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .content {
    padding: 0 20px;
    gap: calc(var(--spacing-content-gap-mobile) * 0.8);
  }
  
  .top-section {
    gap: calc(var(--spacing-top-gap-mobile) * 0.8);
  }
  
  .text-section {
    gap: calc(var(--spacing-top-gap-mobile) * 0.8);
  }
  
  .heading {
    font-size: calc(var(--font-size-heading-mobile) * 0.9);
    line-height: calc(var(--line-height-heading-mobile) * 0.9);
  }
  
  .subheading {
    font-size: calc(var(--font-size-subheading-mobile) * 0.95);
  }
}

/* Background always covers full viewport on all screen sizes */

/* Noscript warning */
.noscript-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fef3c7;
  color: #92400e;
  padding: 16px;
  text-align: center;
  z-index: 1000;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.noscript-warning p {
  margin: 8px 0;
}

.noscript-warning a {
  color: #92400e;
  font-weight: var(--font-weight-bold);
  text-decoration: underline;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-image {
    filter: none;
  }

  .status-message {
    transition: none;
  }

  .status-message::after {
    animation: none;
  }
}

/* Print styles */
@media print {
  .hero-background {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .submit-button {
    display: none;
  }

  .contact {
    color: black;
  }
}