/*
 * AgentVisor AI landing styles.
 * Self-contained: no JavaScript, no web fonts, no external assets.
 * Colour palette: neutral. Light + dark via prefers-color-scheme.
 */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-alt: #f6f5ef;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-code: #f7f6f0;
  --bg-code-dark: #14161b;
  --border: #e2dfd3;
  --border-strong: #b5b09f;
  --fg: #0d1117;
  --fg-muted: #565b64;
  --fg-strong: #000000;
  --accent: #0a5c8b;
  --accent-hover: #084264;
  --accent-fg: #ffffff;
  --success: #1a7c3b;
  --danger: #b53a1b;
  --code-fg-dark: #f2f2ef;
  --token-key: #7c1a68;
  --token-str: #0a5c8b;
  --token-num: #b53a1b;
  --token-comment: #6a706c;
  --token-add: #1a7c3b;
  --token-add-bg: rgba(26, 124, 59, 0.10);
  --status-fg: #b53a1b;
  --max: 68rem;
  --nav-h: 3.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c10;
    --bg-alt: #101218;
    --bg-nav: rgba(11, 12, 16, 0.85);
    --bg-code: #14161b;
    --bg-code-dark: #06080b;
    --border: #23262d;
    --border-strong: #3b3f47;
    --fg: #e9ecf2;
    --fg-muted: #9098a4;
    --fg-strong: #ffffff;
    --accent: #6faed7;
    --accent-hover: #92c2e3;
    --accent-fg: #06080b;
    --success: #6ecf8e;
    --danger: #e07b60;
    --token-key: #d18ac5;
    --token-str: #a5cef5;
    --token-num: #e59b7c;
    --token-comment: #7a8290;
    --token-add: #6ecf8e;
    --token-add-bg: rgba(110, 207, 142, 0.10);
    --status-fg: #e07b60;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Nav ----------------------------------------------------------- */

nav[aria-label="Primary"] {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg-strong);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 120ms;
}

.nav-links a:hover, .nav-links a:focus-visible { color: var(--fg-strong); }

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* --- Hero ---------------------------------------------------------- */

.hero {
  padding: 5.5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(10, 92, 139, 0.06), transparent 60%),
    radial-gradient(ellipse 40% 40% at 85% 100%, rgba(181, 58, 27, 0.04), transparent 60%);
}

@media (prefers-color-scheme: dark) {
  .hero {
    background:
      radial-gradient(ellipse 60% 50% at 15% 0%, rgba(111, 174, 215, 0.10), transparent 60%),
      radial-gradient(ellipse 40% 40% at 85% 100%, rgba(224, 123, 96, 0.06), transparent 60%);
  }
}

.hero h1 {
  margin: 0 0 1.25rem;
  color: var(--fg-strong);
  font-size: clamp(2.15rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 32ch;
}

.lede {
  margin: 0 0 2rem;
  max-width: 44rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--fg);
  line-height: 1.55;
}

.lede-secondary { max-width: 52rem; font-size: 1.05rem; color: var(--fg-muted); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.cta {
  display: inline-block;
  padding: 0.72rem 1.3rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--fg-strong);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  transition: transform 80ms, background 120ms, border-color 120ms;
}

.cta:hover, .cta:focus-visible {
  background: var(--bg-alt);
  outline: none;
  transform: translateY(-1px);
}

.cta.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.cta.primary:hover, .cta.primary:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.hero-meta {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

/* --- Sections ------------------------------------------------------ */

main section {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border);
}

main section.alt { background: var(--bg-alt); }
main section:last-of-type { border-bottom: 0; }

.section-kicker {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h2 {
  margin: 0 0 1.5rem;
  color: var(--fg-strong);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 24ch;
}

h3 {
  margin: 0 0 0.55rem;
  color: var(--fg-strong);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--fg-muted); font-size: 0.94rem; }

/* --- Two-column blocks -------------------------------------------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
}

.two-col-flip > *:first-child { order: 2; }
.two-col-flip > *:last-child { order: 1; }

@media (max-width: 820px) {
  .two-col-flip > *:first-child { order: 1; }
  .two-col-flip > *:last-child { order: 2; }
}

/* --- Check list --------------------------------------------------- */

.check-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.98rem;
}

