/* =============================================
   OtterApi Site — style.css
   ============================================= */

/* --- Variables -------------------------------- */
:root {
  --color-bg: #dfe6e9;
  --color-accent: #a29bfe;
  --color-accent-dark: #7c6ff7;
  --color-accent-light: #c8c3ff;
  --color-error: #d63031;
  --color-surface: #ffffff;
  --color-text: #2d3436;
  --color-text-muted: #636e72;
  --color-code-bg: #2d3436;
  --color-code-text: #dfe6e9;
  --color-border: #b2bec3;
  --color-hero-bg: #6c5ce7;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 12px rgba(44, 44, 80, 0.09);
  --shadow-md: 0 4px 24px rgba(44, 44, 80, 0.14);
  --transition: 0.18s ease;

  --sidebar-width: 248px;
  --nav-height: 62px;
  --max-content: 860px;
}

/* --- Reset ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}
a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { color: var(--color-accent); text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }

/* --- Top Navigation --------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img { width: 32px; height: 32px; border-radius: 6px; }
.nav-logo:hover { text-decoration: none; color: var(--color-accent-dark); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--color-accent-dark);
  border-color: var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}
.btn-lg {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* --- Hero ------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--color-hero-bg) 0%, var(--color-accent) 100%);
  color: #fff;
  padding: 5rem 1.5rem 4.5rem;
  text-align: center;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  line-height: 1.6;
}
.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 0.65rem 1.2rem;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.97rem;
  color: #fff;
  margin-bottom: 2rem;
  cursor: default;
}
.hero-install .cmd { user-select: all; }
.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 99px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

/* --- Feature Cards ---------------------------- */
.features {
  padding: 4rem 1.5rem;
}
.features-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: 0.5rem;
}
.section-title {
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.6rem;
}
.section-sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}
.card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* --- Quick Start Section ---------------------- */
.quickstart {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 4rem 1.5rem;
}
.quickstart-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.quickstart-text h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.quickstart-text p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-size: 0.97rem;
}
.route-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.route-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
}
.method {
  display: inline-block;
  min-width: 58px;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
  text-align: center;
}
.method-get  { background: #d0f0c0; color: #276221; }
.method-post { background: #fef3c7; color: #92400e; }
.method-put  { background: #dbeafe; color: #1e40af; }
.method-patch{ background: #ede9fe; color: #5b21b6; }
.method-del  { background: #fee2e2; color: #991b1b; }

/* --- Deep Dive Strips ------------------------- */
.deepdive {
  padding: 4rem 1.5rem;
}
.deepdive-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.deepdive-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3.5rem;
}
.deepdive-row:last-child { margin-bottom: 0; }
.deepdive-row.reverse { direction: rtl; }
.deepdive-row.reverse > * { direction: ltr; }
.deepdive-copy h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--color-text);
}
.deepdive-copy p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.deepdive-copy .btn { margin-top: 0.5rem; }

/* --- Footer ----------------------------------- */
.site-footer {
  background: var(--color-text);
  color: #b2bec3;
  padding: 2.5rem 1.5rem;
  font-size: 0.88rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
}
.footer-logo img { width: 26px; height: 26px; border-radius: 5px; }
.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
}
.footer-links a {
  color: #b2bec3;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--color-accent-light); }
.footer-copy { color: #636e72; }

/* =============================================
   DOCS LAYOUT
   ============================================= */

.docs-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: calc(100vh - var(--nav-height));
  gap: 0;
}

/* Sidebar */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 2rem 0 2rem;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
}
.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0 1.25rem;
  margin-bottom: 0.4rem;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-nav a {
  display: block;
  padding: 0.38rem 1.25rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  line-height: 1.4;
}
.sidebar-nav a:hover {
  color: var(--color-accent-dark);
  background: rgba(162, 155, 254, 0.08);
  border-left-color: var(--color-accent-light);
  text-decoration: none;
}
.sidebar-nav a.active {
  color: var(--color-accent-dark);
  background: rgba(162, 155, 254, 0.13);
  border-left-color: var(--color-accent);
  font-weight: 600;
}

/* Docs Content */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 2.5rem 3rem;
  max-width: var(--max-content);
}

/* Docs Typography */
.docs-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}
.docs-content .page-lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.docs-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.25rem;
  border-top: 2px solid var(--color-accent-light);
  padding-top: 1rem;
}
.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 1.75rem 0 0.5rem;
}
.docs-content h4 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 1.25rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.docs-content p { margin-bottom: 0.9rem; }
.docs-content ul, .docs-content ol { margin-bottom: 0.9rem; }

