/* Garagent documentation site — shared stylesheet.
   Palette matches the app's own theme (apps/web/src/index.css's :root
   tokens) so these pages feel like they belong to the product rather than
   a generic doc template bolted on afterward. */

:root {
  --bg: #0b0e14;
  --panel: #12151f;
  --panel-border: #232838;
  --text: #e6e8ef;
  --text-dim: #8a90a6;
  --accent: #4f9dff;
  --accent-dim: #2f6fe0;
  --warn: #ffd166;
  --good: #6fdcaa;
  --bad: #ff6f6f;
  --radius: 12px;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

code {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
}

pre {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.95em;
}

/* ---------------------------- Top nav ---------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: rgba(11, 14, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-border);
}

.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.site-nav .brand:hover {
  text-decoration: none;
}
.site-nav .brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: none;
}

.site-nav .nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav .nav-links a {
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}
.site-nav .nav-links a:hover {
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}
.site-nav .nav-links a.active {
  color: var(--accent);
  background: var(--panel);
}

/* ---------------------------- Layout ---------------------------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-header {
  margin-bottom: 40px;
}
.page-header h1 {
  font-size: 2.1rem;
  margin: 0 0 10px;
}
.page-header .eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.page-header .lead {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 68ch;
}

section {
  margin: 56px 0;
}
section h2 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
}
section > .section-intro {
  color: var(--text-dim);
  max-width: 72ch;
  margin-bottom: 24px;
}

/* ---------------------------- Hero (index) ---------------------------- */

.hero {
  text-align: center;
  padding: 60px 0 30px;
}
.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 14px;
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-dim);
  font-size: 1.2rem;
  max-width: 60ch;
  margin: 0 auto 28px;
}
.hero .cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-primary {
  background: var(--accent);
  color: #06101f;
}
.btn-primary:hover {
  background: #6ba9ff;
  text-decoration: none;
}
.btn-secondary {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* ---------------------------- Cards / grids ---------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.95rem;
}

.feature-block {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.feature-block h3 {
  margin-top: 0;
  font-size: 1.3rem;
}
.feature-block .badge-row {
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-right: 6px;
  background: rgba(79, 157, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(79, 157, 255, 0.35);
}
.badge.good {
  background: rgba(111, 220, 170, 0.15);
  color: var(--good);
  border-color: rgba(111, 220, 170, 0.35);
}
.badge.warn {
  background: rgba(255, 209, 102, 0.15);
  color: var(--warn);
  border-color: rgba(255, 209, 102, 0.35);
}
.badge.bad {
  background: rgba(255, 111, 111, 0.15);
  color: var(--bad);
  border-color: rgba(255, 111, 111, 0.35);
}

/* ---------------------------- Screenshot placeholders ---------------------------- */

/* Real screenshots drop in as <img> tags with these same classes/paths —
   see doc/SCREENSHOTS.md for the exact file to save at each path. Until an
   image exists at that path, this placeholder box renders instead (an
   <img> with a missing src shows its alt text and this styling via the
   `onerror`-free CSS trick below: a figure wrapping the img, styled so a
   broken image still reads as an intentional "screenshot goes here" slot
   rather than a rendering bug). */
.shot {
  margin: 18px 0;
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  text-align: center;
}
/* A real screenshot displays at its own natural size (scaled down only if
   it's wider than the column or taller than max-height) instead of being
   stretched to fill the full content width — a narrow modal crop and a
   wide office-view screenshot both end up a sensible, consistent size
   instead of the modal looking blown up. Before a real image exists at
   this path, the same box renders as a striped placeholder (min-height
   keeps it from collapsing to nothing). */
.shot img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 480px;
  min-height: 160px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    45deg,
    #171b26,
    #171b26 12px,
    #1a1f2c 12px,
    #1a1f2c 24px
  );
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 60px 16px;
}
.shot figcaption {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-top: 1px solid var(--panel-border);
}
.shot figcaption code {
  font-size: 0.82em;
}

/* ---------------------------- Lightbox ---------------------------- */
/* Click any real (loaded) screenshot to view it full size — see
   assets/lightbox.js. A broken/placeholder image isn't clickable (no
   cursor, no handler attached), so this only ever fires once a real photo
   exists at that path. */

.shot img.is-loaded {
  cursor: zoom-in;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(6, 8, 13, 0.9);
  backdrop-filter: blur(2px);
}
.lightbox-overlay.open {
  display: flex;
}
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------------------- Step lists ---------------------------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 4px 44px;
  margin-bottom: 18px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------- Tables ---------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}
th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------------------------- Callouts ---------------------------- */

.callout {
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
  color: var(--text-dim);
}
.callout strong {
  color: var(--text);
}
.callout.warn {
  border-left-color: var(--warn);
}

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

footer {
  border-top: 1px solid var(--panel-border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }
  .site-nav {
    flex-wrap: wrap;
  }
}
