/* Shared styles for the static DFS Crunch pages (/plans, /ai, /support, /privacy, /terms).
   Colours and type follow the homepage dark theme (src/index.css .dark tokens, Bebas Neue display font). */
:root {
  color-scheme: dark;
  --bg: hsl(222.2, 84%, 4.9%);
  --fg: hsl(210, 40%, 98%);
  --text: hsl(213, 27%, 84%);
  --muted: hsl(217.2, 32.6%, 17.5%);
  --muted-fg: hsl(215, 20.2%, 65.1%);
  --border: hsl(217.2, 32.6%, 17.5%);
  --primary: hsl(231, 83%, 65%);
  --primary-soft: hsla(231, 83%, 65%, 0.12);
  --primary-fg: hsl(222.2, 47.4%, 11.2%);
  --check: #34d399;
  --panel: rgba(0, 0, 0, 0.2);
  --line: rgba(255, 255, 255, 0.06);
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.65; }
img { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .wrap { padding: 0 2rem; } }
.skip-link { position: absolute; left: -999px; top: 0.75rem; z-index: 100; background: var(--primary); color: var(--primary-fg); padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-weight: 600; text-decoration: none; }
.skip-link:focus { left: 1rem; }

/* Header and footer */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border); background: rgba(2, 8, 23, 0.85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--fg); font-size: 1.25rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a { padding: 0.45rem 0.75rem; border-radius: 0.375rem; color: var(--muted-fg); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.site-nav a:hover { background: var(--muted); color: var(--fg); }
.site-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--fg); }
@media (max-width: 440px) { .brand span { display: none; } .site-nav a { padding: 0.45rem 0.6rem; } }
.site-footer { border-top: 1px solid rgba(255, 255, 255, 0.05); background: var(--panel); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 2rem; padding-bottom: 2rem; color: var(--muted-fg); font-size: 0.875rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-inner a { color: var(--muted-fg); text-decoration: none; }
.footer-inner a:hover { color: var(--fg); }
.footer-inner p { margin: 0; }
@media (max-width: 640px) { .footer-inner { flex-direction: column; justify-content: center; text-align: center; } }

/* Page hero: same grid texture and glow as the homepage hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.hero::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(hsla(210, 40%, 98%, 0.045) 1px, transparent 1px), linear-gradient(90deg, hsla(210, 40%, 98%, 0.045) 1px, transparent 1px);
  background-size: 56px 56px; }
.hero::after { content: ""; position: absolute; left: 50%; top: -9rem; width: 56rem; max-width: 140vw; height: 22rem; transform: translateX(-50%); border-radius: 9999px; background: hsla(231, 83%, 65%, 0.18); filter: blur(110px); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; padding-top: 3.5rem; padding-bottom: 3rem; }
@media (min-width: 1024px) { .hero .wrap { padding-top: 5rem; padding-bottom: 4rem; } }
.eyebrow { margin: 0 0 1rem; font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.28em; color: var(--primary); text-transform: uppercase; }
h1 { margin: 0; max-width: 18ch; font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 9vw, 5.75rem); line-height: 0.9; letter-spacing: -0.01em; }
.lead { margin: 1.5rem 0 0; max-width: 46rem; color: var(--muted-fg); font-size: 1.125rem; line-height: 1.75; }
@media (min-width: 640px) { .lead { font-size: 1.25rem; } }
.meta { margin: 1.25rem 0 0; color: var(--muted-fg); font-size: 0.875rem; }

/* Long-form documents with a table of contents */
.doc { display: grid; gap: 2.5rem; padding-top: 3rem; padding-bottom: 5rem; }
@media (min-width: 1024px) {
  .doc { grid-template-columns: 15rem minmax(0, 46rem); justify-content: start; gap: 3.5rem; }
  .toc { position: sticky; top: 5.5rem; align-self: start; max-height: calc(100vh - 7rem); overflow: auto; }
}
.toc { border: 1px solid var(--line); background: var(--panel); border-radius: 1rem; padding: 1.25rem 1.25rem 1rem; font-size: 0.875rem; }
.toc-title { margin: 0 0 0.5rem; font-family: var(--display); font-size: 1rem; letter-spacing: 0.2em; color: var(--primary); }
.toc ol { margin: 0; padding-left: 1.2rem; color: var(--muted-fg); }
.toc li { margin: 0.3rem 0; }
.toc a { color: var(--muted-fg); text-decoration: none; }
.toc a:hover { color: var(--fg); }
.page { padding-top: 3rem; padding-bottom: 5rem; }
.prose { min-width: 0; max-width: 46rem; }
.prose h2, .section-title { margin: 3rem 0 1rem; font-family: var(--display); font-weight: 400; font-size: 2.25rem; line-height: 1; letter-spacing: 0.01em; scroll-margin-top: 5.5rem; }
.prose > section:first-child > h2, .prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.75rem 0 0.5rem; font-size: 1.125rem; line-height: 1.4; scroll-margin-top: 5.5rem; }
.prose p, .prose li, .prose td, .prose dd { color: var(--text); }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.prose li { margin: 0.4rem 0; }
.prose li::marker { color: var(--muted-fg); }
.prose strong { color: var(--fg); }
.prose code, .table code, .card code { font-family: var(--mono); font-size: 0.875em; background: rgba(255, 255, 255, 0.07); border-radius: 0.25rem; padding: 0.1rem 0.35rem; color: var(--fg); }
code { font-family: var(--mono); overflow-wrap: anywhere; }
.note { margin: 1.25rem 0; border-left: 3px solid var(--primary); background: hsla(231, 83%, 65%, 0.06); border-radius: 0.5rem; padding: 0.9rem 1.1rem; }
.note p:last-child { margin-bottom: 0; }
.owner { color: var(--muted-fg); }

