/* Turmeric API Docs -- auto-generated by tools/gendocs.py */

:root {
  /* Backgrounds */
  --bg-base:       #0C0A08;
  --bg-surface:    #111009;
  --bg-panel:      #161411;
  --bg-hover:      #1C1915;

  /* Borders */
  --border:        #222018;
  --border-mid:    #2E2B22;
  --border-str:    #3D3A2F;

  /* Gold palette */
  --gold:          #D48B1C;
  --gold-bright:   #EFA030;
  --gold-dim:      #7A5010;
  --gold-subtle:   rgba(212,139,28,0.08);
  --gold-line:     rgba(212,139,28,0.25);

  /* Text */
  --text-primary:  #EAE0D2;
  --text-sec:      #8A7D6E;
  --text-dim:      #4A4438;

  /* Syntax highlight */
  --syn-kw:        #EFA030;
  --syn-str:       #D9735A;
  --syn-type:      #7AC4B8;
  --syn-num:       #A8C98A;
}

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

html { font-size: 16px; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-header .nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.site-header .nav-logo:hover { text-decoration: none; }
.site-header nav { display: flex; gap: 2px; font-size: 0.875rem; }
.site-header nav a {
  color: var(--text-sec);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}
.site-header nav a:hover { color: var(--text-primary); background: var(--bg-hover); text-decoration: none; }
.site-header nav a.active { color: var(--gold-bright); }

/* Search */
.search-wrap { margin-left: auto; }
.search-input {
  background: var(--bg-base);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.3rem 0.65rem;
  font-size: 0.875rem;
  width: 220px;
  transition: border-color 0.15s, width 0.2s;
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--gold); width: 280px; }
.search-input::placeholder { color: var(--text-dim); }
.search-no-results {
  display: none;
  padding: 2rem;
  color: var(--text-sec);
  font-style: italic;
}

/* Layout */
.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* Sidebar */
.sidebar {
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  margin-top: 1rem;
  font-weight: 500;
}
.sidebar h3:first-child { margin-top: 0; }
.sidebar ul { list-style: none; }
.sidebar li { margin: 0.15rem 0; }
.sidebar a { font-size: 0.825rem; color: var(--text-sec); font-family: 'Iosevka', 'Fira Code', monospace; }
.sidebar a:hover { color: var(--gold-bright); text-decoration: none; }

/* Content */
.content {
  padding: 2rem 2.5rem;
  min-width: 0;
}

/* Module heading */
.module-heading {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.module-heading h1 {
  font-size: 1.75rem;
  color: var(--gold-bright);
  font-family: 'Iosevka', 'Fira Code', monospace;
}
.module-path {
  font-size: 0.85rem;
  color: var(--text-sec);
  margin-top: 0.25rem;
}

/* Definition cards */
.def-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  transition: background 0.15s, border-color 0.15s;
}
.def-card:hover { background: var(--bg-hover); border-color: var(--border-mid); }
.def-card:target { border-color: var(--gold); }

.def-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.def-card-header h2 {
  font-size: 1rem;
  font-family: 'Iosevka', 'Fira Code', monospace;
  color: var(--gold-bright);
  font-weight: 600;
}

.kind-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-family: 'Iosevka', 'Fira Code', monospace;
  font-weight: 600;
  text-transform: lowercase;
}
.kind-defn      { background: rgba(212,139,28,0.15); color: var(--gold-bright); }
.kind-defmacro  { background: rgba(217,115,90,0.15); color: var(--syn-str); }
.kind-defstruct { background: rgba(168,201,138,0.12); color: var(--syn-num); }
.kind-definstance { background: rgba(122,196,184,0.12); color: var(--syn-type); }

/* LT4: badge for linear types and ^linear / lref<T> annotations */
.linear-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-family: 'Iosevka', 'Fira Code', monospace;
  font-weight: 600;
  text-transform: lowercase;
  background: rgba(80,200,232,0.12);
  color: #50C8E8;
}

.def-signature {
  font-family: 'Iosevka', 'Fira Code', monospace;
  font-size: 0.875rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-primary);
}

.def-summary {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.def-section { margin-top: 0.75rem; }
.def-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.param-table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
.param-table td { padding: 0.2rem 0.75rem 0.2rem 0; vertical-align: top; }
.param-table td:first-child {
  font-family: 'Iosevka', 'Fira Code', monospace;
  color: var(--gold-bright);
  white-space: nowrap;
  width: 1%;
}
.param-table td:nth-child(2) { color: var(--text-sec); white-space: nowrap; width: 1%; }

.def-returns { font-size: 0.875rem; color: var(--text-primary); }

.def-example {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-family: 'Iosevka', 'Fira Code', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-primary);
}

.def-since { font-size: 0.8rem; color: var(--text-sec); margin-top: 0.5rem; }

.module-doc {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
}
.module-doc-summary {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.def-deprecated {
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid #d97706;
  background: rgba(217, 119, 6, 0.08);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.def-deprecated-label {
  font-weight: 700;
  color: #d97706;
  margin-right: 0.4rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* Internal section */
details.internal-section {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
details.internal-section summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-sec);
  user-select: none;
}
.internal-list { margin-top: 0.75rem; }
.internal-item {
  font-family: 'Iosevka', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-sec);
  padding: 0.2rem 0;
}
.internal-item-summary { color: var(--text-primary); margin-left: 0.5rem; font-family: inherit; }

/* Index page */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.index-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: background 0.15s, border-color 0.15s;
}
.index-card:hover { background: var(--bg-hover); border-color: var(--border-mid); text-decoration: none; }
.index-card h3 {
  font-family: 'Iosevka', 'Fira Code', monospace;
  font-size: 0.95rem;
  color: var(--gold-bright);
  margin-bottom: 0.35rem;
}
.index-card p { font-size: 0.85rem; color: var(--text-sec); }
.index-card .export-count { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4rem;
}
.site-footer code { color: var(--text-sec); font-family: 'Iosevka', 'Fira Code', monospace; }

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-sec);
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-sec);
  margin: 4px 0;
  transition: background 0.15s;
}
.hamburger:hover span { background: var(--text-primary); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
}
.sidebar-overlay.is-open { display: block; }

/* Responsive */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .site-header { padding: 0 1rem; }
  .site-header nav { display: none; }
  .search-input { width: 140px; }
  .search-input:focus { width: 180px; }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 100;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
    padding: 1.5rem 1rem;
  }
  .sidebar.is-open { display: block; }
  .content { padding: 1.25rem 1rem; }
}
