/* ==========================================================================
   soroagent theme — extracted from the "SoroAgent Website" design
   Drop this file into any site:  <link rel="stylesheet" href="soroagent-theme.css">
   Everything is driven by the tokens in :root, so re-skinning = editing tokens.
   Items marked [added] were not in the original but complete the system
   (e.g. hover state for the primary button, a dark ground for code).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color — surfaces */
  --sa-page:        #EEF6F1;  /* mint-tinted page background */
  --sa-surface:     #FFFFFF;  /* cards, sections, nav pills */
  --sa-soft:        #ECFDF5;  /* tinted fills: step numbers, soft buttons, site tags */

  /* Color — text */
  --sa-fg:          #111613;  /* near-black with a green cast */
  --sa-muted:       #5F6763;  /* secondary text, captions, descriptions */

  /* Color — lines */
  --sa-border:      #E3E7E5;  /* neutral hairlines, buttons, dividers */
  --sa-card-border: #DCE9E1;  /* green-tinted outline for big cards & pills */

  /* Color — accent (emerald) */
  --sa-accent:       #047857; /* links, primary buttons, icons, highlights */
  --sa-accent-hover: #065F46; /* link hover; primary-button hover [added] */
  --sa-on-accent:    #FFFFFF;

  /* Color — brand mascot (owl logo) */
  --sa-brand-green:  #34D399; /* body */
  --sa-brand-mint:   #7AE3BE; /* belly */
  --sa-brand-deep:   #28A477; /* wings */
  --sa-brand-beak:   #FDE68A;
  --sa-brand-ink:    #0A0A0C; /* eyes */
  --sa-brand-perch:  #7C5A3A;

  /* Typography */
  --sa-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sa-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sa-text-base: 17px;   /* body, line-height 1.6 */
  --sa-lh-base:   1.6;

  --sa-text-display: clamp(40px, 7vw, 60px); /* h1 — lh 1.05, tracking -0.035em, 700 */
  --sa-text-logo:    26px;                    /* wordmark — 700, -0.025em */
  --sa-text-h2:      28px;                    /* section titles — lh 1.2, -0.02em, 700 */
  --sa-text-h3:      22px;                    /* card titles — -0.01em */
  --sa-text-lede:    20px;                    /* hero subtitle, muted */
  --sa-text-nav:     15px;                    /* nav pills, step descriptions */
  --sa-text-ui:      14px;                    /* panels, badges, footer, fine print */
  --sa-text-sm:      13px;                    /* small buttons, chips, captions */
  --sa-text-xs:      12px;                    /* mono tags, url pills, meta */
  --sa-text-2xs:     11px;                    /* tiny pills */

  --sa-weight-medium: 500;
  --sa-weight-semi:   600;
  --sa-weight-bold:   700;

  /* Spacing (values actually used in the design) */
  --sa-space-1:  4px;
  --sa-space-2:  6px;
  --sa-space-3:  8px;
  --sa-space-4:  10px;
  --sa-space-5:  12px;
  --sa-space-6:  14px;
  --sa-space-7:  16px;
  --sa-space-8:  20px;
  --sa-space-9:  24px;
  --sa-space-10: 28px;
  --sa-space-11: 32px;
  --sa-space-12: 36px;
  --sa-space-13: 40px;
  --sa-space-14: 56px;
  --sa-section-pad: clamp(28px, 6vw, 56px);
  --sa-section-gap: 24px;   /* vertical gap between section cards */

  /* Layout */
  --sa-container: 760px;    /* single narrow column, centered */
  --sa-gutter:    16px;
  --sa-measure:   520px;    /* max width for lede / long paragraphs (560 also used) */

  /* Radii */
  --sa-radius-xs:   6px;    /* url pill, site tag */
  --sa-radius-sm:   8px;    /* small buttons, icon buttons */
  --sa-radius-md:   10px;   /* hero CTAs, output boxes */
  --sa-radius-lg:   12px;   /* list cards / posts */
  --sa-radius-xl:   14px;   /* popovers / panels */
  --sa-radius-2xl:  16px;   /* framed demos / browser mockups */
  --sa-radius-3xl:  24px;   /* section cards */
  --sa-radius-pill: 999px;  /* nav links, badges, chips, tags */

  /* Elevation — the site is flat; shadows only on floating UI */
  --sa-shadow-fab:     0 8px 20px rgba(0, 0, 0, .12);
  --sa-shadow-popover: 0 16px 40px rgba(0, 0, 0, .18);

  /* Focus */
  --sa-focus: 2px solid var(--sa-accent);
  --sa-focus-offset: 2px;

  /* Icons — Lucide-style line icons, 24×24 viewBox, round caps & joins */
  --sa-icon-stroke-feature: 1.8; /* 22–28px accent icons in content */
  --sa-icon-stroke-ui: 2;        /* 16px icons in nav / footer */

  /* Motion */
  --sa-ease: ease-in-out;
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sa-page);
  color: var(--sa-fg);
  font-family: var(--sa-font-sans);
  font-size: var(--sa-text-base);
  line-height: var(--sa-lh-base);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sa-accent); }
