/* CoilChat marketing — shared design system. Mirrors the app's tokens/components exactly.
   Landing-specific styles (hero, widget mockup, loop art, inbox showcase) stay inline in index.html. */

:root {
  --paper: #f7f3ec;
  --panel: #fffdf8;
  --ink: #16130f;
  --muted: #6b655c;
  --faint: #9b958c;
  --line: #e7ded0;
  --accent: #ff5d2e;
  --accent-ink: #c8431c;
  --good: #3f9142;
  --shadow-card: 0 1px 2px rgba(22, 19, 15, 0.04), 0 8px 24px rgba(22, 19, 15, 0.05);
  --shadow-lift: 0 2px 4px rgba(22, 19, 15, 0.04), 0 22px 50px -12px rgba(22, 19, 15, 0.16);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Public Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 84px;
}
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image: radial-gradient(rgba(22, 19, 15, 0.025) 1px, transparent 1px);
  background-size: 4px 4px;
}
::selection {
  background: rgba(255, 93, 46, 0.22);
}
a {
  color: inherit;
  text-decoration: none;
}
.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}
.narrow {
  max-width: 880px;
}

/* ── Type ───────────────────────────────────────────── */
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.display {
  font-size: clamp(2.9rem, 6.4vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  letter-spacing: -0.025em;
}
.lede {
  font-size: clamp(1.06rem, 1.5vw, 1.28rem);
  color: var(--muted);
  line-height: 1.55;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 500;
}
.ital {
  font-style: italic;
  font-weight: 500;
}
.accent {
  color: var(--accent-ink);
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 13px 22px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(255, 93, 46, 0.6);
}
.btn-primary:hover {
  background: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(255, 93, 46, 0.65);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: rgba(22, 19, 15, 0.3);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 9px 16px;
  font-size: 14px;
  border-radius: 10px;
}
.btn svg {
  width: 16px;
  height: 16px;
}

/* ── Nav ────────────────────────────────────────────── */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: border-color 0.25s ease, background 0.25s ease, backdrop-filter 0.25s ease;
  border-bottom: 1px solid transparent;
}
header.nav.scrolled {
  background: rgba(247, 243, 236, 0.78);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand .dot {
  color: var(--accent);
}
.mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
  flex: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a.lk {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}
.nav-links a.lk:hover,
.nav-links a.lk.active {
  color: var(--ink);
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-cta .signin {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
}
.nav-cta .signin:hover {
  color: var(--ink);
}
@media (max-width: 860px) {
  .nav-links,
  .nav-cta .signin {
    display: none;
  }
}

/* ── Pills / eyebrows ───────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  box-shadow: var(--shadow-card);
}
.pill .ping {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(63, 145, 66, 0.5);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 145, 66, 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(63, 145, 66, 0);
  }
}

/* ── Page hero (sub-pages) ──────────────────────────── */
.page-hero {
  position: relative;
  padding: clamp(52px, 7vw, 90px) 0 clamp(24px, 4vw, 40px);
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -140px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(255, 93, 46, 0.13), transparent 62%);
  pointer-events: none;
  z-index: 0;
}
.page-hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  letter-spacing: -0.03em;
  margin-top: 16px;
  max-width: 16em;
}
.page-hero .lede {
  margin-top: 20px;
  max-width: 38em;
}
.page-hero .meta-line {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ── Sections ───────────────────────────────────────── */
section.band {
  padding: clamp(56px, 8vw, 104px) 0;
}
section.band.tight {
  padding: clamp(36px, 5vw, 64px) 0;
}
.panel-band {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sec-head {
  max-width: 640px;
}
.sec-head.center {
  margin: 0 auto;
  text-align: center;
}
.sec-head .h2 {
  margin: 14px 0 0;
}
.sec-head .lede {
  margin-top: 18px;
}

/* ── Cards / feature grid ───────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(22, 19, 15, 0.12);
}
.card .fi {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 93, 46, 0.1);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.card h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Prose (docs / legal) ───────────────────────────── */
.prose {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}
.prose > *:first-child {
  margin-top: 0;
}
.prose h2 {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--ink);
  margin: 2.4em 0 0.55em;
  scroll-margin-top: 90px;
}
.prose h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--ink);
  margin: 1.9em 0 0.5em;
  letter-spacing: -0.01em;
}
.prose p {
  margin: 0 0 1.05em;
}
.prose ul,
.prose ol {
  margin: 0.5em 0 1.3em;
  padding-left: 1.35em;
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose li {
  margin: 0.4em 0;
}
.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(22, 19, 15, 0.06);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.1em;
  margin: 1.4em 0;
  font-style: italic;
  color: var(--muted);
}
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.6em 0;
}

