/* ==========================================================================
   Cautio: site stylesheet
   ========================================================================== */

/* Fonts (self-hosted Poppins, SIL Open Font Licence) ---------------------- */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/poppins-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-latin-700-normal.woff2") format("woff2"); }

/* Design tokens ----------------------------------------------------------- */
:root {
    --navy: #0d1b2b;
    --ink: #0a1628;
    --text: #1d1e20;
    --text-strong: #1a1a1a;
    --blue-900: #043c5c;
    --blue-700: #055482;
    --blue-600: #066ca8;
    --orange: #f47432;
    --cream: #fff7e7;
    --sand: #ccc5b8;
    --slate: #64748b;
    --slate-300: #94a3b8;
    --charcoal: #373c42;
    --grey-btn: #6f7783;
    --hero: #20272f;
    --white: #ffffff;

    --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";

    --container: 1020px;
    --container-wide: 1224px;
    --gutter: 24px;
    --header-h: 131px;
    --radius-card: 12px;
    --radius-field: 10px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6, p, ul { margin: 0; }

a { color: inherit; }

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

[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--navy);
    color: var(--white);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* Layout helpers ---------------------------------------------------------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container.wide { max-width: calc(var(--container-wide) + var(--gutter) * 2); }
.container.narrow { max-width: calc(640px + var(--gutter) * 2); }
.center { text-align: center; }

.section { padding-block: 40px 80px; }

/* Typography helpers ------------------------------------------------------ */
.eyebrow {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--blue-900);
    margin-bottom: 20px;
}
.eyebrow--light { color: var(--white); }
.eyebrow--dark { color: var(--ink); }

.h-lg {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.h-md {
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.3;
    font-weight: 700;
    color: var(--ink);
}

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 56px;
    padding: 14px 32px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(0); }

.btn-grey { background: var(--grey-btn); color: var(--cream); }
.btn-grey:hover { background: #5d646f; }

.btn-blue { background: var(--blue-600); color: var(--white); font-weight: 400; padding-inline: 40px; }
.btn-blue:hover { background: #055b8e; }

.btn[disabled] { opacity: .7; cursor: progress; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 34px;
}
.btn-row--center { justify-content: center; }

/* Header ------------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--white);
    box-shadow: 0 1px 0 rgba(13, 27, 43, .06);
}
.header-inner {
    max-width: calc(var(--container-wide) + var(--gutter) * 2);
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-inner .logo { padding-left: 16px; }
.header-inner .logo img { width: 286px; height: auto; }
.header-cta { min-height: 57px; padding-inline: 40px; margin-right: 16px; }

/* Hero -------------------------------------------------------------------- */
.hero {
    position: relative;
    background-color: var(--hero);
    background-image: url("../img/hero-bg.jpg");
    background-image: image-set(url("../img/hero-bg.webp") type("image/webp"), url("../img/hero-bg.jpg") type("image/jpeg"));
    background-size: cover;
    background-position: center;
    color: var(--cream);
    padding-block: 34px 57px;
    min-height: 761px;
    display: flex;
    align-items: center;
}
.hero .container { position: relative; }

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 26px;
    border-radius: 100px;
    background: rgba(255, 255, 255, .71);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
    color: var(--blue-900);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.hero h1 {
    margin-top: 8px;
    max-width: 990px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.3;
    font-weight: 600;
}

.hero-lead {
    margin-top: 14px;
    max-width: 960px;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.52;
    font-weight: 300;
}

.hero .btn-row { margin-top: 32px; }

/* Trust bar --------------------------------------------------------------- */
.trust-bar {
    background: var(--sand);
    padding-block: 40px 39px;
}
.trust-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 0;
    font-size: 18px;
    line-height: 1.3;
}
.trust-list li { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 0 6px; }
.trust-list li + li::before {
    content: "|";
    margin-inline: 14px;
    color: var(--text-strong);
    font-weight: 500;
}
.trust-list strong { color: var(--text-strong); font-weight: 700; }
.trust-list span { color: var(--slate); font-weight: 500; }

/* Cards ------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 62px;
    margin-top: 42px;
}
.card {
    padding: 30px 24px 32px;
}
.card h3 {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--ink);
}
.card p {
    margin-top: 16px;
    color: var(--blue-900);
}
.card--sand { background: var(--sand); }
.card--cream { background: var(--cream); }

.card-icon {
    margin: 0 0 8px !important;
    font-size: 32px;
    line-height: 1.3;
}
.card-icon + h3 { margin-top: 0; }
.card h3 + p { margin-top: 14px; }

/* What we do -------------------------------------------------------------- */
.services { background: var(--cream); padding-bottom: 96px; }
.services .intro {
    margin-top: 18px;
    max-width: 632px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 300;
    color: var(--slate);
}

/* About ------------------------------------------------------------------- */
.about { background: var(--navy); color: var(--white); padding-bottom: 72px; }
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 476px) minmax(0, 530px);
    justify-content: space-between;
    column-gap: 12px;
    row-gap: 48px;
}
.about-copy h2 { color: var(--white); margin-bottom: 16px; }
.about-copy p:not(.eyebrow) { color: var(--slate-300); }
.about-copy p + p { margin-top: 20px; }
.about-copy .eyebrow + h2 { margin-top: 0; }
.about-copy strong { color: #e2e8f0; font-weight: 600; }

.stats {
    align-self: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 23px;
    margin-top: 60px;
}
.stat {
    background: rgba(255, 255, 255, .17);
    border: 1px solid rgba(0, 0, 0, .17);
    border-radius: var(--radius-card);
    min-height: 169px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.stat-num {
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.3;
    font-weight: 700;
    color: var(--cream);
}
.stat-label { margin-top: 6px; color: var(--white); max-width: 185px; }

.cert-list {
    grid-column: 1;
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 13px 7px;
    max-width: 420px;
}
.cert-list li {
    min-width: 77px;
    min-height: 38px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    background: rgba(5, 84, 130, .71);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

/* Why Cautio -------------------------------------------------------------- */
.why { background: var(--orange); color: var(--ink); padding-bottom: 72px; }
.why .eyebrow { margin-bottom: 16px; }
.why .card-grid { margin-top: 56px; }

/* Call to action ---------------------------------------------------------- */
.cta { background: var(--charcoal); color: var(--white); padding-block: 93px 80px; }
.cta-lead {
    max-width: 812px;
    margin: 28px auto 0;
    font-weight: 300;
    color: rgba(255, 255, 255, .85);
}
.cta .btn-row { margin-top: 35px; }
.cta-email {
    max-width: 615px;
    margin: 36px auto 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 300;
}
.cta-email a { color: var(--white); text-underline-offset: 3px; }

/* Subscribe --------------------------------------------------------------- */
.subscribe { background: var(--blue-700); color: var(--cream); padding-block: 52px 69px; }
.subscribe-title { font-size: clamp(30px, 4vw, 40px); line-height: 1.3; font-weight: 600; }
.subscribe-sub { margin-top: 6px; }
.subscribe-form { max-width: 503px; margin: 2px auto 0; text-align: left; }
.subscribe-form .btn { display: flex; margin: 15px auto 0; font-weight: 400; color: var(--white); padding-inline: 40px; }
.subscribe .form-alert { max-width: 503px; margin: 16px auto 4px; }

/* Forms ------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 2px; }
.field + .field { margin-top: 17px; }
.field label { font-size: 14px; line-height: 24px; }
.field input,
.field textarea {
    width: 100%;
    min-height: 59px;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-field);
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--grey-btn); opacity: 1; }
.field input:focus,
.field textarea:focus { outline: 3px solid var(--orange); outline-offset: 1px; }
.field.has-error input,
.field.has-error textarea { border-color: #ffb4a8; box-shadow: 0 0 0 2px #e5484d; }
.field-error { margin-top: 4px; font-size: 14px; color: #ffd8d2; font-weight: 500; }

.form-alert {
    padding: 12px 16px;
    border-radius: var(--radius-field);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 16px;
}
.form-alert--success { background: #e7f7ee; color: #0f5132; }
.form-alert--error { background: #fdecea; color: #8a1c13; }

/* Honeypot: hidden from people, visible to naive bots */
.hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* Contact page ------------------------------------------------------------ */
.contact-hero { background: var(--blue-900); color: var(--white); padding-block: 96px 80px; }
.contact-grid {
    max-width: calc(var(--container-wide) + var(--gutter) * 2);
    display: grid;
    grid-template-columns: minmax(0, 503px) minmax(0, 576px);
    justify-content: space-between;
    gap: 48px;
    align-items: start;
}
.contact-grid--center { align-items: center; }
.h-contact { font-size: clamp(36px, 4.5vw, 48px); line-height: 1.3; font-weight: 600; margin-top: 9px; }
.contact-label { margin-top: 18px; font-size: 24px; line-height: 1.3; font-weight: 600; }
.contact-intro p { margin-top: 8px; }
.contact-intro a { color: var(--white); text-decoration: none; }
.contact-intro a:hover { text-decoration: underline; }
.contact-intro p + p { margin-top: 18px; }
.contact-form { width: 100%; max-width: 546px; }
.contact-form .btn { margin-top: 22px; }

.location { background: var(--cream); padding-block: 81px 74px; }
.location-title { font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--text); }
.location p { margin-top: 20px; color: var(--blue-900); max-width: 503px; }
.map-frame {
    width: 100%;
    aspect-ratio: 606 / 383;
    background: #e8e2d6;
    overflow: hidden;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Privacy policy ---------------------------------------------------------- */
.legal { padding-block: 64px 96px; }
.prose { max-width: calc(860px + var(--gutter) * 2); }
.prose h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.3; font-weight: 600; color: var(--ink); margin-bottom: 24px; }
.prose h2 { font-size: 24px; line-height: 1.3; font-weight: 600; margin: 40px 0 14px; color: var(--text); }
.prose p + p { margin-top: 16px; }
.prose ul { margin: 14px 0 16px; padding-left: 24px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--blue-600); text-underline-offset: 2px; }

/* 404 --------------------------------------------------------------------- */
.not-found { background: var(--navy); color: var(--white); padding-block: 120px; }
.not-found p:not(.eyebrow) { margin-top: 20px; color: var(--slate-300); }
.not-found .btn-row { margin-top: 32px; }

/* Footer ------------------------------------------------------------------ */
.site-footer { background: var(--navy); color: var(--cream); }
.footer-inner {
    max-width: calc(var(--container-wide) + var(--gutter) * 2);
    min-height: 107px;
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
    gap: 16px;
    padding-block: 22px;
}
.footer-mark img { width: 59px; height: auto; }
.footer-text { text-align: center; font-size: 14px; line-height: 1.3; }
.footer-text p + p { margin-top: 8px; }
.footer-text a { font-weight: 300; text-underline-offset: 2px; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1100px) {
    .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; }
}

