:root {
  --bg: #fffaf4;
  --surface: #ffffff;
  --text: #1b1f2a;
  --muted: #5b6270;
  --line: #eee2d3;
  --accent: #ff6b00;
  --accent-text: #c45200;
  --on-accent: #ffffff;
  --accent-soft: #fff0e2;
  --user: #1b1f2a;
  --on-user: #ffffff;
  --shadow: 0 1px 2px rgba(27, 31, 42, 0.05), 0 12px 32px rgba(27, 31, 42, 0.07);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --surface: #1c1f27;
    --text: #f3f1ee;
    --muted: #a8adb9;
    --line: #2c303b;
    --accent: #ff7a1a;
    --accent-text: #ff9a4d;
    --on-accent: #14161c;
    --accent-soft: #2b2119;
    --user: #f3f1ee;
    --on-user: #14161c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.nav a { color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 15px; }
.nav a:hover { color: var(--text); }

.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding: 40px 0 64px; }
.hero h1 { font-size: clamp(38px, 6.2vw, 62px); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 32em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.works { margin: 16px 0 0; font-size: 15px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 700; font-size: 16px;
  padding: 13px 22px; border-radius: 999px; border: 0;
  text-decoration: none; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn:hover { filter: brightness(1.05); }

.chat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 88%; padding: 10px 15px; border-radius: 20px; font-size: 15.5px; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--user); color: var(--on-user); border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--accent-soft); border-bottom-left-radius: 6px; }
.tool { align-self: flex-start; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding-left: 4px; }
.tool svg { width: 16px; height: 16px; flex: none; }
.tool b { color: var(--text); font-weight: 600; }

section { padding: 56px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(27px, 4vw, 36px); letter-spacing: -0.015em; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 28px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.card .ico { font-size: 28px; line-height: 1; }
.card h3 { margin: 10px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

.url {
  display: flex; gap: 8px; align-items: center; max-width: 600px;
  background: var(--surface); border: 1.5px dashed var(--accent); border-radius: 14px;
  padding: 8px 8px 8px 16px; margin: 0 0 24px;
}
.url code { flex: 1; font: 600 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.copy { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }

.setup { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setup h3 { margin: 12px 0 4px; font-size: 20px; }
.setup ol { margin: 8px 0 0; padding-left: 22px; }
.setup li { margin: 7px 0; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.small { margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }

.prompts { display: flex; flex-wrap: wrap; gap: 10px; }
.prompt {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.prompt:hover { border-color: var(--accent); }

.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 28px; margin: 0; padding: 0; list-style: none; }
.sources li { color: var(--muted); font-size: 15.5px; }
.sources b { color: var(--text); }
.note { margin: 26px 0 0; color: var(--muted); font-size: 15px; max-width: 46em; }

footer { border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 15px; }
footer p { margin: 10px 0 0; }
.links a { margin-right: 18px; }

.doc { max-width: 720px; padding: 16px 0 64px; }
.doc h1 { font-size: clamp(32px, 5vw, 42px); letter-spacing: -0.02em; margin: 12px 0 4px; }
.doc .meta { color: var(--muted); margin: 0 0 24px; }
.doc h2 { font-size: 21px; margin: 32px 0 8px; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 15px; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 16px 0 48px; }
  .setup, .cards { grid-template-columns: 1fr; }
  .nav a:not(.keep) { display: none; }
  section { padding: 44px 0; }
}
