/* Design system adapted from powerforcesoftware.com: warm paper, ink, Literata
   headings, IBM Plex body and mono, pill buttons, white hairline cards. */
:root {
  --ink: #0F0F0F;
  --paper: #F7F4EC;          /* rgba copy in header.site and .modal backdrop */
  --paper-card: #FFFFFF;
  --paper-line: #DDDDDD;
  --gray-100: #EFEFEF;
  --gray-500: #888888;       /* decoration only: fails AA as text */
  --gray-700: #3A3A3A;
  --text-body: #1A1A1A;
  --text-muted: #5E5E5E;     /* 5.7:1 on paper */
  --accent: #7A5200;         /* 6.35:1 on paper; used only for .annot */
  --ok: #14612E;
  --err: #9B1C1C;
  --radius: 14px;
  --max: 1180px;
  --font-display: "Literata", "Liberation Serif", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--text-body); font-family: var(--font-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 20px; }
section { padding-block: 72px; }
@media (min-width: 860px) { section { padding-block: 104px; } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5vw + 1rem, 3.6rem); line-height: 1.03; font-weight: 900; }
h2 { font-size: clamp(1.7rem, 2.6vw + 1rem, 2.4rem); line-height: 1.14; }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.14rem; color: var(--text-muted); max-width: 52ch; }
.prose { max-width: 66ch; }
.prose a, .lede a, .annot a { text-underline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-family: var(--font-body); font-weight: 600; font-size: .98rem; padding: 14px 26px; min-height: 44px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s ease, background-color .15s ease, opacity .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--paper-card); color: var(--ink); border: 2px solid var(--ink); }
.btn-primary:hover { background: var(--gray-100); }
.btn-ghost { background: transparent; border-color: var(--paper-line); color: var(--text-body); }
.btn-ghost:hover { border-color: var(--gray-500); }
.btn:disabled, .htmx-request .btn { opacity: .55; cursor: progress; }

/* Header */
header.site { position: sticky; top: 0; z-index: 40; background: rgba(247, 244, 236, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--paper-line); }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: .5em; min-height: 44px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-logo img { display: block; height: 28px; width: auto; }
.brand .dot { width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid var(--ink); }
.nav-links { display: none; gap: 22px; font-size: .92rem; font-weight: 500; }
.nav-links a { text-decoration: none; color: var(--text-body); opacity: .8; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; }
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav .btn { padding: 10px 20px; font-size: .9rem; }

/* Mobile nav: .nav-links is a SIBLING of the <details>, never inside it. */
.nav-toggle > summary { list-style: none; cursor: pointer; }
.nav-toggle > summary::-webkit-details-marker { display: none; }
.nav-toggle-btn { display: inline-flex; align-items: center; gap: 9px; min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--paper-line); background: var(--paper-card); font-weight: 600; font-size: .9rem; }
.nav-toggle-bars { width: 16px; height: 2px; background: var(--ink); position: relative; display: inline-block; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: var(--ink); }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-toggle[open] ~ .nav-links { display: flex; flex-direction: column; gap: 2px; position: absolute; top: calc(100% + 8px); right: 20px; background: var(--paper-card); border: 1px solid var(--paper-line); border-radius: 12px; padding: 10px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .35); min-width: 220px; z-index: 50; }
.nav-toggle[open] ~ .nav-links a { padding: 12px; border-radius: 8px; opacity: 1; min-height: 44px; display: flex; align-items: center; }
.nav-toggle[open] ~ .nav-links a:hover { background: var(--gray-100); }
@media (max-width: 1179px) { .nav > .btn { display: none; } }
@media (min-width: 760px) { .nav-toggle { display: none; } .nav-links { display: flex; align-items: center; } }
@media (min-width: 760px) and (max-width: 899px) { .nav-links { gap: 10px; font-size: .78rem; } }
@media (min-width: 900px) and (max-width: 1039px) { .nav-links { gap: 14px; font-size: .84rem; } }

/* Hero */
.hero { padding-top: 56px; }
.hero-statement { font-size: clamp(2.6rem, 6vw + 1.4rem, 5.5rem); letter-spacing: -.02em; max-width: 18ch; margin-bottom: 48px; }
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* Marginal notes: the one place --accent is used */
.annot { display: flex; flex-direction: column; gap: 22px; border-left: 3px solid var(--accent); background: linear-gradient(90deg, rgba(122, 82, 0, .07), rgba(122, 82, 0, 0) 65%); padding: 20px 20px 20px 22px; }
.annot p { font-family: var(--font-mono); font-size: .88rem; line-height: 1.65; color: var(--text-muted); margin: 0; }
.annot a { color: var(--text-muted); }
.annot a:hover { color: var(--ink); }
.annot-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 7px; background: var(--accent); color: var(--paper); font-weight: 700; font-size: .72rem; letter-spacing: .03em; border-radius: 4px; margin-bottom: 9px; }

/* Page header for inner pages */
.page-head { padding-top: 64px; padding-bottom: 40px; }
.page-head h1 { max-width: 20ch; }
.page-head + section { padding-top: 24px; }
.crumb { font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted); margin-bottom: 20px; }
.crumb a { color: var(--text-muted); }

