/* Theme: Neurocolourful Sunrise */
:root {
  --base: #00202e;
  --text: #ffffff;
  --card: #2c4875;
  --accent: #ff6361;
  --accent2: #ffa600;
  --magenta-700: #b24086;
  --warm-grey: #f3f3f3;
  --anthracite: #333333;
  /* Layout tokens (from styleguide) */
  --radius: 16px;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  /* Gradient tokens from styleguide */
  --midnight: #00202e;
  --petrol: #003f5c;
  --blueviolet: #2c4875;
  --violet: #8a508f;
  --magenta: #bc5090;
  --red: #ff6361;
  --orange: #ff8531;
  --amber: #ffa600;
  --pastel-yellow: #ffd380;
  --white: #ffffff;
}

/* Self-hosted fonts */
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Variable.woff2") format("woff2-variations"),
    url("/fonts/Inter-Regular.woff2") format("woff2"),
    url("/fonts/Inter-Variable.ttf") format("truetype"),
    url("/fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Raleway";
  src: url("/fonts/Raleway-Variable.ttf") format("truetype"),
    url("/fonts/Raleway-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Base typography */
html {
  font-size: 16px;
}
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  background: var(--base);
  color: var(--text);
}

/* Ensure center alignment even without Tailwind applying */
body {
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
}
header {
  width: 100%;
  padding: 3rem 1.5rem 0;
}
header > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
main {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
footer {
  width: 100%;
  padding: 0 1.5rem 3rem;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Enforce logo size explicitly */
#siteLogo {
  width: 20px;
  height: 20px;
}

/* Card and form fallbacks */
.card {
  border-radius: var(--radius);
  padding: 1.5rem;
}
#waitlistForm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  #waitlistForm {
    flex-direction: row;
  }
}

.hero-heading {
  font-family: "Raleway", "Inter", system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, "Noto Sans";
}

/* Animated sunrise gradient (from styleguide header) */
@keyframes shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-card {
  background: linear-gradient(
    135deg,
    var(--midnight),
    var(--petrol),
    var(--blueviolet),
    var(--violet),
    var(--magenta),
    var(--red),
    var(--orange),
    var(--amber),
    var(--pastel-yellow)
  );
  background-size: 200% 200%;
  animation: shift 20s ease infinite;
  color: var(--white);
  box-shadow: var(--shadow);
}

/* Hero logo and subtitle */
.hero-logo {
  display: block;
  width: 512px;
  height: 512px;
  max-width: 80vw;
  max-height: 80vw;
  margin: 0 auto 1rem;
  border-radius: 1rem;
}

/* Brand row for legal page header */
.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
}
.brand-logo-sm {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}
.brand-name-sm {
  font-family: "Raleway", "Inter", system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, "Noto Sans";
  font-size: 14px;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

/* Utilities */
.card {
  background-color: var(--card);
}
.focus-ring:focus,
.focus-ring:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 3px;
}
input[type="email"] {
  background: #ffffff;
  color: var(--base);
  border: 1px solid transparent;
}
input[type="email"]:focus {
  border-color: var(--magenta-700);
}

/* Mobile and accessibility optimizations */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}
.hero-heading {
  font-size: clamp(28px, 6vw, 32px);
}
button,
input[type="submit"],
input[type="email"] {
  min-height: 48px; /* Comfortable tap target */
}
#waitlistForm > input,
#waitlistForm > button {
  width: 100%;
}
@media (min-width: 640px) {
  #waitlistForm > button {
    width: auto;
  }
}
@media (max-width: 480px) {
  main {
    padding: 2rem 1rem;
  }
  .card {
    padding: 1.25rem;
  }
  .hero-logo {
    margin-bottom: 0.75rem;
  }
}
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  footer {
    padding-bottom: max(3rem, calc(3rem + env(safe-area-inset-bottom)));
  }
}
@media (prefers-reduced-motion: reduce) {
  .gradient-card {
    animation: none;
  }
  html:focus-within {
    scroll-behavior: auto;
  }
}
