/* ==========================================================================
   Crypto Security Advisor - funnel page styles.
   Scoped under .csa so nothing collides with the Nicepage u-* framework that
   still drives the header, menu and footer. The site's CSP is style-src 'self',
   so every rule lives here: no inline styles anywhere in index.html. Fonts are a
   system stack because font-src blocks third-party hosts.
   ========================================================================== */

/* Base rules that the retired framework stylesheet used to provide. Paragraph size, weight and
   leading are kept exactly as the site has always rendered them. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: #fff; }

.csa {
  --csa-ink: #0b1020;
  --csa-ink-2: #141b3a;
  --csa-paper: #ffffff;
  --csa-tint: #f4f5fa;
  --csa-text: #16192a;
  --csa-muted: #5a6078;
  --csa-line: #dfe2ec;
  --csa-accent: #2a63c4;
  --csa-accent-ink: #1f4fa8;
  --csa-on-dark: #eef1fb;
  --csa-on-dark-muted: #b7bfda;
  --csa-cyan: #6cc3ef;
  --csa-ok: #1f7a4d;
  --csa-no: #b3261e;
  --csa-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Cambria, "Times New Roman", serif;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--csa-text);
  background: var(--csa-paper);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

.csa *, .csa *::before, .csa *::after { box-sizing: border-box; }

.csa h1, .csa h2, .csa h3 {
  font-family: inherit;
  color: inherit;
  line-height: 1.15;
  margin: 0 0 0.6em;
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.csa h1 { font-family: var(--csa-display); font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: 0; line-height: 1.1; }
.csa h2 { font-family: var(--csa-display); font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: 0; }
.csa h3 { font-size: 1.2rem; margin-bottom: 0.45em; }
.csa p { margin: 0 0 1em; font-size: 1.25rem; line-height: 1.8; font-weight: 300; }
.csa ul, .csa ol { margin: 0; padding: 0; }
/* Links never break across lines; link text on the site is kept short enough for a phone. */
.csa a { color: var(--csa-accent-ink); text-decoration: underline; text-underline-offset: 0.15em; white-space: nowrap; }
.csa a:hover { color: var(--csa-accent); }

/* Keyboard users get an unmistakable focus ring everywhere: a dark outer ring with a white
   inner ring, so it contrasts on light and dark backgrounds alike. */
.csa a:focus-visible, .csa button:focus-visible, .csa select:focus-visible, .csa summary:focus-visible, .csa [tabindex]:focus-visible {
  outline: 3px solid #0b1020;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #ffffff;
  border-radius: 4px;
}

.csa-skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 1000;
  background: #0b1020;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.csa-skip:focus { left: 8px; outline: 3px solid #ffffff; outline-offset: 2px; box-shadow: 0 0 0 5px #0b1020; }

.csa-wrap {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
}
.csa-measure { max-width: 62ch; }
.csa-measure-wide { max-width: 78ch; }

.csa-section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.csa-section-tint { background: var(--csa-tint); }
.csa-section-dark { background: var(--csa-ink); color: var(--csa-on-dark); }
.csa-section-dark a { color: var(--csa-cyan); }
.csa-section-dark .csa-lead { color: var(--csa-on-dark); }

.csa-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--csa-accent-ink);
  margin: 0 0 0.9rem;
}
.csa-section-dark .csa-eyebrow, .csa-hero .csa-eyebrow { color: var(--csa-cyan); }

.csa-lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--csa-muted);
  max-width: 62ch;
}