/* Cards: border weight progresses hairline to heavy across the four topics */
.card-grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 40px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--paper-card); border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 24px 22px; display: flex; flex-direction: column; gap: 10px; }
.card:nth-child(2) { border-color: var(--gray-500); }
.card:nth-child(3) { border: 1.5px solid var(--gray-700); }
.card:nth-child(4) { border: 2px solid var(--ink); }
.card-num { font-family: var(--font-mono); font-size: .85rem; color: var(--gray-700); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--text-muted); flex: 1; }
.card .more { font-weight: 600; text-underline-offset: 3px; }

@media (min-width: 1040px) { .card-grid.three { grid-template-columns: repeat(3, 1fr); } }

/* FAQ */
.faq { margin-top: 24px; max-width: 46rem; border-top: 1px solid var(--paper-line); }
.faq-item { border-bottom: 1px solid var(--paper-line); }
.faq-item summary { cursor: pointer; padding: 16px 0; min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.3rem; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0 0 18px; color: var(--text-muted); max-width: 60ch; }

/* Process steps */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 18px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; border-top: 1px solid var(--paper-line); padding-top: 18px; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: .85rem; color: var(--gray-700); display: block; margin-bottom: 8px; }
.steps li:nth-child(2) { border-top: 1.5px solid var(--gray-500); }
.steps li:nth-child(3) { border-top: 2px solid var(--gray-700); }
.steps li:nth-child(4) { border-top: 3px solid var(--ink); }
.steps strong { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); margin-bottom: 4px; }
.steps span { color: var(--text-muted); }

/* Detail-page layout */
.split { display: grid; gap: 40px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.list { padding-left: 1.1em; margin: 0 0 1em; }
.list li { margin-bottom: .6em; }
.band { background: var(--ink); color: #F2F2F2; }
.band h2, .band h3 { color: #fff; }
.band p { color: #D6D6D6; }
.band .btn-primary { background: #fff; }
.band a:not(.btn) { color: inherit; }
.band a:focus-visible { outline-color: #fff; }

/* Contact layout (adapted from powerforcesoftware.com home page contact section) */
.contact-wrap { display: grid; gap: 40px; padding-block: 56px 72px; }
@media (min-width: 960px) { .contact-wrap { grid-template-columns: .9fr 1.1fr; gap: 60px; } }
.contact-side .lede { margin-top: 14px; }
.contact-fact { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; font-size: .95rem; }
.contact-fact .mark { font-family: var(--font-mono); color: var(--ink); font-weight: 600; }
.contact-fact a { text-underline-offset: 2px; }

form.contact-form { background: var(--paper-card); border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 28px; display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.field label .opt { font-weight: 400; color: var(--text-muted); }
.two-col { display: grid; gap: 18px; }
@media (min-width: 520px) { .two-col { grid-template-columns: 1fr 1fr; } }
.contact-form input[type=text], .contact-form input[type=email], .contact-form input[type=tel], .contact-form select, .contact-form textarea { font-family: var(--font-body); font-size: .96rem; padding: 12px 14px; min-height: 44px; border-radius: 9px; border: 1px solid var(--gray-500); background: var(--gray-100); color: var(--text-body); width: 100%; transition: border-color .15s ease, box-shadow .15s ease; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0, 0, 0, .15); }
.contact-form textarea { min-height: 140px; resize: vertical; }
.hp-field { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.form-privacy-note { font-size: .85rem; line-height: 1.55; color: var(--text-muted); margin: -4px 0 0; }
.form-privacy-note a { color: var(--text-body); text-decoration: underline; }
.form-footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
#form-indicator { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--paper-line); border-top-color: var(--ink); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#form-response:empty { display: none; }
.ok, .err { border-radius: 10px; padding: 14px 16px; background: var(--paper-card); }
.ok { border: 1px solid var(--ok); border-left-width: 4px; }
.err { border: 1px solid var(--err); border-left-width: 4px; }
.err ul { margin: .5rem 0 0; padding-left: 1.2rem; }

/* Legal pages */
.legal-meta { font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted); margin: 0; }
.legal-section { padding-block: 28px; }
.legal-section h2 { font-size: clamp(1.3rem, 1.4vw + 1rem, 1.7rem); }
.placeholder { display: block; border: 1px dashed var(--gray-500); border-radius: 8px; padding: 12px 16px; color: var(--text-muted); font-family: var(--font-mono); font-size: .9rem; max-width: 66ch; margin: 0; background: rgba(255, 255, 255, .5); }
span.placeholder { display: inline; padding: 2px 8px; }

/* Footer */
footer.site { border-top: 1px solid var(--paper-line); padding-block: 40px; font-size: .92rem; color: var(--text-muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { color: var(--text-body); text-decoration: none; padding-block: 11px; margin-block: -11px; min-height: 44px; display: inline-flex; align-items: center; }
.footer-nav a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .htmx-indicator { transition: none; } .spin { animation: none; } }
