:root {
  --bg: #f7f5f0;
  --bg-raised: #ffffff;
  --ink: #1a1c1e;
  --ink-2: #4a4f57;
  --ink-3: #7a808a;
  --border: #e4e0d6;
  --accent: #2f9e7a;
  --accent-soft: #d8f3e8;
  --accent-ink: #0f3d2e;
  --shadow: 0 10px 30px rgba(26, 28, 30, 0.06);
  --radius: 16px;
  --radius-s: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

html[data-territory="curious"] {
  --accent: #2f9e7a;
  --accent-soft: #d8f3e8;
  --accent-ink: #0f3d2e;
  --bg: #f4faf7;
}
html[data-territory="witty"] {
  --accent: #e4572e;
  --accent-soft: #ffe3d9;
  --accent-ink: #5a1c0a;
  --bg: #fff8f4;
}
html[data-territory="cosmic"] {
  --accent: #5b5fc7;
  --accent-soft: #e4e6ff;
  --accent-ink: #1e2058;
  --bg: #f6f6ff;
}
html[data-territory="grounded"] {
  --accent: #8a6a3a;
  --accent-soft: #f3e8d4;
  --accent-ink: #3a2a12;
  --bg: #faf6ef;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  transition: background 0.45s ease, color 0.3s ease;
}

a { color: var(--accent-ink); }
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: white; padding: 0.5rem 1rem; z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.75rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 85%, white);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem; color: var(--ink);
}
.brand-mark .mark { color: var(--accent); }
.top-nav { display: flex; gap: 0.9rem; flex: 1; flex-wrap: wrap; }
.top-nav a {
  text-decoration: none; color: var(--ink-2); font-size: 0.9rem; font-weight: 500;
}
.top-nav a:hover { color: var(--accent-ink); }
.wip-pill {
  margin: 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 0.25rem 0.55rem; border-radius: 999px;
}

main { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 4rem; }

.hero {
  position: relative; padding: 4.5rem 0 3rem; overflow: hidden;
}
.hero-orb {
  position: absolute; inset: -20% auto auto 50%;
  width: 420px; height: 420px; margin-left: -120px;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 65%);
  opacity: 0.9; pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(-10px, 0) scale(1); }
  to { transform: translate(30px, 20px) scale(1.08); }
}
.eyebrow {
  position: relative; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink);
  margin: 0 0 0.75rem;
}
.hero-title {
  position: relative; margin: 0 0 1rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; letter-spacing: -0.03em;
}
.hero-title .word { color: var(--accent-ink); }
.hero-title .rest { display: block; font-weight: 500; color: var(--ink); margin-top: 0.2em; }
.hero-lede {
  position: relative; max-width: 38rem; color: var(--ink-2); font-size: 1.1rem; margin: 0 0 1.5rem;
}
.hero-actions { position: relative; display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hint { position: relative; color: var(--ink-3); font-size: 0.88rem; margin: 0; }
kbd {
  font-family: var(--font-mono); font-size: 0.8em;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.4em;
}

.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 0.65rem 1.1rem; border-radius: 999px;
  transition: transform 0.18s cubic-bezier(0.2, 1.2, 0.3, 1), background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.send {
  width: 2.5rem; height: 2.5rem; padding: 0; justify-content: center; border-radius: 50%;
}

.section { padding: 2.5rem 0 1rem; }
.section-head { margin-bottom: 1.25rem; }
.section-head h2 {
  font-family: var(--font-display); font-size: 1.75rem; margin: 0 0 0.35rem; letter-spacing: -0.02em;
}
.section-head p { margin: 0; color: var(--ink-2); max-width: 36rem; }

.territory-switch {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1rem;
}
@media (max-width: 720px) {
  .territory-switch { grid-template-columns: repeat(2, 1fr); }
  .top-nav { display: none; }
}
.territory {
  appearance: none; cursor: pointer; text-align: left;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s cubic-bezier(0.2, 1.2, 0.3, 1);
  font: inherit; color: inherit;
}
.territory:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.territory[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.t-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.territory[data-territory="curious"] .t-dot { background: #2f9e7a; }
.territory[data-territory="witty"] .t-dot { background: #e4572e; }
.territory[data-territory="cosmic"] .t-dot { background: #5b5fc7; }
.territory[data-territory="grounded"] .t-dot { background: #8a6a3a; }
.t-name { font-weight: 700; font-size: 1.05rem; }
.t-tag {
  align-self: flex-start; font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--accent-ink); background: var(--accent-soft);
  padding: 0.1rem 0.4rem; border-radius: 999px;
}
.territory-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow);
  animation: card-in 0.35s cubic-bezier(0.2, 1.1, 0.3, 1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.territory-card h3 { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1.35rem; }
.territory-card p { margin: 0; color: var(--ink-2); }

.swatches {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem;
}
.swatch {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-s);
  overflow: hidden; box-shadow: var(--shadow);
}
.swatch .chip-color { height: 72px; }
.swatch .meta { padding: 0.65rem 0.75rem; }
.swatch .meta strong { display: block; font-size: 0.85rem; }
.swatch .meta code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-3); }

.type-ramp { display: flex; flex-direction: column; gap: 1.25rem; }
.type-row {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.type-row .label {
  display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.4rem;
}
.type-row .sample { margin: 0; }
.type-row.display .sample {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.type-row.body .sample { font-size: 1.05rem; color: var(--ink-2); max-width: 40rem; }
.type-row.mono .sample { font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent-ink); }

.logo-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem;
}
.logo-card {
  margin: 0; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.75rem; color: var(--ink);
}
.logo-svg { width: 100%; height: auto; color: var(--ink); }
.logo-card figcaption { font-size: 0.85rem; color: var(--ink-2); }

.comp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem;
}
.comp-block {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.comp-block h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.row { display: flex; gap: 0.5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.chip {
  font-size: 0.8rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border); color: var(--ink-2);
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--ink-2); }
.field input {
  font: inherit; padding: 0.65rem 0.8rem; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.card {
  background: linear-gradient(145deg, var(--accent-soft), var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius-s); padding: 1rem;
}
.card-kicker {
  margin: 0 0 0.25rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-ink);
}
.card-title { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1.15rem; }
.card-body { margin: 0; font-size: 0.9rem; color: var(--ink-2); }

.chat-shell {
  max-width: 480px; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent-soft) 55%, white);
}
.chat-av {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: white; font-size: 1rem;
}
.chat-head strong { display: block; font-size: 0.95rem; }
.chat-status { font-size: 0.75rem; color: var(--ink-3); text-transform: lowercase; }
.chat-thread {
  min-height: 220px; max-height: 320px; overflow: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.65rem; background: var(--bg);
}
.bubble {
  max-width: 85%; padding: 0.65rem 0.85rem; border-radius: 14px; font-size: 0.92rem;
  animation: bubble-in 0.28s cubic-bezier(0.2, 1.2, 0.3, 1);
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.bubble.user {
  align-self: flex-end; background: var(--accent); color: white;
  border-bottom-right-radius: 4px;
}
.bubble.bot {
  align-self: flex-start; background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--ink); border-bottom-left-radius: 4px;
}
.chat-composer {
  display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border);
  background: var(--bg-raised);
}
.chat-composer input {
  flex: 1; font: inherit; padding: 0.6rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
}
.chat-composer input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.site-foot {
  max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 3rem;
  color: var(--ink-3); font-size: 0.85rem;
}
.site-foot a { color: var(--accent-ink); }
