/* =========================================================================
   Clude — Linear-inspired dark system
   Base tokens · reset · nav · buttons · hero · chat mockup · footer · shared
   ========================================================================= */

:root {
  /* ---- Surfaces (near-black, cool) ---- */
  --bg:        #08090A;
  --bg-raise:  #0C0D0F;
  --bg-2:      #101113;
  --bg-3:      #16171A;
  --surface:   rgba(255, 255, 255, 0.026);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.065);

  /* ---- Lines ---- */
  --line:    rgba(255, 255, 255, 0.08);
  --line-2:  rgba(255, 255, 255, 0.12);
  --line-3:  rgba(255, 255, 255, 0.18);

  /* ---- Text ---- */
  --fg:    #F7F8F8;
  --fg-2:  #9CA3B0;
  --fg-3:  #6B7079;
  --fg-4:  #4A4E56;

  /* ---- Brand: ONE restrained accent (Linear-style), used sparingly ---- */
  --brand:        #5865E0;
  --brand-bright: #7C86F0;
  --brand-text:   #AEB4CC;   /* muted slate — most "accent" text is near-grayscale */
  --indigo:       #5E6AD2;
  --violet:       #8B5CF6;

  /* ---- Memory-type palette — desaturated to near-monochrome tints ---- */
  --clude-episodic:      #9098BE;
  --clude-semantic:      #8FB2A4;
  --clude-procedural:    #C2AE8C;
  --clude-self-model:    #A79CC2;
  --clude-introspective: #BE9DB0;

  /* ---- Type ---- */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- Geometry ---- */
  --maxw: 1120px;
  --maxw-text: 760px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --pill: 999px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(78, 107, 255, 0.32); color: #fff; }

/* Faint page-wide vignette + grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(180, 188, 210, 0.06), transparent 60%);
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.page { position: relative; z-index: 1; }

/* ============================================================ */
/* SHARED — eyebrows, section heads                             */
/* ============================================================ */
.eyebrow-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: var(--pill);
  white-space: nowrap;
}
.eyebrow-pill.brand { color: var(--fg-2); border-color: var(--line-2); background: var(--surface-2); }
.eyebrow-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #C2C8DC; box-shadow: 0 0 10px 1px rgba(180, 190, 220, 0.7); }

.section { padding: 120px 0; position: relative; }
.section-head { max-width: 720px; margin: 0 auto 64px; text-align: center; }
.section-head .eyebrow-row { justify-content: center; }
.section-title {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.028em;
  margin: 0 0 18px;
  color: var(--fg);
}
.section-title .quiet { color: var(--fg-3); }
.section-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0 auto;
  max-width: 600px;
  text-wrap: pretty;
}

/* ============================================================ */
/* BUTTONS                                                      */
/* ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.btn .arr { transition: transform .18s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 10px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(34, 68, 255, 0);
}
.btn-primary:hover { background: var(--brand-bright); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 22px -6px rgba(46, 91, 255, 0.7); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-3); }

.btn-soft {
  background: transparent;
  color: var(--fg-2);
  border-color: var(--line);
}
.btn-soft:hover { color: var(--fg); border-color: var(--line-3); }

/* ============================================================ */
/* NAV                                                          */
/* ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-left { display: flex; align-items: center; gap: 34px; }
.nav-brand { display: inline-flex; align-items: center; gap: 9px; }
.nav-brand-mark { width: 22px; height: 22px; color: var(--fg); display: block; }
.nav-brand-word {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px;
  font-weight: 450;
  color: var(--fg-2);
  padding: 7px 11px;
  border-radius: 7px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-link:hover { color: var(--fg); background: var(--surface); }
.nav-right { display: flex; align-items: center; gap: 12px; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ============================================================ */
/* HERO                                                         */
/* ============================================================ */
.hero { position: relative; padding: 92px 0 72px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; left: 50%; top: -180px; transform: translateX(-50%);
  width: 1400px; height: 760px;
  background:
    radial-gradient(46% 56% at 50% 0%, rgba(94, 106, 210, 0.34), transparent 72%),
    radial-gradient(34% 50% at 22% 8%, rgba(34, 68, 255, 0.30), transparent 70%),
    radial-gradient(34% 52% at 80% 4%, rgba(139, 92, 246, 0.24), transparent 72%);
  filter: blur(28px);
  pointer-events: none; z-index: 0;
}
/* hairline top sheen */
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 176, 255, 0.5), transparent);
  z-index: 1;
}
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 860px; margin: 0 auto; text-align: center; }
.hero-content .eyebrow-row { justify-content: center; }
.hero-title {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #FFFFFF 30%, #B7BDC9 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-title .quiet { color: var(--fg-3); -webkit-text-fill-color: var(--fg-3); }
.hero-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0 auto 34px;
  max-width: 620px;
  text-wrap: pretty;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.hero-meta { font-size: 14px; color: var(--fg-3); }
.hero-meta b { color: var(--fg); font-weight: 600; }

.hero-mockup { margin: 64px auto 0; max-width: 1080px; position: relative; z-index: 2; }

/* ============================================================ */
/* TRUSTED ROW                                                  */
/* ============================================================ */
.trusted { padding: 8px 0 64px; }
.trusted-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-3); margin-bottom: 26px;
}
.trusted-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 16px 40px;
}
.trusted-logo {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--fg-3);
  opacity: 0.7; transition: opacity .2s, color .2s;
  white-space: nowrap;
}
.trusted-logo:hover { opacity: 1; color: var(--fg-2); }