@media (max-width: 920px) {
    :root { --header-h: 96px; }
    .header-inner .logo { padding-left: 0; }
    .header-inner .logo img { width: 220px; }
    .header-cta { margin-right: 0; min-height: 48px; padding-inline: 24px; font-size: 14px; }

    .card-grid { grid-template-columns: 1fr; gap: 20px; max-width: 560px; }

    .about-grid { grid-template-columns: 1fr; }
    .stats { margin-top: 0; max-width: 560px; }
    .cert-list { grid-column: auto; }

    .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .contact-form { max-width: none; }
    .contact-hero { padding-block: 56px 64px; }
    .location { padding-block: 56px; }

    .trust-list { flex-direction: column; gap: 10px; }
    .trust-list li + li::before { display: none; }
}

@media (max-width: 640px) {
    :root { --gutter: 20px; --header-h: 80px; }
    .header-inner .logo img { width: 170px; }
    .header-cta { padding-inline: 18px; min-height: 42px; font-size: 13px; }

    .section { padding-block: 40px 56px; }
    .hero {
        min-height: 0;
        padding-block: 40px 56px;
        background-image: url("../img/hero-bg.jpg");
        background-image: image-set(url("../img/hero-bg-960.webp") type("image/webp"), url("../img/hero-bg.jpg") type("image/jpeg"));
        background-position: 78% center;
    }
    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(32, 39, 47, .92) 0%, rgba(32, 39, 47, .78) 70%, rgba(32, 39, 47, .35) 100%);
    }
    .pill-badge { font-size: 12px; padding-inline: 16px; }
    .btn-row { flex-direction: column; align-items: stretch; gap: 14px; }
    .btn-row--center { align-items: stretch; }

    .trust-bar { padding-block: 28px; }
    .trust-list { font-size: 16px; }

    .stats { gap: 14px; }
    .stat { min-height: 140px; }
    .stat-label { font-size: 14px; }

    .cta { padding-block: 64px 56px; }

    .footer-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn { transition: none; }
    .btn:hover { transform: none; }
}

@media print {
    .site-header { position: static; box-shadow: none; }
    .subscribe, .btn-row, .map-frame, .skip-link { display: none !important; }
}

/* 404 fills the screen on short pages */
.not-found {
    min-height: calc(100vh - var(--header-h) - 107px);
    display: flex;
    align-items: center;
}
.not-found .container { width: 100%; }
