/* ==========================================================================
   New Gravity Incubator — shared styles
   Brand palette (from the New Gravity brand folder):
     Primary:   #2c0055 (deep indigo)   #acc5ff (light blue)
     Secondary: #7043b5 (violet) #ff6577 (coral) #ffd4d4 (pink)
                #d8ead3 (sage) #8fb628 (green) #e6c867 (gold) #cf7b01 (amber)
   To restyle the site, change the tokens just below.
   ========================================================================== */

:root {
  --indigo: #2c0055;
  --blue: #acc5ff;
  --violet: #7043b5;
  --coral: #ff6577;
  --gold: #e6c867;

  --bg: #faf9fc;
  --surface: #ffffff;
  --text: #1f1430;
  --heading: #2c0055;
  --muted: #5d5470;
  --border: #e5e0ee;
  --accent: #2c0055;
  --accent-hover: #4a1f80;
  --on-accent: #ffffff;
  --accent-soft: #eaf0ff;
  --link: #7043b5;
  --focus: #7043b5;

  --hero-bg: #2c0055;
  --hero-text: #ffffff;
  --hero-muted: #d9e3ff;

  --success: #2f6b1c;
  --success-soft: #eef6ea;
  --danger: #c4283a;
  --danger-soft: #fff0f1;
  --placeholder-bg: #fbf1cc;
  --notice-bg: #fbf6e2;
  --notice-border: #e6c867;
  --embed-bg: #ffffff; /* Airtable forms are always light, in both themes */

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --max: 1080px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12001f;
    --surface: #1c0a30;
    --text: #ece7f5;
    --heading: #ffffff;
    --muted: #b4a9c8;
    --border: #35214f;
    --accent: #acc5ff;
    --accent-hover: #c8d8ff;
    --on-accent: #2c0055;
    --accent-soft: #261545;
    --link: #acc5ff;
    --focus: #acc5ff;

    --hero-bg: #1c0038;

    --success: #9fd68a;
    --success-soft: #16260f;
    --danger: #ff8a96;
    --danger-soft: #3a1018;
    --placeholder-bg: #4a3d10;
    --notice-bg: #2a230c;
    --notice-border: #7a6620;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow { max-width: 760px; }

.muted { color: var(--muted); }

.placeholder {
  /* Marks text that still needs real content. Remove the span once filled in. */
  background: var(--placeholder-bg);
  border-radius: 4px;
  padding: 0 0.25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus {
  left: 12px; top: 12px; z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--heading);
}
.brand img { display: block; height: 40px; width: auto; }
.brand-tag {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--heading); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--heading); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