a:hover { color: var(--sa-accent-hover); }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: var(--sa-focus);
  outline-offset: var(--sa-focus-offset);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
.sa-display {
  margin: 0 0 20px;
  font-size: var(--sa-text-display);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: var(--sa-weight-bold);
}
.sa-h2 {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;           /* 8px when followed by a .sa-lede */
  font-size: var(--sa-text-h2);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: var(--sa-weight-bold);
}
.sa-h2 svg { width: 28px; height: 28px; flex: none; }
.sa-h3 { margin: 0 0 4px; font-size: var(--sa-text-h3); letter-spacing: -0.01em; }

.sa-lede       { margin: 0 0 36px; font-size: var(--sa-text-lede); color: var(--sa-muted); max-width: var(--sa-measure); }
.sa-section-lede { margin: 0 0 24px; color: var(--sa-muted); }
.sa-muted      { color: var(--sa-muted); }
.sa-caption    { margin-top: 12px; font-size: var(--sa-text-sm); color: var(--sa-muted); }
.sa-fine       { font-size: var(--sa-text-ui); color: var(--sa-muted); }
.sa-mono       { font-family: var(--sa-font-mono); font-size: var(--sa-text-xs); }

/* Wordmark: "soro" in fg + "agent" in accent */
.sa-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--sa-fg); }
.sa-logo:hover { color: var(--sa-fg); }
.sa-logo__text { font-size: var(--sa-text-logo); font-weight: var(--sa-weight-bold); letter-spacing: -0.025em; }
.sa-logo__text em { font-style: normal; color: var(--sa-accent); }
.sa-logo svg { width: 44px; height: 44px; flex: none; } /* white tile, rx ≈ 23% */

/* Arrow text link, e.g. "Privacy policy →" */
.sa-link-strong { font-weight: var(--sa-weight-semi); text-decoration: none; }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.sa-container { max-width: var(--sa-container); margin: 0 auto; padding: 0 var(--sa-gutter); }

.sa-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 24px 8px;
}

/* The signature element: every section is a white rounded card on the mint page */
.sa-section {
  margin-top: var(--sa-section-gap);
  background: var(--sa-surface);
  border: 1px solid var(--sa-card-border);
  border-radius: var(--sa-radius-3xl);
  padding: var(--sa-section-pad);
}
.sa-section:first-of-type { margin-top: 8px; }

.sa-footer {
  margin-top: 32px; padding: 24px 8px 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: var(--sa-text-ui); color: var(--sa-muted);
}
.sa-footer__links { display: flex; flex-wrap: wrap; gap: 20px; }
.sa-footer a { color: var(--sa-muted); display: inline-flex; align-items: center; gap: 6px; }
.sa-footer a:hover { color: var(--sa-accent); }
.sa-footer svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
/* Large CTA (hero) — 12×20 padding, radius 10, 600 weight, 18px icon, 10px gap */
.sa-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-md);
  background: transparent;
  color: var(--sa-fg);
  font: inherit; font-weight: var(--sa-weight-semi);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s; /* [added] */
}
.sa-btn svg { width: 18px; height: 18px; flex: none; }
.sa-btn:hover { color: var(--sa-accent); border-color: var(--sa-accent); }

