/* Reed design system
   Light canvas, black pills, SF Pro Rounded.
   Adapted from ollama.com. Do not load webfonts. */

:root {
  --reed-bg: #ffffff;
  --reed-ink: #000000;
  --reed-ink-strong: #171717;
  --reed-ink-mid: #525252;
  --reed-muted: #737373;
  --reed-faint: #a3a3a3;
  --reed-line: #e5e5e5;
  --reed-line-soft: #f5f5f5;
  --reed-wash: #0000000d;
  --reed-wash-hover: #0000001a;
  --reed-inverse: #171717;
  --reed-inverse-hover: #000000;
  --reed-inverse-ink: #ffffff;

  --reed-rec: #ef4444;
  --reed-work: #d97706;
  --reed-ok: #16a34a;
  --reed-warn: #ca8a04;

  --font-display: "SF Pro Rounded", ui-rounded, "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-display: 2.25rem;
  --text-title: 1.875rem;
  --text-section: 1.5rem;
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-micro: 0.75rem;

  --leading-display: 1.15;
  --leading-body: 1.625;
  --tracking-display: -0.02em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  --reed-max-main: 56rem;
  --reed-max-prose: 42rem;
  --reed-pad-x: 24px;

  --reed-radius-pill: 999px;
  --reed-radius-card: 8px;
  --reed-shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.06);
  --reed-focus: 0 0 0 2px var(--reed-bg), 0 0 0 4px var(--reed-ink-strong);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.reed {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--reed-bg);
  color: var(--reed-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.reed a {
  color: inherit;
  text-decoration: none;
}

body.reed ::selection {
  background: var(--reed-ink-strong);
  color: var(--reed-inverse-ink);
}

body.reed [id] {
  scroll-margin-top: 5rem;
}

img {
  max-width: 100%;
  display: block;
}

/* Type */

.reed-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
}

h1,
h2,
h3,
.reed-h1,
.reed-h2,
.reed-h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--tracking-display);
  color: var(--reed-ink);
  margin: 0;
}

.reed-h1,
h1 {
  font-size: var(--text-title);
  line-height: 1.2;
}

.reed-h2,
h2 {
  font-size: var(--text-section);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.reed-h3,
h3 {
  font-size: 1.125rem;
  line-height: 1.35;
}

.reed-lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--reed-ink);
}

.reed-muted {
  color: var(--reed-muted);
}

.reed-faint {
  color: var(--reed-faint);
}

.reed-small {
  font-size: var(--text-small);
}

.reed-micro {
  font-size: var(--text-micro);
}

.reed-mono {
  font-family: var(--font-mono);
}

@media (min-width: 768px) {
  .reed-h1,
  h1 {
    font-size: var(--text-display);
    line-height: var(--leading-display);
  }

  .reed-h2,
  h2 {
    font-size: 1.875rem;
  }
}

/* Layout */

.reed-wrap {
  width: 100%;
  max-width: var(--reed-max-main);
  margin-inline: auto;
  padding-inline: var(--reed-pad-x);
}

.reed-prose {
  width: 100%;
  max-width: var(--reed-max-prose);
}

.reed-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-inline: auto;
  max-width: var(--reed-max-prose);
}

.reed-hero h1 {
  margin-top: var(--space-8);
}

.reed-section {
  margin-top: var(--space-24);
}

.reed-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.reed-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 48px;
}

@media (min-width: 768px) {
  .reed-section {
    margin-top: var(--space-32);
  }

  .reed-split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .reed-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Header / footer */

.reed-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--reed-bg);
}

.reed-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px var(--reed-pad-x);
  gap: var(--space-6);
}

.reed-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  z-index: 50;
}

.reed-brand svg {
  display: block;
}

.reed-nav-links {
  display: none;
  align-items: center;
  gap: var(--space-6);
  font-size: 1.125rem;
}

.reed-nav-links a:hover,
.reed-nav-links a:focus-visible,
.reed-nav-links a.is-active {
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}

.reed-nav-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  color: var(--reed-ink);
  display: inline-flex;
}

.reed-nav-toggle svg {
  display: block;
}

