/* Neiliro landing — palette and type mirror the product itself
   (web/src/styles.css in the app repo) so the marketing page and the
   screenshots inside it read as one thing. */

:root {
  --surface: #f6f7f4;
  --surface-2: #eaece8;
  --surface-3: #dfe2dc;
  --border: #d2d7cd;
  --text: #131c24;
  --text-muted: #5a6a74;
  --accent: #1f6e8c;
  --on-accent: #ffffff;
  --accent-soft: #d8e8ee;
  --shadow: 0 1px 2px rgb(19 28 36 / 0.06), 0 8px 24px rgb(19 28 36 / 0.07);
  --shadow-lg: 0 2px 4px rgb(19 28 36 / 0.08), 0 24px 64px rgb(19 28 36 / 0.14);

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-sans: 'Golos Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #18232c;
    --surface-2: #101820;
    --surface-3: #22303a;
    --border: #2c3b47;
    --text: #e8eae5;
    --text-muted: #8b9aa5;
    --accent: #4d9ebb;
    --on-accent: #08131a;
    --accent-soft: #1c3a47;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.35), 0 24px 64px rgb(0 0 0 / 0.5);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

h1, h2, h3 { margin: 0 0 0.6em; line-height: 1.15; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.9em;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.logo svg { border-radius: 7px; }

.site-nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.6rem 0;
}
.site-nav a:hover { color: var(--text); }

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  font: 600 1rem var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }

.btn-sm { min-height: 2.4rem; padding: 0.35rem 1rem; font-size: 0.92rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

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

.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 0; }
.hero-inner { max-width: 46rem; text-align: center; }
.hero .eyebrow { color: var(--accent); }

.lede, .section-lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 38rem;
  margin-inline: auto;
}

.hero-hint {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin: 0.9rem auto 0;
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
}
.trust-chips li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.hero-shot { margin-top: clamp(2rem, 5vw, 3.5rem); }
.hero-shot .window-frame { box-shadow: var(--shadow-lg); }

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

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.6rem auto 0;
  max-width: 30rem;
}
.waitlist-form input[type="email"] {
  flex: 1 1 14rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--text);
  font: 400 1rem var(--font-sans);
}
.waitlist-form input[type="email"]::placeholder { color: var(--text-muted); }
.waitlist-form input[type="email"]:focus-visible { outline-offset: 0; }

.waitlist-form .hp { display: none; }

.form-note {
  flex-basis: 100%;
  min-height: 1.4em;
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.form-note.ok { color: var(--accent); font-weight: 600; }
.form-note.err { color: #b3423a; }
@media (prefers-color-scheme: dark) {
  .form-note.err { color: #e08a83; }
}

/* ---------- Screenshot frames ---------- */

.window-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.window-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.window-bar i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
}

.phone-frame {
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}

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

section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.features { padding-bottom: 0; }
.features > .container:first-child { text-align: center; }

.feature-row {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) 3fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin-top: clamp(3rem, 7vw, 5rem);
}
.feature-row:nth-of-type(even) .feature-copy { order: 2; }
.feature-row p:last-child { color: var(--text-muted); }

@media (max-width: 820px) {
  .feature-row { grid-template-columns: 1fr; }
  .feature-row:nth-of-type(even) .feature-copy { order: 0; }
}

.phones .container { text-align: center; }
.phone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: 2.5rem;
}
@media (max-width: 640px) {
  .phone-grid { grid-template-columns: 1fr; max-width: 20rem; margin-inline: auto; }
}

.details .container > .eyebrow,
.details .container > h2 { text-align: center; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
}
.detail-grid li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.4rem 1.5rem;
}
.detail-grid h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.detail-grid p { margin: 0; color: var(--text-muted); font-size: 0.97rem; }

/* ---------- Self-host ---------- */

.selfhost { background: var(--surface); border-block: 1px solid var(--border); }
.selfhost-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.selfhost p { color: var(--text-muted); }
@media (max-width: 820px) {
  .selfhost-inner { grid-template-columns: 1fr; }
}

.handled-card {
  list-style: none;
  margin: 0;
  padding: 1.5rem 1.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.handled-card li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 1.02rem;
}
.handled-card li:not(.mono-label):not(.handled-out)::before {
  content: "✓";
  color: var(--accent);
  font-weight: 600;
}
.handled-card .mono-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.handled-card .handled-out {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- CTA + footer ---------- */

.cta .cta-inner { text-align: center; max-width: 46rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-left: auto; }
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0;
}
.footer-nav a:hover { color: var(--text); }
.footer-nav .icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-radius: 0.6rem;
  transition: color 180ms ease;
}
.footer-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ============ Legal pages (privacy, terms) ============ */
.legal { padding: 48px 0 80px; }
.legal-inner { max-width: 720px; }
.legal h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 8px; }
.legal-meta { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 28px; }
.legal h2 { font-size: 1.15rem; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--text); line-height: 1.65; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent); }
.legal .mono { font-family: var(--font-mono); font-size: 0.9em; }

