/* ============================================================================
   rterminal — website design system
   Solarized Light (Ethan Schoonover), tuned so essential text/controls clear
   WCAG AA on the cream ground. Single, deliberate light theme.
   ========================================================================== */

:root {
  /* grounds */
  --paper:   #fdf6e3;   /* base3  — primary surface */
  --paper-2: #f6efda;   /* between base3/base2 — subtle raised */
  --paper-3: #eee8d5;   /* base2  — page + alt sections */
  --field:   #fffaf0;   /* inset input surface */
  --line:    #e4ddc7;   /* hairline */
  --line-2:  #dcd4bd;   /* stronger divider */

  /* ink */
  --head:  #0f3b44;     /* deep Solarized teal — display headings */
  --ink:   #586e75;     /* base01 — primary text / labels */
  --body:  #4d6068;     /* readable body */
  --muted: #566b6d;     /* secondary text — AA on both the paper and page grounds */

  /* accents — bright hues for non-text marks; *-ink darker for text (AA on both grounds) */
  --blue: #268bd2;   --blue-ink: #1a6fad;   --blue-deep: #155d92;
  --cyan: #2aa198;   --cyan-ink: #197068;
  --green:#859900;   --green-ink:#5f6f00;
  --yellow:#b58900;  --orange:#cb4b16;  --red:#dc322f;  --red-ink:#c42d2b;
  --violet:#6c71c4;  --violet-ink:#565aad;  --magenta:#d33682;

  --ring: rgba(38,139,210,.30);
  --shadow-sm: 0 1px 2px rgba(15,59,68,.05);
  --shadow-md: 0 2px 6px rgba(15,59,68,.06), 0 20px 42px -26px rgba(7,54,66,.34);
  --shadow-lg: 0 2px 8px rgba(15,59,68,.07), 0 40px 80px -40px rgba(7,54,66,.42);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", "JetBrains Mono", Consolas, monospace;

  --maxw: 1080px;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--paper-3);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--head); letter-spacing: -.02em; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cyan-ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.lede { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 60ch; }

/* -------------------------------------------------------------- brand mark */
.mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); }
.mark svg { width: 26px; height: 26px; }
.mark .word { font-size: 17px; font-weight: 700; letter-spacing: .01em; color: var(--head); }

