/* ==========================================================================
   NGOPR — coming soon
   Zero external dependencies. System fonts only. All visuals are CSS/SVG.
   Palette is tuned to pass WCAG AA for text on the dark background.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg:            #07080d;
  --bg-elevated:   #0d0f18;
  --line:          #232838;
  --line-strong:   #333a4f;

  /* Text (contrast on --bg)
     --text        ~17.4:1
     --text-muted  ~8.4:1  (AA + AAA for normal text)
     --text-subtle ~5.9:1  (passes AA) */
  --text:          #f4f6fb;
  --text-muted:    #b9c0d4;
  --text-subtle:   #939cba;

  /* Accents */
  --accent:        #8b7bff;
  --accent-strong: #6d5efc;
  --accent-cyan:   #22d3ee;
  --accent-soft:   rgba(139, 123, 255, 0.16);

  /* Semantic */
  --ok:            #5eead4;
  --ok-soft:       rgba(94, 234, 212, 0.12);
  --warn:          #fcd34d;
  --warn-soft:     rgba(252, 211, 77, 0.12);
  --danger:        #fca5a5;

  /* Geometry */
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shell:     68rem;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, p { margin: 0; }

img, svg { display: block; max-width: 100%; }

a {
  color: var(--text);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

strong { font-weight: 650; color: var(--text); }

/* ---------- Focus visibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Never remove focus entirely; fall back for older engines */
:focus { outline-color: var(--accent-cyan); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-strong);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Layout shell ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 2.5rem);
}

/* ---------- Decorative backdrop ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.backdrop__glow--a {
  width: min(60rem, 120vw);
  aspect-ratio: 1;
  top: -34rem;
  left: 50%;
  translate: -50% 0;
  background: radial-gradient(circle at 50% 50%,
              rgba(109, 94, 252, 0.85) 0%,
              rgba(109, 94, 252, 0.28) 42%,
              rgba(109, 94, 252, 0) 70%);
}
.backdrop__glow--b {
  width: min(42rem, 90vw);
  aspect-ratio: 1;
  bottom: -22rem;
  right: -12rem;
  background: radial-gradient(circle at 50% 50%,
              rgba(34, 211, 238, 0.45) 0%,
              rgba(34, 211, 238, 0.12) 45%,
              rgba(34, 211, 238, 0) 72%);
  opacity: 0.4;
}

/* Faint technical grid for texture */
.backdrop__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 22%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 22%, #000 0%, transparent 78%);
}

/* Subtle top hairline highlight */
.backdrop__grain {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent 22%);
  mask-image: linear-gradient(to bottom, #000, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
}

.backdrop__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 30%, transparent 40%, rgba(0, 0, 0, 0.72) 100%);
}

/* ---------- Header ---------- */
.site-header {
  padding-block: clamp(1.25rem, 3vw, 1.75rem);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
}
.logo__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
  box-shadow: 0 6px 22px -8px rgba(109, 94, 252, 0.9);
}
.logo__text {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.site-header__nav { display: none; }
@media (min-width: 44rem) {
  .site-header__nav { display: block; }
  .nav-link {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--text-subtle);
    text-decoration: none;
    letter-spacing: 0.01em;
  }
  .nav-link:hover { color: var(--accent-cyan); }
}

/* ---------- Hero ---------- */
.main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding-block: clamp(1.5rem, 6vw, 4rem);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.15rem, 2.6vw, 1.75rem);
}

/* Status pill */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.95rem 0.42rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  backdrop-filter: blur(8px);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18); opacity: 1; }
  50%      { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.05); opacity: 0.72; }
}

/* Wordmark — 5 glyphs ("NGOPR"), so the font-size is deliberately capped well
   below the container width. The measured render width stays inside the
   available line box at every breakpoint down to 320px (verified in a real
   browser; see README). */
