/* ═══════════════════════════════════════════════════════════════════════
   Taskbrewery — main stylesheet
   Shared by landing (index.html) and wiki (wiki/index.html)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
  --brand:       #2ecc8f;   /* primary green */
  --brand-dark:  #25a873;
  --brand-light: #d8f5eb;
  --ink:         #0f1117;
  --ink-muted:   #5a6172;
  --surface:     #ffffff;
  --surface-alt: #f7f8fa;
  --border:      #e4e7ed;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.1),  0 4px 12px rgba(0,0,0,.06);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --transition:  0.18s ease;
  --nav-h:       64px;
  --container:   1120px;
}

/* ── Reset / base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a  { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
h1,h2,h3,h4 { line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }

/* ── Layout helpers ───────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 40px);
}
.section { padding-block: clamp(64px, 10vw, 112px); }
.section__header { text-align: center; max-width: 560px; margin-inline: auto; margin-bottom: clamp(40px,6vw,72px); }
.section__title  { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: .6em; }
.section__subtitle { font-size: 1.0625rem; color: var(--ink-muted); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-family: var(--font);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none !important;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn--sm  { font-size: .875rem; padding: .4em 1em; }
.btn--md  { font-size: .9375rem; padding: .6em 1.4em; }
.btn--lg  { font-size: 1rem; padding: .75em 1.75em; }

.btn--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 4px 14px rgba(46,204,143,.35);
}
.btn--ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border);
}
.btn--white {
  background: #fff;
  color: var(--brand-dark);
  border-color: #fff;
}
.btn--white:hover {
  background: var(--brand-light);
  border-color: var(--brand-light);
}

/* ══════════════════════════════════════════════════════════════════════
   NAV
   ══════════════════════════════════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none !important;
  flex-shrink: 0;
}
.nav__brand img { border-radius: var(--radius-sm); }
.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: 1rem;
  flex: 1;
}
.nav__links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color var(--transition);
}
.nav__links a:hover { color: var(--ink); text-decoration: none; }

/* ══════════════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════════════ */
.hero {
  padding-top: clamp(56px, 10vw, 100px);
  padding-bottom: clamp(40px, 6vw, 60px);
  background: linear-gradient(160deg, #f0fdf6 0%, #ffffff 55%);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-rows: auto;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 3rem;
  }
  .hero__visual { grid-row: 1 / 3; grid-column: 2; }
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .3em .8em;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero__title {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: .6em;
}
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.175rem);
  color: var(--ink-muted);
  max-width: 500px;
  margin-bottom: 2rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* ── Mock UI card stack ───────────────────────────────────────────────── */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}
