/* =============================================================================
 * Afrinet Connect — Launch Countdown · STYLES
 * Brand palette mirrors afrinet_frontend: violet primary hsl(252 80% 63%) on a
 * near-black navy, with cyan accents taken from the Afrinet Connect logo mark.
 * ===========================================================================*/

/* ----------------------------------------------------------------- Tokens -- */
/* Light theme is the default; dark is applied when the OS prefers it (unless the
   visitor forced light) and whenever the visitor forces dark via the toggle. */
:root {
  --bg: hsl(220 33% 97%);
  --bg-2: hsl(252 56% 95%);
  --surface: hsla(0 0% 100% / 0.72);
  --border: hsla(222 47% 20% / 0.12);
  --fg: hsl(222 47% 12%);
  --muted: hsl(215 16% 40%);

  --primary: hsl(252 76% 58%);
  --primary-ink: hsl(210 40% 98%);
  --cyan: hsl(190 90% 40%);
  --violet-glow: hsla(252 80% 63% / 0.22);
  --cyan-glow: hsla(189 94% 54% / 0.2);
  --surface-2: hsla(252 60% 96% / 0.6);
  --track: hsla(222 47% 20% / 0.12);
  --modal-bg: hsl(0 0% 100%);

  /* Theme-flipping text fills (gradient start + the big numerals). */
  --numeral: hsl(222 47% 12%);
  --title-grad-start: hsl(222 60% 22%);

  /* Tokens that don't change with theme. */
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 940px;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* Dark tokens, shared by the OS-preference and the forced-dark cases. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: hsl(222 84% 4.9%);
    --bg-2: hsl(222 47% 9%);
    --surface: hsla(222 47% 14% / 0.55);
    --border: hsla(210 40% 98% / 0.1);
    --fg: hsl(210 40% 98%);
    --muted: hsl(215 20% 65%);
    --primary: hsl(252 80% 63%);
    --primary-ink: hsl(210 40% 98%);
    --cyan: hsl(189 94% 54%);
    --violet-glow: hsla(252 80% 63% / 0.45);
    --cyan-glow: hsla(189 94% 54% / 0.35);
    --surface-2: hsla(222 47% 11% / 0.35);
    --track: hsla(210 40% 98% / 0.08);
    --modal-bg: hsl(222 47% 10%);
    --numeral: #fff;
    --title-grad-start: #fff;
  }
}
:root[data-theme="dark"] {
  --bg: hsl(222 84% 4.9%);
  --bg-2: hsl(222 47% 9%);
  --surface: hsla(222 47% 14% / 0.55);
  --border: hsla(210 40% 98% / 0.1);
  --fg: hsl(210 40% 98%);
  --muted: hsl(215 20% 65%);
  --primary: hsl(252 80% 63%);
  --primary-ink: hsl(210 40% 98%);
  --cyan: hsl(189 94% 54%);
  --violet-glow: hsla(252 80% 63% / 0.45);
  --cyan-glow: hsla(189 94% 54% / 0.35);
  --surface-2: hsla(222 47% 11% / 0.35);
  --track: hsla(210 40% 98% / 0.08);
  --modal-bg: hsl(222 47% 10%);
  --numeral: #fff;
  --title-grad-start: #fff;
}

/* ------------------------------------------------------------- Base reset -- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* Author `display` rules (e.g. .launched{display:flex}) otherwise beat the
   UA's [hidden]{display:none}, leaving "hidden" sections visible. */
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--fg);
  background:
    radial-gradient(1100px 600px at 50% -10%, var(--bg-2), transparent 60%),
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s ease, color 0.4s ease;
}
img {
  max-width: 100%;
  display: block;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------- Background art -- */
.constellation {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 320px at 15% 20%, var(--violet-glow), transparent 70%),
    radial-gradient(620px 360px at 85% 80%, var(--cyan-glow), transparent 72%);
  filter: blur(18px);
  opacity: 0.7;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from {
    transform: translate3d(-18px, -10px, 0) scale(1);
  }
  to {
    transform: translate3d(18px, 12px, 0) scale(1.08);
  }
}

/* --------------------------------------------------------------- Layout --- */
.shell {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 20px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(26px, 5vw, 44px);
  text-align: center;
}

