/* Ceruli waitlist site
   Tokens first, then base, layout, and components. */

:root {
  --ink: #1b1f3b;
  --ink-soft: #454a6b;
  --muted: #666c8f;
  --paper: #f7f8fc;
  --white: #ffffff;
  --line: #e3e5f0;
  --indigo: #5b5bd6;
  --indigo-dark: #4343b4;
  --indigo-deep: #202258;
  --lavender: #ecebfa;
  --green: #1e7a4f;
  --red: #b3202f;

  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-frame: 14px;
  --radius-control: 10px;
  --header-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
}

p { margin: 0; }

a { color: var(--indigo-dark); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-control);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Layout ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}
.wrap--wide { max-width: 1240px; }
.wrap--narrow { max-width: 760px; }

.section { padding-block: clamp(64px, 9vw, 112px); }
.section--tint { background: var(--white); border-block: 1px solid var(--line); }

.section-title {
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.9rem);
  line-height: 1.1;
  max-width: 18ch;
}
.section-sub { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(247, 248, 252, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand { display: inline-flex; flex: none; }
.brand img { height: 30px; width: auto; }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { color: var(--indigo-dark); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: 1.5px solid var(--indigo);
  border-radius: var(--radius-control);
  background: var(--indigo);
  color: var(--white);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: progress; }

.btn--small { padding: 11px 18px; font-size: 0.9375rem; }
.btn--block { width: 100%; }

.btn--ghost {
  background: transparent;
  color: var(--indigo-dark);
}
.btn--ghost:hover { background: var(--lavender); color: var(--indigo-dark); border-color: var(--indigo); }

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

.hero { padding-top: clamp(48px, 8vw, 96px); overflow: hidden; }

.hero-copy { max-width: 760px; }
.hero h1 {
  font-size: clamp(2.5rem, 1.2rem + 5.4vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
}
.lead {
  margin-top: 24px;
  max-width: 56ch;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: var(--ink-soft);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.fine { margin-top: 16px; font-size: 0.875rem; color: var(--muted); }

/* Browser frame for product screenshots */
.frame {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-frame);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(32, 34, 88, 0.06),
    0 24px 48px -16px rgba(32, 34, 88, 0.22);
}
.frame-bar {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  background: #f1f2f9;
  border-bottom: 1px solid var(--line);
}
.frame-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d3d6e6;
}
.frame img { width: 100%; }

/* The hero screenshot is cropped so it bleeds off the bottom of the first screen */
.hero-shot {
  margin-top: clamp(40px, 6vw, 72px);
  max-height: clamp(300px, 52vw, 640px);
  border-bottom: 0;
  border-radius: var(--radius-frame) var(--radius-frame) 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 24px 64px -20px rgba(32, 34, 88, 0.3);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
}
.hero-shot img { object-fit: cover; object-position: top; }

@keyframes rise {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: none; }
}

/* Steps -------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.steps li { position: relative; }
.step-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--white);
  font: 700 1rem/1 var(--font-display);
}
/* Connecting line between steps */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 52px;
  right: -20px;
  height: 2px;
  background: var(--line);
}
.steps h3 { margin-top: 20px; font-size: 1.25rem; line-height: 1.25; }
.steps p { margin-top: 8px; color: var(--ink-soft); font-size: 1rem; }

/* Features ----------------------------------------------------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  margin-top: clamp(56px, 8vw, 96px);
}
#features .section-title + .section-sub + .feature { margin-top: 56px; }

.feature--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature--flip .feature-text { order: 2; }

.feature-text h3 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  line-height: 1.15;
}
.feature-text p { margin-top: 16px; max-width: 46ch; color: var(--ink-soft); }

/* Approval promise --------------------------------------------- */

.promise {
  background: var(--indigo-deep);
  color: var(--white);
  padding-block: clamp(56px, 8vw, 96px);
}
.promise-inner {
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
}
.promise-icon { flex: none; color: #b9b9f5; }
.promise h2 {
  color: var(--white);
  font-size: clamp(2rem, 1rem + 3.6vw, 3.6rem);
  line-height: 1.06;
  max-width: 20ch;
}
.promise p { margin-top: 16px; max-width: 54ch; color: #d3d4f2; font-size: 1.125rem; }

/* Waitlist ----------------------------------------------------- */

.waitlist-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding: clamp(28px, 5vw, 64px);
  background: var(--lavender);
  border-radius: 20px;
}
.waitlist h2 {
  font-size: clamp(2rem, 1.2rem + 2.8vw, 3.2rem);
  line-height: 1.08;
}
.waitlist-copy p { margin-top: 16px; max-width: 40ch; color: var(--ink-soft); font-size: 1.125rem; }

.waitlist-box {
  padding: clamp(24px, 3vw, 36px);
  background: var(--white);
  border-radius: var(--radius-frame);
  box-shadow: 0 1px 2px rgba(32, 34, 88, 0.06), 0 16px 40px -16px rgba(32, 34, 88, 0.25);
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #cfd2e4;
  border-radius: var(--radius-control);
  background: var(--white);
  color: var(--ink);
  font: 400 1rem/1.3 var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:hover { border-color: #aeb2cf; }
.field input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.2); }
.field input[aria-invalid="true"] { border-color: var(--red); }

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

.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fdecee;
  border-radius: var(--radius-control);
  color: var(--red);
  font-size: 0.9375rem;
  font-weight: 500;
}
.waitlist-box .fine { text-align: center; }

.success { text-align: center; padding-block: 12px; }
.success:focus { outline: none; }
.success svg { margin: 0 auto 16px; }
.success h3 { font-size: 1.75rem; line-height: 1.2; }
.success p { margin-top: 8px; color: var(--ink-soft); }
.success:not([hidden]) { animation: pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}

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

.faq { margin-top: 40px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 22px 48px 22px 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--indigo);
  border-bottom: 2px solid var(--indigo);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 48px 24px 0; max-width: 60ch; color: var(--ink-soft); }

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

.site-footer { padding-block: 40px; border-top: 1px solid var(--line); background: var(--white); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .brand img { height: 26px; }
.site-footer p { font-size: 0.875rem; color: var(--muted); }

/* Responsive --------------------------------------------------- */

@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps li:nth-child(2)::after { display: none; }
}

@media (max-width: 820px) {
  .nav { display: none; }
  .header-inner { justify-content: space-between; }

  .feature,
  .feature--flip { grid-template-columns: 1fr; gap: 28px; }
  .feature--flip .feature-text { order: 0; }

  .waitlist-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 20px; }

  /* Vertical timeline on small screens */
  .steps { grid-template-columns: 1fr; row-gap: 0; margin-top: 40px; }
  .steps li { padding: 0 0 36px 60px; }
  .steps li:last-child { padding-bottom: 0; }
  .step-num { position: absolute; left: 0; top: 0; }
  .steps li:not(:last-child)::after,
  .steps li:nth-child(2)::after {
    display: block;
    top: 44px;
    bottom: 4px;
    left: 19px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .steps h3 { margin-top: 6px; }

  .promise-inner { flex-direction: column; align-items: flex-start; }
  .actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