.card-stack {
  position: relative;
  width: 380px;
  max-width: 100%;
  aspect-ratio: 16 / 11;
}
.card-stack__card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.card-stack__card--back {
  transform: rotate(-4deg) translateY(8px);
  background: var(--brand-light);
  opacity: .45;
  box-shadow: var(--shadow-sm);
}
.card-stack__card--mid {
  transform: rotate(-1.5deg) translateY(4px);
  opacity: .7;
  box-shadow: var(--shadow-sm);
}
.card-stack__card--front {
  transform: rotate(0deg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mock-ui { height: 100%; display: flex; flex-direction: column; }
.mock-ui__topbar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .9rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.mock-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.mock-ui__body {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.mock-sidebar {
  width: 130px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: .6rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.mock-nav-item {
  font-size: .65rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: .35rem .5rem;
  border-radius: var(--radius-sm);
  cursor: default;
}
.mock-nav-item--active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
}
.mock-content {
  flex: 1;
  padding: .75rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.mock-task {
  font-size: .65rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.mock-task--done { opacity: .5; text-decoration: line-through; }
.mock-task--active { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.mock-check {
  font-size: .7rem;
  flex-shrink: 0;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
}
.mock-check--empty {
  background: transparent;
  border: 1.5px solid var(--border);
}
.mock-tag {
  margin-left: auto;
  font-size: .55rem;
  font-weight: 600;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: .15em .5em;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   FEATURES
   ══════════════════════════════════════════════════════════════════════ */
.features { background: var(--surface-alt); }
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card__icon {
  font-size: 2rem;
  margin-bottom: .85rem;
  line-height: 1;
}
.feature-card__title {
  font-size: 1.075rem;
  margin-bottom: .45rem;
}
.feature-card__body {
  font-size: .9375rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════════════════
   HOW IT WORKS
   ══════════════════════════════════════════════════════════════════════ */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 720px;
  margin-inline: auto;
}
.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.step__num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  flex-shrink: 0;
  min-width: 48px;
}
.step__title {
  font-size: 1.1rem;
  margin-bottom: .35rem;
}
.step__desc {
  font-size: .9375rem;
  color: var(--ink-muted);
}

/* ══════════════════════════════════════════════════════════════════════
   CTA BAND
   ══════════════════════════════════════════════════════════════════════ */
.cta-band {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1a9e6a 100%);
  color: #fff;
  padding-block: clamp(56px, 9vw, 96px);
}
.cta-band__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.cta-band__title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  color: #fff;
}
.cta-band__sub {
  font-size: 1.05rem;
  opacity: .88;
  max-width: 480px;
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
  background: var(--surface);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
}
.footer__brand img { border-radius: 4px; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-left: auto;
}
.footer__links a {
  font-size: .875rem;
  color: var(--ink-muted);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--ink); text-decoration: none; }
.footer__copy {
  width: 100%;
  font-size: .8125rem;
  color: var(--ink-muted);
}

/* ══════════════════════════════════════════════════════════════════════
   WIKI LAYOUT  (used only in wiki pages, not on landing)
   ══════════════════════════════════════════════════════════════════════ */
.wiki-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.wiki-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 1.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.wiki-sidebar__search {
  padding: 0 1rem 1rem;
}
.wiki-sidebar__search input {
  width: 100%;
  padding: .45em .75em;
  font-size: .875rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline-offset: 2px;
}
.wiki-sidebar__search input:focus { outline: 2px solid var(--brand); }

.wiki-nav { padding: 0 .5rem; }
.wiki-nav__section { margin-bottom: 1.25rem; }
.wiki-nav__section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 .75rem;
  margin-bottom: .3rem;
}
.wiki-nav__item {
  display: block;
  padding: .4rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none !important;
}
.wiki-nav__item:hover {
  background: var(--border);
  color: var(--ink);
}
.wiki-nav__item.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
}

/* ── Wiki main content ────────────────────────────────────────────────── */
.wiki-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem);
}
.wiki-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8125rem;
  color: var(--ink-muted);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.wiki-breadcrumb a { color: var(--ink-muted); }
.wiki-breadcrumb a:hover { color: var(--ink); }
.wiki-breadcrumb__sep { color: var(--border); }

/* ── Markdown prose styles ────────────────────────────────────────────── */
.prose {
  max-width: 72ch;
  line-height: 1.75;
}
.prose h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .5em; margin-top: 0; }
.prose h2 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-top: 2em; margin-bottom: .5em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.1rem; margin-top: 1.75em; margin-bottom: .4em; }
.prose h4 { font-size: 1rem; margin-top: 1.5em; margin-bottom: .35em; }
.prose p  { margin-bottom: 1em; }
.prose ul, .prose ol { margin-bottom: 1em; padding-left: 1.5em; list-style: revert; }
.prose li { margin-bottom: .3em; }
.prose a  { color: var(--brand-dark); font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose strong { font-weight: 700; }
.prose em     { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--brand);
  padding: .5em 1em;
  margin: 1.25em 0;
  background: var(--brand-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-muted);
}
.prose code {
  font-size: .875em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: .12em .4em;
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}
.prose pre {
  background: var(--ink);
  color: #e8f0fe;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.25em 0;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .875rem;
  color: inherit;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
  font-size: .9375rem;
}
.prose th, .prose td {
  padding: .55em .9em;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  background: var(--surface-alt);
  font-weight: 600;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-block: 1.25em;
}

/* ── Loading / error states ───────────────────────────────────────────── */
.wiki-loading, .wiki-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--ink-muted);
  gap: .75rem;
}
.wiki-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sidebar toggle (mobile) ──────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: .4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4em .75em;
  font-size: .875rem;
  font-family: var(--font);
  color: var(--ink-muted);
  cursor: pointer;
  margin-right: auto;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav__links { display: none; }

  .wiki-layout { flex-direction: column; }
  .wiki-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .wiki-sidebar.open {
    max-height: 80vh;
    overflow-y: auto;
  }
  .sidebar-toggle { display: flex; }
}

@media (max-width: 600px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__links { margin-left: 0; }
}