/* ---------------------------------------------------------------- Brand --- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.brand__logo {
  width: clamp(104px, 20vw, 140px);
  height: auto;
  filter: drop-shadow(0 10px 40px var(--cyan-glow));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-8px);
  }
}
.brand__badge {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.brand__badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* ----------------------------------------------------------------- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
}
.hero__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.05;
}
.hero__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 7vw, 4.2rem);
  background: linear-gradient(100deg, var(--title-grad-start) 10%, var(--primary) 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.hero__tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  color: var(--fg);
}
.hero__intro {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.1rem);
  line-height: 1.65;
}

/* ------------------------------------------------------------ Countdown --- */
.countdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.countdown__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 2.2vw, 20px);
  width: 100%;
  max-width: 760px;
}
.unit {
  position: relative;
  padding: clamp(16px, 3vw, 28px) 8px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 hsla(0 0% 100% / 0.06);
  overflow: hidden;
}
.unit::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--cyan), transparent);
  opacity: 0.8;
}
.unit__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 8vw, 3.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--numeral);
  text-shadow: 0 0 24px var(--violet-glow);
}
.unit__value.tick {
  animation: tick 0.5s ease;
}
@keyframes tick {
  0% {
    transform: translateY(-40%);
    opacity: 0;
    filter: blur(4px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}
.unit__label {
  display: block;
  margin-top: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------- Progress --- */
.progress {
  width: 100%;
  max-width: 760px;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  box-shadow: 0 0 18px var(--violet-glow);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress__caption {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ------------------------------------------------------------- Launched --- */
.launched {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.launched__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3rem);
  margin: 0;
  background: linear-gradient(100deg, var(--title-grad-start), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------- Notify --- */
.notify {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notify__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  margin: 0;
}
.notify__sub {
  margin: 0 0 8px;
  color: var(--muted);
}
.notify__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.notify__input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 1rem;
  font-family: inherit;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.notify__input::placeholder {
  color: hsla(215 20% 65% / 0.8);
}
.notify__input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--violet-glow);
}
.notify__input.invalid {
  border-color: hsl(0 72% 60%);
  box-shadow: 0 0 0 4px hsla(0 72% 60% / 0.25);
}
.notify__msg {
  min-height: 1.2em;
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--cyan);
}
.notify__msg.error {
  color: hsl(0 80% 72%);
}

/* ---------------------------------------------------------------- Button -- */
.btn {
  appearance: none;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 999px;
  color: var(--primary-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.2s ease;
}
.btn--primary {
  background: linear-gradient(100deg, var(--primary), hsl(252 80% 55%));
  box-shadow: 0 14px 40px -12px var(--violet-glow);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px -12px var(--violet-glow);
  filter: brightness(1.07);
}
.btn--primary:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.notify__btn {
  flex: 0 0 auto;
}

/* ----------------------------------------------------------------- Foot --- */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}
.social {
  display: flex;
  gap: 12px;
}
.social a {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, border-color 0.2s, color 0.2s, box-shadow 0.25s;
}
.social a:hover {
  transform: translateY(-3px);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.social svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.share {
  appearance: none;
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s;
}
.share:hover {
  color: var(--fg);
}
.foot__legal {
  margin: 0;
  font-size: 0.8rem;
  color: hsla(215 20% 65% / 0.7);
}

/* --------------------------------------------------------- Theme toggle --- */
.theme-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 5;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.theme-toggle:hover {
  transform: translateY(-2px) rotate(12deg);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ------------------------------------------------- Hero CTA & back link --- */
.hero__cta {
  margin-top: 6px;
  display: flex;
  justify-content: center;
}
.btn--ghost {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s, transform 0.2s;
}
.backlink:hover {
  color: var(--fg);
  transform: translateX(-2px);
}

/* ------------------------------------------------------- Reveal on load --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------------------------------------- Small screens -- */
@media (max-width: 540px) {
  .countdown__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .notify__btn {
    flex: 1 1 100%;
  }
}

/* --------------------------------------------------------------- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 18, 0.62);
  backdrop-filter: blur(5px);
  animation: modalFade 0.25s ease;
}
.modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 26px;
  text-align: center;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal__x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.modal__x:hover {
  color: var(--fg);
  background: var(--surface-2);
}
.modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 10px 30px -6px var(--violet-glow);
  animation: modalPing 0.5s ease 0.1s both;
}
.modal__icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--fg);
}
.modal__body {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}
.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
@keyframes modalFade {
  from {
    opacity: 0;
  }
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}
@keyframes modalPing {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

/* --------------------------------------------------------- Reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .aurora {
    animation: none;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
