/* ==========================================================================
   ServiceSpaceAI — Private Beta teaser
   ========================================================================== */

:root {
  --accent: #2baae2;
  --accent-dim: rgba(43, 170, 226, .12);
  --accent-border: rgba(43, 170, 226, .35);
  --bg: #060b14;
  --bg-panel: #0a121d;
  --bg-panel-alt: #0b1420;
  --bg-chrome: #0d1622;
  --text: #d9e3ee;
  --text-heading: #f4f8fb;
  --text-dim: #a9b9cb;
  --text-dimmer: #8fa3b7;
  --text-faint: #5c7286;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --max-width: 1180px;
}

/* ---- Reset & base ---- */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.site-footer {
  flex: none;
}

h1, h2, h3 {
  font-family: 'Poppins', system-ui, sans-serif;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: #6fd0f2;
  text-decoration: none;
}

a:hover {
  color: #a7e4f8;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

input {
  font-family: inherit;
}

img {
  max-width: 100%;
}

/* Author rules like `.join-form { display: flex }` otherwise win the
   cascade over the browser's default `[hidden]` rule, since same-specificity
   ties go to the author stylesheet. Keep [hidden] authoritative. */
[hidden] {
  display: none !important;
}

::selection {
  background: rgba(43, 170, 226, .35);
}

/* ---- Motion ---- */

@keyframes ssFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ssRise {
  from { opacity: 0; transform: translateY(105%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Entrance only — nothing on this page loops once it has settled. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- Atmospheric background ---- */

.bg-atmosphere {
  /* Fixed and clipped: .grid-floor is deliberately larger than the viewport
     (inset: -50%) so its perspective transform has room. Without overflow
     containment here that oversize expands the document and the page scrolls
     sideways. */
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
}

.glow--top {
  top: -18%;
  left: 50%;
  transform: translateX(-50%);
  width: 1400px;
  height: 1000px;
  max-width: 200vw;
  background: radial-gradient(circle, rgba(43, 170, 226, .22) 0%, rgba(43, 170, 226, .08) 32%, transparent 68%);
  filter: blur(10px);
  opacity: .85;
}

.glow--left {
  top: 38%;
  left: 8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(18, 58, 94, .53) 0%, transparent 70%);
}

.glow--right {
  bottom: -10%;
  right: 4%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(14, 44, 74, .6) 0%, transparent 70%);
}

/* Static perspective grid — no drift; it is texture, not motion. */
.grid-floor {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(43, 170, 226, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 170, 226, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(600px) rotateX(58deg) translateY(-8%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 42%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 42%, #000 20%, transparent 72%);
}

/* ---- Buttons ---- */

.btn {
  display: inline-block;
  font-weight: 700;
  border-radius: 9px;
  transition: transform .15s ease, filter .15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #04121e;
  font-size: 15px;
  padding: 15px 28px;
}

.btn--primary:hover {
  filter: brightness(1.08);
}

.btn--block {
  width: 100%;
  text-align: center;
  padding: 14px;
}

/* ---- Hero ---- */

.hero {
  position: relative;
  z-index: 5;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 22px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: .9;
  animation: ssFade .8s ease both .02s;
}

.hero h1 {
  font-family: 'Poppins', system-ui, sans-serif;
  margin: 0;
  font-size: clamp(23px, 3.1vw, 38px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--text-heading);
  white-space: nowrap;
}

/* Forces the stat line to break after "80% Feel Faster." on mobile instead
   of wherever text-wrap: balance happens to land it. */
.hero-break {
  display: none;
}

/* The wrapper clips the rise, so the line arrives from below rather than
   fading in place. */
.hero-line {
  display: block;
  overflow: hidden;
}

.hero-line > span {
  display: block;
  animation: ssRise .95s cubic-bezier(.16, 1, .3, 1) both .05s;
}

/* 6% is the indictment, not a win — it recedes rather than taking accent. */
.hero-prove {
  color: var(--text-dim);
  font-weight: 500;
}

.hero-marks {
  display: inline-flex;
  align-items: center;
  gap: .34em;
  margin-left: .6em;
  position: relative;
  top: .06em;
}

.hero-marks img {
  /* Both marks are square. Pinning both axes (rather than width: auto) keeps
     them sized even if this rule is ever missing — the SVGs carry no
     intrinsic size of their own, so an unstyled one fills its container. */
  height: .76em;
  width: .76em;
  display: block;
  opacity: .8;
}

.kicker {
  font-family: 'Poppins', system-ui, sans-serif;
  margin-top: 52px;
  font-size: clamp(20px, 2.5vw, 31px);
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(43, 170, 226, .28);
  animation: ssFade .9s ease both .8s;
}

.hero-brand {
  margin-top: 14px;
  animation: ssFade .9s ease both 1s;
}

.hero-brand img {
  height: 34px;
  width: auto;
  display: block;
}

.hero-rails {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 48px;
  margin-top: 84px;
  animation: ssFade .9s ease both 1.2s;
}

.rail {
  position: relative;
  background: none;
  border: none;
  padding: 8px 2px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: color .28s ease;
}

.rail svg {
  transition: transform .28s cubic-bezier(.16, 1, .3, 1);
}

.rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .38s cubic-bezier(.16, 1, .3, 1);
}

.rail:hover {
  color: var(--text-heading);
}

.rail:hover svg {
  transform: translateX(5px);
}

.rail:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---- Join modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 9, 16, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ssFadeUp .2s ease both;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #101b28, #0a121d);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .04);
  padding: 40px 36px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .05);
  color: var(--text-dimmer);
  transition: background .15s ease, color .15s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--text-heading);
}

.modal-confirmation .confirmation-icon {
  margin: 0 auto 18px;
  display: block;
}

.modal-confirmation h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-heading);
}

.modal-confirmation p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
}

.modal-intro h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-heading);
  padding-right: 20px;
}

.modal-intro > p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
}

.join-form {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dimmer);
  letter-spacing: .02em;
}

.field input,
.field textarea {
  margin-top: 6px;
  width: 100%;
  background: #0a131f;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  color: #eef3f8;
  font-size: 14px;
}

.field textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field-counter {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
}

.field-counter.is-near-limit {
  color: #f2a2a2;
}

/* Honeypot: off-screen rather than display:none/visibility:hidden, since
   simple bots specifically skip those two and still fill the field. */
.field--honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.form-error {
  font-size: 13px;
  color: #f2a2a2;
}

/* ---- Footer ---- */

.site-footer {
  position: relative;
  z-index: 5;
  flex: none;
  padding: 20px 24px 40px;
  text-align: center;
  animation: ssFade .9s ease both 1.4s;
}

.attrib {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* The hero is one unbroken line on wide screens; below this it must wrap
   or it would overflow the viewport. */
@media (max-width: 760px) {
  .hero h1 {
    white-space: normal;
  }

  .hero-break {
    display: block;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 32px 20px;
    min-height: 0;
  }

  body {
    justify-content: center;
  }

  .eyebrow {
    font-size: 10.5px;
    letter-spacing: .26em;
    margin-bottom: 16px;
  }

  .kicker {
    margin-top: 36px;
  }

  .hero-brand img {
    height: 27px;
  }

  .hero-rails {
    gap: 10px 30px;
    margin-top: 64px;
  }

  .rail {
    font-size: 15px;
  }

  .attrib {
    font-size: 10px;
    letter-spacing: .14em;
  }

  .btn--primary {
    width: 100%;
  }

  .modal-card {
    padding: 32px 24px;
  }

  .site-footer {
    padding: 16px 20px 32px;
  }
}
