/* ============================================================
   Templates section (/templates/ and the three template pages).
   Its own look, so it doesn't read as the homepage: ruled
   "paper" backgrounds, left-aligned numbered section heads,
   file cards instead of a centred hero, ruled lists instead of
   floating cards, and a light closing strip instead of the dark
   gradient CTA. Everything is scoped to body.tpl.
   ============================================================ */

.tpl {
  --tpl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --tpl-rule: rgba(15,23,42,.045);
  --tpl-ink: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tpl { --tpl-rule: rgba(255,255,255,.04); }
  /* style.css paints dark feature cards; keep them transparent here. */
  :root:not([data-theme="light"]) .tpl .feature-card { background: none; }
}
:root[data-theme="dark"] .tpl { --tpl-rule: rgba(255,255,255,.04); }

/* ---------- Hero: ruled sheet, text left, file on the right ---------- */
.tpl .tp-hero { position: relative; overflow: hidden; padding: var(--page-hero-pt) 0 3.75rem; border-bottom: 1px solid var(--border);
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, var(--tpl-rule) 31px 32px),
    linear-gradient(180deg, var(--muted-bg), var(--bg)); }
.tpl .tp-hero__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
.tpl .tp-hero__grid > :not(:first-child) { align-self: center; }
@media (min-width: 980px) { .tpl .tp-hero__grid { grid-template-columns: 1.05fr 1fr; gap: 3.5rem; } }
.tpl .tp-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; }
.tpl .btn__meta { font-weight: 500; opacity: .8; margin-left: 0.35rem; font-size: 0.85em; }
.tpl .tp-hero__facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding: 0; margin: 0; font-size: 0.875rem; color: var(--text-muted); }
.tpl .tp-hero__facts li { display: inline-flex; align-items: center; gap: 0.4rem; }
.tpl .tp-hero__facts svg { color: #16A34A; }

/* File card: the template shown as the file you'll get. */
.file-card { margin: 0; width: 100%; max-width: 560px; justify-self: end; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 22px 48px -24px rgba(15,23,42,.35), 0 2px 6px rgba(15,23,42,.06); overflow: hidden; }
@media (max-width: 979px) { .file-card { justify-self: center; } }
.file-card__bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); background: var(--muted-bg); }
.file-card__bar svg { color: var(--red-text); flex-shrink: 0; }
.file-card__name { font-family: var(--tpl-mono); font-size: 0.8125rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card__ext { margin-left: auto; font-family: var(--tpl-mono); font-size: 0.6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--red-text); border: 1px solid currentColor; border-radius: 4px; padding: 0.05rem 0.35rem; }
.file-card__preview { padding: 14px; background: #F8FAFC; border-bottom: 1px solid var(--border); }
.file-card__preview img { display: block; width: 100%; height: auto; border-radius: 4px; background: #fff; }
.file-card__meta { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; }
.file-card__meta div { padding: 0.7rem 0.9rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.file-card__meta div:nth-child(2n) { border-right: none; }
.file-card__meta div:nth-last-child(-n+2) { border-bottom: none; }
.file-card__meta dt { font-family: var(--tpl-mono); font-size: 0.6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.file-card__meta dd { margin: 0.15rem 0 0; font-size: 0.875rem; font-weight: 600; color: var(--text); }

/* ---------- Section heads: left-aligned, numbered ---------- */
.tpl main { counter-reset: tsec; }
.tpl .section-head { text-align: left; align-items: flex-start; max-width: 760px; }
.tpl .section-title { text-align: left; }
.tpl .section-sub { text-align: left; margin-inline: 0; max-width: 640px; }
.tpl .eyebrow { padding: 0; background: none; border: 0; border-radius: 0; gap: 0.65rem;
  font-family: var(--tpl-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--red-text); }
.tpl .eyebrow::before { counter-increment: tsec; content: counter(tsec, decimal-leading-zero); width: auto; height: auto; background: none; border-radius: 0;
  color: var(--text-muted); padding-right: 0.65rem; border-right: 1px solid var(--border); }

/* ---------- "Where it stops" features: a ruled spec list, not floating cards ---------- */
.tpl .features { background: var(--muted-bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tpl .features__grid { gap: 0; border-top: 2px solid var(--tpl-ink); counter-reset: tfeat; }
.tpl .feature-card { background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: 1.5rem 0; overflow: visible; }
.tpl .feature-card::before { display: none; }
.tpl .feature-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
.tpl .feature-card__icon { width: auto; height: auto; background: none; border-radius: 0; gap: 0.6rem; }
.tpl .feature-card__icon::before { counter-increment: tfeat; content: counter(tfeat, upper-alpha); font-family: var(--tpl-mono); font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.tpl .feature-card:hover .feature-card__icon { background: none; color: var(--red-text); transform: none; }
.tpl .feature-card h3 { margin-top: 0.75rem; }
.tpl .feature-card p a { color: var(--red-text); text-decoration: underline; text-underline-offset: 0.15em; }
@media (min-width: 640px) {
  .tpl .feature-card { padding: 1.5rem 1.5rem 1.5rem 0; }
  .tpl .feature-card:nth-child(2n) { padding: 1.5rem 0 1.5rem 1.5rem; border-left: 1px solid var(--border); }
}
@media (min-width: 1024px) {
  .tpl .features__grid--wide .feature-card,
  .tpl .features__grid--wide .feature-card:nth-child(2n) { padding: 1.5rem 1.25rem; border-left: 1px solid var(--border); border-bottom: 0; }
  .tpl .features__grid--wide .feature-card:first-child { padding-left: 0; border-left: 0; }
  .tpl .features__grid--wide .feature-card:last-child { padding-right: 0; }
}

/* ---------- FAQ: heading row on top, ruled Q-list underneath ---------- */
.tpl .faq-grid { display: block; margin-top: 0; }
.tpl .faq-intro { display: grid; grid-template-columns: 1fr; gap: 0 2rem; align-items: end; margin-bottom: 1.75rem; }
.tpl .faq-intro .eyebrow { justify-self: start; }
@media (min-width: 760px) {
  .tpl .faq-intro { grid-template-columns: 1fr auto; }
  .tpl .faq-intro > :not(.faq-contact) { grid-column: 1; }
  .tpl .faq-contact { grid-column: 2; grid-row: 1 / span 3; text-align: right; }
}
.tpl .faq-contact { margin: 1rem 0 0; padding: 0; border: 0; background: none; border-radius: 0; }
.tpl .faq-contact__icon { display: none; }
.tpl .faq-contact h3 { margin: 0; font-size: 0.9375rem; }
.tpl .faq-contact p { margin: 0.15rem 0 0; }
.tpl .faq-contact .btn { margin-top: 0.6rem; }
.tpl .faq-list { background: none; border: 0; border-top: 2px solid var(--tpl-ink); border-radius: 0; box-shadow: none; overflow: visible; counter-reset: tq; }
.tpl .faq-item { border-bottom: 1px solid var(--border); background: none; }
.tpl .faq-item:last-of-type { border-bottom: 1px solid var(--border); }
.tpl .faq-item summary { justify-content: flex-start; padding: 1.1rem 0; }
.tpl .faq-item summary::before { counter-increment: tq; content: "Q" counter(tq); flex-shrink: 0; min-width: 2.5rem;
  font-family: var(--tpl-mono); font-size: 0.75rem; font-weight: 700; color: var(--red-text); }
.tpl .faq-item summary::after { margin-left: auto; background-color: transparent; border: 1px solid var(--border); border-radius: 6px; }
.tpl .faq-item summary:hover { background: none; color: var(--red-text); }
.tpl .faq-item[open] { background: none; }
.tpl .faq-item[open] summary { border-bottom: 0; }
.tpl .faq-item p { padding: 0 2.5rem 1.35rem 2.5rem; }

/* ---------- Download row inside "What's inside" ---------- */
.tpl .download-panel { background: var(--surface); border: 1.5px dashed #CBD5E1; }
.tpl .download-panel__text h3 { font-family: var(--tpl-mono); font-size: 0.9375rem; }

/* ---------- Closing CTA: light strip with a red top rule ---------- */
.tpl .waitlist { background: var(--bg); padding: 3.5rem 0 5rem; }
.tpl .waitlist__panel { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--red); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 2rem 1.75rem; text-align: left; }
.tpl .waitlist__panel::before, .tpl .waitlist__panel::after { display: none; }
.tpl .waitlist__inner { max-width: none; margin: 0; text-align: left; display: grid; gap: 0.5rem 3rem; align-items: center; }
@media (min-width: 900px) {
  .tpl .waitlist__panel { padding: 2.25rem 2.5rem; }
  .tpl .waitlist__inner { grid-template-columns: 1fr auto; }
  .tpl .waitlist__inner > :not(.tpl-cta__actions) { grid-column: 1; }
  .tpl .tpl-cta__actions { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
.tpl .waitlist__panel h2 { color: var(--text); font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
.tpl .waitlist__panel .waitlist__inner > p { color: var(--text-muted); font-size: 1rem; margin-top: 0; }
.tpl .waitlist__panel .waitlist__inner > p a { color: var(--red-text); text-decoration: underline; text-underline-offset: 0.15em; }
.tpl .waitlist__panel .btn--ghost { color: var(--text); border-color: var(--border); }
.tpl .waitlist__panel .btn--ghost:hover { background: var(--muted-bg); color: var(--text); border-color: #CBD5E1; }
.tpl-cta__actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- Hub: industry band uses ruled lines, not a red glow ---------- */
.tpl .pro-band::before { background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(255,255,255,.035) 31px 32px); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tpl .file-card__preview { background: #0F172A; }
  :root:not([data-theme="light"]) .tpl .download-panel { border-color: #334155; }
}
:root[data-theme="dark"] .tpl .file-card__preview { background: #0F172A; }
:root[data-theme="dark"] .tpl .download-panel { border-color: #334155; }
