@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Source+Sans+3:wght@300;400;500;600&family=Source+Code+Pro:wght@400;500&display=swap');

:root {
  --bg:       #f8f6f1;
  --surface:  #ffffff;
  --ink:      #1e1e1e;
  --ink-soft: #555550;
  --border:   #e2ddd5;
  --accent:   #2d6a4f;   /* forest green — knowledge, growth */
  --accent-lt:#e8f4ef;
  --amber:    #c77b2e;
  --amber-lt: #fdf3e7;
  --tag-bg:   #eeeae3;
  --serif:    'Lora', Georgia, serif;
  --sans:     'Source Sans 3', sans-serif;
  --mono:     'Source Code Pro', monospace;
  --nav-h:    60px;
  --max:      1080px;
  --col:      680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex; align-items: center;
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  width: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 700;
  color: var(--ink); text-decoration: none; letter-spacing: -0.3px;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  font-size: 0.82rem; font-weight: 500; color: var(--ink-soft);
  text-decoration: none; padding: 6px 12px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--accent-lt); color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

/* ── LAYOUT ── */
.page-wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ── HERO (index) ── */
.site-hero {
  max-width: var(--max); margin: 0 auto;
  padding: 72px 24px 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.hero-text {}
.hero-label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
  display: inline-block; margin-bottom: 16px;
}
.hero-text h1 {
  font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700; line-height: 1.15; color: var(--ink); margin-bottom: 18px;
}
.hero-text p {
  font-size: 1.05rem; color: var(--ink-soft); line-height: 1.75;
  max-width: 420px; margin-bottom: 28px;
}
.hero-btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 11px 24px; border-radius: 6px; font-weight: 600;
  font-size: 0.9rem; text-decoration: none;
  transition: background 0.15s;
}
.hero-btn:hover { background: #245a42; }

.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px;
}
.hero-card-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 20px;
}
.hero-topic-list { list-style: none; }
.hero-topic-list li {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.hero-topic-list li:last-child { border-bottom: none; }
.hero-topic-list a {
  font-size: 0.9rem; font-weight: 500; color: var(--ink);
  text-decoration: none; transition: color 0.15s;
}
.hero-topic-list a:hover { color: var(--accent); }
.topic-num {
  font-family: var(--mono); font-size: 0.65rem; color: #bbb;
  min-width: 20px;
}

/* ── SECTION DIVIDER ── */
.section-title {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.section-title h2 {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--ink);
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── CARDS GRID ── */
.cards-wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px 64px; }
.cards-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card-top { height: 3px; }
.card-body { padding: 20px 20px 16px; flex: 1; }
.card-cat {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px;
}
.card h3 {
  font-family: var(--serif); font-size: 1rem; font-weight: 600;
  color: var(--ink); line-height: 1.4; margin-bottom: 8px;
}
.card p { font-size: 0.83rem; color: var(--ink-soft); line-height: 1.6; }
.card-foot {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.card-foot .read {
  font-size: 0.78rem; font-weight: 600; color: var(--accent); text-decoration: none;
}
.card-foot .mins {
  font-family: var(--mono); font-size: 0.68rem; color: #aaa;
}

/* ── ARTICLE ── */
.article-wrap {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: var(--col) 1fr; gap: 64px;
  align-items: start;
}
.article-main { min-width: 0; padding: 40px 0 80px; }
.article-sidebar { padding-top: 40px; position: sticky; top: 80px; }

/* breadcrumb */
.crumb {
  font-size: 0.78rem; color: var(--ink-soft);
  display: flex; gap: 6px; align-items: center; margin-bottom: 28px;
}
.crumb a { text-decoration: none; color: var(--ink-soft); transition: color 0.15s; }
.crumb a:hover { color: var(--accent); }

/* article header */
.a-cat {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.article-main h1 {
  font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700; line-height: 1.2; color: var(--ink); margin-bottom: 16px;
}
.a-meta {
  font-size: 0.78rem; color: var(--ink-soft);
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 36px;
}
.tag {
  background: var(--tag-bg); color: var(--ink-soft);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 4px;
}

/* body prose */
.a-body { font-size: 1.02rem; line-height: 1.85; color: #2a2a28; }
.a-body h2 {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
  color: var(--ink); margin: 44px 0 14px; line-height: 1.3;
}
.a-body h3 {
  font-size: 1.05rem; font-weight: 600;
  color: var(--ink); margin: 30px 0 10px;
}
.a-body p { margin-bottom: 18px; }
.a-body ul, .a-body ol { padding-left: 1.4rem; margin-bottom: 18px; }
.a-body li { margin-bottom: 5px; }
.a-body strong { font-weight: 600; }
.a-body a { color: var(--accent); }

.callout {
  background: var(--accent-lt); border-left: 3px solid var(--accent);
  padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 28px 0;
  font-size: 0.95rem;
}
.callout p { margin: 0; }

.tip {
  background: var(--amber-lt); border-left: 3px solid var(--amber);
  padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 28px 0;
}
.tip-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--amber); margin-bottom: 8px;
}
.tip p { margin: 0; font-size: 0.93rem; }

.prompt-ex {
  background: #1e1e1e; color: #d4d4d4;
  border-radius: 8px; padding: 18px 22px; margin: 20px 0;
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.65;
}
.prompt-ex::before {
  content: 'Example prompt';
  display: block; font-size: 0.6rem; letter-spacing: 2px;
  text-transform: uppercase; color: #666; margin-bottom: 8px;
}

/* ── SIDEBAR ── */
.sidebar-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.sb-head {
  background: var(--tag-bg); padding: 10px 16px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink-soft);
}
.sb-body { padding: 14px 16px; }
.toc-list { list-style: none; }
.toc-list li {
  border-bottom: 1px solid var(--border); padding: 7px 0;
  font-size: 0.83rem;
}
.toc-list li:last-child { border-bottom: none; }
.toc-list a { text-decoration: none; color: var(--ink); transition: color 0.15s; }
.toc-list a:hover { color: var(--accent); }

.related-list { list-style: none; }
.related-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.83rem; }
.related-list li:last-child { border-bottom: none; }
.related-list a { text-decoration: none; color: var(--ink); font-weight: 500; transition: color 0.15s; display: flex; gap: 8px; align-items: flex-start; }
.related-list a:hover { color: var(--accent); }
.related-list .rnum { font-family: var(--mono); font-size: 0.62rem; color: #bbb; padding-top: 2px; }

/* ── ARTICLE FOOTER ── */
.a-nav {
  display: flex; justify-content: space-between;
  padding: 24px 0; border-top: 1px solid var(--border);
  margin-top: 48px;
}
.a-nav a {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  text-decoration: none; transition: opacity 0.15s;
}
.a-nav a:hover { opacity: 0.75; }
.a-nav .prev { color: var(--ink-soft); font-weight: 400; }

/* ── PROGRESS BAR ── */
.progress {
  position: fixed; top: var(--nav-h); left: 0; height: 2px;
  background: var(--accent); z-index: 200; width: 0;
  transition: width 0.08s linear;
}

/* ── FOOTER ── */
.footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap;
}
.footer-brand .logo { display: block; margin-bottom: 8px; }
.footer-brand p { font-size: 0.82rem; color: var(--ink-soft); max-width: 220px; line-height: 1.6; }
.footer-col h4 {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { font-size: 0.83rem; color: var(--ink-soft); text-decoration: none; transition: color 0.15s; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  max-width: var(--max); margin: 28px auto 0; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem; color: #aaa;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  padding: 16px 0; font-weight: 600; font-size: 0.97rem;
  cursor: pointer; display: flex; justify-content: space-between;
}
.faq-q::after { content: '+'; color: var(--accent); font-size: 1.2rem; font-weight: 300; }
.faq-q.open::after { content: '−'; }
.faq-a { display: none; padding-bottom: 16px; font-size: 0.93rem; color: var(--ink-soft); line-height: 1.75; }
.faq-a.open { display: block; }

/* ── GLOSSARY ── */
.gloss-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.gloss-term { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--accent); margin-bottom: 5px; }
.gloss-def { font-size: 0.93rem; color: var(--ink-soft); line-height: 1.7; }

/* ── STEPS ── */
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li {
  counter-increment: s; padding: 18px 18px 18px 58px;
  position: relative; border-left: 2px solid var(--border);
  margin-left: 20px; margin-bottom: 6px;
}
.steps li::before {
  content: counter(s);
  position: absolute; left: -18px; top: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
}
.steps li h4 { font-weight: 600; margin-bottom: 4px; }
.steps li p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .site-hero { grid-template-columns: 1fr; gap: 32px; }
  .article-wrap { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 1.9rem; }
}

/* ── ANIMATION ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeUp 0.5s ease both; }
.fade-in-2 { animation: fadeUp 0.5s 0.1s ease both; }
.fade-in-3 { animation: fadeUp 0.5s 0.2s ease both; }
