/*
Theme Name: StatsAlly
Theme URI: https://example.test/statsally
Author: StatsAlly
Description: A fast, accessible WordPress theme for statistical consulting and quantitative research support.
Version: 2.2.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: statsally
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog, education
*/

:root {
  --ink: #102a43;
  --ink-2: #334e68;
  --muted: #627d98;
  --line: #d9e2ec;
  --surface: #ffffff;
  --surface-2: #f5f9f8;
  --surface-3: #e5f4ef;
  --brand: #08736a;
  --brand-dark: #055f58;
  --accent: #efa928;
  --danger: #b42318;
  --success: #067647;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(16, 42, 67, .10);
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .65em; line-height: 1.12; letter-spacing: -.025em; }
h1 { font-size: clamp(2.75rem, 4vw, 4rem); line-height: 1.06; }
h2 { font-size: clamp(1.9rem, 2.6vw, 2.625rem); }
h3 { font-size: clamp(1.2rem, 1.45vw, 1.375rem); line-height: 1.22; }
p { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.3rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { width: auto; height: auto; padding: .8rem 1rem; margin: 0; clip: auto; white-space: normal; }

.container { width: min(calc(100% - 2rem), var(--container)); margin-inline: auto; }
.narrow { width: min(calc(100% - 2rem), 780px); margin-inline: auto; }
.section { padding: clamp(3.5rem, 6vw, 6rem) 0; }
.section--soft { background: var(--surface-2); }
.section--dark { color: white; background: var(--ink); }
.section--dark a { color: #b9f3e8; }
.section-heading { max-width: 760px; margin-bottom: 2.5rem; }
.section-heading.center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-flex; gap: .45rem; align-items: center; margin-bottom: .75rem; color: var(--brand); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.section--dark .eyebrow { color: #8de2d2; }
.lead { color: var(--ink-2); font-size: clamp(1.05rem, 1.5vw, 1.2rem); }
.section--dark .lead { color: #d9e7ef; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cluster { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

.skip-link { position: fixed; left: 1rem; top: -10rem; z-index: 9999; padding: .8rem 1rem; color: white; background: var(--ink); border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(217,226,236,.85); backdrop-filter: blur(14px); }
.header-inner { min-height: 76px; display: flex; gap: 1.25rem; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.brand-logo { width: auto; max-width: 190px; max-height: 48px; object-fit: contain; }
.custom-logo { max-height: 48px; width: auto; }
.primary-nav { display: flex; align-items: center; gap: 1.3rem; }
.primary-nav-list { display: flex; gap: 1.15rem; align-items: center; margin: 0; padding: 0; list-style: none; }
.primary-nav a { color: var(--ink); font-size: .95rem; font-weight: 600; text-decoration: none; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--brand); }
.primary-nav-item { position: relative; }
.primary-nav-item--services::after { content: ""; position: absolute; top: 100%; left: -.9rem; right: -.9rem; height: .8rem; }
.primary-nav-service-trigger { display: inline-flex; align-items: center; gap: .2rem; }
.subnav-toggle { width: 32px; min-height: 32px; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 8px; }
.subnav-toggle span[aria-hidden="true"] { display: block; width: 8px; height: 8px; margin: 0 auto 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .18s; }
.subnav-toggle[aria-expanded="true"] span[aria-hidden="true"] { margin-bottom: -2px; transform: rotate(225deg); }
.service-subnav { position: absolute; top: calc(100% + .8rem); left: -.9rem; z-index: 20; display: none; width: min(320px, calc(100vw - 2rem)); padding: .65rem; margin: 0; background: white; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); list-style: none; }
.primary-nav-item--services:hover .service-subnav, .primary-nav-item--services:focus-within .service-subnav, .service-subnav.is-open { display: grid; gap: .15rem; }
.service-subnav a { display: block; padding: .65rem .75rem; border-radius: 8px; }
.service-subnav a:hover, .service-subnav a:focus-visible { background: var(--surface-3); }
.service-subnav__intro { padding-bottom: .35rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); }
.service-subnav__intro a { color: var(--brand-dark); }
.service-subnav small { display: block; margin-top: .15rem; color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.35; }
.mobile-nav-note { display: none; }
.mobile-nav-cta { display: none; }
.nav-toggle { display: none; width: 46px; height: 46px; padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; }
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { content: ""; display: block; width: 22px; height: 2px; margin: 5px auto; background: currentColor; transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle span { opacity: 0; }
.nav-open .nav-toggle::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle::after { transform: translateY(-7px) rotate(-45deg); }

.button, .wp-block-button__link, input[type="submit"] { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: .78rem 1.25rem; color: white; background: var(--brand); border: 1px solid var(--brand); border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; transition: transform .18s, background .18s, box-shadow .18s; }
.button:hover, .wp-block-button__link:hover, input[type="submit"]:hover { color: white; background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(8,115,106,.22); }
.button--accent { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.button--accent:hover { color: var(--ink); background: #f7b941; }
.button--ghost { color: var(--ink); background: white; border-color: var(--line); }
.button--ghost:hover { color: var(--brand); background: white; border-color: var(--brand); }
.button--small { min-height: 40px; padding: .55rem .95rem; font-size: .9rem; }

.hero { position: relative; overflow: hidden; padding: clamp(4.5rem, 9vw, 8rem) 0; background: linear-gradient(130deg, #e3f5f0 0%, #f8fbfa 55%, #fff4dc 100%); }
.hero::before { content: ""; position: absolute; width: 520px; height: 520px; right: -220px; top: -210px; background: radial-gradient(circle, rgba(239,169,40,.27), transparent 68%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero h1 span { color: var(--brand); }
.hero-copy { max-width: 720px; }
.hero-actions { margin: 2rem 0 1.4rem; }
.trust-line { display: flex; flex-wrap: wrap; gap: .8rem 1.3rem; margin-top: 1.5rem; color: var(--ink-2); font-size: .92rem; font-weight: 700; }
.trust-line span::before { content: "✓"; margin-right: .4rem; color: var(--brand); }
.hero-card { position: relative; padding: clamp(1.4rem, 3vw, 2.2rem); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; inset: 12px -12px -12px 12px; z-index: -1; background: var(--brand); border-radius: 24px; opacity: .12; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .8rem; margin-top: 1.25rem; }
.mini-stat { padding: 1rem; background: var(--surface-2); border-radius: 12px; }
.mini-stat strong { display: block; font-size: 1.35rem; }
.cta-assurance { margin: .85rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.section--dark .cta-assurance, .cta .cta-assurance { color: #d9e7ef; }
.hero-route-card { padding: clamp(1.5rem, 3vw, 2rem); background: rgba(255,255,255,.97); border: 1px solid rgba(8,115,106,.18); border-radius: 20px; box-shadow: var(--shadow); }
.hero-route-card h2 { font-size: clamp(1.55rem, 2.4vw, 2.15rem); }
.hero-route-list { display: grid; gap: .75rem; padding: 0; margin: 1.2rem 0; list-style: none; }
.hero-route-list li { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: .75rem; padding: .75rem; background: var(--surface-2); border-radius: 10px; }
.hero-route-list strong { color: var(--brand-dark); }
.hero-route-list span { color: var(--ink-2); font-size: .9rem; line-height: 1.45; }
.path-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.25rem; }
.path-card { display: flex; flex-direction: column; min-height: 280px; padding: 1.5rem; background: white; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius); box-shadow: 0 9px 30px rgba(16,42,67,.05); }
.path-card p { color: var(--ink-2); }
.path-card .button { align-self: flex-start; margin-top: auto; }
.audience-list { display: grid; gap: .75rem; }
.audience-list > div { display: grid; gap: .25rem; padding: 1rem 1.1rem; background: white; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); }
.audience-list strong { color: var(--brand-dark); }
.audience-list span { color: var(--ink-2); font-size: .94rem; }

.card { padding: 1.5rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 9px 30px rgba(16,42,67,.05); }
.card:hover { border-color: #afd9d1; box-shadow: var(--shadow); }
.card-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 1rem; color: white; background: var(--brand); border-radius: 14px; font-size: 1.35rem; font-weight: 900; }
.card ul { margin-bottom: 0; color: var(--ink-2); }
.service-card { display: flex; flex-direction: column; }
.service-card .button { margin-top: auto; align-self: flex-start; }
.process-card { position: relative; padding-top: 4.2rem; }
.step-number { position: absolute; left: 1.5rem; top: 1.3rem; width: 40px; height: 40px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 50%; font-weight: 900; }
.team-card { overflow: hidden; padding: 0; }
.team-avatar { min-height: 220px; display: grid; place-items: center; background: linear-gradient(145deg, var(--surface-3), #fff4dc); }
.team-avatar span { width: 112px; height: 112px; display: grid; place-items: center; color: white; background: var(--brand); border: 8px solid rgba(255,255,255,.7); border-radius: 50%; font-size: 2rem; font-weight: 900; }
.team-body { padding: 1.4rem; }
.stars { color: #d88700; letter-spacing: .1em; }
.quote { font-size: 1.05rem; }
.review-meta { display: flex; gap: .8rem; align-items: center; margin-top: 1.4rem; }
.review-avatar { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 50%; font-weight: 900; }
.stats-band { padding: 2rem 0; color: white; background: var(--brand); }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; text-align: center; }
.stats-grid strong { display: block; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.faq details { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 800; }
.faq details p { margin: .8rem 0 0; color: var(--ink-2); }
.cta { padding: clamp(2rem, 5vw, 4rem); color: white; background: linear-gradient(130deg, var(--ink), #184e62); border-radius: 28px; }

.page-hero { padding: clamp(3.5rem, 7vw, 6rem) 0; background: linear-gradient(130deg, var(--surface-3), #fff); }
.breadcrumbs { margin-bottom: 1.2rem; color: var(--muted); font-size: .88rem; }
.breadcrumbs a { color: inherit; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: start; }
.prose { font-size: 1.05rem; }
.prose h2, .prose h3 { margin-top: 1.5em; }
.prose > *:first-child { margin-top: 0; }
.sidebar { position: sticky; top: 100px; }
.price-card { position: relative; }
.price-card.featured { border: 2px solid var(--brand); transform: translateY(-10px); }
.badge { display: inline-flex; padding: .25rem .65rem; color: var(--brand-dark); background: var(--surface-3); border-radius: 999px; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.price { margin: .5rem 0; font-size: 2.3rem; font-weight: 900; letter-spacing: -.04em; }
.price small { color: var(--muted); font-size: .9rem; font-weight: 500; }
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; }
.contact-next-steps { display: grid; gap: 1rem; padding: 0; margin: 1.25rem 0 0; list-style: none; counter-reset: contact-step; }
.contact-next-steps li { position: relative; padding-left: 2.5rem; counter-increment: contact-step; }
.contact-next-steps li::before { content: counter(contact-step); position: absolute; left: 0; top: .1rem; display: grid; width: 1.75rem; height: 1.75rem; place-items: center; color: white; background: var(--brand); border-radius: 50%; font-size: .8rem; font-weight: 700; }
.contact-next-steps strong, .contact-next-steps span { display: block; }
.contact-next-steps span { margin-top: .15rem; color: var(--ink-2); font-size: .92rem; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field--full { grid-column: 1 / -1; }
label { color: var(--ink); font-size: .92rem; font-weight: 800; }
input[type="text"], input[type="email"], input[type="search"], select, textarea { width: 100%; min-height: 48px; padding: .7rem .8rem; color: var(--ink); background: white; border: 1px solid #bcccdc; border-radius: 9px; }
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(239,169,40,.8); outline-offset: 3px; border-color: var(--brand); }
.honeypot { position: absolute; left: -10000px; }
.notice { padding: 1rem 1.1rem; margin-bottom: 1rem; border-radius: 10px; font-weight: 700; }
.notice--success { color: var(--success); background: #ecfdf3; border: 1px solid #abefc6; }
.notice--error { color: var(--danger); background: #fef3f2; border: 1px solid #fecdca; }

.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.4rem; }
.post-card { overflow: hidden; padding: 0; }
.post-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--brand), var(--ink)); font-size: 2rem; font-weight: 900; }
.post-body { padding: 1.4rem; }
.post-meta { color: var(--muted); font-size: .85rem; }
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; gap: .5rem; }
.page-numbers { min-width: 42px; min-height: 42px; display: grid; place-items: center; padding: .4rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.page-numbers.current { color: white; background: var(--brand); border-color: var(--brand); }
.comments-area { margin-top: 3rem; }
.comment-list { padding: 0; list-style: none; }
.comment-body { padding: 1.2rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 12px; }

.site-footer { padding: 4rem 0 1.5rem; color: #d9e7ef; background: #0b2239; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3,1fr); gap: 2rem; }
.site-footer h3 { color: white; font-size: 1rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer a { color: #d9e7ef; text-decoration: none; }
.site-footer a:hover { color: white; }
.site-footer .brand-logo { filter: brightness(0) invert(1); opacity: .98; }
.footer-contact { display: grid; gap: .25rem; margin: 1rem 0; font-style: normal; }
.footer-contact a { width: fit-content; text-decoration: underline; text-underline-offset: .18em; }
.footer-bottom { display: flex; gap: 1rem; justify-content: space-between; margin-top: 3rem; padding-top: 1.3rem; border-top: 1px solid rgba(255,255,255,.16); color: #9fb3c8; font-size: .86rem; }

/* Quantitative decision and routing components. */
.hero-decision-map {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(8,115,106,.16);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.map-node, .map-result { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px; }
.map-node { background: var(--surface-3); }
.map-result { color: white; background: var(--ink); border-color: var(--ink); }
.map-node small, .map-result small { display: block; margin-bottom: .15rem; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.map-branches { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; height: 26px; }
.map-branches i { border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); }
.map-branches i:last-child { border-right: 2px solid var(--brand); border-left: 0; }
.map-options { display: grid; grid-template-columns: repeat(3,1fr); gap: .65rem; }
.map-options span { padding: .7rem .5rem; background: #fff8e9; border: 1px solid #f4d99f; border-radius: 10px; font-size: .84rem; font-weight: 800; text-align: center; }

.stage-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.stage-card { position: relative; min-height: 210px; padding: 1.4rem 3rem 1.4rem 1.4rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s; }
.stage-card:hover { color: var(--ink); border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-3px); }
.stage-card > span { display: inline-block; margin-bottom: 1rem; color: var(--brand); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.stage-card b { position: absolute; right: 1.4rem; bottom: 1.2rem; color: var(--brand); font-size: 1.4rem; }
.stage-grid--five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.stage-grid--five .stage-card { min-height: 190px; }
.discipline-links, .resource-topics { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.5rem 0; }
.discipline-links a, .resource-topics a { padding: .45rem .85rem; color: var(--brand-dark); background: white; border: 1px solid #b8dcd6; border-radius: 999px; font-weight: 800; text-decoration: none; }
.discipline-links a:hover, .resource-topics a:hover { border-color: var(--brand); }
.text-link { font-weight: 700; text-decoration-thickness: .09em; text-underline-offset: .2em; }
.stage-card:focus-visible, .related-link:focus-visible, .discipline-links a:focus-visible, .resource-topics a:focus-visible { outline: 3px solid rgba(239,169,40,.8); outline-offset: 3px; }

.decision-matrix { display: grid; grid-template-columns: .9fr 1.1fr 1.2fr; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.decision-matrix > div { padding: .9rem 1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.decision-matrix > div:nth-child(3n) { border-right: 0; }
.decision-matrix > div:nth-last-child(-n+3) { border-bottom: 0; }
.decision-matrix .matrix-head { color: white; background: var(--ink); font-size: .82rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.method-map { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); }
.method-map > div { padding: 1.25rem; background: white; }
.method-map h3 { color: var(--brand-dark); font-size: 1rem; }
.method-map p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.software-strip { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-top: 1.2rem; padding: 1rem 1.2rem; background: white; border: 1px solid var(--line); border-radius: 12px; }
.software-strip span { padding: .2rem .55rem; color: var(--muted); background: var(--surface-2); border-radius: 6px; font-weight: 700; }
.judgment-path { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; align-self: center; }
.judgment-path span { padding: .65rem .8rem; color: var(--ink); background: white; border-radius: 8px; font-weight: 850; }
.judgment-path b { color: var(--accent); }
.section-action { margin-top: 2rem; }

.service-list { display: grid; gap: 1.2rem; }
.service-row { display: grid; grid-template-columns: 64px minmax(0,1fr) minmax(0,1fr); gap: 1.5rem; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); }
.service-row h2 a { color: var(--ink); text-decoration: none; }
.service-row h2 a:hover { color: var(--brand); }
.service-index { width: 52px; height: 52px; display: grid; place-items: center; color: white; background: var(--brand); border-radius: 14px; font-weight: 900; }
.content-section { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.content-section:last-child { border-bottom: 0; }
.check-list { padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 1.7rem; margin-bottom: .55rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 900; }
.check-list--stop li::before { content: "×"; color: var(--danger); }
.decision-graphic { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; justify-content: center; padding: 2rem; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.decision-graphic span { padding: .55rem .7rem; color: var(--brand-dark); background: var(--surface-3); border-radius: 8px; font-weight: 850; }
.decision-graphic i { color: var(--accent); font-style: normal; font-weight: 900; }
.decision-graphic--compact { box-shadow: none; }
.evidence-card { border-top: 5px solid var(--accent); }
.mini-flow { counter-reset: flow; padding: 0; list-style: none; }
.mini-flow li { position: relative; padding: .65rem .7rem .65rem 2.5rem; margin-bottom: .45rem; background: var(--surface-2); border-radius: 8px; }
.mini-flow li::before { counter-increment: flow; content: counter(flow); position: absolute; left: .65rem; width: 1.25rem; height: 1.25rem; display: grid; place-items: center; color: white; background: var(--brand); border-radius: 50%; font-size: .72rem; font-weight: 900; }
.synthetic-note, .confidentiality-note { padding: .85rem 1rem; color: #5b4616; background: #fff8e9; border: 1px solid #f2d28c; border-radius: 9px; font-size: .9rem; }
.confidentiality-note { max-width: 900px; margin-top: 1.5rem; }
.related-links > h2 { margin-bottom: 1.2rem; }
.related-link { display: flex; flex-direction: column; gap: .45rem; min-height: 145px; padding: 1.3rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.related-link:hover { color: var(--brand-dark); border-color: var(--brand); }
.related-link span { color: var(--brand); font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.case-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; gap: 1rem; align-items: end; margin-bottom: 2rem; padding: 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.filter-field { display: flex; flex-direction: column; gap: .3rem; }
.case-visual { aspect-ratio: 16/10; display: grid; grid-template-columns: 1fr repeat(3,.5fr); gap: .5rem; align-items: end; margin: -1.5rem -1.5rem 1.2rem; padding: 1.3rem; color: white; background: linear-gradient(135deg,var(--ink),var(--brand)); border-radius: var(--radius) var(--radius) 0 0; }
.case-visual span { align-self: start; font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.case-visual b { display: block; height: 35%; background: rgba(255,255,255,.5); border-radius: 4px 4px 0 0; }
.case-visual b:nth-child(3) { height: 62%; }
.case-visual b:nth-child(4) { height: 88%; background: var(--accent); }
.case-card { overflow: hidden; display: flex; flex-direction: column; }
.case-card .text-link { margin-top: auto; }
.meta-chips { margin-bottom: .8rem; }
/* WordPress-native case-study archive and report. */
.case-archive-hero .lead { max-width: 850px; }
.case-filter-actions { display: flex; gap: .85rem; align-items: center; padding-bottom: .1rem; }
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.case-card { padding: 0; }
.case-card .case-visual { margin: 0; border-radius: var(--radius) var(--radius) 0 0; }
.case-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.5rem; }
.case-card-image { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.case-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.case-card-image:hover img { transform: scale(1.02); }
.case-card h2 { font-size: 1.45rem; }
.case-card h2 a { color: var(--ink); text-decoration: none; }
.case-card h2 a:hover { color: var(--brand); }
.case-card-body > .text-link { margin-top: auto; }
.meta-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge--stage { color: #5b4616; background: #fff4dc; }
.badge--reproducible { color: #05603a; background: #dcfae6; }
.case-card-details { display: grid; gap: .45rem; margin: 0 0 1rem; color: var(--ink-2); font-size: .9rem; }
.case-card-details div { display: grid; grid-template-columns: 76px 1fr; gap: .5rem; }
.case-card-details dt, .case-details dt { font-weight: 850; }
.case-card-details dd, .case-details dd { margin: 0; }
.case-evidence-label { padding-top: .8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; font-weight: 750; }
.case-empty-state { max-width: 780px; padding: clamp(2rem, 6vw, 4rem); margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 24px; text-align: center; }
.case-empty-state .cluster { justify-content: center; }

.case-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 3rem; align-items: start; }
.case-hero h1 { max-width: 850px; }
.case-disclosure { padding: 1.5rem; background: rgba(255,255,255,.92); border: 1px solid #f2d28c; border-top: 5px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.case-disclosure h2 { font-size: 1.35rem; }
.case-disclosure p:last-child { margin-bottom: 0; }
.case-layout { display: grid; grid-template-columns: minmax(0, 820px) minmax(280px, 320px); gap: clamp(2rem, 5vw, 4rem); justify-content: center; align-items: start; }
.case-report { min-width: 0; font-size: 1.06rem; line-height: 1.78; }
.case-report h2 { margin-top: 1.8em; scroll-margin-top: 110px; }
.case-report h3 { margin-top: 1.65em; scroll-margin-top: 110px; }
.case-report h4, .case-report h5, .case-report h6 { margin-top: 1.5em; scroll-margin-top: 110px; }
.case-report > *:first-child { margin-top: 0; }
.case-report img, .case-featured-image img { width: auto; max-width: 100%; height: auto; }
.case-featured-image, .case-report .wp-block-image { margin: 0 0 2rem; }
.case-report figcaption { margin-top: .65rem; color: var(--muted); font-size: .88rem; line-height: 1.5; text-align: center; }
.case-report .wp-block-table { max-width: 100%; margin: 2rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.case-report table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .94rem; }
.case-report th, .case-report td { padding: .75rem .85rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.case-report th { color: white; background: var(--ink); }
.case-report tbody tr:nth-child(even) { background: var(--surface-2); }
.case-sidebar { position: sticky; top: 100px; display: grid; gap: 1rem; }
.case-utility { padding: 1.25rem; }
.case-utility h2 { font-size: 1.3rem; }
.reproducibility-status { padding: .65rem .75rem; color: var(--success); background: #ecfdf3; border-radius: 8px; font-weight: 800; }
.case-file-list { display: grid; gap: .65rem; padding: 0; margin: 0; list-style: none; }
.case-file-list li { padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.case-file-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.case-file-list a { display: block; font-weight: 800; overflow-wrap: anywhere; }
.case-file-list span { display: block; margin-top: .15rem; color: var(--muted); font-size: .78rem; }
.case-details { display: grid; gap: .85rem; margin: 0; }
.case-details div { display: grid; gap: .15rem; }
.case-details dd { color: var(--ink-2); }
.case-related .related-link { height: 100%; }

.engagement-steps { display: grid; gap: 1rem; }
.engagement-steps .card { position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 1rem; padding-left: 1.2rem; }
.engagement-steps .step-number { position: static; }
.study-timeline { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.study-timeline a, .study-timeline span:nth-child(4n+1) { padding: .5rem .7rem; background: var(--surface-3); border-radius: 8px; font-weight: 800; text-decoration: none; }
.study-timeline > span { color: var(--muted); }
.dark-card { color: var(--ink); }
.privacy-card { margin-top: 1rem; border-top: 5px solid var(--danger); }
.check-label { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.check-label input { margin-top: .4rem; }
.methodological-note { margin-top: 3rem; }

@media (max-width: 980px) {
  /* A backdrop filter creates a containing block for fixed descendants. Without
     this override, the mobile panel is sized against the 76px header instead
     of the viewport and can be obscured by the page. */
  .site-header { backdrop-filter: none; }
  .grid-4, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .contact-grid, .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav-toggle { display: block; }
  .primary-nav { position: fixed; inset: 76px 0 0; z-index: 1001; display: none; padding: 1.5rem; background: white; overflow: auto; }
  .nav-open .primary-nav { display: block; }
  .primary-nav-list { align-items: stretch; flex-direction: column; gap: 0; }
  .primary-nav-item { border-bottom: 1px solid var(--line); }
  .primary-nav a { display: block; padding: .85rem 0; font-size: 1.05rem; }
  .primary-nav-service-trigger { width: 100%; justify-content: space-between; }
  .primary-nav-item--services::after { content: none; }
  .subnav-toggle { width: 44px; min-height: 44px; }
  .service-subnav { position: static; width: auto; margin: 0 0 .75rem; box-shadow: none; }
  .primary-nav-item--services:hover .service-subnav { display: none; }
  .service-subnav.is-open, .primary-nav-item--services:focus-within .service-subnav { display: grid; }
  .service-subnav a { padding: .7rem .75rem; font-size: .96rem; }
  .mobile-nav-note { display: block; margin: 1.2rem 0 .8rem; color: var(--muted); font-size: .92rem; line-height: 1.45; }
  .primary-nav .mobile-nav-cta { display: inline-flex; width: 100%; margin-top: .25rem; padding: .78rem 1.25rem; color: var(--ink); }
  .header-cta { display: none; }
  .footer-grid { grid-template-columns: repeat(2,1fr); }
  .stage-grid, .stage-grid--five { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .method-map { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .service-row { grid-template-columns: 52px minmax(0,1fr); }
  .service-row > div:last-child { grid-column: 2; }
  .case-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .case-filters .button { justify-self: start; }
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-hero-grid, .case-layout { grid-template-columns: 1fr; }
  .case-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 0; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .posts-grid, .stats-grid, .form-grid, .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 3.25rem 0; }
  .hero { padding: 4rem 0; }
  .hero-actions .button { width: 100%; }
  .price-card.featured { transform: none; }
  .footer-bottom { flex-direction: column; }
  .stage-grid, .stage-grid--five, .method-map, .case-filters { grid-template-columns: 1fr; }
  .stage-grid--five { gap: 0; }
  .stage-grid--five .stage-card { min-height: 0; margin-bottom: 1.8rem; padding: 1.25rem 1.4rem; }
  .stage-grid--five .stage-card:last-child { margin-bottom: 0; }
  .stage-grid--five .stage-card b { right: auto; bottom: -1.8rem; left: 50%; z-index: 1; padding: .15rem .45rem; background: var(--surface); line-height: 1; transform: translateX(-50%) rotate(90deg); }
  .stage-grid--five .stage-card:last-child b { display: none; }
  .case-grid, .case-sidebar { grid-template-columns: 1fr; }
  .case-filter-actions { align-items: flex-start; flex-direction: column; }
  .stage-card { min-height: 0; }
  .service-row { grid-template-columns: 1fr; }
  .service-row > div:last-child { grid-column: auto; }
  .decision-matrix { display: block; overflow: visible; border: 0; }
  .decision-matrix > div { padding: .85rem 1rem; border: 1px solid var(--line); border-bottom: 0; }
  .decision-matrix > div:nth-child(3n+1) { color: white; background: var(--brand); border-color: var(--brand); border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-weight: 850; }
  .decision-matrix > div:nth-child(3n+2) { background: var(--surface-2); }
  .decision-matrix > div:nth-child(3n+2)::before, .decision-matrix > div:nth-child(3n)::before { display: block; margin-bottom: .25rem; color: var(--muted); font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
  .decision-matrix > div:nth-child(3n+2)::before { content: "Common decision"; }
  .decision-matrix > div:nth-child(3n)::before { content: "Relevant support"; }
  .decision-matrix > div:nth-child(3n) { margin-bottom: 1rem; border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .decision-matrix .matrix-head { display: none; }
  .decision-graphic { align-items: stretch; flex-direction: column; }
  .decision-graphic i { transform: rotate(90deg); text-align: center; }
  .map-options { grid-template-columns: 1fr; }
  .judgment-path { align-items: stretch; flex-direction: column; }
  .judgment-path b { transform: rotate(90deg); text-align: center; }
  .engagement-steps .card { grid-template-columns: 1fr; }
  .hero-route-list li { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .button, .sidebar, .case-sidebar, .case-related { display: none !important; }
  body { color: black; }
  a { color: black; text-decoration: none; }
}
