/*
 * Bleedor landing page styles.
 *
 * Palette pulled directly from browser.py so the seam from browser →
 * landing page is invisible. Edit browser.py's UI_* constants and
 * mirror here if the browser's chrome palette ever changes.
 *
 *   --bg          = UI_BG          (#0B0B0D)
 *   --bg-panel    = UI_BG_PANEL    (#101013)
 *   --text        = UI_TEXT        (#F3F3F1, warm white)
 *   --text-dim    = UI_TEXT_DIM    (#B4B4B0)
 *   --text-mute   = UI_TEXT_MUTE   (#7A7A76)
 *   --accent      = UI_ACCENT      (#E8443B, semantic red)
 *   --hairline    = UI_HAIRLINE    (white @ 8.5%)
 *
 * Per DESIGN.md principle 5: "The chrome is loud through craft, not
 * noise." No gradients, no glows, no emoji. Monochrome with one
 * restrained accent used only where it means something.
 */

:root {
  --bg: #0B0B0D;
  --bg-panel: #101013;
  --bg-elev: #141416;
  --text: #F3F3F1;
  --text-dim: #B4B4B0;
  --text-mute: #7A7A76;
  --accent: #E8443B;
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-hi: rgba(255, 255, 255, 0.21);

  --radius: 4px;
  --stack: "Inter", "Inter Variable", "Segoe UI Variable Text",
           "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--stack);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover {
  color: var(--text);
  border-bottom-color: var(--hairline-hi);
}

.view[hidden] { display: none !important; }

/* ---------- Home view ---------------------------------------------------- */

#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.home-inner {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.wordmark {
  margin: 0 0 18px;
  font-size: clamp(56px, 10vw, 104px);
  font-weight: 200;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--text);
}

.tagline {
  margin: 0 0 40px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}

.search-form {
  display: flex;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 120ms ease;
}
.search-form:focus-within {
  border-color: var(--hairline-hi);
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--stack);
  font-size: 15px;
  letter-spacing: 0.005em;
}
.search-input::placeholder { color: var(--text-mute); }
.search-input::-webkit-search-cancel-button { display: none; }

.search-submit {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--hairline);
  padding: 0 22px;
  color: var(--text-dim);
  font-family: var(--stack);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.search-submit:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.search-submit:active { color: var(--accent); }

.home-links {
  margin-top: 36px;
  font-size: 13px;
  color: var(--text-mute);
}
.home-links a { color: var(--text-mute); }
.home-links a:hover { color: var(--text-dim); }
.home-links .dot {
  margin: 0 8px;
  color: var(--text-off, #4A4A48);
}

/* ---------- Results view ------------------------------------------------- */

#results {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--hairline);
}

.wordmark-small {
  font-size: 22px;
  font-weight: 200;
  letter-spacing: -0.03em;
  color: var(--text);
  border: 0;
  flex-shrink: 0;
}
.wordmark-small:hover { color: var(--accent); border: 0; }

.results-form {
  flex: 1;
  display: flex;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.results-form:focus-within { border-color: var(--hairline-hi); }

.results-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--stack);
  font-size: 14px;
}
.results-input::-webkit-search-cancel-button { display: none; }

.results-submit {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--hairline);
  padding: 0 16px;
  color: var(--text-dim);
  font-family: var(--stack);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.results-submit:hover { color: var(--text); }

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  font-size: 12px;
  color: var(--text-mute);
}

.demo-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(232, 68, 59, 0.08);
  border: 1px solid rgba(232, 68, 59, 0.28);
  border-radius: 3px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result .cite {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.01em;
}

.result .title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 2px 0 4px;
}
.result .title a {
  color: inherit;
  border: 0;
}
.result .title a:hover { color: var(--accent); border: 0; }

.result .snippet {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.results-empty {
  padding: 32px 0;
  color: var(--text-mute);
  font-size: 14px;
  text-align: center;
}

.results-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- Doc pages (about, privacy) ----------------------------------- */

.doc {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 24px 96px;
}

.doc-header {
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--hairline);
}

.doc-body {
  padding-top: 32px;
}

.doc-body h1 {
  margin: 0 0 20px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.doc-body h2 {
  margin: 40px 0 12px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.doc-body p,
.doc-body ul {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-dim);
}

.doc-body p.lede {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 28px;
}

.doc-body strong {
  color: var(--text);
  font-weight: 500;
}

.doc-body ul {
  padding-left: 20px;
}
.doc-body li {
  margin-bottom: 6px;
}
.doc-body li::marker {
  color: var(--text-mute);
}

.doc-body a {
  color: var(--text);
  border-bottom: 1px solid var(--hairline-hi);
}
.doc-body a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.doc-body code {
  font-family: "JetBrains Mono", "Consolas", ui-monospace, monospace;
  font-size: 0.88em;
  padding: 1px 5px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--text);
}

.doc-body kbd {
  font-family: var(--stack);
  font-size: 0.82em;
  font-weight: 500;
  padding: 1px 6px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline-hi);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--text);
}

.doc-meta {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
  margin: -12px 0 28px;
}

.doc-links {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-mute);
}
.doc-links a { color: var(--text-mute); border: 0; }
.doc-links a:hover { color: var(--text-dim); border: 0; }
.doc-links .dot {
  margin: 0 8px;
  color: #4A4A48;
}

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 520px) {
  #results { padding: 16px 16px 64px; }
  .results-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .wordmark-small { text-align: left; }
  .result .title { font-size: 16px; }

  .doc { padding: 16px 16px 64px; }
  .doc-body p, .doc-body ul { font-size: 14px; }
  .doc-body p.lede { font-size: 15px; }
}

/* Reduce motion for users who've asked for it. */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