.wordmark {
  font-size: clamp(1.5rem, 10.2vw, 7rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0.005em;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: linear-gradient(170deg, #ffffff 8%, #d7d2ff 46%, #8b7bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Fallback for engines without background-clip: text */
  -webkit-text-fill-color: transparent;
}
/* Solid colour when gradient text is unsupported */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark { color: var(--text); -webkit-text-fill-color: var(--text); background: none; }
}

/* Lede */
.lede {
  max-width: 32rem;
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---------- Signup ---------- */
.signup {
  width: 100%;
  max-width: min(34rem, 100%);
  margin-top: clamp(0.5rem, 2vw, 1.25rem);
  padding: clamp(1.35rem, 3.4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 42%),
    rgba(13, 15, 24, 0.72);
  backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
    0 32px 70px -40px rgba(0, 0, 0, 0.95);
  text-align: left;
}

.signup__heading {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}

.signup__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.field {
  flex: 1 1 14rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.field__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(7, 8, 13, 0.82);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* >=16px avoids iOS zoom-on-focus */
  appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.field__input::placeholder { color: var(--text-subtle); opacity: 1; }
.field__input:hover { border-color: #454d68; }
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(7, 8, 13, 0.95);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
/* Keep a keyboard-visible ring even with the custom focus style above */
.field__input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.field__input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(252, 165, 165, 0.14);
}

/* Button */
.button {
  flex: 1 1 9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 60%, #5a4bec 100%);
  color: #ffffff;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 34px -16px rgba(109, 94, 252, 0.95);
  transition: transform 140ms ease, box-shadow 200ms ease, filter 160ms ease;
}
.button:hover { filter: brightness(1.08); box-shadow: 0 18px 40px -16px rgba(109, 94, 252, 1); }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; filter: none; }
.button__icon { width: 18px; height: 18px; flex: 0 0 auto; transition: transform 160ms ease; }
.button:hover .button__icon { transform: translateX(3px); }

.signup__hint {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

/* Used by 404.html */
.signup__intro {
  margin-bottom: 1.15rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.signup__actions { margin: 0; }

/* The button doubles as a link on the 404 page */
a.button {
  text-decoration: none;
  color: #ffffff;
  display: inline-flex;
}
a.button:hover { color: #ffffff; }

/* ---------- Result notice ---------- */
.notice:empty { display: none; }

.notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.notice:focus { outline: none; }

.notice--ok {
  border-color: rgba(94, 234, 212, 0.4);
  border-left-color: var(--ok);
  background: var(--ok-soft);
}
.notice--error {
  border-color: rgba(252, 165, 165, 0.4);
  border-left-color: var(--danger);
  background: rgba(252, 165, 165, 0.1);
}

.notice__title {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.notice__meta {
  display: block;
  margin-top: 0.65rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px dashed rgba(252, 211, 77, 0.35);
  border-radius: 6px;
  background: var(--warn-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--warn);
  letter-spacing: 0.01em;
}

/* ---------- Tagline (formerly byline) ---------- */
.byline {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: clamp(0.5rem, 2vw, 1rem);
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.byline__rule {
  width: clamp(1.5rem, 6vw, 3rem);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-strong));
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 8, 13, 0.6);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}
.site-footer__copy,
.site-footer__links { margin: 0; }
.site-footer__links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-inline-start: auto;
}
.site-footer__links a { color: var(--text-muted); text-decoration-color: transparent; }
.site-footer__links a:hover { color: var(--accent); text-decoration-color: currentColor; }
.site-footer__links span { color: var(--line-strong); }

@media (max-width: 30rem) {
  .site-footer__inner { justify-content: flex-start; text-align: left; }
  .site-footer__links { margin-inline-start: 0; }
}

/* ---------- Reveal animation (Enhanced only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    animation: reveal 700ms cubic-bezier(0.22, 0.7, 0.24, 1) forwards;
  }
  [data-reveal]:nth-of-type(1) { animation-delay: 40ms; }
  .wordmark[data-reveal]        { animation-delay: 120ms; }
  .lede[data-reveal]            { animation-delay: 220ms; }
  .signup[data-reveal]          { animation-delay: 320ms; }
  .byline[data-reveal]          { animation-delay: 420ms; }

  @keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
  }

  /* Parallax-ish drift on the ambient glow */
  .backdrop__glow--a {
    animation: drift 26s ease-in-out infinite alternate;
  }
  @keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(0, 2.5rem, 0) scale(1.06); }
  }
}

/* Fully disable motion when the user asks for it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .backdrop, .skip-link, .button__icon { display: none !important; }
  body { background: #fff; color: #111; }
  .wordmark { color: #111; -webkit-text-fill-color: #111; background: none; }
  .signup, .site-footer { border-color: #ccc; background: #fff; }
}

/* ---------- Small screens ---------- */
@media (max-width: 26rem) {
  .signup__form { flex-direction: column; align-items: stretch; }
  .button { flex: 1 1 auto; width: 100%; }
  .field { flex: 1 1 auto; }
  .site-header__inner { gap: 0.75rem; }
  .logo__text { letter-spacing: 0.16em; }
}

/* ---------- High-contrast / forced colors ---------- */
@media (forced-colors: active) {
  .button { border: 1px solid ButtonText; }
  .wordmark { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; }
  .status, .signup, .notice { border: 1px solid CanvasText; }
}