.reed-drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--reed-bg);
  z-index: 30;
  padding: 5.5rem var(--reed-pad-x) var(--space-8);
}

.reed-drawer.is-open {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 1.875rem;
  font-family: var(--font-display);
  font-weight: 500;
}

@media (min-width: 900px) {
  .reed-header {
    position: static;
  }

  .reed-nav-links {
    display: flex;
  }

  .reed-nav-toggle,
  .reed-drawer {
    display: none !important;
  }
}

.reed-footer {
  margin-top: auto;
}

.reed-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px var(--reed-pad-x) 24px;
  color: var(--reed-muted);
  font-size: var(--text-small);
  text-align: center;
}

.reed-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.reed-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 768px) {
  .reed-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    font-size: var(--text-micro);
    padding: 14px var(--reed-pad-x);
    text-align: left;
  }

  .reed-footer-links {
    gap: 24px;
  }
}

/* Buttons + links */

.reed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.25;
  border-radius: var(--reed-radius-pill);
  padding: 12px 32px;
  background: var(--reed-inverse);
  color: var(--reed-inverse-ink);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

/* Outranks `body.reed a { color: inherit }` for anchor buttons */
body.reed .reed-btn {
  color: var(--reed-inverse-ink);
}

.reed-btn:hover {
  background: var(--reed-inverse-hover);
}

.reed-btn:disabled,
.reed-btn[aria-disabled="true"] {
  background: var(--reed-line);
  color: var(--reed-faint);
  cursor: default;
  pointer-events: none;
}

.reed-btn:focus-visible {
  outline: none;
  box-shadow: var(--reed-focus);
}

.reed-btn-ghost,
body.reed .reed-btn-ghost {
  background: var(--reed-wash);
  color: var(--reed-ink);
}

.reed-btn-ghost:hover {
  background: var(--reed-wash-hover);
}

.reed-btn-sm {
  font-size: var(--text-small);
  padding: 6px 14px;
}

.reed-text-link {
  color: var(--reed-muted);
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

.reed-text-link:hover {
  color: var(--reed-ink-strong);
  text-decoration: underline;
}

.reed-underline {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reed-underline:hover {
  color: var(--reed-ink-strong);
}

/* Chips, keys, cards */

.reed-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--reed-line);
  border-radius: var(--reed-radius-pill);
  padding: 2px 8px;
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--reed-muted);
  line-height: 1.4;
}

.reed-key {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  padding: 3px 7px;
  border: 1px solid var(--reed-line);
  border-radius: 6px;
  background: var(--reed-wash);
  color: var(--reed-ink-strong);
}

button.reed-key {
  appearance: none;
  margin: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button.reed-key:hover {
  background: var(--reed-wash-hover);
}

button.reed-key:active,
button.reed-key.is-down {
  background: var(--reed-wash-hover);
  transform: translateY(1px);
}

.reed-nums {
  font-variant-numeric: tabular-nums;
}

.reed-card {
  background: var(--reed-bg);
  border: 1px solid var(--reed-line);
  border-radius: var(--reed-radius-card);
  overflow: hidden;
}

.reed-card-pad {
  padding: 20px 24px;
}

.reed-window {
  border: 1px solid var(--reed-line);
  border-radius: var(--reed-radius-card);
  overflow: hidden;
  background: var(--reed-bg);
}

.reed-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}

.reed-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.reed-dot-red { background: #f87171; }
.reed-dot-yellow { background: #facc15; }
.reed-dot-green { background: #4ade80; }

.reed-window-body {
  padding: 24px 20px;
  font-size: var(--text-small);
  line-height: 1.7;
  color: var(--reed-ink-mid);
}

/* Demo — the field you dictate into, HUD floating over it */

.reed-demo {
  position: relative;
  padding-bottom: 24px;
}

.reed-demo-body {
  min-height: 118px;
}

.reed-demo-hud {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(340px, calc(100% - 40px));
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.reed-demo-hud .reed-hud {
  width: 100%;
  height: 48px;
  font-size: 13px;
}

.reed-demo-hud.is-hidden {
  opacity: 0;
  transform: translate(-50%, 6px);
  pointer-events: none;
}

.reed-caret {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: var(--reed-ink-strong);
  animation: reed-caret-blink 1.1s step-end infinite;
}

@keyframes reed-caret-blink {
  50% { opacity: 0; }
}

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

.reed-feature p {
  margin: 0;
}

.reed-feature-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.reed-feature-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--reed-faint);
}

.reed-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--reed-wash);
  border: 1px solid var(--reed-line-soft);
  border-radius: var(--reed-radius-pill);
  padding: 8px 14px;
}

