/* Shared styles for FieldFlowCAD content pages (everything except the landing page).
   Tokens mirror site/landing.html so the pages read as one site. */
:root {
  color-scheme: dark;
  --bg: #0b1014;
  --bg-2: #0e151a;
  --panel: #131c23;
  --line: #26343f;
  --line-soft: #1d2831;
  --text: #dde7ee;
  --muted: #8da0ad;
  --faint: #5c7180;
  --accent: #45c6d6;
  --accent-ink: #04222a;
  --warn: #e5ae4a;
  --sans: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --maxw: 1220px;
  --readw: 760px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef2f4;
    --bg-2: #f5f8f9;
    --panel: #ffffff;
    --line: #ccd8de;
    --line-soft: #dde5e9;
    --text: #142029;
    --muted: #4e626e;
    --faint: #6d838f;
    --accent: #0b7f90;
    --accent-ink: #ffffff;
    --warn: #91620f;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 99; padding: 8px 12px; background: var(--panel); border: 1px solid var(--accent); border-radius: 6px; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 64px;
  padding: 10px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-2);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }

.nav-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.nav-link { padding: 8px 10px; border-radius: 6px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--accent); }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 15px; border-radius: 10px; }

/* layout */
.wrap { width: min(var(--maxw), 100%); margin: 0 auto; padding: 0 clamp(18px, 4vw, 28px); }
.read { width: min(var(--readw), 100%); margin: 0 auto; padding: 0 clamp(18px, 4vw, 28px); }

.crumbs { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; color: var(--faint); font-size: 13px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.page-head { padding: 22px 0 8px; }
.kicker { margin: 0 0 10px; color: var(--accent); font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -.02em; }
.lede { margin: 0 0 18px; color: var(--muted); font-size: 19px; }
.byline { margin: 0 0 8px; color: var(--faint); font-size: 13.5px; }
.byline a { color: var(--muted); }

h2 { margin: 44px 0 12px; font-size: clamp(22px, 3vw, 28px); line-height: 1.2; letter-spacing: -.01em; }
h3 { margin: 28px 0 8px; font-size: 18.5px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 6px; }

.answer { margin: 20px 0 8px; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--panel); }
.answer p:last-child { margin-bottom: 0; }

.formula { margin: 16px 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; white-space: pre; }

.note { margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 15px; }
.note p:last-child { margin-bottom: 0; }

.table-scroll { margin: 16px 0 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { background: var(--panel); color: var(--muted); font-size: 13px; letter-spacing: .03em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.card h2, .card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 15.5px; }
.card p:last-child { margin-bottom: 0; }
.card .price { color: var(--text); font-size: 32px; font-weight: 750; letter-spacing: -.02em; }
.card .price small { color: var(--muted); font-size: 15px; font-weight: 500; }
.card ul { padding-left: 18px; color: var(--muted); font-size: 15.5px; }

figure { margin: 26px 0; }
figure img { display: block; border: 1px solid var(--line); border-radius: 10px; }
figcaption { margin-top: 8px; color: var(--faint); font-size: 13.5px; }

.cta { margin: 48px 0 0; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.cta h2 { margin: 0 0 8px; }
.cta p { color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.sources { color: var(--muted); font-size: 15px; }

/* footer */
.site-footer { margin-top: 64px; padding: 34px 0; border-top: 1px solid var(--line-soft); background: var(--bg-2); color: var(--faint); font-size: 13.5px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; margin-bottom: 24px; }
.footer-cols h2 { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.footer-cols ul { margin: 0; padding: 0; list-style: none; }
.footer-cols a, .footer-legal a { color: var(--muted); text-decoration: none; }
.footer-cols a:hover, .footer-legal a:hover { color: var(--accent); }
.footer-legal { margin: 0; }
