/* ──────────────────────────────────────────────────────────────────────────
   Feature pages — features.php, ai-modules.php, ai-tasks.php, ai-skills.php

   These four are the deep reading the home page deliberately does not carry.
   They share one namespace (.fp-) and take every colour from tokens.css, so
   light, dark and OLED all resolve without a second palette here.

   Layout rule of the file: sibling groups are spaced with flex/grid `gap`,
   never per-element margins, and anything that can outgrow its track
   (tables, long title lists) scrolls inside its own container rather than
   widening the page.
   ────────────────────────────────────────────────────────────────────────── */

.fp {
  --fp-gutter: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--fp-gutter) 80px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.fp-hero {
  text-align: center;
  padding: 58px 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.fp-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  text-wrap: balance;
  max-width: 20ch;
}
.fp-hero .fp-lead {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 62ch;
}
.fp-hero .fp-lead strong { color: var(--text); font-weight: 700; }
.fp-hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Stat strip — live counts, so it is data rather than decoration. */
.fp-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.fp-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 17px;
  min-width: 118px;
  text-align: center;
}
.fp-stat b {
  display: block;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.fp-stat span { font-size: .73rem; color: var(--muted); font-weight: 600; }

/* ── Jump links ──────────────────────────────────────────────────────────── */
.fp-jump {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 0 8px;
}
.fp-jump a {
  font-size: .79rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 13px;
  background: var(--surface);
}
.fp-jump a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.fp-sec { padding: 40px 0 0; scroll-margin-top: 82px; }
.fp-sec-hd { margin-bottom: 20px; max-width: 68ch; }
.fp-sec-hd h2 {
  margin: 0 0 8px;
  font-size: clamp(1.32rem, 2.6vw, 1.72rem);
  font-weight: 800;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.fp-sec-hd p { margin: 0; font-size: .95rem; line-height: 1.65; color: var(--muted); }
.fp-sec-hd .badge { margin-bottom: 12px; }

.fp-sec > p { font-size: .94rem; line-height: 1.7; color: var(--text); max-width: 68ch; }
.fp-sec h3 { margin: 24px 0 8px; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }

/* ── Card grids ──────────────────────────────────────────────────────────── */
.fp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.fp-grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.fp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 19px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fp-card-ic {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 1.05rem;
}
.fp-card h3 { margin: 0; font-size: .96rem; font-weight: 700; letter-spacing: -.01em; }
.fp-card p  { margin: 0; font-size: .85rem; line-height: 1.6; color: var(--muted); }
.fp-card p strong { color: var(--text); font-weight: 600; }
.fp-card code {
  font-size: .8rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}

/* A card that is a link (the cross-link rail, the home page tiles). */
a.fp-card { color: inherit; transition: border-color .15s ease, transform .15s ease; }
a.fp-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
a.fp-card .fp-more { margin-top: auto; font-size: .82rem; font-weight: 700; color: var(--primary); }

/* ── Category list (modules) ─────────────────────────────────────────────── */
.fp-cats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.fp-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fp-cat-hd { display: flex; align-items: baseline; gap: 8px; }
.fp-cat-hd h3 { margin: 0; font-size: .91rem; font-weight: 700; flex: 1; min-width: 0; }
.fp-cat-n {
  font-size: .71rem; font-weight: 800; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 99px; padding: 2px 8px; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.fp-cat ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.fp-cat li {
  font-size: .76rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px;
  background: var(--bg);
}

/* ── Template / skill tables ─────────────────────────────────────────────── */
.fp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.fp-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.fp-table th, .fp-table td {
  text-align: left; padding: 11px 14px; font-size: .85rem;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
.fp-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.fp-table tr:last-child td { border-bottom: 0; }
.fp-table td b { font-weight: 700; }
.fp-table td .fp-td-sub { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; line-height: 1.55; }
.fp-table .fp-when { white-space: nowrap; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-table .fp-cost { white-space: nowrap; font-size: .78rem; color: var(--muted); }

.fp-group-hd {
  display: flex; align-items: baseline; gap: 9px;
  margin: 24px 0 10px;
}
.fp-group-hd h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.fp-group-hd span { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Numbered steps ──────────────────────────────────────────────────────── */
.fp-steps { display: flex; flex-direction: column; gap: 15px; counter-reset: fps; }
.fp-step { display: flex; gap: 14px; align-items: flex-start; }
.fp-step .n {
  counter-increment: fps;
  flex-shrink: 0; width: 29px; height: 29px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .83rem; font-weight: 800;
}
.fp-step .n::before { content: counter(fps); }
.fp-step .t { padding-top: 3px; }
.fp-step .t strong { display: block; font-size: .93rem; margin-bottom: 3px; }
.fp-step .t span { font-size: .86rem; color: var(--muted); line-height: 1.6; }

/* ── Worked example ──────────────────────────────────────────────────────── */
.fp-ex {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: var(--surface);
  padding: 13px 16px;
  display: flex; flex-direction: column; gap: 7px;
}
.fp-ex .say { font-size: .88rem; font-weight: 600; }
.fp-ex .got { font-size: .85rem; color: var(--muted); line-height: 1.65; }
.fp-ex .got strong { color: var(--text); font-weight: 600; }
.fp-exs { display: flex; flex-direction: column; gap: 10px; }

/* ── Callout ─────────────────────────────────────────────────────────────── */
.fp-note {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 12px; padding: 14px 16px;
  font-size: .86rem; line-height: 1.65;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
}
.fp-note.plain { background: var(--surface); border-color: var(--border); }
.fp-note .ic { flex-shrink: 0; font-size: 1.05rem; line-height: 1.4; }
.fp-note p { margin: 0; }
.fp-note p + p { margin-top: 7px; }

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.fp-faq { display: flex; flex-direction: column; gap: 8px; }
.fp-faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 13px 16px;
}
.fp-faq summary {
  cursor: pointer; font-size: .91rem; font-weight: 650;
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.fp-faq summary::-webkit-details-marker { display: none; }
.fp-faq summary::after { content: '+'; color: var(--primary); font-weight: 800; flex-shrink: 0; }
.fp-faq details[open] summary::after { content: '–'; }
.fp-faq details p { margin: 10px 0 0; font-size: .87rem; line-height: 1.7; color: var(--muted); }

/* ── Closing CTA ─────────────────────────────────────────────────────────── */
.fp-cta {
  margin-top: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 32px 26px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 13px;
}
.fp-cta h2 { margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; }
.fp-cta p { margin: 0; font-size: .92rem; color: var(--muted); max-width: 54ch; line-height: 1.65; }
.fp-cta-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── Cross-links ─────────────────────────────────────────────────────────── */
.fp-xref { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 26px; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .fp-hero { padding: 40px 0 26px; }
  .fp-sec { padding-top: 32px; }
  .fp-stat { min-width: 102px; padding: 9px 13px; }
  .fp-stat b { font-size: 1.14rem; }
  .fp-hero-ctas .btn, .fp-cta-row .btn { width: 100%; justify-content: center; }
  .fp-hero-ctas, .fp-cta-row { width: 100%; max-width: 320px; }
}
