:root {
  --paper: #f0eee8;
  --paper-2: #e4e1d8;
  --ink: #0e0e0e;
  --muted: #5a5852;
  --line: #d4d0c6;
  --accent: #0e0e0e;
  --accent-hover: #2a2a2a;
  --pine: #101412;
  --pine-2: #1a211e;
  --pine-ink: #e8eee9;
  --signal: #b4472a;
  --signal-hover: #93381f;
  --white: #faf9f5;
  --shadow: 0 20px 50px rgba(14, 14, 14, 0.12);
  --font: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Nunito", "Segoe UI", system-ui, sans-serif;
  --max: 1180px;
  --nav: 76px;
  --r: 3px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html, body { margin: 0; padding: 0; }

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

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--white);
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* Grain */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand img { display: block; }
.logo-full { height: 24px; width: auto; }
.logo-mark { height: 28px; width: auto; display: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--muted);
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  background: var(--ink);
  color: var(--white) !important;
  padding: 9px 16px;
  border-radius: var(--r);
  font-size: 0.95rem;
  font-weight: 600;
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 56px 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--signal);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 16px 0 20px;
  max-width: 16ch;
  text-wrap: balance;
}

.caret {
  display: inline-block;
  width: 0.12em;
  height: 0.72em;
  background: var(--signal);
  margin-left: 0.06em;
  vertical-align: -0.02em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.lede {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 42px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-radius: var(--r);
  padding: 12px 18px;
  font-size: 1rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--ink); color: var(--ink); }

/* Demo card */
.demo {
  background: var(--pine);
  color: var(--pine-ink);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid color-mix(in srgb, white 10%, transparent);
}

.demo-site {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 22%, transparent);
}

.chip {
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--pine-ink) 70%, transparent);
}

.thread {
  padding: 22px 20px 8px;
  display: grid;
  gap: 14px;
  min-height: 230px;
  max-height: 320px;
  overflow-y: auto;
}

.msg {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: var(--r);
  line-height: 1.45;
}
.msg-you {
  justify-self: end;
  background: var(--pine-2);
}
.msg-us {
  justify-self: start;
  background: color-mix(in srgb, white 8%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
}
.msg small {
  display: block;
  opacity: 0.55;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 16px 20px 18px;
}

.composer input::placeholder {
  color: color-mix(in srgb, var(--pine-ink) 55%, transparent);
}

.composer input,
.composer textarea,
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: color-mix(in srgb, white 8%, transparent);
  border: 1px solid color-mix(in srgb, white 12%, transparent);
  border-radius: var(--r);
  padding: 12px 14px;
}

.composer button,
.send {
  background: var(--signal);
  color: #fff;
  border: 0;
  border-radius: var(--r);
  font: inherit;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.suggestions button {
  background: transparent;
  color: var(--pine-ink);
  border: 1px solid color-mix(in srgb, white 16%, transparent);
  border-radius: var(--r);
  font: inherit;
  font-size: 0.85rem;
  padding: 7px 12px;
  cursor: pointer;
}
.suggestions button:hover { border-color: var(--signal); color: var(--signal); }

/* Sections */
section { padding: 84px 0; }

.kicker {
  font-size: 0.92rem;
  color: var(--signal);
  font-weight: 600;
  margin: 0 0 10px;
}

h2 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  font-weight: 800;
  text-wrap: balance;
}

.sub {
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 36px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 20px 24px;
  min-height: 220px;
}

.num {
  font-size: 0.92rem;
  color: var(--signal);
  margin-bottom: 14px;
  font-weight: 600;
}

.step h3,
.feature h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.step p { margin: 0; color: var(--muted); font-size: 0.98rem; }

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: start;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
}

.table th,
.table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--paper-2);
}
.table tr:last-child td { border-bottom: 0; }
.good { font-weight: 600; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature {
  padding: 22px;
  border-radius: var(--r);
  background: var(--white);
  border: 1px solid var(--line);
}
.feature h3 { margin: 0 0 8px; font-size: 1.2rem; }
.feature p { margin: 0; color: var(--muted); }

.dark {
  background: var(--pine);
  color: var(--pine-ink);
}
.dark .kicker { color: var(--signal); }
.dark .sub, .dark .feature p { color: color-mix(in srgb, var(--pine-ink) 72%, transparent); }
.dark .feature {
  background: color-mix(in srgb, white 6%, transparent);
  border-color: color-mix(in srgb, white 10%, transparent);
}

.faq {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 16px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 0 0 14px; color: var(--muted); }

.start {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: start;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}
.field textarea { min-height: 140px; resize: vertical; }

.form-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 10px;
}

.ok {
  display: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}
.ok.show { display: block; }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Client app */
.client-body {
  background: #0e1211;
  color: #e8eee9;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.side {
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 22px 16px;
  background: #0b0f0e;
}

.side h1 {
  font-size: 1rem;
  margin: 0 0 22px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.side h1 img { height: 22px; width: auto; }

.side nav { display: grid; gap: 4px; }
.side a, .side button.navitem {
  color: #b7c2bc;
  text-decoration: none;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.side a.active, .side button.navitem.active,
.side a:hover, .side button.navitem:hover {
  background: color-mix(in srgb, var(--signal) 16%, transparent);
  color: #f3d5c8;
}

.workspace { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #9db5aa;
}

.chat {
  padding: 24px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.bubble {
  max-width: 68ch;
  padding: 12px 14px;
  border-radius: var(--r);
  line-height: 1.5;
}
.bubble.user {
  margin-left: auto;
  background: #1c2a26;
}
.bubble.agent {
  background: #151a19;
  border: 1px solid rgba(255,255,255,.06);
}

.dock {
  padding: 16px 22px 22px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.dock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.dock textarea {
  min-height: 52px;
  max-height: 160px;
  resize: vertical;
  background: #151a19;
  color: inherit;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r);
  padding: 12px 14px;
  font: inherit;
}

.gate {
  position: fixed;
  inset: 0;
  background: rgba(8,10,10,.72);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 24px;
}

.gate-card {
  width: min(440px, 100%);
  background: #121716;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r);
  padding: 28px;
}

.gate-card h2 {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #fff;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--signal);
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 30;
}

@media (max-width: 960px) {
  .steps, .features, .split, .start, .app, .swatches, .id-grid, .rules { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .logo-full { display: none; }
  .logo-mark { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav);
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .nav-links.open { display: flex; }
  .hero h1 { max-width: none; }
  .msg { max-width: 92%; }
  .side { display: none; }
  section { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret, .dot { animation: none; }
}

/* Brand ID */
.id-hero { padding-top: 48px; }
.id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.id-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  background: var(--white);
  min-height: 180px;
  display: grid;
  align-content: space-between;
  gap: 24px;
}
.id-card.dark-card {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.id-card img { max-height: 56px; width: auto; }
.id-card .mark { max-height: 72px; }
.swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.swatch {
  min-height: 140px;
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.92rem;
  border: 1px solid var(--line);
}
.type-show .giant {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
}
.type-show .body-show { margin: 0 0 8px; }
.type-show .mono-show {
  color: var(--muted);
  font-size: 1rem;
}
.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.rules li { margin-bottom: 8px; }
.stacked-logo { max-width: 280px; }

.start > div:last-child {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(14,14,14,.06);
}
