@import './design-system.css';

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-starlight);
  background-color: var(--color-void);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle cosmic grain texture on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-teal-bright);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover, a:focus {
  color: var(--color-magenta-bright);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-starlight);
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

@media (min-width: 1200px) {
  .container {
    padding-inline: var(--space-12);
  }
}

.section {
  padding-block: var(--space-12);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-16);
  }
}

@media (min-width: 1200px) {
  .section {
    padding-block: var(--space-24);
  }
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: linear-gradient(
    to bottom,
    rgba(7, 7, 15, 0.95) 0%,
    rgba(7, 7, 15, 0.80) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-void-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo / wordmark */
.nav-logo {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-starlight);
  text-decoration: none;
  position: relative;
  z-index: 101;
}

.nav-logo:hover, .nav-logo:focus {
  color: var(--color-gold-bright);
}

/* Desktop nav links */
.nav-links {
  display: none;
  list-style: none;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dim);
  text-decoration: none;
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a[aria-current="page"] {
  color: var(--color-starlight);
  border-bottom-color: var(--color-nebula-purple);
}

/* Hamburger button (phone only) */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 101;
  padding: var(--space-2);
}

@media (min-width: 768px) {
  .nav-hamburger {
    display: none;
  }
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-starlight);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  transform-origin: center;
}

/* Hamburger → X animation when drawer is open */
body.nav-open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
body.nav-open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Slide-out drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--color-void-mid);
  border-left: 1px solid var(--color-void-border);
  z-index: 99;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  padding-top: calc(var(--nav-height) + var(--space-8));
  padding-inline: var(--space-6);
  padding-bottom: var(--space-8);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Subtle purple edge glow on the drawer */
.nav-drawer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--color-nebula-purple),
    var(--color-teal),
    transparent
  );
  opacity: 0.6;
}

body.nav-open .nav-drawer {
  transform: translateX(0);
}

.nav-drawer a {
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-dim);
  text-decoration: none;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-void-border);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.nav-drawer a:last-child {
  border-bottom: none;
}

.nav-drawer a:hover,
.nav-drawer a:focus,
.nav-drawer a[aria-current="page"] {
  color: var(--color-starlight);
  padding-left: var(--space-3);
}

/* Drawer overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 15, 0.7);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  backdrop-filter: blur(2px);
}

body.nav-open .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   PAGE WRAPPER (accounts for fixed nav)
   ============================================================ */

.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 100svh;
}

/* Radial nebula glow behind hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(124, 58, 237, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 60%, rgba(13, 148, 136, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(219, 39, 119, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.hero-image {
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: center top;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

.hero-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(7, 7, 15, 0.2) 0%,
    rgba(7, 7, 15, 0.1) 40%,
    rgba(7, 7, 15, 0.75) 80%,
    var(--color-void) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-12) var(--space-4) var(--space-12);
  max-width: 800px;
}

@media (min-width: 768px) {
  .hero {
    min-height: 85vh;
  }

  .hero-content {
    padding: var(--space-16) var(--space-8) var(--space-16);
  }
}

@media (min-width: 1200px) {
  .hero-content {
    padding: var(--space-20) var(--space-12) var(--space-20);
  }
}

/* Phone: stacked layout — image area above, text below */
@media (max-width: 767px) {
  .hero {
    min-height: auto;
    flex-direction: column;
  }

  .hero-image {
    position: relative;
    height: 50vw;
    min-height: 240px;
    max-height: 360px;
    opacity: 0.6;
  }

  .hero-image-overlay {
    background: linear-gradient(
      to bottom,
      transparent 0%,
      var(--color-void) 100%
    );
  }

  .hero-content {
    position: relative;
    padding: var(--space-6) var(--space-4) var(--space-10);
  }
}

.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-teal-bright);
  margin-bottom: var(--space-4);
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-starlight);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .hero-headline {
    font-size: var(--text-5xl);
  }
}

@media (min-width: 1200px) {
  .hero-headline {
    font-size: var(--text-6xl);
  }
}

.hero-subline {
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  color: var(--color-dim);
  margin-bottom: var(--space-8);
  max-width: 560px;
  line-height: var(--leading-normal);
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ghost);
}

.hero-tagline em {
  font-style: normal;
  color: var(--color-gold-bright);
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.section-header {
  margin-bottom: var(--space-10);
}

.section-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-nebula-purple);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-starlight);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--text-4xl);
  }
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-dim);
  margin-top: var(--space-4);
  max-width: 600px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-primary {
  background: var(--color-nebula-purple);
  color: var(--color-starlight);
  border-color: var(--color-nebula-purple);
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--color-nebula-deep);
  border-color: var(--color-nebula-purple);
  box-shadow: var(--glow-purple);
  color: var(--color-starlight);
}

.btn-outline {
  background: transparent;
  color: var(--color-teal-bright);
  border-color: var(--color-teal);
}

.btn-outline:hover, .btn-outline:focus {
  background: rgba(13, 148, 136, 0.1);
  border-color: var(--color-teal-bright);
  box-shadow: var(--glow-teal);
  color: var(--color-teal-bright);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--color-void-surface);
  border: 1px solid var(--color-void-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  border-color: var(--color-nebula-purple);
  box-shadow: var(--glow-purple);
}

.card-body {
  padding: var(--space-6);
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-nebula-purple),
    var(--color-teal),
    transparent
  );
  border: none;
  margin-block: var(--space-12);
  opacity: 0.4;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--color-void-border);
  padding-block: var(--space-10);
  text-align: center;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ghost);
  margin-bottom: var(--space-2);
}

.footer-taglines {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .footer-taglines {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-4);
  }
}

.footer-taglines span {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-ghost);
}

.footer-taglines span + span::before {
  content: '·';
  margin-right: var(--space-4);
}

@media (max-width: 767px) {
  .footer-taglines span + span::before {
    display: none;
  }
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-ghost);
  opacity: 0.6;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Nebula background on login */
.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 50%, rgba(124, 58, 237, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 30%, rgba(13, 148, 136, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 60% 80%, rgba(219, 39, 119, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--color-void-surface);
  border: 1px solid var(--color-void-border);
  padding: var(--space-10) var(--space-8);
}

@media (min-width: 768px) {
  .login-card {
    max-width: 440px;
    border-radius: var(--radius-xl);
    border-color: var(--color-nebula-purple);
    box-shadow: var(--glow-purple);
  }
}

/* Phone: full-screen login form */
@media (max-width: 767px) {
  .login-page {
    align-items: flex-start;
  }

  .login-card {
    min-height: 100vh;
    padding: var(--space-16) var(--space-5) var(--space-10);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.login-logo {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--color-nebula-purple), var(--color-teal-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  text-align: center;
  font-size: var(--text-sm);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-ghost);
  margin-bottom: var(--space-10);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-dim);
}

.form-input {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-starlight);
  background: var(--color-void);
  border: 1px solid var(--color-void-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  min-height: var(--touch-min);
  width: 100%;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
  color: var(--color-ghost);
}

.form-input:focus {
  border-color: var(--color-nebula-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-magenta-bright);
  margin-top: var(--space-2);
  display: none;
}

.form-error.visible {
  display: block;
}

.login-submit {
  width: 100%;
  margin-top: var(--space-8);
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-6);
}

/* ============================================================
   PLACEHOLDER / COMING-SOON BANNER
   ============================================================ */

.coming-soon-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-8);
}

.coming-soon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold-bright);
  box-shadow: 0 0 12px var(--color-gold-bright);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.coming-soon-text {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold-bright);
}

/* ============================================================
   FOCUS STYLES (accessibility)
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--color-nebula-purple);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