/* ---------- hero */
.csa-hero {
  position: relative;
  color: var(--csa-on-dark);
  background-color: var(--csa-ink);
  background-image:
    linear-gradient(180deg, rgba(11, 16, 32, 0.72) 0%, rgba(11, 16, 32, 0.86) 60%, rgba(11, 16, 32, 0.97) 100%),
    url("images/CSA-Banner.jpg");
  background-size: cover;
  background-position: 50% 35%;
  padding: clamp(4.5rem, 11vw, 9rem) 0 clamp(3.5rem, 7vw, 6rem);
}
.csa-hero-inner { max-width: 60rem; }
.csa-hero h1 { color: #fff; max-width: 20ch; }
.csa-hero .csa-lead { color: var(--csa-on-dark); font-size: 1.25rem; max-width: 58ch; margin-bottom: 1.8rem; }
/* Qualified with the element so it outranks the generic .csa p margin reset. */
.csa p.csa-hero-note { color: var(--csa-on-dark-muted); font-size: 0.95rem; margin: 2.5rem 0 0; max-width: 60ch; }

/* ---------- buttons */
.csa-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.csa-btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1.2;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
/* Written as `.csa a.csa-btn-*` on purpose: `.csa a` (0,1,1) outranks a lone class (0,1,0),
   so without the element in the selector the link colour wins and the primary button renders
   blue text on a blue background. The dark-section link colour has the same specificity. */
.csa a.csa-btn, .csa a.csa-btn:hover, .csa a.csa-btn:focus-visible { text-decoration: none; }
.csa a.csa-btn-primary { background: var(--csa-accent); color: #fff; border-color: var(--csa-accent); }
.csa a.csa-btn-primary:hover, .csa a.csa-btn-primary:focus-visible { background: #1f4fa8; border-color: #1f4fa8; color: #fff; }
.csa a.csa-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.csa a.csa-btn-ghost:hover, .csa a.csa-btn-ghost:focus-visible { background: rgba(255, 255, 255, 0.1); border-color: #fff; color: #fff; }

/* ---------- layout primitives */
.csa-grid { display: grid; gap: 1.25rem; list-style: none; }
.csa-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.csa-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.csa-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2.5rem;
  align-items: start;
}

.csa-card {
  background: var(--csa-paper);
  border: 1px solid var(--csa-line);
  border-radius: 10px;
  padding: 1.5rem 1.5rem 1.1rem;
}
.csa-card p:last-child { margin-bottom: 0; }
.csa-card-list h3 { margin-bottom: 0.9rem; }

/* Numbered function cards: the counter is the ordinal, so the list stays an <ol>.
   Six cards sit as two rows of three at desktop. */
.csa-domains { counter-reset: csa-domain; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.csa-count {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--csa-muted);
  margin: -0.2rem 0 0.7rem;
}
.csa-domains > li { position: relative; padding-top: 1.6rem; }
.csa-domains > li::before {
  counter-increment: csa-domain;
  content: counter(csa-domain, decimal-leading-zero);
  position: absolute;
  top: 0.9rem;
  right: 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--csa-muted);
}

/* ---------- check / cross lists */
.csa-checks, .csa-crosses, .csa-never, .csa-reasons { list-style: none; }
.csa-checks li, .csa-crosses li, .csa-never li, .csa-reasons li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.7rem;
}
.csa-checks li::before, .csa-crosses li::before, .csa-never li::before {
  position: absolute;
  left: 0;
  top: 0.05em;
  font-weight: 700;
  line-height: 1.5;
}
.csa-checks li::before { content: "\2713"; color: var(--csa-ok); }
.csa-crosses li::before { content: "\00D7"; color: var(--csa-no); font-size: 1.15em; top: -0.05em; }
.csa-never li::before { content: "\2014"; color: var(--csa-cyan); }
.csa-never li { font-size: 1.1rem; margin-bottom: 0.9rem; max-width: 62ch; }
.csa-reasons li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.65em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--csa-accent);
}
.csa-reasons strong { color: var(--csa-text); }

/* ---------- steps */
.csa-steps {
  list-style: none;
  counter-reset: csa-step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.csa-steps > li {
  position: relative;
  padding-top: 3.2rem;
  border-top: 1px solid var(--csa-line);
}
.csa-steps > li::before {
  counter-increment: csa-step;
  content: counter(csa-step);
  position: absolute;
  top: 0.9rem;
  left: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--csa-ink);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}
.csa-steps p:last-child { margin-bottom: 0; }

/* ---------- about */
.csa-about {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 2.5rem;
  align-items: start;
}
.csa-portrait {
  width: 100%;
  height: auto;
  max-width: 260px;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 20%;
  border: 4px solid var(--csa-paper);
  box-shadow: 0 6px 24px rgba(11, 16, 32, 0.12);
}
@media (max-width: 640px) {
  .csa-about { grid-template-columns: 1fr; }
  .csa-portrait { max-width: 180px; }
}

/* ---------- faq */