.sa-btn--primary {
  background: var(--sa-accent);
  border-color: var(--sa-accent);
  color: var(--sa-on-accent);
}
.sa-btn--primary:hover { background: var(--sa-accent-hover); border-color: var(--sa-accent-hover); color: var(--sa-on-accent); } /* [added] */

.sa-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Small button (panels/toolbars) — 8×14, radius 8, 13px/600, white fill */
.sa-btn--sm {
  gap: 6px; padding: 8px 14px;
  border-radius: var(--sa-radius-sm);
  background: var(--sa-surface);
  font-size: var(--sa-text-sm);
}
.sa-btn--sm.sa-btn--primary { background: var(--sa-accent); }

/* Soft button — tinted mint fill, accent text */
.sa-btn--soft {
  padding: 6px 12px; border: 0;
  border-radius: var(--sa-radius-sm);
  background: var(--sa-soft); color: var(--sa-accent);
  font-size: var(--sa-text-sm);
}
.sa-btn--soft:hover { background: #D1FAE5; color: var(--sa-accent-hover); } /* [added] */

/* Icon-only button — 32×32, radius 8, ghost */
.sa-icon-btn {
  width: 32px; height: 32px; border: 0; border-radius: var(--sa-radius-sm);
  background: transparent; color: var(--sa-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.sa-icon-btn:hover { background: var(--sa-page); color: var(--sa-fg); }
.sa-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* Underlined text button */
.sa-text-btn {
  border: 0; padding: 0; background: none; color: var(--sa-accent);
  font: inherit; text-decoration: underline; cursor: pointer;
}

/* Floating action button (the owl launcher) — 56px circle */
.sa-fab {
  width: 56px; height: 56px; padding: 6px; border-radius: 50%;
  border: 1px solid var(--sa-card-border); background: var(--sa-surface);
  box-shadow: var(--sa-shadow-fab); cursor: pointer;
}
.sa-fab svg { width: 100%; height: 100%; display: block; }
.sa-fab--nudge { animation: sa-nudge 2.4s var(--sa-ease) 1s 3; }
@keyframes sa-nudge { 0%, 100% { transform: none; } 10% { transform: translateY(-4px); } 20% { transform: none; } }

/* --------------------------------------------------------------------------
   6. PILLS, BADGES, CHIPS, TAGS
   -------------------------------------------------------------------------- */
/* Nav link pill — 44px tall touch target */
.sa-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.sa-nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--sa-card-border); border-radius: var(--sa-radius-pill);
  background: var(--sa-surface); color: var(--sa-fg);
  text-decoration: none; font-weight: var(--sa-weight-medium); font-size: var(--sa-text-nav);
}
.sa-nav-link:hover { color: var(--sa-accent); border-color: var(--sa-accent); }
.sa-nav-link svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Eyebrow badge ("Open source · MIT license") */
.sa-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 24px; padding: 6px 12px;
  border: 1px solid var(--sa-border); border-radius: var(--sa-radius-pill);
  font-size: var(--sa-text-ui); font-weight: var(--sa-weight-medium);
  color: var(--sa-accent); text-decoration: none;
}
.sa-badge svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* Suggestion chip */
.sa-chip {
  align-self: flex-start; padding: 8px 12px;
  border: 1px solid var(--sa-border); border-radius: var(--sa-radius-pill);
  background: var(--sa-surface); color: var(--sa-fg);
  font: inherit; font-size: var(--sa-text-sm); text-align: left; cursor: pointer;
}
.sa-chip:hover { border-color: var(--sa-accent); color: var(--sa-accent); }

