/* intellego-site — calm, low-sensory design system. Light only, no motion. */

:root {
  --bg:        #f4f6f5;
  --surface:   #ffffff;
  --surface-2: #eef2f0;
  --ink:       #1e2a28;   /* primary text — high contrast on --bg */
  --ink-soft:  #51605c;   /* muted text — meets AA on --bg */
  --border:    #dde4e1;
  --accent:    #2f6f66;   /* deep sage/teal */
  --accent-ink:#ffffff;
  --accent-hi: #285f57;   /* hover */
  --accent-soft:#e3efec;
  --amber:     #7a5a1e;
  --radius:    14px;
  --measure:   66ch;
  --maxw:      1080px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
}

/* Dark theme — same calm, low-sensory feel, high contrast. */
[data-theme="dark"] {
  --bg:        #141f1d;
  --surface:   #1b2926;
  --surface-2: #223330;
  --ink:       #e9efec;
  --ink-soft:  #a4b3ae;
  --border:    #2c3c38;
  --accent:    #5fb3a6;
  --accent-ink:#0f1c1a;
  --accent-hi: #76c4b8;
  --accent-soft:#223f39;
  --amber:     #d9b877;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }        /* no motion */

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 700; letter-spacing: -0.01em; margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 650; margin: 0 0 0.5em; }
h3 { font-size: 1.06rem; font-weight: 650; margin: 0 0 0.3em; }

p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hi); }

strong { font-weight: 650; }
em { font-style: normal; background: var(--accent-soft); padding: 0 3px; border-radius: 4px; }

/* Visible focus for keyboard users */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); color: var(--ink); padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) 0; z-index: 20;
}
.skip-link:focus { left: 0; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-links { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.96rem; }
.nav-links a:hover { color: var(--ink); }
.nav-source { font-weight: 600; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Layout ---------- */
main { display: block; }
section { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.band { padding-top: 72px; padding-bottom: 72px; border-top: 1px solid var(--border); }
.band-quiet { background: var(--surface-2); border-top: 1px solid var(--border); }
.section-lede { font-size: 1.06rem; color: var(--ink-soft); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
  padding-top: 64px; padding-bottom: 72px;
}
.hero-copy { min-width: 0; }
.chip {
  display: inline-block; margin: 0 0 14px; padding: 5px 12px;
  background: var(--accent-soft); color: var(--accent-hi);
  border-radius: 999px; font-size: 0.82rem; font-weight: 600;
}
.lede { font-size: 1.15rem; color: var(--ink-soft); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 12px; }
.cta-note { color: var(--ink-soft); font-size: 0.92rem; margin: 6px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }

/* ---------- App preview mock ---------- */
.preview { min-width: 0; }
.win {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 1px 0 var(--border);
}
.win-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #cdd6d2; display: inline-block; }
.win-title { margin-left: 8px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.win-body { padding: 20px; }
.heard { margin: 0 0 16px; color: var(--ink); font-size: 1rem; }
.heard-label {
  display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 2px; font-weight: 700;
}
.card { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); }
.card dl { margin: 0; padding: 6px 4px; }
.facet { padding: 10px 16px; border-top: 1px solid var(--surface-2); }
.facet:first-child { border-top: 0; }
.facet dt { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-hi); font-weight: 700; margin-bottom: 2px; }
.facet dd { margin: 0; font-size: 0.96rem; }
.facet-suggest dd { color: var(--ink-soft); font-style: italic; }

/* ---------- Facet + trust grids ---------- */
.facet-grid, .trust-grid {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px;
}
.facet-grid li, .trust-grid li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.facet-grid p, .trust-grid p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }
.opt {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-hi); background: var(--accent-soft); padding: 2px 7px; border-radius: 999px;
  vertical-align: middle; font-weight: 700;
}

/* ---------- Ethics note ---------- */
.note { max-width: none; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.note-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px; }
.note h2 { font-size: 1.2rem; margin-bottom: 0.3em; }
.note p { max-width: 78ch; color: var(--ink); margin: 0; }

/* ---------- Download ---------- */
.dl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; margin-top: 24px; max-width: 760px;
}
.dl-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dl-platform { font-size: 1.2rem; font-weight: 650; margin: 0 0 2px; }
.dl-meta { margin: 0; color: var(--ink-soft); font-size: 0.9rem; display: flex; gap: 10px; }
.dl-meta span + span::before { content: "·"; margin-right: 10px; color: var(--border); }
.dl-status { margin: 18px 0 20px; color: var(--ink-soft); max-width: 70ch; }
.build { border-top: 1px solid var(--border); padding-top: 16px; }
.build summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.build-steps { margin: 14px 0 6px; padding-left: 20px; }
.build-steps li { margin-bottom: 12px; max-width: 68ch; }
pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; margin: 8px 0 0;
}
code { font-family: var(--mono); font-size: 0.86rem; color: var(--ink); }
.build-steps code, pre code { line-height: 1.5; }
.dl-other { margin-top: 18px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-brand { margin: 0; font-weight: 650; }
.footer-links { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .preview { order: 2; }
  .nav-links { gap: 16px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .nav { padding: 10px 16px; }
  section { padding-left: 16px; padding-right: 16px; }
  .band { padding-top: 52px; padding-bottom: 52px; }
  .dl-card { padding: 20px; }
  .btn { width: 100%; }
}

/* ---------- Docs page ---------- */
.doc { max-width: 840px; margin: 0 auto; padding: 44px 24px 80px; }
.doc-lede { font-size: 1.12rem; color: var(--ink-soft); margin-bottom: 6px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 26px 0 8px; }
.toc p { margin: 0 0 8px; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.toc ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 28px; }
.toc li { margin: 3px 0; }
.doc section { padding-top: 8px; }
.doc h2 { scroll-margin-top: 80px; border-top: 1px solid var(--border); padding-top: 34px; margin-top: 34px; }
.doc h3 { margin-top: 26px; scroll-margin-top: 80px; }
.doc ul, .doc ol { max-width: var(--measure); }
.doc li { margin-bottom: 6px; }
table.cfg { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
table.cfg th, table.cfg td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.cfg thead th { color: var(--ink-soft); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
table.cfg td code { white-space: nowrap; }
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 13px 16px; margin: 18px 0; }
.callout p { margin: 0; max-width: none; }

/* Respect reduced-motion explicitly (page has no motion regardless) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