/* ── Docs layout ────────────────────────────────────── */
.doc-layout {
  display: grid;
  grid-template-columns: 218px 1fr;
  gap: 56px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 92px;
}
.toc h6 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  margin: 18px 0 8px;
}
.toc h6:first-child {
  margin-top: 0;
}
.toc a {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover,
.toc a.active {
  color: var(--ink);
  border-left-color: var(--accent);
}
@media (max-width: 880px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc {
    position: static;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    columns: 2;
  }
}

/* ── Callout / code block ───────────────────────────── */
.callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 15px 18px;
  margin: 1.5em 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}
.callout b {
  color: var(--ink);
}
.code {
  background: var(--ink);
  color: rgba(247, 243, 236, 0.92);
  border-radius: 14px;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 1.4em 0;
  box-shadow: var(--shadow-card);
}
.code .c {
  color: #9b958c;
}
.code .a {
  color: #ff9e7a;
}
.code .s {
  color: #9ad8a0;
}

/* ── Steps (getting started) ────────────────────────── */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: step;
}
.step-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  align-items: start;
}
.step-item .sn {
  counter-increment: step;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  display: grid;
  place-items: center;
}
.step-item .sn::before {
  content: counter(step);
}
.step-item h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.step-item p {
  margin-top: 7px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}
.step-item .code {
  margin-top: 14px;
  margin-bottom: 4px;
}
@media (max-width: 560px) {
  .step-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── Contact ────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 93, 46, 0.12);
}
.field textarea {
  min-height: 130px;
  resize: vertical;
}
.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.contact-card h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
}
.contact-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 5px 0 10px;
}
.contact-card a.em {
  font-weight: 600;
  color: var(--accent-ink);
}

/* ── CTA band (shared) ──────────────────────────────── */
.cta {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}
.cta::before {
  content: '';
  position: absolute;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 760px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 93, 46, 0.22), transparent 60%);
  pointer-events: none;
}
.cta .wrap {
  padding: clamp(60px, 8vw, 100px) 24px;
  text-align: center;
}
.cta h2 {
  color: var(--paper);
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
}
.cta p {
  margin: 20px auto 0;
  max-width: 36em;
  color: rgba(247, 243, 236, 0.7);
  font-size: 1.08rem;
}
.cta .acts {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta .btn-ghost {
  color: var(--paper);
  border-color: rgba(247, 243, 236, 0.25);
}
.cta .btn-ghost:hover {
  border-color: rgba(247, 243, 236, 0.55);
}
.cta .fine {
  margin-top: 18px;
  font-size: 13px;
  color: rgba(247, 243, 236, 0.5);
}
.coil-watermark {
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 260px;
  opacity: 0.1;
  pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────── */
footer {
  padding: 64px 0 40px;
  border-top: 1px solid var(--line);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 760px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}
.foot-grid .blurb {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 26em;
  margin-top: 14px;
  line-height: 1.55;
}
.foot-col h5 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 14px;
}
.foot-col a {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
  transition: color 0.15s ease;
  width: fit-content;
}
.foot-col a:hover {
  color: var(--ink);
}
.foot-bottom {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--faint);
}
.foot-bottom a {
  color: var(--muted);
}
.foot-bottom a:hover {
  color: var(--ink);
}

/* ── Reveal ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  * {
    animation: none !important;
  }
}