/* Mono tag (outlined pill) */
.sa-tag {
  display: inline-block; margin: 4px 6px 0 0; padding: 1px 8px;
  border: 1px solid var(--sa-card-border); border-radius: var(--sa-radius-pill);
  font: var(--sa-text-xs) var(--sa-font-mono); color: var(--sa-accent);
}
/* Mono label (filled) — e.g. a domain or file name */
.sa-label {
  display: inline-block; padding: 2px 8px; border-radius: var(--sa-radius-xs);
  background: var(--sa-soft); color: var(--sa-accent);
  font: var(--sa-text-xs) var(--sa-font-mono);
}
/* Dashed meta pill */
.sa-pill-dashed {
  font-weight: var(--sa-weight-medium); font-size: var(--sa-text-2xs);
  padding: 1px 6px; border: 1px dashed var(--sa-muted); border-radius: var(--sa-radius-pill);
}

/* --------------------------------------------------------------------------
   7. CONTENT PATTERNS
   -------------------------------------------------------------------------- */
/* Feature list: label column (150px) + description, hairline dividers */
.sa-features { margin: 0; }
.sa-feature {
  display: flex; flex-wrap: wrap; gap: 4px 32px;
  padding: 22px 0; border-bottom: 1px solid var(--sa-border);
}
.sa-feature:first-child { padding-top: 0; }
.sa-feature:last-child  { padding-bottom: 0; border-bottom: 0; }
.sa-feature dt { flex: 0 0 150px; font-weight: var(--sa-weight-semi); display: flex; align-items: center; gap: 10px; }
.sa-feature dt svg { width: 22px; height: 22px; flex: none; stroke: var(--sa-accent); }
.sa-feature dd { flex: 1 1 360px; margin: 0; color: var(--sa-muted); }

/* Numbered steps */
.sa-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.sa-steps li { display: flex; gap: 12px; }
.sa-steps b { display: block; }
.sa-steps li span:not(.sa-step-num) { color: var(--sa-muted); font-size: var(--sa-text-nav); }
.sa-step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--sa-soft); color: var(--sa-accent);
  font-weight: var(--sa-weight-bold); font-size: var(--sa-text-ui);
  display: flex; align-items: center; justify-content: center;
}

/* Small card / list item */
.sa-card {
  display: flex; gap: 10px; padding: 12px;
  border: 1px solid var(--sa-border); border-radius: var(--sa-radius-lg);
  background: var(--sa-surface);
}

/* Inset output / callout box */
.sa-inset { min-height: 120px; padding: 12px; border-radius: var(--sa-radius-md); background: var(--sa-page); }

/* Browser-window frame for screenshots & demos */
.sa-window { border: 1px solid var(--sa-border); border-radius: var(--sa-radius-2xl); overflow: hidden; background: var(--sa-page); }
.sa-window__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--sa-border); background: var(--sa-surface); }
.sa-window__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sa-border); }
.sa-window__url { margin-left: 8px; padding: 3px 10px; border-radius: var(--sa-radius-xs); background: var(--sa-page); color: var(--sa-muted); font: var(--sa-text-xs) var(--sa-font-mono); }

/* Popover / floating panel */
.sa-popover {
  width: min(320px, calc(100% - 32px)); padding: 14px;
  border: 1px solid var(--sa-card-border); border-radius: var(--sa-radius-xl);
  background: var(--sa-surface); box-shadow: var(--sa-shadow-popover);
  display: flex; flex-direction: column; gap: 10px;
  font-size: var(--sa-text-ui); line-height: 1.5;
}
.sa-popover__head { display: flex; align-items: center; gap: 8px; font-weight: var(--sa-weight-bold); }
.sa-popover__head .sa-icon-btn { margin-left: auto; }

/* Skeleton line (placeholder text in mockups) */
.sa-skeleton { display: block; height: 7px; border-radius: 4px; background: var(--sa-border); }

/* --------------------------------------------------------------------------
   8. MOTION & ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