/* ---------- contact */
.csa-contact .csa-actions { margin: 1.5rem 0 2rem; }
.csa-contact strong { color: #fff; word-break: break-all; }
.csa-fine {
  font-size: 0.85rem;
  color: var(--csa-on-dark-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1.2rem;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .csa-btn { transition: none; }
}

/* ---------- top bar (replaces the Nicepage menu; no dependency on nicepage.js) */
.csa-topbar { background: var(--csa-ink); color: var(--csa-on-dark); padding: 0.85rem 0; }
.csa-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
/* Written as `.csa a.csa-brand` for the same reason as the buttons: `.csa a` (0,1,1)
   outranks a lone class and would paint the brand link blue and underlined on the dark bar. */
.csa a.csa-brand { color: #fff; text-decoration: none; font-family: var(--csa-display); font-weight: 700; letter-spacing: 0.01em; font-size: 1.25rem; line-height: 1; }
.csa a.csa-brand:hover, .csa a.csa-brand:focus-visible { color: var(--csa-cyan); }
/* On a phone the hero's own button sits one line below the bar; a second one only costs height. */
@media (max-width: 480px) {
  .csa-topbar .csa-btn-small { display: none; }
  .csa-topbar-inner { justify-content: center; }
}
.csa a.csa-btn-small { padding: 0.55rem 1rem; font-size: 0.9rem; }

/* ---------- ways to work with me: four rungs, most to least involved */
.csa-ladder { list-style: none; counter-reset: csa-rung; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.25rem; }
.csa-ladder > li.csa-card { position: relative; padding-left: 4.4rem; }
.csa-ladder > li::before {
  counter-increment: csa-rung;
  content: counter(csa-rung);
  position: absolute;
  left: 1.4rem;
  top: 1.5rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--csa-ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}
.csa-ladder h3 { margin-bottom: 0.2rem; }
.csa-price { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--csa-muted); margin: 0 0 0.6rem; }
.csa-ladder .csa-card p { margin-bottom: 0.45em; }
.csa-ladder p:last-child { margin-bottom: 0; }
.csa-ladder .csa-actions { margin-top: 0.8rem; }

/* ---------- FAQ as expandable pills. Native <details>: keyboard-accessible, no script. */
.csa-faq { display: grid; gap: 0.6rem; margin-top: 1rem; }
.csa-faq-item { border: 1px solid var(--csa-line); border-radius: 999px; background: var(--csa-paper); overflow: hidden; }
.csa-faq-item[open] { border-radius: 16px; }
.csa-faq-item summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 0.85rem 3rem 0.85rem 1.25rem; font-weight: 700; line-height: 1.35;
}
.csa-faq-item summary::-webkit-details-marker { display: none; }
.csa-faq-item summary::after {
  content: "+" / ""; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--csa-tint);
  color: var(--csa-accent-ink); font-weight: 700; display: grid; place-items: center;
}
.csa-faq-item[open] summary::after { content: "2" / ""; }
.csa-faq-item summary:hover { background: var(--csa-tint); }
.csa-faq-item summary:focus-visible { outline: 3px solid #0b1020; outline-offset: -3px; }
.csa-faq-item > div { padding: 0 1.25rem 1rem; }
.csa-faq-item > div p { margin: 0; }

/* ---------- mini-assessment page */
/* Generous spacing on purpose: ten questions in a row read as a wall without it. */
.csa-q { border: 1px solid var(--csa-line); border-radius: 12px; padding: 1.5rem 1.5rem 1.4rem; margin: 0 0 2rem; background: var(--csa-paper); }
.csa-q-meta { font-weight: 700; color: var(--csa-accent-ink); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 0.8rem; }
/* The statement is the <label> for its dropdown, so it must render as a block. */
.csa-q-text { display: block; font-size: 1.15rem; line-height: 1.5; margin-bottom: 1rem; }
.csa-select {
  display: block; width: min(100%, 26rem); padding: 0.7rem 2.4rem 0.7rem 0.9rem;
  font: inherit; font-size: 1rem; color: var(--csa-text); background: var(--csa-paper);
  border: 1px solid var(--csa-line); border-radius: 8px; cursor: pointer;
}
.csa-select:focus-visible { outline: 3px solid #0b1020; outline-offset: 2px; box-shadow: 0 0 0 2px #ffffff; border-color: var(--csa-accent); }
#csa-form-title + .csa-lead { margin-bottom: 2rem; }
.csa-form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 2.25rem; }
.csa-form-note { color: var(--csa-muted); font-size: 0.95rem; }
.csa-error { color: var(--csa-no); font-weight: 700; margin: 1.5rem 0 0; }
.csa-result { margin-top: 2.75rem; }
.csa-result[hidden] { display: none; }
.csa-result-card { border: 1px solid var(--csa-line); border-radius: 12px; padding: 1.5rem; background: var(--csa-paper); }
.csa-overall { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; line-height: 1; margin: 0.3rem 0 0.2rem; font-variant-numeric: tabular-nums; }
.csa-overall small { font-size: 1rem; font-weight: 400; color: var(--csa-muted); }
/* Scoped under .csa-result so it outranks the generic .csa ul margin reset. */
.csa-result .csa-func-list { list-style: none; display: grid; gap: 0.7rem; margin: 1.2rem 0 2.25rem; }
.csa-func-row { display: grid; grid-template-columns: 6.5rem 1fr 3rem; align-items: center; gap: 0.75rem; }
.csa-func-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.csa-bar { height: 0.6rem; background: var(--csa-tint); border-radius: 999px; overflow: hidden; border: 1px solid var(--csa-line); }
.csa-bar-fill { display: block; height: 100%; background: var(--csa-accent); border-radius: 999px; width: 0; }
.csa-fill-0 { width: 0; } .csa-fill-1 { width: 10%; } .csa-fill-2 { width: 20%; } .csa-fill-3 { width: 30%; }
.csa-fill-4 { width: 40%; } .csa-fill-5 { width: 50%; } .csa-fill-6 { width: 60%; } .csa-fill-7 { width: 70%; }
.csa-fill-8 { width: 80%; } .csa-fill-9 { width: 90%; } .csa-fill-10 { width: 100%; }
.csa-result .csa-actions { margin-top: 1.4rem; }

/* Form buttons are <button>, not <a>; the primary/ghost rules above are anchor-specific
   on purpose, so the button variants are declared here with matching specificity. */
.csa button.csa-btn { font-family: inherit; font-size: inherit; cursor: pointer; }
.csa button.csa-btn-primary { background: var(--csa-accent); color: #fff; border-color: var(--csa-accent); }
.csa button.csa-btn-primary:hover, .csa button.csa-btn-primary:focus-visible { background: #1f4fa8; border-color: #1f4fa8; color: #fff; }
/* A ghost button for light backgrounds (the dark-background ghost is white on white here). */
.csa a.csa-btn-ghost-light, .csa button.csa-btn-ghost-light { background: transparent; color: var(--csa-ink); border-color: var(--csa-ink); }
.csa a.csa-btn-ghost-light:hover, .csa button.csa-btn-ghost-light:hover { background: var(--csa-ink); color: #fff; }
.csa a.csa-btn-link { font-weight: 700; }

/* Deep-link targets (public anchors used from other sites). */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.csa [id] { scroll-margin-top: 1.5rem; }
/* A section anchor lands on the section's own eyebrow, not on the padding above it. */
.csa-section[id] { scroll-margin-top: calc(1.5rem - clamp(3rem, 6vw, 5.5rem)); }
.csa .csa-card:target, .csa .csa-faq-item:target { outline: 3px solid #0b1020; outline-offset: 4px; box-shadow: 0 0 0 2px #ffffff; }

/* Legal pages: plain document rhythm. */
.csa-legal h1 { margin-bottom: 0.5em; }
.csa-legal h2 { font-size: 1.35rem; margin-top: 2.25rem; }
.csa-legal .csa-list { padding-left: 1.25rem; display: grid; gap: 0.6rem; margin-bottom: 1em; }
.csa-legal .csa-actions { margin-top: 2.5rem; }

/* Never break the contact address across lines. */
.csa-nowrap { white-space: nowrap; font-size: max(0.7em, min(1em, 4.3vw)); }
/* Buttons that follow a checklist get clear air above them. */
.csa-checks + .csa-actions, .csa-crosses + .csa-actions { margin-top: 2.25rem; }

/* Phone layout for the ladder: links never wrap, so the widest button or link in a card has to
   fit the column. Below 400px the rung number sits above the title instead of in a gutter, the
   cards lose some padding, and the base size steps down one notch. */
@media (max-width: 400px) {
  .csa { font-size: 1rem; }
  .csa .csa-card { padding: 1rem; }
  .csa-ladder > li.csa-card { padding-left: 1rem; padding-top: 3.4rem; }
  .csa-ladder > li::before { left: 1rem; top: 1rem; }
  .csa-ladder .csa-card p { font-size: 1.05rem; }
}


/* The certification name is long; keep it on one line by scaling it on narrow screens. */
.csa a.csa-fit { display: inline-block; white-space: nowrap; font-size: max(0.6em, min(1em, 3.55vw)); }

/* Self-check: an unrated question is marked in place, not only counted. */
.csa-q-note { color: var(--csa-no); font-weight: 700; margin: 0.6rem 0 0; font-size: 1rem; }
.csa-q-missing { border-color: var(--csa-no); }
.csa-q-missing .csa-select { border-color: var(--csa-no); }
/* The result region is always in the accessibility tree; it only takes space once filled. */
.csa-result:empty { display: none; }
.csa-result:focus { outline: none; }
.csa-result-title { font-family: inherit; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--csa-accent-ink); margin: 0 0 0.9rem; }

/* Footer, in the site's own markup. */
.csa-footer { background: #000; color: #fff; text-align: center; padding: 1.25rem 0 2rem; }
.csa-footer p { margin: 0; font-size: 0.8rem; line-height: 1.4; font-weight: 400; }
.csa-footer-links { margin-bottom: 0.2rem; }
.csa.csa-footer a { color: #d9dce6; text-decoration: none; display: inline-block; padding: 0.15rem 0.8rem; min-height: 24px; }
.csa.csa-footer a:hover { color: #fff; text-decoration: underline; }
.csa.csa-footer .csa-footer-credit a { color: #fff; font-weight: 700; }
.csa.csa-footer a:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; box-shadow: 0 0 0 5px #0b1020; }
