/* ==========================================================================
   Nextora Analytics — design system (roadmap §3.5 / §4.5, direction "Blend A+B")

   Clinical-precise palette on a near-white ground, hairline borders, no drop
   shadows, no gradients, two font weights (400 / 500), sentence case.
   From direction B: in-hero service tiles and the availability badge only.

   System font stack only. This stylesheet must never issue a network request:
   no imports, no custom font declarations, no external asset references. The
   CSP is `default-src 'self'` and smoke.ps1 asserts it.
   ========================================================================== */

:root {
    color-scheme: light;

    /* Ink */
    --ink: #0F172A;
    --ink-2: #475569;
    --ink-3: #64748B;

    /* Accent */
    --accent: #0E5C63;
    --accent-hover: #0A464C;
    --accent-tint: #E6F2F1;

    /* Ground and structure */
    --surface: #FFFFFF;
    --ground: #FCFCFD;
    --ground-2: #F6F7F8;
    --line: #E3E6E8;
    --line-strong: #CBD5E1;

    /* Focus ring — ink reads at >15:1 against every ground used here */
    --focus-ring: #0F172A;

    /* Type scale, ratio 1.25 */
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-md: 0.9375rem;
    --text-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
    --text-h3: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
    --text-h2: clamp(1.5rem, 1.28rem + 0.9vw, 1.953rem);
    --text-h1: clamp(2.125rem, 1.6rem + 2.3vw, 3.052rem);

    /* Rhythm */
    --section-y: clamp(4rem, 9vw, 7rem);
    --band-y: clamp(3rem, 7vw, 4.5rem);
    --hero-y: clamp(3.5rem, 8vw, 6.5rem);
    --gap: clamp(1rem, 2.5vw, 1.5rem);
    --gap-lg: clamp(1.5rem, 4vw, 2.5rem);
    --pad-panel: clamp(1.25rem, 3.5vw, 2rem);

    /* Shape */
    --radius: 0.5rem;
    --radius-sm: 0.375rem;
    --radius-pill: 999px;

    /* Widths — `.container` keeps a 1rem gutter on each side */
    --width: 72rem;
    --width-narrow: 44rem;
    --gutter: 2rem;

    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--ink-2);
    background: var(--ground);
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    overflow-wrap: break-word;
}

/* The honeypot wrapper carries `hidden`; never let a layout rule reveal it. */
[hidden] {
    display: none !important;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
    color: var(--ink);
    font-weight: 500;
    line-height: 1.2;
    text-wrap: balance;
}

h1 {
    margin: 0 0 1.25rem;
    font-size: var(--text-h1);
    letter-spacing: -0.02em;
    max-width: 22ch;
}

h2 {
    margin: 2rem 0 1rem;
    font-size: var(--text-h2);
    letter-spacing: -0.015em;
    max-width: 26ch;
}

h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: var(--text-h3);
}

h4 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

p,
li {
    max-width: 70ch;
}

strong,
b {
    color: var(--ink);
    font-weight: 500;
}

.lead {
    margin: 0 0 1.5rem;
    max-width: 58ch;
    color: var(--ink-2);
    font-size: var(--text-lg);
}

.eyebrow {
    display: block;
    margin: 0 0 0.85rem;
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Links and focus
   -------------------------------------------------------------------------- */

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 0.1em;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    z-index: 10;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    color: #ffffff;
    background: var(--ink);
    font-weight: 500;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.container {
    width: min(100% - var(--gutter), var(--width));
    margin-inline: auto;
}

.container.narrow {
    width: min(100% - var(--gutter), var(--width-narrow));
}

.page-content {
    flex: 1;
    padding-block: clamp(2rem, 6vw, 4rem);
}

/* Full-bleed sections carry their own vertical rhythm. */
.page-content:has(> .hero, > .section, > .cta-band) {
    padding-block: 0;
}

.section {
    padding-block: var(--section-y);
    border-top: 1px solid var(--line);
}

.section.tint {
    background: var(--ground-2);
}

.hero + .section {
    border-top: 0;
}

.section-head {
    max-width: 46rem;
    margin: 0 0 var(--gap-lg);
}

.section-head > :first-child {
    margin-top: 0;
}

.section-head h2 {
    margin: 0;
}

.section-head p {
    margin: 0.85rem 0 0;
    max-width: 58ch;
    font-size: var(--text-lg);
}

/* --------------------------------------------------------------------------
   Header and primary navigation
   -------------------------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--ground);
}

.primary-nav {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.brand {
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.brand:hover {
    color: var(--accent);
}

.nav-links {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    list-style: none;
}

.nav-links li {
    max-width: none;
}

.nav-links a {
    display: inline-block;
    padding-block: 0.45rem;
    color: var(--ink-2);
    font-size: var(--text-md);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.35rem;
}

.nav-links a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35rem;
}

/* Header CTA — sized down from the page buttons. */
.nav-cta {
    padding: 0.5rem 0.9rem;
    font-size: var(--text-md);
}

/* --------------------------------------------------------------------------
   Hero — left aligned. The old centered hero over a <ul> was the biggest
   "template site" tell, so there is deliberately no text-align here.
   -------------------------------------------------------------------------- */

.hero {
    padding-block: var(--hero-y);
    border-bottom: 1px solid var(--line);
    background: var(--ground);
}

.hero-inner {
    width: min(100% - var(--gutter), var(--width));
    margin-inline: auto;
}

.hero-inner > :first-child {
    margin-top: 0;
}

.hero h1 {
    max-width: 22ch;
}

.hero .lead {
    max-width: 54ch;
    font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem);
}

.availability {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 100%;
    margin: 0 0 1.5rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--accent-tint);
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
}

