/* =========================================================
   Open Task Hub — Main Stylesheet
   ========================================================= */

/* ---------- Custom Properties ---------- */
:root {
  --accent:    #1d4ed8;
  --accent-h:  #1e40af;
  --dark:      #172033;
  --bg:        #f6f7fb;
  --bg-white:  #ffffff;
  --muted:     #667085;
  --border:    #d0d5dd;
  --success:   #16a34a;
  --danger:    #dc2626;
  --warning:   #ea580c;
  --info:      #0284c7;

  /* issue status colors */
  --status-open:        #2563eb;
  --status-in-progress: #7c3aed;
  --status-blocked:     #dc2626;
  --status-in-review:   #d97706;
  --status-done:        #16a34a;
  --status-rejected:    #6b7280;
  --status-duplicate:   #9ca3af;

  /* priority colors */
  --prio-low:      #6b7280;
  --prio-normal:   #2563eb;
  --prio-high:     #d97706;
  --prio-critical: #dc2626;

  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:      'Cascadia Code', 'Fira Code', 'Consolas', monospace;

  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,.12);

  --nav-h:     64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.4em; }

/* ---------- Typography ---------- */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);  font-weight: 700; line-height: 1.25; }
h3 { font-size: 1.2rem;  font-weight: 700; }
h4 { font-size: 1rem;    font-weight: 600; }
p  { margin-top: .5rem; color: var(--muted); }
p.lead { font-size: 1.15rem; color: var(--dark); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
main { flex: 1; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--dark);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.01em;
}
.navbar-brand .brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
}
.navbar-brand span.brand-name { color: #fff; }
.navbar-brand span.brand-accent { color: #93c5fd; }

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: .45rem .85rem;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: .92rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.10);
  color: #fff;
}
.nav-links .btn-gh {
  margin-left: .5rem;
  background: #334155;
  color: #e2e8f0;
  border-radius: 6px;
  display: flex; align-items: center; gap: .4rem;
}
.nav-links .btn-gh:hover { background: #475569; color: #fff; }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .35rem;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1e3a5f 60%, #1d4ed8 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; }
.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 100px;
  padding: .25rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 1.25rem;
}
.hero h1 { color: #fff; margin-bottom: .75rem; }
.hero h1 span { color: #93c5fd; }
.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  border: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(29,78,216,.35);
}
.btn-primary:hover { background: var(--accent-h); box-shadow: 0 4px 20px rgba(29,78,216,.45); }
.btn-outline {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.3);
}
.btn-outline:hover { background: rgba(255,255,255,.18); }
.btn-secondary {
  background: #e2e8f0;
  color: var(--dark);
}
.btn-secondary:hover { background: #cbd5e1; }

/* ---------- Section ---------- */
.section {
  padding: 4rem 0;
}
.section-alt { background: var(--bg-white); }
.section-dark {
  background: var(--dark);
  color: #fff;
}
.section-dark p { color: #94a3b8; }
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header p { max-width: 560px; margin: .5rem auto 0; }
.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
}
.section-dark .section-label { color: #93c5fd; }

/* ---------- Feature Cards ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.feature-icon {
  width: 48px; height: 48px;
  background: #eff6ff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.feature-card h3 { margin-bottom: .35rem; }
.feature-card p  { margin-top: 0; font-size: .93rem; }

/* ---------- Stat Bar ---------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label { font-size: .85rem; color: var(--muted); }

/* ---------- Tech Stack ---------- */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.tech-badge {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: .55rem 1.1rem;
  font-size: .88rem;
  font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
}
.tech-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #60a5fa;
}

/* ---------- Code Blocks ---------- */
pre, .code-block {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.7;
  position: relative;
  border: 1px solid #334155;
}
code {
  font-family: var(--mono);
  font-size: .875em;
}
p code, li code, td code {
  background: #e2e8f0;
  color: #1e293b;
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .85em;
}
.section-dark p code {
  background: #334155;
  color: #e2e8f0;
}

/* Syntax token colors */
.tok-kw    { color: #f472b6; }   /* keywords */
.tok-str   { color: #86efac; }   /* strings */
.tok-num   { color: #fbbf24; }   /* numbers */
.tok-cmt   { color: #64748b; font-style: italic; }  /* comments */
.tok-fn    { color: #7dd3fc; }   /* functions / commands */
.tok-key   { color: #93c5fd; }   /* JSON keys */
.tok-url   { color: #6ee7b7; }   /* URLs */
.tok-flag  { color: #c4b5fd; }   /* CLI flags */
.tok-var   { color: #fcd34d; }   /* variables / env vars */

/* Copy button */
.copy-btn {
  position: absolute;
  top: .6rem; right: .6rem;
  background: #334155;
  color: #94a3b8;
  border: 1px solid #475569;
  border-radius: 5px;
  padding: .2rem .55rem;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.copy-btn:hover { background: #475569; color: #e2e8f0; }
.copy-btn.copied { background: #16a34a; color: #fff; border-color: #16a34a; }

.code-filename {
  background: #0f172a;
  color: #64748b;
  font-family: var(--mono);
  font-size: .78rem;
  padding: .45rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid #334155;
  border-bottom: none;
  margin-bottom: 0;
}
.code-filename + pre {
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: 0;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
th {
  background: #f1f5f9;
  color: var(--dark);
  font-weight: 700;
  text-align: left;
  padding: .7rem 1rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ---------- HTTP Method Badges ---------- */
.method {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  min-width: 56px;
  text-align: center;
}
.method-get    { background: #dcfce7; color: #15803d; }
.method-post   { background: #dbeafe; color: #1d4ed8; }
.method-delete { background: #fee2e2; color: #dc2626; }
.method-patch  { background: #fff7ed; color: #c2410c; }
.method-put    { background: #fef9c3; color: #854d0e; }

/* ---------- Status / Priority Badges ---------- */
.badge {
  display: inline-block;
  padding: .18rem .6rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-open        { background: #dbeafe; color: var(--status-open); }
.badge-in-progress { background: #ede9fe; color: var(--status-in-progress); }
.badge-blocked     { background: #fee2e2; color: var(--status-blocked); }
.badge-in-review   { background: #fef3c7; color: var(--status-in-review); }
.badge-done        { background: #dcfce7; color: var(--status-done); }
.badge-rejected    { background: #f3f4f6; color: var(--status-rejected); }
.badge-duplicate   { background: #f9fafb; color: var(--status-duplicate); border: 1px solid #e5e7eb; }

.badge-low      { background: #f3f4f6; color: var(--prio-low); }
.badge-normal   { background: #dbeafe; color: var(--prio-normal); }
.badge-high     { background: #fef3c7; color: var(--prio-high); }
.badge-critical { background: #fee2e2; color: var(--prio-critical); }

.badge-task  { background: #f0fdf4; color: #15803d; }
.badge-bug   { background: #fee2e2; color: #dc2626; }
.badge-story { background: #ede9fe; color: #7c3aed; }
.badge-epic  { background: #fff7ed; color: #c2410c; }

/* ---------- Issue Table Mockup ---------- */
.mockup {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mockup-bar {
  background: var(--dark);
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.mockup-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.mockup-dot:nth-child(1) { background: #ef4444; }
.mockup-dot:nth-child(2) { background: #f59e0b; }
.mockup-dot:nth-child(3) { background: #22c55e; }
.mockup-title {
  flex: 1;
  text-align: center;
  font-size: .78rem;
  color: #64748b;
  font-family: var(--mono);
}
.mockup-content { padding: 1.25rem; }
.mockup-content table th { font-size: .8rem; }
.mockup-content table td { font-size: .82rem; }

/* ---------- Sprint Lifecycle ---------- */
.sprint-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.sprint-step {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  border-radius: var(--radius);
  padding: .75rem 1.5rem;
  text-align: center;
  font-weight: 700;
  font-size: .92rem;
  color: var(--accent);
  min-width: 130px;
}
.sprint-step.active-step {
  background: #dbeafe;
  border-color: var(--accent);
}
.sprint-arrow {
  padding: 0 .6rem;
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
}
.sprint-label {
  display: block;
  font-size: .7rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: .15rem;
}

/* ---------- Label Examples ---------- */
.label-example {
  display: inline-block;
  padding: .2rem .75rem;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  margin: .25rem;
  color: #fff;
}

/* ---------- Docs Layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem 0 4rem;
}
.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
}
.docs-sidebar h4 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: .6rem;
  padding: 0 .5rem;
}
.docs-sidebar ul {
  list-style: none;
  padding: 0;
}
.docs-sidebar ul li a {
  display: block;
  padding: .4rem .6rem;
  border-radius: 6px;
  font-size: .88rem;
  color: var(--muted);
  font-weight: 500;
  transition: background .12s, color .12s;
}
.docs-sidebar ul li a:hover,
.docs-sidebar ul li a.active {
  background: #eff6ff;
  color: var(--accent);
  text-decoration: none;
}
.docs-sidebar ul + h4 { margin-top: 1rem; }

.docs-content { min-width: 0; }
.docs-content h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.docs-content h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.docs-content h3 { margin-top: 1.5rem; color: var(--dark); }
.docs-content p  { color: var(--muted); margin: .5rem 0 1rem; }
.docs-content ul, .docs-content ol { margin: .75rem 0; }
.docs-content li { margin-bottom: .35rem; color: var(--muted); }
.docs-content pre { margin: 1rem 0; }

/* Step list */
.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list > li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  color: var(--dark);
}
.step-list > li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  margin-top: .1rem;
}
.step-body h3 { margin-top: 0; margin-bottom: .35rem; }
.step-body p  { margin: 0 0 .75rem; }

/* ---------- API Endpoint Card ---------- */
.endpoint-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.endpoint-path {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 600;
  color: var(--dark);
}
.endpoint-desc {
  margin-left: auto;
  font-size: .85rem;
  color: var(--muted);
}
.endpoint-body { padding: 1.25rem; }
.endpoint-body h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .5rem;
}
.endpoint-body pre { margin: 0 0 1rem; }
.endpoint-body pre:last-child { margin-bottom: 0; }

/* ---------- Alert / Note ---------- */
.note {
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .85rem 1.1rem;
  margin: 1rem 0;
  font-size: .92rem;
  color: #1e40af;
}
.note strong { color: var(--accent); }
.note-warn {
  background: #fff7ed;
  border-color: var(--warning);
  color: #9a3412;
}
.note-warn strong { color: var(--warning); }

/* ---------- Footer ---------- */
footer {
  background: var(--dark);
  color: #94a3b8;
  padding: 2.5rem 0;
  font-size: .88rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a { color: #94a3b8; transition: color .15s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-copy { width: 100%; text-align: center; margin-top: .5rem; color: #475569; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.font-mono { font-family: var(--mono); }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
}

@media (max-width: 700px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--dark);
    flex-direction: column;
    align-items: stretch;
    padding: .75rem 1rem 1rem;
    gap: .15rem;
    border-top: 1px solid #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .nav-links.open { display: flex; }
  .nav-links .btn-gh { margin-left: 0; }

  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }

  .stats-bar { gap: 1.5rem; }

  .sprint-flow { gap: .25rem; }
  .sprint-step { min-width: 100px; padding: .55rem 1rem; font-size: .82rem; }
  .sprint-arrow { padding: 0 .25rem; font-size: 1.1rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
  .endpoint-header { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .endpoint-desc { margin-left: 0; }
}
