/* ==========================================================================
   Astra Makers — Launching Soon
   Standalone static styles. No frameworks. No external fonts.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --color-navy: #0b1f3a;
  --color-blue: #1d4ed8;
  --color-cyan: #06b6d4;
  --color-teal: #14b8a6;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-border: #cbd5e1;

  /* Layout */
  --max-width: 1200px;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Typography */
  --font-sans: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-2xs: 0.6875rem;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;

  /* Surfaces / elevation */
  --surface-soft: color-mix(in srgb, var(--color-surface) 88%, transparent);
  --surface-card: color-mix(in srgb, var(--color-surface) 90%, transparent);
  --border-soft: color-mix(in srgb, var(--color-border) 55%, transparent);
  --border-faint: color-mix(in srgb, var(--color-border) 40%, transparent);
  --shadow-soft: 0 1px 2px color-mix(in srgb, var(--color-navy) 4%, transparent);
  --shadow-card: 0 2px 8px color-mix(in srgb, var(--color-navy) 3.5%, transparent);

  /* Decorative opacity targets (also drive entrance keyframe end-states) */
  --topology-opacity: 0.16;
  --racks-opacity: 0.07;

  /* Motion — entrance ≤300ms; decorative loops are longer by design */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --enter-duration: 200ms;
  --enter-distance: 10px;

  /* Focus */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--color-blue) 35%, transparent);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Prevent incidental horizontal scroll on narrow viewports */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

h1,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

/* --------------------------------------------------------------------------
   Background — faint grid + soft radial glows
   -------------------------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  animation: fade-in var(--enter-duration) var(--ease) both;
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--color-border) 42%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--color-border) 42%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.38;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}

.bg__glow--one {
  width: min(52vw, 520px);
  height: min(52vw, 520px);
  top: -8%;
  left: 18%;
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 70%);
  animation: glow-drift 18s var(--ease) infinite alternate;
}

.bg__glow--two {
  width: min(48vw, 480px);
  height: min(48vw, 480px);
  bottom: -12%;
  right: 12%;
  background: radial-gradient(circle, var(--color-blue) 0%, transparent 70%);
  animation: glow-drift 22s var(--ease) infinite alternate-reverse;
}

@keyframes glow-drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(24px, -16px);
  }
}

/* --------------------------------------------------------------------------
   Decorative SVG overlays
   -------------------------------------------------------------------------- */
.deco {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.deco--topology {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: var(--topology-opacity);
  animation: fade-in-topology var(--enter-duration) var(--ease) 40ms both;
}

.deco--racks {
  width: 72px;
  height: 180px;
  opacity: var(--racks-opacity);
  top: 50%;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--color-navy);
  stroke-width: 1.25;
  animation: fade-in-racks var(--enter-duration) var(--ease) 60ms both;
}

.deco--racks-left {
  left: max(1.5rem, calc((100vw - var(--max-width)) / 2 - 2rem));
}

.deco--racks-right {
  right: max(1.5rem, calc((100vw - var(--max-width)) / 2 - 2rem));
}

.deco__lines {
  stroke: var(--color-navy);
}

.deco__nodes {
  fill: var(--color-cyan);
}

/* Soft node pulse — ~9s cycle */
.deco__pulse-node {
  transform-origin: center;
  transform-box: fill-box;
  animation: node-pulse 9s var(--ease) infinite;
}

.deco__pulse-node--alt {
  animation-delay: 4.5s;
}

@keyframes node-pulse {
  0%,
  82%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  88% {
    opacity: 0.5;
    transform: scale(1.55);
  }
  94% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Faint light along one connection — ~10s cycle */
.deco__pulse-line {
  stroke: var(--color-cyan);
  stroke-width: 1.5;
  stroke-dasharray: 12 88;
  stroke-dashoffset: 100;
  opacity: 0;
  animation: line-travel 10s linear infinite;
}

@keyframes line-travel {
  0%,
  70% {
    opacity: 0;
    stroke-dashoffset: 100;
  }
  75% {
    opacity: 0.55;
  }
  90% {
    opacity: 0.35;
    stroke-dashoffset: 0;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

/* --------------------------------------------------------------------------
   Hero
   Entrance order: bg → logo → heading → accent → subtitle → body → badge →
   countdown → status → footer (delays below; duration = --enter-duration)
   -------------------------------------------------------------------------- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) 0 calc(var(--space-xl) + 1.5rem);
}

.hero__inner {
  width: 100%;
  max-width: 40rem;
  text-align: center;
}

.hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: calc(var(--space-lg) + 0.35rem);
  animation: fade-up var(--enter-duration) var(--ease) 100ms both;
}

.hero__logo {
  width: 92px;
  height: 92px;
}

.hero__brand-name {
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-navy);
}

.hero__title {
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
  animation: fade-up var(--enter-duration) var(--ease) 200ms both;
}

.hero__accent {
  width: 80px;
  height: 2px;
  margin: 0 auto var(--space-md);
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-cyan) 20%,
    var(--color-teal) 50%,
    var(--color-cyan) 80%,
    transparent 100%
  );
  animation: fade-up var(--enter-duration) var(--ease) 240ms both;
}

.hero__domains {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-blue);
  margin-bottom: var(--space-lg);
  animation: fade-up var(--enter-duration) var(--ease) 300ms both;
}

.hero__lead {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  animation: fade-up var(--enter-duration) var(--ease) 360ms both;
}

.hero__copy {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 35rem; /* ~560px reading measure */
  margin: 0 auto var(--space-lg);
  animation: fade-up var(--enter-duration) var(--ease) 400ms both;
}

.hero__badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 1.35rem;
  background-color: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  cursor: default;
  user-select: none;
  animation: fade-up var(--enter-duration) var(--ease) 460ms both;
}

.hero__badge-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.hero__badge-date {
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--color-navy);
}

