/* ==========================================================================
   Home page on the Cautio Design System, 2026-12-06.
   Loaded only on the home page (index.php head_extra), before ds.css, so it
   uses the tokens ds.css sets on :root. Flat 4px boxes with a hairline, one
   figure per card (never twice on the page), steps as ExtraLight numbers with
   a Lucide arrow, sentence-case headings ending in a red full stop, and one
   red (Action Red) button per view. Spacing on the 8px grid.
   ========================================================================== */

/* Hero: three rotating messages, one red action on each -------------------- */
.hm-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--cautio-navy);
    background-image: radial-gradient(circle 380px at 100% 100%, rgba(246, 138, 49, .7), rgba(231, 17, 54, .38) 36%, rgba(231, 17, 54, 0) 72%);
    color: #fff;
    padding-block: 104px 48px;
}
.hm-hero-inner { position: relative; z-index: 1; }
.hm-hero-figure {
    position: absolute; z-index: 0; pointer-events: none;
    top: 64px; right: calc((100% - min(100%, 1068px)) / 2 + 24px);
    width: 192px; height: 192px;
}
.hm-display {
    max-width: 780px;
    font-size: clamp(38px, 5.4vw, 64px); line-height: 1.02; font-weight: 800; letter-spacing: -.02em;
    color: #fff;
}
.hm-subhead {
    margin-top: 24px; max-width: 760px;
    font-size: clamp(20px, 2vw, 24px); line-height: 1.3; font-weight: 600; color: #fff;
}
.hm-lead {
    margin-top: 16px; max-width: 720px;
    font-size: 18px; line-height: 1.6; font-weight: 300; color: var(--text-on-dark-muted);
}
.hm-display--slide { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; }
.hm-alert { margin-top: 24px; max-width: 720px; }
.hm-hero-actions { margin-top: 40px; }
.hm-hero .hero-ticks { margin-top: 24px; }

/* Slide controls: numbered tabs (active one underlined) and a pause button.
   main.js shows them, rotates every 7 seconds, pauses on keyboard focus and
   never auto-plays for people who prefer reduced motion. */
.hm-slider-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 72px; }
.hm-hero .slider-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 8px 32px; }
.hm-hero .slider-tab {
    flex-direction: row; align-items: baseline; gap: 10px;
    padding: 8px 0 12px; border-radius: 0;
    font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .6);
    background: linear-gradient(var(--cautio-orange), var(--cautio-orange)) left bottom / 0 2px no-repeat;
    transition: color var(--dur-base) var(--ease-standard), background-size var(--dur-base) var(--ease-standard);
}
.hm-hero .slider-tab:hover { color: #fff; }
.hm-hero .slider-tab[aria-selected="true"] { color: #fff; background-size: 100% 2px; }
.hm-tab-num { font-size: 12px; font-weight: 600; letter-spacing: .14em; color: inherit; }
.hm-hero .slider-pause {
    display: inline-grid; place-items: center; align-self: center;
    width: 40px; height: 40px; padding: 0;
    border: 1px solid rgba(255, 255, 255, .5); border-radius: 8px;
    background: transparent; color: #fff;
    transition: background-color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard);
}
.hm-hero .slider-pause:hover { background: var(--tint-white); border-color: #fff; }
.hm-hero .slider-pause svg { display: block; }
.hm-hero .slider-pause .icon-pause, .hm-hero .slider-pause .icon-play { line-height: 0; }

.hm-card-btn.btn-outline::after {
    content: ""; display: inline-block; flex: none; width: 16px; height: 16px; margin-left: 6px; vertical-align: -3px;
    background: currentColor;
    -webkit-mask: var(--i-arrow) center / contain no-repeat; mask: var(--i-arrow) center / contain no-repeat;
}

/* Sections and section headings ------------------------------------------- */
.hm-section { padding-block: 96px; }
.hm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; margin-bottom: 48px; }
.hm-head-text { max-width: 720px; }
.hm-head-figure { flex: none; width: 128px; height: 128px; }
.hm-h2 { font-size: clamp(28px, 3vw, 34px); line-height: 1.1; font-weight: 800; letter-spacing: -.01em; color: var(--cautio-navy); }
.hm-h3 { font-size: clamp(22px, 2.2vw, 26px); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--cautio-navy); }
.hm-supporting { margin-top: 12px; font-size: 18px; line-height: 1.6; color: var(--steel-grey); }