/* ---------- Support ---------- */

.support { padding: 0 0 80px; }
.support-inner { max-width: 46rem; }
/* The landing pads every <section> into a full-width band. Here the
   sections are chapters of one document and space themselves. */
.support section { padding: 0; }
.support h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 20px; }
.support .mono { font-family: var(--font-mono); font-size: 0.9em; }
.support-lede { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- The search band ---------- */

.support-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  text-align: center;
}
.support-hero .container { max-width: 40rem; }

.faq-search {
  position: relative;
  display: flex;
  align-items: center;
}
.faq-search svg {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.faq-search input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  -webkit-appearance: none;
}
.faq-search input::placeholder { color: var(--text-muted); }
.faq-search input:focus-visible { outline-offset: 0; }

.support-hero-note {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ---------- Topics ---------- */

.faq-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  margin: 2.5rem 0 0;
}
/* Two per row on a phone rather than one: six stacked cards is the scroll
   this layout exists to remove. Below that the column is too narrow to
   read and they stack. */
@media (max-width: 760px) {
  .faq-cards { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .faq-card { padding: 1.1rem 0.9rem 0.9rem; }
  .faq-card p { font-size: 0.87rem; }
}
@media (max-width: 380px) {
  .faq-cards { grid-template-columns: 1fr; }
}
.faq-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem 1.2rem 1.1rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.faq-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.faq-card svg { margin: 0 auto 0.7rem; color: var(--accent); display: block; }
.faq-card h2 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin: 0 0 0.45em; }
.faq-card p { margin: 0 0 0.7em; color: var(--text-muted); font-size: 0.92rem; }
.faq-card-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
@media (prefers-reduced-motion: reduce) {
  .faq-card { transition: none; }
  .faq-card:hover { transform: none; }
}

.faq-empty { margin: 2.5rem 0 0; color: var(--text-muted); }

.faq-back {
  display: inline-block;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  text-decoration: none;
}
.faq-back::before { content: '← '; }
.faq-back:hover { text-decoration: underline; }

/*
  One topic at a time. The grid is the resting state; picking a card makes
  that section the target and the grid steps aside. A browser without :has()
  keeps both on screen, which is only the old page — nothing breaks.
*/
/* Clears the sticky header when a card jumps to its section. */
.faq-group { display: none; margin: 2.5rem 0; scroll-margin-top: 5.5rem; }
.faq-group:target { display: block; }
body:has(.faq-group:target) .faq-cards { display: none; }

/* Searching outranks the choice: every group is a candidate again and the
   script hides the misses. */
body.is-searching .faq-cards,
body.is-searching .faq-back { display: none; }
body.is-searching .faq-group { display: block; }
body.is-searching .faq-group.is-hidden,
body.is-searching .faq-item.is-hidden { display: none; }
.faq-group h3 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8em;
}

.faq-item { border-top: 1px solid var(--border); }
.faq-group .faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 500;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
/* The marker is drawn, not typographic: a "+" glyph shifts baseline between
   the two states and the row twitches on every open. */
.faq-item summary::after {
  content: '';
  flex: none;
  margin-left: auto;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: translateY(0.15rem) rotate(-135deg); }
.faq-item summary:hover { color: var(--accent); }
.faq-body { padding: 0 0 1.1rem; }
.faq-body p { margin: 0 0 0.7em; color: var(--text-muted); }
.faq-body p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after { transition: none; }
}

/* ---------- Support form ---------- */

.support-contact { margin-top: 4rem; }
.support-form { margin-top: 1.5rem; }

.field { margin-bottom: 1.25rem; }
/* Two short fields on one line: the form is the tail of the page, and every
   row of it is a row of scrolling between a question and asking it. */
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}
.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.field-optional {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.field textarea { resize: vertical; min-height: 6.5rem; line-height: 1.55; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 0; }
.field-hint { margin: 0.4rem 0 0; font-size: 0.87rem; color: var(--text-muted); }

.support-form .hp { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-actions .form-note { margin: 0; text-align: left; }
.form-fineprint { margin: 1.25rem 0 0; font-size: 0.87rem; color: var(--text-muted); }

/* Without JavaScript the form posts and the browser lands on #thanks;
   :target is the whole confirmation mechanism, no script involved. */
.thanks { display: none; }
.thanks:target {
  display: block;
  /* The header is sticky: without this the panel lands under it. */
  scroll-margin-top: 5rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.thanks p { margin: 0; }

/* Screenshots inside an answer. They sit at their natural size — the width
   attribute is the CSS size of a 2x capture — and only shrink on narrow
   screens, because an upscaled screenshot of small type reads worse than a
   small one. */
.faq-shot { margin: 0.2rem 0 1rem; }
.faq-shot img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