.check-list li {
  padding-left: 1.6rem;
  position: relative;
  margin: 0.5rem 0;
  color: var(--fg);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.5rem;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* --- Dashboard preview mock --------------------------------------- */

.dashboard-preview { min-width: 0; }

.mock-window {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
}

.mock-window-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.mock-window-bar .dot {
  width: 10px; height: 10px; border-radius: 999px; background: var(--border-strong);
}
.mock-window-bar .dot.red { background: #e07b60; }
.mock-window-bar .dot.yellow { background: #e3b26a; }
.mock-window-bar .dot.green { background: #6ecf8e; }

.mock-url {
  margin-left: 0.6rem;
  color: var(--fg-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.mock-body { padding: 1rem; }

.mock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.mock-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: var(--bg-panel, var(--bg));
}

.mock-stat-label {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}

.mock-stat-value {
  margin: 0 0 0.15rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}

.mock-stat-sub {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.mock-ok { color: #1a7c3b; }
.mock-fail { color: #b53a1b; }

.mock-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.mock-table td {
  padding: 0.5rem 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.mock-table tr:first-child td { border-top: 0; }
.mock-table .right { text-align: right; }

.mock-sid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--fg);
}

.mock-pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}
.mock-pill.live   { background: rgba(26, 124, 59, 0.14);  color: #1a7c3b; }
.mock-pill.closed { background: rgba(10, 92, 139, 0.12);  color: #0a5c8b; }
.mock-pill.failed { background: rgba(181, 58, 27, 0.12);  color: #b53a1b; }

@media (prefers-color-scheme: dark) {
  .mock-window { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
  .mock-ok, .mock-pill.live { color: #6ecf8e; }
  .mock-fail, .mock-pill.failed { color: #e07b60; }
  .mock-pill.closed { color: #92c2e3; }
}

/* --- Feature rows in "What you get" ------------------------------- */

.feature {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: center;
  padding: 2.25rem 0;
  border-top: 1px solid var(--border);
}

.feature:first-of-type { border-top: 0; padding-top: 0.5rem; }
.feature:nth-of-type(even) { direction: rtl; }
.feature:nth-of-type(even) > * { direction: ltr; }

.feature h3 { font-size: 1.35rem; margin-bottom: 0.9rem; }
.feature .feature-copy p { font-size: 1rem; color: var(--fg); }

@media (max-width: 820px) {
  .feature, .feature:nth-of-type(even) { grid-template-columns: 1fr; direction: ltr; gap: 1.25rem; }
}

/* --- Scenarios / When you'd want it ------------------------------- */

.scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.scenarios article {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

main section.alt .scenarios article { background: var(--bg-alt); }

@media (max-width: 820px) {
  .scenarios { grid-template-columns: 1fr; }
}

/* --- Under-the-hood grid ------------------------------------------ */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2.5rem;
  margin-top: 1rem;
}

.tech-grid p { color: var(--fg-muted); font-size: 0.98rem; }

@media (max-width: 720px) {
  .tech-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* --- Link columns -------------------------------------------------- */

.link-columns {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 3rem;
}

.link-columns li {
  break-inside: avoid;
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

main section.alt .link-columns li { background: var(--bg); }

.link-columns a { color: var(--accent); font-weight: 500; }

@media (max-width: 720px) {
  .link-columns { columns: 1; }
}

/* --- Code blocks --------------------------------------------------- */

pre {
  background: var(--bg-code-dark);
  color: var(--code-fg-dark);
  padding: 1.15rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  font: 0.92rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  margin: 0;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04),
              0 8px 24px rgba(0, 0, 0, 0.06);
}

pre.filename {
  padding: 0.35rem 0.9rem;
  background: var(--bg-code);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  box-shadow: none;
  font-size: 0.82rem;
  margin: 0;
}

pre.filename + pre { border-radius: 0 0 6px 6px; box-shadow: none; margin-top: 0; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }

/* Inline code inside paragraphs */
p code, li code {
  background: rgba(127, 127, 127, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--fg-strong);
  white-space: nowrap;
}

/* Syntax colours */
.k { color: var(--token-key); }
.s { color: var(--token-str); }
.n { color: var(--token-num); }
.c { color: var(--token-comment); font-style: italic; }

@media (prefers-color-scheme: dark) {
  pre {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4),
                0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* Diff header + add lines */
.diff-header {
  display: block;
  color: var(--fg-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.diff-add {
  display: inline-block;
  width: 100%;
  color: var(--token-add);
  background: var(--token-add-bg);
  margin: 0 -1.25rem;
  padding: 0 1.25rem;
}

/* HTTP status highlight */
.http-status { color: var(--status-fg); font-weight: 600; }

/* Shell prompt */
.prompt { color: var(--token-comment); user-select: none; }
.in { color: var(--code-fg-dark); font-weight: 600; }

/* --- Feature visual container ------------------------------------- */

.feature-visual pre { max-height: 22rem; }

/* --- Links -------------------------------------------------------- */

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

a:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Footer -------------------------------------------------------- */

footer {
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.9rem;
}

footer p { margin: 0 0 0.5rem; }
footer .muted { font-size: 0.88rem; }
footer a { color: var(--fg-muted); text-decoration: none; }
footer a:hover { color: var(--fg-strong); text-decoration: underline; }

.footer-inner { display: flex; flex-direction: column; gap: 0.25rem; }

/* --- Code-language variants (all inherit .pre base) ---------------- */

pre.code-diff, pre.code-http, pre.code-json, pre.code-shell {
  /* Reserved for future per-language tuning; base .pre style applies. */
}
