/* Magic Exit public site.
   Tokens and components follow the "Journey" design system of the Fund Search app
   (PE-website frontend/src/journey.css). */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f3ee;
  --ink: #1e2a3a;
  --ink-soft: #5b6673;
  --ink-faint: #8b949f;
  --accent: #1cc7b7; /* Lagoon */
  --accent-hover: #14ad9f;
  --accent-soft: rgba(28, 199, 183, 0.14);
  --accent-ink: #0b7f7a; /* Lagoon is too light for small text on white: use this for accent text */
  --on-accent: #1e2a3a; /* text on Lagoon fills (navy reads better than white) */
  --line: #e6e2da;
  --error: #c62828;
  --success: #2e7d32;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 42, 58, 0.04), 0 12px 32px rgba(30, 42, 58, 0.06);
  --font-head: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --nav-height: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-wide {
  max-width: 940px;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.brand img {
  display: block;
}

.brand-name {
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--ink);
}

/* Wordmark: the dot of the i in "Magic" is a Lagoon node, like the centre of the Hub logo.
   The letter is a dotless i (ı) with the node drawn on top. */
.brand-i {
  position: relative;
  display: inline-block;
}

.brand-i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.03em;
  width: 0.24em;
  height: 0.24em;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
}

.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;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a:not(.btn) {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.nav-links a:not(.btn):hover {
  color: var(--accent-ink);
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 1rem;
}

.h1 {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}

.h3 {
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}

.body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.center {
  text-align: center;
}

/* ---------- Sections ---------- */
.section {
  padding: 5.5rem 0;
}

.section-tight {
  padding: 0 0 1rem;
}

.section-soft {
  background: var(--bg-soft);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-small {
  padding: 0.5rem 1.25rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-quiet:hover {
  border-color: var(--ink);
}

.btn:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ---------- Video ---------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--ink);
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle at 30% 20%, rgba(28, 199, 183, 0.25), transparent 55%), var(--ink);
}

.video-placeholder p {
  margin: 0;
  font-size: 0.9375rem;
}

.play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}

.play::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 20px;
  border-style: solid;
  border-width: 12px 0 12px 18px;
  border-color: transparent transparent transparent var(--on-accent);
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  margin: 0 0 1rem;
}

.tag-accent {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* ---------- Connections theme ----------
   One idea repeats across the site: navy nodes are funds, sellers and advisors, and the Lagoon
   link is the match Magic Exit finds. Icons live in /icons, the hero art in /art. */
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero-art {
  width: 100%;
  height: auto;
}

.card-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

.how-steps {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  position: relative;
}

/* the dashed link from each step node to the next one */
.how-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 32px;
  left: 64px;
  right: -2rem;
  border-top: 2px dashed #d3d8de;
}

.how-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.how-node {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
}

.how-num {
  font-size: 0.8125rem;
  color: var(--accent-ink);
  margin-right: 0.375rem;
}

/* faint dot grid, the same grid as the hero art */
.section-grid {
  background-image: radial-gradient(circle, #e2e5e9 1.4px, transparent 1.6px);
  background-size: 28px 28px;
  background-position: center;
}

.section-grid .wrap {
  background: var(--bg);
  border-radius: var(--radius);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  max-width: 44rem;
}

.modal-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin-bottom: 0.75rem;
}

.done-icon {
  display: block;
  width: 72px;
  height: 72px;
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-art {
    max-width: 420px;
  }

  .how-steps {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  /* vertical link on small screens */
  .how-step:not(:last-child)::after {
    top: 64px;
    bottom: -1.75rem;
    left: 31px;
    right: auto;
    border-top: 0;
    border-left: 2px dashed #d3d8de;
  }

  .how-step {
    padding-left: 5.25rem;
    min-height: 64px;
  }

  .how-node {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
  }
}

/* ---------- Forms ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field > span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field em {
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  resize: vertical;
  min-height: 7rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field [aria-invalid="true"] {
  border-color: var(--error);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.form-status {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.form-status.is-error {
  color: var(--error);
}

.form-status.is-success {
  color: var(--success);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-ink);
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .wrap {
    padding: 0 1rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .nav-links a[href$="#how-it-works"] {
    display: none;
  }

  .nav-links {
    gap: 0.875rem;
  }

  .btn-small {
    padding: 0.5rem 0.875rem;
  }

  .cards,
  .row {
    grid-template-columns: 1fr;
  }

  .form {
    padding: 1.25rem;
  }

  .footer-links {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Small pieces ---------- */
.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent-ink);
}

.actions-center {
  justify-content: center;
}

.back-link {
  display: inline-flex;
  gap: 0.375rem;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent-ink);
}

.note {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

/* ---------- Contact popup ---------- */
.modal {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(30, 42, 58, 0.45);
  backdrop-filter: blur(2px);
}

.modal-body {
  position: relative;
  padding: 2rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.form-plain {
  margin-top: 1.5rem;
  padding: 0;
  border: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  .modal-body {
    padding: 1.5rem 1.25rem;
  }
}

/* ---------- Waitlist questionnaire ---------- */
.wizard {
  gap: 1.5rem;
}

.wizard-progress-bar {
  position: relative;
  height: 20px;
  margin: 0 10px;
}

/* grey track behind the nodes */
.wizard-progress-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  height: 2px;
  background: var(--line);
}

/* Lagoon link from the first node to the current one */
.wizard-progress-bar span {
  position: absolute;
  left: 0;
  top: 8px;
  height: 4px;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.wizard-nodes {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-nodes li {
  width: 14px;
  height: 14px;
  margin: 0 -7px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #c9ced4;
  position: relative;
}

.wizard-nodes li.is-done {
  background: var(--ink);
  border-color: var(--ink);
}

.wizard-nodes li.is-current {
  width: 20px;
  height: 20px;
  margin: 0 -10px;
  background: var(--bg);
  border: 6px solid var(--accent);
}

.wizard-count {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.step {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
  animation: step-in 0.25s ease;
}

.step[hidden] {
  display: none;
}

.step:focus {
  outline: none;
}

.step-title {
  padding: 0;
  margin: 0 0 0.5rem;
  font-family: var(--font-head);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.step-hint {
  margin: -0.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.question {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.question + .question {
  margin-top: 0.5rem;
}

.question-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.choices {
  display: grid;
  gap: 0.625rem;
  border-radius: 12px;
}

.choices-compact {
  grid-template-columns: repeat(2, 1fr);
}

.choices.is-invalid .choice span {
  border-color: var(--error);
}

.choice {
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  background: var(--bg);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.choices-compact .choice span {
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
}

.choice small {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.choice:hover span {
  border-color: var(--ink-faint);
}

.choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input:focus-visible + span {
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-color: var(--accent);
}

.wizard-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.wizard-nav[hidden] {
  display: none;
}

.wizard-nav .form-status {
  flex: 1;
}

.wizard-nav [data-next] {
  margin-left: auto;
}

.step-done .btn {
  align-self: flex-start;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step {
    animation: none;
  }

  .wizard-progress-bar span {
    transition: none;
  }
}

@media (max-width: 640px) {
  .choices-compact {
    grid-template-columns: 1fr;
  }

  .wizard-nav {
    flex-wrap: wrap;
  }

  .wizard-nav .form-status {
    order: 3;
    flex-basis: 100%;
  }
}

/* Free-text field shown when "Other" is picked in the waitlist */
.other-field {
  margin-top: 0.25rem;
}

.other-field[hidden],
.question[hidden] {
  display: none;
}