@media (max-width: 520px) {
  .brand-tag { display: none; }
  .brand img { height: 34px; }
  .nav a { padding: 8px 9px; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--heading); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--heading); color: var(--heading); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 96px 0 104px;
}
.hero-orbit {
  position: absolute;
  right: -60px;
  top: 50%;
  height: 135%;
  width: auto;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { color: var(--hero-text); max-width: 780px; margin-bottom: 0; }
.hero .btn-row { margin-top: 36px; }
.hero .btn-primary { background: var(--blue); color: var(--indigo); }
.hero .btn-primary:hover { background: #c8d8ff; color: var(--indigo); }
.hero .btn-secondary { color: var(--hero-text); border-color: rgba(255, 255, 255, 0.4); }
.hero .btn-secondary:hover { border-color: #fff; color: #fff; }
@media (max-width: 720px) {
  .hero { padding: 64px 0 72px; }
  .hero-orbit { right: -160px; opacity: 0.35; }
}

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-tight { padding-top: 56px; }

.lede { font-size: 1.2rem; line-height: 1.7; }
.lede p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--link);
  margin-bottom: 12px;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 26px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.step-stage {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.step-amount {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 2px 0 12px;
}
.step p { margin: 0; color: var(--text); }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
}

/* Closing / CTA */
.closing { font-size: 1.15rem; }

.cta {
  margin-top: 40px;
  background: var(--hero-bg);
  color: var(--hero-text);
  border-radius: calc(var(--radius) * 1.4);
  padding: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta h2 { color: var(--hero-text); margin: 0 0 6px; }
.cta p { margin: 0; color: var(--hero-muted); }
.cta a:not(.btn) { color: var(--blue); }
.cta .placeholder { background: rgba(255, 255, 255, 0.18); color: inherit; }
.cta .btn { background: var(--blue); color: var(--indigo); }
.cta .btn:hover { background: #c8d8ff; color: var(--indigo); }
@media (max-width: 600px) {
  .cta { padding: 32px 24px; }
}

/* Page header (inner pages) */
.page-head { padding: 64px 0 32px; }
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}
.page-meta strong { color: var(--text); font-weight: 600; }

/* ---------- FAQ ---------- */

.faq-list { margin-bottom: 48px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 56px 20px 24px;
  font-weight: 600;
  color: var(--heading);
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-item summary:hover { color: var(--link); }
.faq-answer { padding: 0 24px 22px; }
.faq-answer p:last-child, .faq-answer ol:last-child, .faq-answer ul:last-child { margin-bottom: 0; }
.faq-answer ol, .faq-answer ul { padding-left: 1.3em; margin: 0 0 1em; }
.faq-answer li { margin-bottom: 0.5em; }

/* ---------- Embedded Airtable form ---------- */

.form-embed {
  background: var(--embed-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.form-embed iframe {
  display: block;
  width: 100%;
  /* Fills most of the screen; the form scrolls inside this box. */
  height: max(640px, calc(100vh - 160px));
  border: 0;
  background: transparent;
}
.form-embed-fallback { font-size: 0.9rem; margin-top: 12px; }

/* ---------- Form ---------- */

.notice {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.notice-setup { background: var(--notice-bg); border: 1px solid var(--notice-border); }
.notice-error { background: var(--danger-soft); color: var(--danger); border: 1px solid currentColor; }

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  margin: 0 0 20px;
  min-width: 0;
}
.form-section legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 20px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.form-section legend + * { clear: left; }
@media (max-width: 600px) {
  .form-section { padding: 22px 18px; }
}

.field { margin-bottom: 24px; }
.form-section > .field:last-child,
.form-section > .conditional:last-child .field:last-child { margin-bottom: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.field-row-3 { grid-template-columns: 1.3fr 1fr 1.3fr; }
@media (max-width: 640px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

.field > label,
.field > .label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.45;
}
.field > label.choice { display: flex; font-weight: 400; margin-bottom: 0; }
.req { color: var(--danger); margin-left: 2px; }
.hint { display: block; font-size: 0.92rem; color: var(--muted); margin: -2px 0 10px; font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
textarea.short { min-height: 100px; }
input[type="file"] {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  margin-right: 12px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--heading);
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: var(--danger); }
.field-error { display: none; color: var(--danger); font-size: 0.9rem; margin-top: 6px; }
.field.invalid .field-error { display: block; }

.word-count { font-size: 0.85rem; color: var(--muted); text-align: right; margin-top: 4px; }
.word-count.over { color: var(--danger); font-weight: 600; }

.choices { display: grid; gap: 10px; }
.choices.inline { display: flex; gap: 12px 28px; flex-wrap: wrap; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
}
.choice input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--violet); flex: none; }

.conditional {
  border-left: 3px solid var(--accent-soft);
  padding-left: 18px;
  margin: -8px 0 24px;
}
.conditional[hidden] { display: none; }

.subgroup-label { font-weight: 600; font-size: 0.95rem; color: var(--muted); margin: 0 0 8px; }
.referral + .referral { margin-top: 4px; }

/* Honeypot: hidden from people, visible to bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.form-actions .muted { font-size: 0.9rem; margin: 0; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.is-submitting .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.success {
  background: var(--success-soft);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
}
.success h2 { color: var(--success); }
.success p:last-child { margin-bottom: 0; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--heading); }

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