/* ============================================================ */
/* CARD primitive (Linear glass)                               */
/* ============================================================ */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ============================================================ */
/* CHAT MOCKUP — dark restyle                                   */
/* ============================================================ */
.chat-mockup {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "head head" "body mem" "input mem";
  background: linear-gradient(180deg, #111316, #0B0C0E);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4);
  height: 520px;
}
.chat-window-head {
  grid-area: head;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}
.chat-dot { width: 11px; height: 11px; border-radius: 50%; }
.chat-dot.r { background: #FF5F57; } .chat-dot.y { background: #FEBC2E; } .chat-dot.g { background: #28C840; }
.model-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 8px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
}
.model-badge-logo { display: inline-flex; }
.model-badge-name { font-family: var(--font-mono); font-size: 12px; color: var(--fg); }
.model-badge-chev { color: var(--fg-3); font-size: 10px; }
.chat-window-tabs { margin-left: auto; }
.persistence-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 5px;
}

.chat-window {
  grid-area: body;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 0;
}
.chat-window::-webkit-scrollbar { width: 0; height: 0; }
.chat-window > * { flex-shrink: 0; }
.model-switch-divider { display: flex; align-items: center; gap: 12px; margin: 2px 0; }
.model-switch-divider .line { flex: 1; height: 1px; background: var(--line); }
.model-switch-divider .label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-3);
  letter-spacing: 0.04em;
}
.model-switch-divider .arrow { color: var(--fg-4); }

.chat-msg { display: flex; gap: 12px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg-2);
}
.chat-avatar.model-avatar { background: var(--surface-3); }
.chat-bubble {
  max-width: 76%;
  font-size: 14px; line-height: 1.55; color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
}
.chat-msg.user .chat-bubble { background: rgba(255, 255, 255, 0.07); border-color: var(--line-2); }
.caret { color: var(--fg-2); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.recall { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.recall .label { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); letter-spacing: 0.04em; display: block; margin-bottom: 7px; }
.recall-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.5; color: var(--fg-2); margin-bottom: 8px; }
.recall-item .d { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }

.chat-input {
  grid-area: input;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}
.chat-input-field {
  flex: 1; font-size: 13px; color: var(--fg-3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 13px;
}
.chat-input-send {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; color: #0a0b0c;
  background: var(--fg); border: 1px solid rgba(255, 255, 255, 0.16);
}

.chat-mem-panel {
  grid-area: mem;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
  padding: 16px;
  overflow: hidden;
}
.chat-mem-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.chat-mem-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); }
.chat-mem-count { font-family: var(--font-mono); font-size: 10px; color: var(--fg-4); }
.chat-mem-row { display: flex; gap: 9px; font-size: 12px; color: var(--fg-2); line-height: 1.4; margin-bottom: 13px; }
.chat-mem-row .d { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.chat-mem-row .meta { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--fg-4); margin-top: 3px; }
@media (max-width: 720px) {
  .chat-mockup { grid-template-columns: 1fr; grid-template-areas: "head" "body" "input"; }
  .chat-mem-panel { display: none; }
}

/* ============================================================ */
/* FOOTER                                                       */
/* ============================================================ */
.footer { border-top: 1px solid var(--line); padding: 72px 0 40px; background: var(--bg-raise); }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .nav-brand { margin-bottom: 16px; }
.footer-brand p { font-size: 14px; color: var(--fg-3); max-width: 260px; line-height: 1.6; margin: 0; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--fg); margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13px; color: var(--fg-3); transition: color .15s; }
.footer-col a:hover { color: var(--fg); }
.footer-nod { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3); }
.footer-nod a { color: var(--brand-text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--fg-4); }
.footer-bottom-right { display: flex; gap: 20px; }
.footer-bottom a { color: var(--fg-4); }
.footer-bottom a:hover { color: var(--fg-2); }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }
