/* MATR Therapeutics — hand-written CSS, no build step.
   Palette from the MATR logo (slate blue #9bb0c1), deepened for text contrast,
   with a warm paper background. System fonts only: no third-party requests. */

:root {
    --slate-50: #f3f6f8;
    --slate-100: #e3eaf0;
    --slate-300: #9bb0c1;   /* the logo colour */
    --slate-500: #6f8ea6;
    --slate-700: #3e5a70;   /* buttons, links: 7.0:1 on white */
    --slate-900: #1f2d3a;   /* body text */
    --muted: #4f5f6c;       /* secondary text: 6.6:1 on white */
    --paper: #fbf9f6;
    --sand: #f2eee7;
    --white: #ffffff;
    --success: #23613f;
    --notice-bg: #fff6e0;
    --notice-ink: #5a4100;
    --error: #a3261b;

    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(31, 45, 58, .06), 0 8px 24px rgba(31, 45, 58, .08);
    --container: 1160px;
    --gutter: clamp(1.1rem, 4vw, 2rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--slate-900);
    background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--slate-700); text-underline-offset: .18em; }
a:hover { color: var(--slate-900); }

:focus-visible { outline: 3px solid var(--slate-500); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; color: var(--slate-900); margin: 0 0 .6em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

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

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--slate-900); color: var(--white); padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 46px; padding: .7rem 1.35rem; border-radius: 999px;
    font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
    border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--slate-700); color: var(--white); }
.btn-primary:hover { background: var(--slate-900); color: var(--white); }
.btn-secondary { background: transparent; color: var(--slate-700); border-color: var(--slate-700); }
.btn-secondary:hover { background: var(--slate-700); color: var(--white); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: var(--white); border-color: rgba(255, 255, 255, .85); }
.btn-ghost:hover { background: var(--white); color: var(--slate-900); }
.btn-sm { min-height: 40px; padding: .5rem 1.05rem; font-size: .95rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 249, 246, .96); border-bottom: 1px solid var(--slate-100); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(251, 249, 246, .85); backdrop-filter: blur(8px); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--slate-900); }
.brand-mark { width: 120px; height: auto; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .04em; white-space: nowrap; }
.brand-word span { font-weight: 500; letter-spacing: .01em; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a:not(.btn) { color: var(--slate-900); text-decoration: none; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover { border-bottom-color: var(--slate-300); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--slate-700); }

.nav-toggle { display: none; width: 46px; height: 46px; border: 1px solid var(--slate-100); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; position: relative; }
.nav-toggle .bar { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--slate-900); transition: transform .2s; }
.nav-toggle .bar:nth-of-type(2) { top: 18px; }
.nav-toggle .bar:nth-of-type(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(2) { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(3) { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 820px) {
    .brand-mark { width: 84px; }
    .brand-word { font-size: 1.1rem; }
    .nav-toggle { display: block; }
    .site-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--paper); border-bottom: 1px solid var(--slate-100); padding: .5rem var(--gutter) 1.25rem;
    }
    .site-nav.is-open { display: flex; }
    .site-nav a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--slate-100); }
    .site-nav a[aria-current="page"] { border-bottom-color: var(--slate-100); font-weight: 700; }
    .site-nav .btn { margin-top: 1rem; }
    .no-js .site-nav { display: flex; position: static; }
}

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; color: var(--white); overflow: hidden; background: var(--slate-900); }
.hero-home { min-height: min(78vh, 720px); }
.hero-page { min-height: min(52vh, 480px); }
.hero picture, .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-img { object-fit: cover; object-position: center 35%; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 30, 40, .05) 20%, rgba(20, 30, 40, .78) 100%); }
.hero-copy { padding-top: 6rem; padding-bottom: clamp(2.5rem, 7vw, 4.5rem); }
.hero h1 { color: var(--white); font-size: clamp(2.6rem, 7vw, 4.6rem); margin-bottom: .25em; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.hero-sub { font-size: clamp(1.1rem, 2.2vw, 1.35rem); max-width: 36rem; margin-bottom: 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section-flush { padding-top: 0; }
.section-tint { background: var(--sand); }
.section-title { margin-bottom: 1.5rem; }
.small-title { font-size: 1.2rem; }
.lead { font-size: 1.2rem; color: var(--slate-900); }
.intro .lead { font-size: clamp(1.15rem, 2vw, 1.35rem); }
.eyebrow { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-size: .85rem; }

/* Service cards (home) */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 1.75rem); }
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr; } }
.service-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.service-card-link { text-decoration: none; color: inherit; }
.service-card-link img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; transition: transform .3s; }
.service-card-link:hover img { transform: scale(1.03); }
.service-card h3 { margin: 1.1rem 1.4rem .5rem; }
.service-card-link:hover h3 { text-decoration: underline; text-underline-offset: .18em; }
.service-card p { margin: 0 1.4rem 1rem; color: var(--muted); font-size: 1rem; }
.service-card .card-cta { margin-top: auto; padding-bottom: 1.4rem; color: var(--slate-900); font-weight: 500; }

/* Split layouts */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: center; }
.split-wide { grid-template-columns: 1.3fr .7fr; }
@media (max-width: 800px) { .split, .split-wide { grid-template-columns: 1fr; } }
.split-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.section-tint .split-img { max-height: 560px; object-fit: cover; }
.rounded { border-radius: var(--radius); }

/* Services list */
.service-rows { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
.service-row { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.service-row:nth-child(even) img { order: 2; }
.service-row img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
@media (max-width: 800px) { .service-row { grid-template-columns: 1fr; } .service-row:nth-child(even) img { order: 0; } }

/* Service detail */
.crumbs ol { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.5rem; font-size: .95rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--slate-300); }
.detail-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.detail-list li { background: var(--white); border-radius: var(--radius-sm); padding: 1.25rem 1.35rem; border-left: 4px solid var(--slate-300); }
.detail-list strong { color: var(--slate-900); }
.detail-cta { margin: 2rem 0 0; }
.other-services { padding-top: 2.5rem; }
.other-services ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.other-services a { display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--slate-300); border-radius: 999px; text-decoration: none; }
.other-services a:hover { background: var(--slate-50); }

/* Contact page */
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
@media (max-width: 560px) { .contact-cards { grid-template-columns: 1fr; } }
.contact-card { background: var(--white); border-radius: var(--radius-sm); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.contact-card h2 { font-family: var(--font-body); font-size: .95rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.contact-card p { margin: 0; overflow-wrap: anywhere; }

/* ---------- Contact form band ---------- */
.contact-band { background: var(--slate-50); border-top: 1px solid var(--slate-100); }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.direct-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .45rem; }
.direct-label { display: inline-block; min-width: 4rem; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.form-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.req { color: var(--error); }
.field-hint { font-size: .92rem; color: var(--muted); margin: -.1rem 0 .4rem; }
.field input, .field textarea {
    width: 100%; font: inherit; color: inherit; background: var(--white);
    border: 1.5px solid #8a9aa6; border-radius: var(--radius-sm); padding: .7rem .85rem;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field textarea:focus { border-color: var(--slate-700); outline: 3px solid rgba(62, 90, 112, .25); outline-offset: 0; }
.field-error { display: block; color: var(--error); font-size: .92rem; margin-top: .3rem; }
.field-error:empty { display: none; }
.field [aria-invalid="true"] { border-color: var(--error); }
.req-note { font-size: .9rem; color: var(--muted); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.25rem; }
.form-status p { margin: 0; }
.form-status.is-success { background: #e6f4ec; color: var(--success); }
.form-status.is-notice { background: var(--notice-bg); color: var(--notice-ink); }
.form-status a { color: inherit; font-weight: 600; }

/* ---------- Utility pages ---------- */
.utility { min-height: 50vh; }
.utility .btn { margin: .25rem .4rem .25rem 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate-900); color: #dbe3e9; padding: 3.5rem 0 1.5rem; font-size: .98rem; }
.site-footer a { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr; gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-mark { width: 120px; opacity: .9; margin-bottom: .8rem; }
.footer-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--white); margin-bottom: .2rem; }
.footer-tag { color: var(--slate-300); }
.footer-h { font-family: var(--font-body); font-size: .85rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-300); margin-bottom: .7rem; }
.site-footer address { font-style: normal; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .9rem; color: #b8c5cf; }
.footer-base p { margin: 0; }

/* Send button with the privacy line beside it */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.privacy-note { margin: 0; font-size: .9rem; color: var(--muted); }
.privacy h2 { font-size: 1.25rem; margin-top: 2rem; }