/* --------------------------------------------------------------------------
   Countdown
   -------------------------------------------------------------------------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  width: 100%;
  max-width: 24rem;
  margin: calc(var(--space-xl) + 0.75rem) auto 0; /* +12px below badge */
  animation: fade-up var(--enter-duration) var(--ease) 540ms both;
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.9rem var(--space-xs);
  background-color: var(--surface-card);
  border: 1px solid var(--border-faint);
  border-radius: 11px;
  box-shadow: var(--shadow-card);
}

.countdown__value {
  font-size: 1.875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-navy);
}

.countdown__label {
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.countdown--launched {
  grid-template-columns: 1fr;
  max-width: 16rem;
}

.countdown--launched .countdown__item {
  padding: var(--space-md);
}

.countdown--launched .countdown__value {
  font-size: var(--text-lg);
}

.countdown--launched .countdown__label {
  display: none;
}

/* --------------------------------------------------------------------------
   Status line + footer
   -------------------------------------------------------------------------- */
.status-line {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: color-mix(in srgb, var(--color-text-secondary) 75%, transparent);
  animation: fade-up var(--enter-duration) var(--ease) 600ms both;
}

.footer {
  padding: calc(var(--space-lg) + 0.25rem) 0 var(--space-md);
  margin-top: 0;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  animation: fade-up var(--enter-duration) var(--ease) 660ms both;
}

.footer__tagline {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  max-width: 28rem;
  margin: 0 auto var(--space-sm);
}

.footer__legal {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Entrance keyframes
   -------------------------------------------------------------------------- */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-topology {
  from {
    opacity: 0;
  }
  to {
    opacity: var(--topology-opacity);
  }
}

@keyframes fade-in-racks {
  from {
    opacity: 0;
  }
  to {
    opacity: var(--racks-opacity);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(var(--enter-distance));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Reduced motion — disable ALL decorative and entrance animations
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bg,
  .bg__glow--one,
  .bg__glow--two,
  .deco--topology,
  .deco--racks,
  .deco__pulse-node,
  .deco__pulse-line,
  .hero__brand,
  .hero__title,
  .hero__accent,
  .hero__domains,
  .hero__lead,
  .hero__copy,
  .hero__badge,
  .countdown,
  .status-line,
  .footer {
    animation: none !important;
  }

  .deco__pulse-line {
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Responsive — ≤1366px
   -------------------------------------------------------------------------- */
@media (max-width: 1366px) {
  :root {
    --topology-opacity: 0.12;
  }
}

/* --------------------------------------------------------------------------
   Responsive — tablet (≤768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --topology-opacity: 0.08;
  }

  .deco--racks {
    display: none;
  }

  .deco--topology {
    animation: none;
  }

  .deco__pulse-node,
  .deco__pulse-line {
    animation: none !important;
  }

  .deco__pulse-line {
    opacity: 0;
  }

  .hero__logo {
    width: 80px;
    height: 80px;
  }

  .countdown {
    max-width: 22rem;
  }

  .countdown__value {
    font-size: 1.625rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive — mobile (≤480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .page {
    padding: var(--space-md) var(--space-sm);
  }

  .hero {
    padding: var(--space-lg) 0 calc(var(--space-lg) + 1rem);
  }

  .hero__logo {
    width: 76px;
    height: 76px;
  }

  .hero__domains {
    letter-spacing: 0.015em;
  }

  .hero__copy {
    max-width: 100%;
  }

  .countdown {
    gap: var(--space-xs);
    max-width: 100%;
  }

  .countdown__item {
    padding: 0.75rem 0.2rem;
    border-radius: 10px;
  }

  .countdown__value {
    font-size: 1.375rem;
  }

  .countdown__label {
    font-size: 0.625rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive — very small (≤360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .hero__domains {
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
  }

  .countdown__value {
    font-size: 1.25rem;
  }

  .countdown__item {
    padding: 0.65rem 0.15rem;
  }
}