/* Tables (stack into labelled rows on small screens) */
.table-wrap { margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--panel); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.55; }
.table th, .table td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-family: var(--display); font-weight: 400; font-size: 0.95rem; letter-spacing: 0.12em; color: var(--muted-fg); }
.table td:first-child { color: var(--fg); font-weight: 600; }
@media (max-width: 720px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: block; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: block; padding: 0.3rem 0.9rem; border: 0; }
  .table.stack td::before { content: attr(data-label); display: block; font-family: var(--display); font-weight: 400; font-size: 0.8rem; letter-spacing: 0.12em; color: var(--muted-fg); }
}

/* Cards, plans, panels */
.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: 1rem; padding: 1.5rem; }
.card.accent { border-color: hsla(231, 83%, 65%, 0.3); background: hsla(231, 83%, 65%, 0.05); }
.card h2, .card h3 { margin: 0 0 0.75rem; font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1; letter-spacing: 0.02em; }
.card p { margin: 0 0 0.75rem; color: var(--text); }
.card p:last-child { margin-bottom: 0; }
.card ol, .card ul { margin: 0; padding-left: 1.25rem; color: var(--text); }
.card .checks { padding-left: 0; }
.card li { margin: 0.45rem 0; }
.plan { display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, 0.08); background: var(--panel); border-radius: 1rem; padding: 1.75rem; }
.plan-cadence { font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.24em; color: var(--muted-fg); text-transform: uppercase; }
.plan-price { margin-top: 0.5rem; font-family: var(--display); font-size: 3.75rem; line-height: 1; }
.plan-name { margin: 0.5rem 0 0; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.18em; text-transform: uppercase; }
.plan-note { margin: 0.5rem 0 0; color: var(--muted-fg); font-size: 0.875rem; }
.checks { list-style: none; margin: 1.5rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.checks li { position: relative; margin: 0.7rem 0; padding-left: 1.6rem; font-size: 0.9rem; color: var(--fg); }
.checks li::before { content: ""; position: absolute; left: 0.3rem; top: 0.2rem; width: 0.4rem; height: 0.75rem; border: solid var(--check); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.section { padding-top: 3.5rem; }
.section:first-child { padding-top: 0; }
.section > .section-title { margin-top: 0; }
.section-intro { margin: 0 0 1.5rem; max-width: 46rem; color: var(--muted-fg); }
.fine { color: var(--muted-fg); font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.25rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.5rem 1.25rem; border-radius: 0.5rem; border: 1px solid var(--border); color: var(--fg); font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--muted); }
.contact-value { font-size: 1.15rem; font-weight: 600; word-break: break-word; }

/* AI page: connector URL, tool list, prompts */
.codebox { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0 0; max-width: 46rem; border: 1px solid hsla(231, 83%, 65%, 0.35); background: rgba(0, 0, 0, 0.45); border-radius: 0.75rem; padding: 0.9rem 1rem; }
.codebox code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 1rem; color: var(--fg); word-break: break-all; -webkit-user-select: all; user-select: all; }
.copy-btn { flex: none; border: 0; border-radius: 0.375rem; padding: 0.45rem 0.85rem; background: var(--primary); color: var(--primary-fg); font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.copy-btn[hidden] { display: none; }
.prompts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.prompt { border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); border-radius: 0.75rem; padding: 0.8rem 1rem; color: var(--fg); }
.prompt::before { content: "\201C"; color: var(--primary); font-weight: 700; margin-right: 0.15rem; }
.prompt::after { content: "\201D"; color: var(--primary); font-weight: 700; margin-left: 0.15rem; }
.faq dt { margin-top: 1.25rem; color: var(--fg); font-weight: 700; }
.faq dd { margin: 0.35rem 0 0; }

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .toc, .skip-link, .copy-btn { display: none; }
  .hero::before, .hero::after { display: none; }
  .prose p, .prose li, .prose td, .lead, .meta { color: #000; }
  a { color: #000; }
}