/* --- Code blocks ------------------------------ */
pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  font-family: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.855rem;
  line-height: 1.6;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid #444;
}
pre.lang-label {
  position: relative;
}
code {
  font-family: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.875em;
  background: rgba(162, 155, 254, 0.15);
  color: var(--color-accent-dark);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(162, 155, 254, 0.25);
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: inherit;
}
.code-block {
  margin: 0.75rem 0 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #3d4045;
}
.code-header {
  background: #1a1e24;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  color: #8892a4;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #3d4045;
}
.code-block pre {
  margin: 0;
  border-radius: 0;
  border: none;
}

/* Syntax color hints (manual spans) */
.kw  { color: #a29bfe; }   /* keywords */
.cl  { color: #74b9ff; }   /* class/type names */
.st  { color: #55efc4; }   /* strings */
.cm  { color: #636e72; font-style: italic; } /* comments */
.nm  { color: #fdcb6e; }   /* method/member names */
.nt  { color: #fd79a8; }   /* numbers */
.op  { color: #dfe6e9; }   /* operators/punctuation */
.route-text { color: #81ecec; word-break: break-all; }  /* HTTP routes */
.http-get    { color: #55efc4; font-weight: 700; }
.http-post   { color: #fdcb6e; font-weight: 700; }
.http-put    { color: #74b9ff; font-weight: 700; }
.http-patch  { color: #a29bfe; font-weight: 700; }
.http-delete { color: #ff7675; font-weight: 700; }

/* --- Tables ----------------------------------- */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.docs-content th {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}
.docs-content td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.5;
}
.docs-content tr:last-child td { border-bottom: none; }
.docs-content tr:hover td { background: rgba(162, 155, 254, 0.05); }

/* Error row highlight */
.error-row td { background: rgba(214, 48, 49, 0.05); }
.error-row td:first-child { color: var(--color-error); font-weight: 700; }

/* --- Callout / Note blocks -------------------- */
.callout {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin: 1rem 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  border-left: 4px solid;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }
.callout-note {
  background: rgba(162, 155, 254, 0.1);
  border-color: var(--color-accent);
  color: #3d3480;
}
.callout-warn {
  background: rgba(253, 203, 110, 0.12);
  border-color: #fdcb6e;
  color: #7d5900;
}
.callout-danger {
  background: rgba(214, 48, 49, 0.08);
  border-color: var(--color-error);
  color: #8b1a1a;
}
.callout-tip {
  background: rgba(85, 239, 196, 0.1);
  border-color: #00cec9;
  color: #004d47;
}

/* --- Step list -------------------------------- */
.step-list {
  list-style: none;
  padding: 0;
  counter-reset: steps;
  margin: 1rem 0 1.25rem;
}
.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
}
.step-list li::before {
  content: counter(steps);
  min-width: 26px;
  height: 26px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* --- Method chips ----------------------------- */
.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: "SF Mono", Consolas, monospace;
}
.chip-get    { background: #d0f0c0; color: #276221; }
.chip-post   { background: #fef3c7; color: #92400e; }
.chip-put    { background: #dbeafe; color: #1e40af; }
.chip-patch  { background: #ede9fe; color: #5b21b6; }
.chip-delete { background: #fee2e2; color: #991b1b; }

/* --- Page nav (prev/next) --------------------- */
.docs-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.page-nav-link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  min-width: 180px;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.page-nav-link:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.page-nav-link .nav-dir {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.2rem;
}
.page-nav-link .nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent-dark);
}
.page-nav-link.next { text-align: right; margin-left: auto; }

/* --- Inline helpers --------------------------- */
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-dark); }
.text-error  { color: var(--color-error); }
.mono { font-family: "SF Mono", "Fira Code", Consolas, monospace; font-size: 0.9em; }

/* --- Responsive ------------------------------- */
@media (max-width: 900px) {
  .quickstart-inner { grid-template-columns: 1fr; display: block;}
  .deepdive-row { grid-template-columns: 1fr; }
  .deepdive-row.reverse { direction: ltr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0; }

  .hero h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 1rem; }

  .docs-wrapper { display: block; }
  .docs-sidebar {
    position: static;
    width: 100%;
    height: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
  }
  .docs-content { padding: 1.5rem 1rem 2rem; }

  .nav-links { display: none; }
  .nav-actions .btn-ghost { display: none; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }

  .cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-install { font-size: 0.82rem; flex-wrap: wrap; justify-content: center; }
  .docs-content h1 { font-size: 1.5rem; }
}
