/* Importing Google Fonts - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  --page: #eef4ff;
  --footer: #0b1437;
  --footer-2: #111c4a;
  --text: #e6ebff;
  --muted: #98a3cc;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --ok: #22c55e;
  --error: #fb7185;
}

body {
  background: var(--page);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.page-demo {
  min-height: 70vh;
  display: grid;
  place-items: center;
  color: #5b6b96;
  font-weight: 500;
}

/* ---------- Waves ---------- */
.footer {
  position: relative;
  color: var(--text);
}

.waves {
  height: 120px;
  margin-bottom: -2px;
  overflow: hidden;
}

.waves svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wave-layer {
  animation: wave linear infinite;
}

.w1 {
  fill: rgba(56, 189, 248, 0.25);
  animation-duration: 18s;
}

.w2 {
  fill: rgba(129, 140, 248, 0.35);
  animation-duration: 12s;
  transform: translateY(12px);
}

.w3 {
  fill: var(--footer);
  animation-duration: 8s;
  transform: translateY(24px);
}

@keyframes wave {
  from {
    translate: 0 0;
  }
  to {
    translate: -1440px 0;
  }
}

.w2 {
  animation-name: wave-rev;
}

@keyframes wave-rev {
  from {
    translate: -1440px 0;
  }
  to {
    translate: 0 0;
  }
}

.footer-body {
  background: var(--footer);
  padding: 20px 24px 28px;
}

.footer-body > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- CTA band ---------- */
.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 32px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.25), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(129, 140, 248, 0.3), transparent 50%),
    var(--footer-2);
  border: 1px solid var(--border);
}

.cta h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.newsletter {
  flex: 1;
  max-width: 460px;
  min-width: 260px;
}

.nl-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border);
  color: var(--muted);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.nl-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.newsletter.invalid .nl-field {
  border-color: var(--error);
  animation: shake 0.35s;
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.nl-field input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
}

.nl-field input::placeholder {
  color: #6b77a3;
}

.nl-field button {
  position: relative;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #0b1437;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.nl-field button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.35);
}

.nl-spinner {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border-radius: 50%;
  border: 2.5px solid rgba(11, 20, 55, 0.3);
  border-top-color: #0b1437;
  animation: spin 0.7s linear infinite;
  display: none;
}

.newsletter.loading .nl-text {
  visibility: hidden;
}

.newsletter.loading .nl-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.nl-msg {
  min-height: 1.3em;
  margin-top: 8px;
  padding-left: 4px;
  font-size: 0.82rem;
}

.nl-msg.ok {
  color: var(--ok);
}

.nl-msg.bad {
  color: var(--error);
}

/* ---------- Columns ---------- */
.columns {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  padding: 56px 0 44px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #0b1437;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand p {
  max-width: 290px;
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.socials {
  display: flex;
  gap: 10px;
  list-style: none;
}

.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition:
    color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease;
}

.socials svg {
  width: 18px;
  height: 18px;
}

.socials a:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-4px);
}

/* Light brand colours need dark icons */
.socials a[aria-label="GitHub"]:hover,
.socials a[aria-label="X / Twitter"]:hover {
  color: #0b1437;
}

.col h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 600;
}

.col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

/* Underline that grows from the left */
.col a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.col a:hover {
  color: var(--text);
  transform: translateX(3px);
}

.col a:hover::after {
  transform: scaleX(1);
}

.pill {
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
}

.pill-hiring {
  color: var(--ok);
  background: rgba(34, 197, 94, 0.14);
}

.col-toggle {
  display: none;
}

/* ---------- Bottom bar ---------- */
.bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ok);
  animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

.to-top {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.to-top:hover {
  background: var(--accent);
  color: #0b1437;
  transform: translateY(-4px);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .columns {
    grid-template-columns: repeat(4, 1fr);
  }

  .brand {
    grid-column: 1 / -1;
  }
}

/* On phones the link columns become an accordion */
@media (max-width: 640px) {
  .waves {
    height: 70px;
  }

  .cta {
    padding: 24px;
  }

  .columns {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 40px;
  }

  .brand {
    margin-bottom: 24px;
  }

  .col {
    border-bottom: 1px solid var(--border);
  }

  .col h3 {
    margin: 0;
    padding: 16px 0;
    cursor: pointer;
  }

  .col-toggle {
    display: block;
    position: relative;
    width: 14px;
    height: 14px;
  }

  .col-toggle::before,
  .col-toggle::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 0;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--muted);
    transition: transform 0.3s ease;
  }

  .col-toggle::after {
    transform: rotate(90deg);
  }

  .col.open .col-toggle::after {
    transform: rotate(0);
  }

  .col ul {
    max-height: 0;
    overflow: hidden;
    transition:
      max-height 0.4s ease,
      padding 0.4s ease;
  }

  .col.open ul {
    max-height: 300px;
    padding-bottom: 18px;
  }

  .bottom {
    flex-direction: column-reverse;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