/* -------------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253,246,227,.82); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a.textlink { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.nav-links a.textlink:hover { color: var(--blue-ink); text-decoration: none; }
.nav-cta .cta-short { display: none; }

/* ------------------------------------------------------------------ button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14.5px; font-weight: 650; line-height: 1;
  padding: 11px 18px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .04s, color .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-ink); color: #fdf6e3; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--blue-ink); color: var(--blue-ink); background: rgba(38,139,210,.05); }
.btn-lg { padding: 13px 22px; font-size: 15.5px; border-radius: 11px; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(2px); }

/* ------------------------------------------------------------------- hero */
.hero { padding: 76px 0 64px; background:
  radial-gradient(1200px 560px at 78% -6%, #fbf3df 0%, var(--paper-3) 62%); }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 52px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 720; margin: 16px 0 0; }
.hero h1 .accent { color: var(--blue-ink); }
.hero .lede { margin-top: 20px; font-size: 19px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-sub { margin-top: 26px; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.works { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 99px; padding: 5px 12px;
}
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }

/* -------------------------------------------------- terminal window mockup */
.term {
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; font-family: var(--mono); font-size: 13px;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  background: var(--paper-2); border-bottom: 1px solid var(--line); }
.term-bar .tdot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.term-bar .tdot:nth-child(1) { background: #e0a3a0; }
.term-bar .tdot:nth-child(2) { background: #ddc38a; }
.term-bar .tdot:nth-child(3) { background: #a7cf9f; }
.term-bar .term-title { margin-left: 8px; color: var(--muted); font-size: 12px; }
.term-body { padding: 18px 18px 20px; line-height: 1.65; }
.term-body .cmd { color: var(--head); }
.term-body .cmd .caret { color: var(--cyan-ink); font-weight: 700; margin-right: 8px; }
.term-body .trace {
  margin: 12px 0; padding: 8px 11px; border-radius: 8px; font-size: 12px;
  color: var(--muted); background: var(--paper-3); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.term-body .trace .tw { color: var(--violet-ink); }
.term-body .answer { color: var(--body); font-family: var(--sans); font-size: 13.5px; line-height: 1.6; }
.term-body .answer .cite { color: var(--blue-ink); font-family: var(--mono); font-size: 11.5px; }
.term-body .refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.term-body .ref {
  font-size: 11px; color: var(--ink); background: var(--field); border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 9px; display: inline-flex; gap: 6px; align-items: center;
}
.term-body .ref::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--cyan); vertical-align: -2px;
  margin-left: 2px; animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-body .handoff { margin-top: 14px; padding: 11px 13px; border-radius: 9px; font-family: var(--sans);
  font-size: 13px; color: var(--head); background: rgba(38,139,210,.08);
  border: 1px solid rgba(38,139,210,.28); border-left: 3px solid var(--blue-ink); }
.term-body .handoff .hlabel { display: inline-block; font-family: var(--mono); font-size: 10px;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-ink);
  margin-right: 8px; }

/* --------------------------------------------------------------- sections */
.section { padding: 72px 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; margin-top: 10px; }
.section-head p { margin-top: 14px; font-size: 17px; color: var(--muted); }

/* card base — a real shadow so cards read raised on the cream .alt sections too */
.agent, .display-win, .loop-side, .skills-card, .sync-card, .case {
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-md);
}
.agent { padding: 18px; }
.agent .name { font-family: var(--mono); font-weight: 700; color: var(--head); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.agent .name .dot { width: 9px; height: 9px; border-radius: 50%; }
.agent .desc { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* flexibility split: agents beside a multimodal display window */
.split { display: grid; grid-template-columns: 1fr 1.12fr; gap: 26px; align-items: start; }
.agents-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.display-win { border-radius: var(--radius); overflow: hidden; }
.dw-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.dw-tab { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 5px 11px; border-radius: 7px; }
.dw-tab.active { color: #fdf6e3; background: var(--blue-ink); font-weight: 600; }
.dw-body { padding: 12px 16px 16px; }
.dw-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.dw-k { flex: none; width: 72px; font-family: var(--mono); font-size: 11px; color: var(--cyan-ink); font-weight: 600; }
.dw-v { font-size: 13px; color: var(--body); line-height: 1.45; }
.dw-mmnote { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* long-running hybrid loop */
.loop { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; margin-bottom: 30px; }
.loop-side { padding: 20px 22px; box-shadow: var(--shadow-sm); }
.loop-side .lh { font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 12px; }
.loop-agent .lh { color: var(--cyan-ink); }
.loop-you .lh { color: var(--blue-ink); }
.loop-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.loop-side li { font-size: 14px; color: var(--body); padding-left: 15px; position: relative; }
.loop-side li::before { content: "\203A"; position: absolute; left: 0; color: var(--muted); }
.loop-arrow { display: flex; align-items: center; justify-content: center; }
.loop-arrow span { font-family: var(--mono); font-size: 11px; color: var(--muted);
  writing-mode: vertical-rl; letter-spacing: .1em; }

/* pipeline — even grid so the numbered sequence never wraps ragged */
.pipe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stage { background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; padding: 13px 14px; }
.stage .num { font-family: var(--mono); font-size: 11px; color: var(--cyan-ink); font-weight: 700; }
.stage .st { display: block; margin-top: 3px; font-weight: 640; color: var(--head); font-size: 14px; }
.stage .sd { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* skills card (preset-but-general) */
.skills-card { padding: 20px 22px; font-family: var(--mono); font-size: 13px; border-radius: var(--radius); }
.skills-card .sc-title { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.skills-card .sc-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.skills-card .sc-row:last-child { border-bottom: 0; }
.skills-card .sc-name { color: var(--head); }
.skills-card .sc-tag { font-size: 11px; color: var(--green-ink); background: rgba(133,153,0,.14); border-radius: 6px; padding: 2px 8px; }
.skills-card .sc-tag.add { color: var(--blue-ink); background: rgba(38,139,210,.10); }

/* case-study cards (a real run) */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.case { padding: 22px; display: flex; flex-direction: column; }
.case-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.case-kicker { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--cyan-ink); font-weight: 700; }
.case-stat { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--head); white-space: nowrap; }
.case-lead { font-size: 14.5px; color: var(--body); line-height: 1.5; }
.case .quote { margin-top: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--head);
  background: var(--paper-2); border-radius: 9px; border-left: 3px solid var(--cyan-ink); }
.case .quote .qcite { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.rank { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--body); }
.rank .rk { flex: none; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center;
  background: var(--paper-3); color: var(--head); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.rank .elo { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--cyan-ink); font-weight: 600; }
.verdict { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--body); }
.verdict .vdot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); flex: none; }

/* split / sync CTA band */
.band { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; }
.band h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; }
.band p { margin-top: 14px; font-size: 17px; color: var(--muted); }
.band ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.band li { display: flex; gap: 10px; font-size: 15px; color: var(--body); }
.band li .ck { color: var(--green-ink); flex: none; font-weight: 700; }
.sync-card {
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 22px; font-family: var(--mono); font-size: 12.5px;
}
.sync-card .row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sync-card .row:last-child { border-bottom: 0; }
.sync-card .k { color: var(--muted); }
.sync-card .v { color: var(--head); }
.sync-card .badge { color: var(--green-ink); background: rgba(133,153,0,.14); border-radius: 6px; padding: 2px 8px; font-size: 11px; }

/* final cta */
.cta-final { text-align: center; padding: 84px 0; background:
  radial-gradient(900px 420px at 50% 120%, #fbf3df, var(--paper-3)); }
.cta-final h2 { font-size: clamp(28px, 3.8vw, 38px); font-weight: 720; }
.cta-final p { margin: 14px auto 0; max-width: 52ch; font-size: 17px; color: var(--muted); }
.cta-final .hero-cta { justify-content: center; margin-top: 28px; }

/* ------------------------------------------------------------------ footer */
.footer { background: var(--paper-3); border-top: 1px solid var(--line); padding: 34px 0; }
.footer .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer .tagline { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.footer .flinks { display: flex; gap: 20px; }
.footer .flinks a { color: var(--muted); font-size: 14px; font-weight: 600; }
.footer .flinks a:hover { color: var(--blue-ink); text-decoration: none; }

/* ============================================================= auth pages */
.auth-body { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1100px 620px at 50% -8%, #fbf3df, var(--paper-3)) fixed; }
.auth-top { padding: 22px 24px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 24px 48px; }
.card {
  width: 400px; max-width: 100%; background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow-md);
}
.card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--field); border: 1px solid var(--line-2); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #a9a892; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.field input.bad { border-color: var(--red); }
.pw { position: relative; }
.pw input { padding-right: 58px; }
.reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent;
  border: 0; padding: 6px 9px; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; }
.reveal:hover { color: var(--blue-ink); }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--red-ink); min-height: 0; }
.hint:empty { margin: 0; }
.note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.meter { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.meter .bars { display: flex; gap: 4px; flex: 1; }
.meter .bars span { height: 4px; flex: 1; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.meter .lab { min-width: 44px; text-align: right; font-size: 11px; font-weight: 600; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.submit { width: 100%; margin-top: 10px; padding: 12px; font: inherit; font-size: 15px; font-weight: 650;
  color: #fdf6e3; background: var(--blue-ink); border: 0; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .04s; }
.submit:hover { background: var(--blue-deep); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: .65; cursor: default; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(253,246,227,.4); border-top-color: #fdf6e3;
  border-radius: 50%; animation: spin .6s linear infinite; display: none; }
.submit.loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.waitspin { width: 40px; height: 40px; margin: 2px 0 18px; border: 3px solid var(--line-2);
  border-top-color: var(--blue-ink); border-radius: 50%; animation: spin .7s linear infinite; }
#view-error .swap a { display: inline-block; }
.price-line { margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.price-line b { color: var(--head); font-weight: 650; }
.err { margin: 13px 0 0; min-height: 1.1em; font-size: 13.5px; color: var(--red-ink); }
.swap { margin: 18px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.card #view-done { display: none; }
.check { width: 46px; height: 46px; margin-bottom: 14px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 23px; font-weight: 700;
  color: var(--green-ink); background: rgba(133,153,0,.15); }
code.token { display: block; margin: 16px 0 0; padding: 13px 14px; font-size: 13.5px; line-height: 1.5;
  color: var(--ink); background: var(--field); border: 1px solid var(--line-2); border-radius: 10px;
  word-break: break-all; font-family: var(--mono); }
.copy { width: 100%; margin-top: 10px; padding: 11px; font: inherit; font-size: 14px; font-weight: 640;
  color: var(--blue-ink); background: transparent; border: 1px solid var(--line-2); border-radius: 10px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.copy:hover { border-color: var(--blue-ink); background: rgba(38,139,210,.06); }
.copy.done { color: var(--green-ink); border-color: rgba(133,153,0,.5); }
.fine { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 48px; }
  .split { grid-template-columns: 1fr; gap: 22px; }
  .loop { grid-template-columns: 1fr; gap: 14px; }
  .loop-arrow span { writing-mode: horizontal-tb; }
  .cases { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 560px) {
  .agents-col { grid-template-columns: 1fr; }
  .pipe { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 12px; }
  .nav-links .hide-sm { display: none; }
  .nav-cta { padding: 8px 13px; }
  .nav-cta .cta-full { display: none; }
  .nav-cta .cta-short { display: inline; }
  .section { padding: 56px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