.availability::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 2rem 0 0;
}

/* Direction B's in-hero service tiles. `.service-tiles` is the pre-rewrite
   name still present in home_page.html; both resolve to the same layout. */
.hero-tiles,
.service-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
    margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
    padding: 0;
    list-style: none;
}

.tile,
.service-tiles li {
    max-width: none;
    margin: 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.tile:hover,
.service-tiles li:hover {
    border-color: var(--line-strong);
}

a.tile,
.tile > a,
.service-tiles a {
    display: block;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

a.tile:hover,
.tile > a:hover,
.service-tiles a:hover {
    color: var(--accent);
}

.tile p {
    margin: 0.4rem 0 0;
    max-width: none;
    color: var(--ink-2);
    font-size: var(--text-md);
}

.proof-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0.75rem 1.25rem;
    margin: clamp(2rem, 5vw, 3rem) 0 0;
    padding: 0;
    list-style: none;
    color: var(--ink-2);
    font-size: var(--text-sm);
}

.proof-strip li {
    max-width: none;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.faq-list {
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.faq-list li {
    max-width: none;
    margin: 0 0 0.65rem;
}

.faq-list details {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.faq-list summary {
    cursor: pointer;
    font-weight: 500;
}

.faq-list summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.faq-list details p {
    margin: 0.75rem 0 0;
}

.credential-strip {
    max-width: 64ch;
    margin: 2rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: var(--text-sm);
}

ul.credential-strip,
ol.credential-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.5rem;
    list-style: none;
}

.credential-strip li {
    max-width: none;
}

/* --------------------------------------------------------------------------
   Cards, problem band, proof
   -------------------------------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: none;
    padding: var(--pad-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.card > :first-child {
    margin-top: 0;
}

.card > :last-child {
    margin-bottom: 0;
}

.card h3 {
    margin: 0 0 0.5rem;
    max-width: none;
}

.card p {
    max-width: none;
    margin: 0 0 1rem;
}

.card .btn,
.card .btn-secondary,
.card > a:last-child {
    margin-top: auto;
    align-self: flex-start;
}

.card-deliverables {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    color: var(--ink-2);
    font-size: var(--text-md);
}

.card-deliverables li {
    position: relative;
    max-width: none;
    margin: 0;
    padding-left: 1.15rem;
}

.card-deliverables li::before {
    content: "";
    position: absolute;
    top: 0.6em;
    left: 0;
    width: 0.4rem;
    height: 0.4rem;
    border: 1px solid var(--accent);
    border-radius: 1px;
}

.pain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: var(--gap-lg);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pain-grid > * {
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0.15rem 0 0.15rem 1.25rem;
    border-left: 2px solid var(--accent-tint);
    color: var(--ink);
    font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem);
}

.proof {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--gap-lg);
    align-items: start;
    margin: 0;
    padding: var(--pad-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    list-style: none;
}

.proof > * {
    min-width: 0;
}

/* A card nested in `.proof` inherits the panel; do not double the border. */
.proof .card {
    padding: 0;
    border: 0;
    background: none;
}

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */

.cta-band {
    padding-block: var(--band-y);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--accent-tint);
}

.cta-band h2 {
    margin: 0 0 0.75rem;
}

.cta-band p {
    margin: 0;
    max-width: 56ch;
    color: var(--ink-2);
    font-size: var(--text-lg);
}

.cta-band .hero-actions {
    margin-top: 1.75rem;
}

/* --------------------------------------------------------------------------
   Buttons. `.button` is the pre-rewrite name still used by analytics.html.
   -------------------------------------------------------------------------- */

.btn,
.btn-secondary,
.button,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover,
.button:hover,
button[type="submit"]:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--ink);
}

.btn-secondary:hover {
    border-color: var(--ink-3);
    background: var(--surface);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

form label {
    display: block;
    color: var(--ink);
    font-size: var(--text-md);
    font-weight: 500;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

form > div,
.form-field {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    max-width: 34rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--ink-3);
}

form [role="alert"],
.errorlist {
    margin: 0;
    padding: 0;
    color: #9F1239;
    font-size: var(--text-sm);
    list-style: none;
}

[role="status"] {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--accent-tint);
    color: var(--ink);
}

.form-note {
    margin: 0.85rem 0 0;
    color: var(--ink-3);
    font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   Legacy content panel — kept so pages not yet rewritten still read well.
   -------------------------------------------------------------------------- */

.content-panel {
    max-width: 52rem;
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.content-panel > :first-child {
    margin-top: 0;
}

.content-panel li {
    margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    padding-block: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    font-size: var(--text-md);
}

/* Pre-rewrite footer markup has no inner container of its own. */
.site-footer > p {
    width: min(100% - var(--gutter), var(--width));
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: var(--gap-lg);
}

.footer-grid h2,
.footer-grid h3 {
    margin: 0 0 0.85rem;
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.footer-links {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    max-width: none;
}

.footer-links a {
    color: var(--ink-2);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    margin: clamp(2rem, 5vw, 3rem) 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: var(--text-sm);
}

.footer-legal p {
    margin: 0;
    max-width: none;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Responsive. The nav must compute `row` at 1280px and `column` at 375px.
   -------------------------------------------------------------------------- */

@media (max-width: 40rem) {
    .primary-nav {
        padding-block: 0.85rem;
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .footer-legal {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .btn,
    .btn-secondary,
    .button,
    button[type="submit"] {
        border: 1px solid ButtonText;
    }

    .card,
    .tile,
    .proof,
    .proof-strip li,
    .faq-list details,
    .content-panel,
    .availability {
        border: 1px solid CanvasText;
    }
}