/* Cards: flat, crisp 4px corners, hairline; one figure flush top right ----- */
.hm-card {
    position: relative; overflow: hidden;
    padding: 32px;
    background: #fff; border: 1px solid var(--border-subtle); border-radius: 4px;
}
.hm-card--navy { background: var(--cautio-navy); border-color: transparent; color: #fff; }
.hm-card-figure { float: right; display: block; width: 64px; height: 64px; margin: -32px -32px 0 16px; }
.hm-service h4, .hm-help-title { clear: right; }
.hm-card-btn { position: relative; z-index: 2; min-height: 48px; margin-top: 24px; padding: 12px 24px; font-size: 15px; }
.hm-tag { font-size: 11px; line-height: 1.4; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--steel-grey); }
.hm-tag--free { color: var(--on-tint-orange); }
.hm-tag-price { display: block; margin-top: 2px; }

/* Start free: two cards on mist, steps as numbers and arrows --------------- */
.hm-free { background: var(--mist); }
.hm-free-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hm-free-card { display: flex; flex-direction: column; }
.hm-free-card .hm-card-btn { align-self: flex-start; margin-top: auto; }
.hm-kicker {
    display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
    font-size: 12px; line-height: 1.4; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--steel-grey);
}
.hm-kicker .rf-icon { width: 18px; height: 18px; color: var(--cautio-navy); }
.hm-free-pitch { margin-top: 8px; font-size: 16px; color: var(--slate-ink); }
.hm-steps { list-style: none; margin: 32px 0 8px; padding: 0; counter-reset: hm-step; }
.hm-steps li {
    position: relative; counter-increment: hm-step;
    display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px;
    padding-bottom: 32px;
}
.hm-steps li::before {
    content: counter(hm-step);
    grid-column: 1; grid-row: 1 / span 3;
    font-size: 44px; line-height: 1; font-weight: 200; letter-spacing: -.02em; color: var(--cautio-navy);
}
.hm-steps li:not(:last-child)::after {
    content: ""; position: absolute; left: 6px; top: 56px; width: 18px; height: 18px;
    background: var(--steel-grey); transform: rotate(90deg);
    -webkit-mask: var(--i-arrow) center / contain no-repeat; mask: var(--i-arrow) center / contain no-repeat;
}
.hm-steps li > * { grid-column: 2; }
.hm-step-when { font-size: 11px; line-height: 1.4; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--on-tint-orange); }
.hm-steps strong { display: block; margin-top: 4px; font-size: 17px; line-height: 1.35; font-weight: 600; color: var(--cautio-navy); }
.hm-steps li > span:last-child { display: block; margin-top: 4px; font-size: 15px; line-height: 1.55; color: var(--slate-ink); }

/* What we do: three groups of service cards --------------------------------- */
.hm-services { background: #fff; }
.hm-group { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border-subtle); }
.hm-head + .hm-group { margin-top: 0; }
.hm-group-head { display: grid; grid-template-columns: 96px minmax(0, 640px); gap: 24px; align-items: start; margin-bottom: 32px; }
.hm-group-num { font-size: 64px; line-height: .9; font-weight: 200; letter-spacing: -.03em; color: var(--cautio-navy); }
.hm-group-head p:not(.hm-group-num) { margin-top: 8px; font-size: 16px; color: var(--steel-grey); }
.hm-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.hm-service { transition: border-color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard); }
.hm-service:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.hm-service h4 { margin-top: 12px; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: var(--cautio-navy); }
.hm-nobr { white-space: nowrap; }
.hm-nobr::after {
    content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .3em; vertical-align: -.05em;
    background: var(--cautio-navy);
    -webkit-mask: var(--i-arrow) center / contain no-repeat; mask: var(--i-arrow) center / contain no-repeat;
}
.hm-service-link {
    color: inherit; text-decoration: underline; text-decoration-color: transparent;
    text-decoration-thickness: 2px; text-underline-offset: 5px;
    transition: text-decoration-color var(--dur-base) var(--ease-standard);
}
.hm-service-link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* the whole card opens the service page */
.hm-service:hover .hm-service-link, .hm-service-link:focus-visible { text-decoration-color: var(--cautio-red); }
.hm-service > p:not(.hm-tag) { clear: none; margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--slate-ink); }
.hm-help .hm-tag { color: var(--text-on-dark-muted); }
.hm-help-title { margin-top: 12px; font-size: 20px; line-height: 1.25; font-weight: 800; color: #fff; }
.hm-help-text { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--text-on-dark-muted); }
.hm-help-btn { width: 100%; padding-inline: 16px; font-size: 14px; white-space: nowrap; }

/* Why Cautio ------------------------------------------------------------------- */
.hm-why .hm-head { margin-bottom: 32px; }

/* Closing: a band of brand colours and figures, then one red action ------- */
.hm-close { background: var(--mist); }
.hm-band { display: flex; height: 96px; margin-bottom: 56px; overflow: hidden; }
.hm-band-block { flex: none; display: block; width: 96px; height: 96px; }
.hm-band-block--wide { width: 192px; }
.hm-band-block--navy { background: var(--cautio-navy); }
.hm-band-block--harbour { background: var(--harbour-blue); }
.hm-band-block--orange { background: var(--cautio-orange); }
.hm-band-block--dusk { background: var(--dusk-blue); }
.hm-band-figure { flex: none; width: 96px; height: 96px; }
.hm-close-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px 64px; align-items: end; }
.hm-close-title { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -.02em; }
.hm-close-email { margin-top: 24px; font-size: 16px; color: var(--slate-ink); }
.hm-close-email a { color: var(--ocean-blue); text-decoration: underline; text-underline-offset: 3px; }

/* Responsive ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .hm-hero-figure { width: 128px; height: 128px; top: 48px; }
    .hm-display { max-width: 640px; }
    .hm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .hm-free-grid, .hm-close-grid { grid-template-columns: minmax(0, 1fr); }
    .hm-head-figure { display: none; }
}
@media (max-width: 760px) {
    .hm-hero {
        padding-block: 56px 32px;
        background-image: radial-gradient(circle 160px at 100% 100%, rgba(246, 138, 49, .7), rgba(231, 17, 54, .38) 36%, rgba(231, 17, 54, 0) 72%);
    }
    .hm-hero-figure { display: none; }
    .hm-display--slide { font-size: clamp(30px, 8vw, 38px); }
    .hm-slider-controls { margin-top: 40px; gap: 16px 24px; }
    .hm-hero .slider-tabs { gap: 8px 24px; }
    /* Numbers only on small screens; the label stays for screen readers */
    .hm-tab-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .hm-tab-num { font-size: 14px; }
    .hm-section { padding-block: 64px; }
    .hm-cards { grid-template-columns: minmax(0, 1fr); }
    .hm-card { padding: 24px; }
    .hm-card-figure { margin: -24px -24px 0 16px; }
    .hm-group { margin-top: 40px; padding-top: 32px; }
    .hm-group-head { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; }
    .hm-group-num { font-size: 44px; }
    .hm-band { margin-bottom: 40px; }
}
@media (max-width: 480px) {
    .hm-hero-actions .btn, .hm-close-actions .btn { width: 100%; }
    .hm-steps li { grid-template-columns: 40px minmax(0, 1fr); }
    .hm-steps li::before { font-size: 38px; }
}