.reed-search input {
  border: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  font-size: var(--text-small);
  outline: none;
  color: var(--reed-ink);
}

.reed-search input::placeholder {
  color: var(--reed-muted);
}

/* HUD */

.reed-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 336px;
  max-width: 100%;
  height: 56px;
  padding: 0 16px;
  background: var(--reed-inverse);
  color: var(--reed-inverse-ink);
  border-radius: var(--reed-radius-pill);
  box-shadow: var(--reed-shadow-float);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.reed-hud-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reed-hud-dot.rec {
  background: var(--reed-rec);
  animation: reed-breathe 1.5s ease-in-out infinite;
}

@keyframes reed-breathe {
  50% { opacity: 0.3; }
}
.reed-hud-dot.work { background: var(--reed-work); }
.reed-hud-dot.ok { background: var(--reed-ok); }
.reed-hud-dot.warn { background: var(--reed-warn); }

.reed-hud-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reed-hud-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.reed-hud-btn {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--reed-radius-pill);
  cursor: pointer;
}

.reed-hud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.reed-hud-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--reed-inverse), 0 0 0 4px var(--reed-inverse-ink);
}

/* Forms (dashboard / support) */

.reed-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reed-field label {
  font-size: var(--text-small);
  color: var(--reed-muted);
}

.reed-field input,
.reed-field textarea,
.reed-field select {
  font: inherit;
  font-size: var(--text-body);
  padding: 10px 14px;
  border: 1px solid var(--reed-line);
  border-radius: var(--reed-radius-pill);
  background: var(--reed-bg);
  color: var(--reed-ink);
}

.reed-field textarea {
  border-radius: var(--reed-radius-card);
  min-height: 120px;
  resize: vertical;
}

.reed-field input:focus,
.reed-field textarea:focus,
.reed-field select:focus {
  outline: none;
  box-shadow: var(--reed-focus);
  border-color: var(--reed-ink-strong);
}

/* Lists / FAQ */

.reed-list {
  border: 1px solid var(--reed-line);
  border-radius: var(--reed-radius-card);
  overflow: hidden;
}

.reed-list + .reed-list,
.reed-list-row + .reed-list-row {
  border-top: 0;
}

.reed-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--reed-line);
}

.reed-list-row:first-child {
  border-top: 0;
}

.reed-faq details {
  border-top: 1px solid var(--reed-line);
  padding: 16px 0;
}

.reed-faq details:first-child {
  border-top: 0;
}

.reed-faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.reed-faq summary::-webkit-details-marker {
  display: none;
}

.reed-faq details p {
  margin: 8px 0 0;
  color: var(--reed-muted);
  font-size: var(--text-small);
}

/* Swatches (guideline only) */

.reed-swatch {
  border: 1px solid var(--reed-line);
  border-radius: var(--reed-radius-card);
  overflow: hidden;
  background: var(--reed-bg);
  color: var(--reed-ink);
}

.reed-swatch-chip {
  height: 72px;
}

.reed-swatch-meta {
  padding: 10px 12px;
  font-size: var(--text-micro);
  background: var(--reed-bg);
  color: var(--reed-muted);
}

.reed-swatch-meta strong {
  display: block;
  font-weight: 500;
  font-size: var(--text-small);
  color: var(--reed-ink);
}

/* Focus + motion */

:focus-visible {
  outline: 2px solid var(--reed-ink-strong);
  outline-offset: 2px;
}

.reed-btn:focus-visible,
.reed-hud-btn:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
