/* ============================================================================
   Homepage. Builds on service-page.css (the site design system); only the
   components unique to the homepage live here. Prefix: .hm-
   ========================================================================== */

/* ---------------------------------------------------------------- hero ---- */
/* Deep-teal hero: portfolio work wall (z 0) under a teal wash (::before,
   z 1) and the blueprint grid (::after, z 1), copy on top (z 2). */
.hm-hero {
    position: relative;
    overflow: hidden;
    background: var(--color-deep);
    padding: 140px 0 80px;
    min-height: min(92dvh, 820px);
    display: flex;
    align-items: flex-end;
}
/* Work wall: three columns on the right drifting in alternate directions,
   washed toward the copy side so the headline always reads. Linear, because
   it is ambient constant motion; each track holds its list twice and moves
   by exactly -50%, so the loop has no seam. */
.hm-wall {
    position: absolute;
    top: -40px;
    bottom: -40px;
    right: -2%;
    width: 54%;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    transform: rotate(-6deg);
    transform-origin: center;
    opacity: 0.9;
}
.hm-wall-col { overflow: hidden; }
.hm-wall-track { display: flex; flex-direction: column; gap: 16px; animation: hm-drift 60s linear infinite; }
.hm-wall-col:nth-child(2) .hm-wall-track { animation-direction: reverse; animation-duration: 70s; }
.hm-wall-col:nth-child(3) .hm-wall-track { animation-duration: 54s; }
.hm-wall img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 1px solid rgba(255, 255, 255, 0.12); }
@keyframes hm-drift { to { transform: translateY(-50%); } }
.hm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to right, #073447 0%, #073447 40%, rgba(7, 52, 71, 0.82) 55%, rgba(7, 52, 71, 0.35) 100%),
        linear-gradient(to top, rgba(7, 52, 71, 0.95), transparent 40%);
    pointer-events: none;
}
@media (max-width: 991px) {
    .hm-wall { width: 100%; right: 0; opacity: 0.35; }
    .hm-hero::before { background: linear-gradient(to bottom, rgba(7, 52, 71, 0.7), #073447 70%); }
}
.hm-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 80px 80px;
    -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
            mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
    pointer-events: none;
}
.hm-hero > .brx-shell { position: relative; z-index: 2; width: 100%; }

.hm-hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 72px;
    align-items: end;
}
@media (max-width: 991px) {
    .hm-hero { padding: 116px 0 64px; min-height: 0; }
    .hm-hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* The one place on the site where the headline is allowed to be loud. */
.hm-h1 {
    font-size: clamp(36px, 4vw, 60px);
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 700;
    color: #fff;
    margin: 0 0 28px;
    max-width: 18ch;
    text-wrap: balance;
}
.hm-h1 em { font-style: normal; color: var(--color-brand); }
.hm-hero-copy .brx-lede { max-width: 60ch; }
.hm-support { margin: 26px 0 0; color: rgba(255, 255, 255, 0.55); max-width: 60ch; line-height: 1.6; }

/* Services index panel, bottom-right of the hero. */
.hm-index { border: 1px solid var(--ind-rule-light); background: rgba(4, 30, 41, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hm-index-head {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ind-rule-light);
    color: rgba(255, 255, 255, 0.55);
}
.hm-index-head span { color: inherit; font-family: inherit; }
.hm-index a {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ind-rule-light);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: background-color 200ms ease;
}
.hm-index a:last-child { border-bottom: 0; }
.hm-index a .ind-mono { color: var(--color-brand); }
.hm-index a .brx-arrow { transition: transform 200ms var(--ind-ease); }
@media (hover: hover) and (pointer: fine) {
    .hm-index a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
    .hm-index a:hover .brx-arrow { transform: translateX(3px); }
}

/* ------------------------------------------------------------ services --- */
/* Ruled rows: numeral, copy, thumbnail, action. The row answers as a whole. */
.hm-svc { border-top: 2px solid var(--ind-rule-strong); }
.hm-svc-row {
    display: grid;
    grid-template-columns: 110px 1fr 240px 200px;
    gap: 32px;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--ind-rule);
    color: var(--ind-ink);
    text-decoration: none;
    position: relative;
}
.hm-svc-n {
    font-size: clamp(44px, 4.4vw, 68px);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ind-deep);
    transition: color 260ms ease, -webkit-text-stroke-color 260ms ease;
}
.hm-svc-copy strong { display: block; font-size: clamp(20px, 1.6vw, 24px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--ind-ink); margin-bottom: 8px; }
.hm-svc-copy > span { display: block; font-size: 16px; line-height: 1.55; color: var(--color-body); max-width: 50ch; }
.hm-svc-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ind-deep); border: 1px solid var(--ind-rule); }
.hm-svc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 700ms var(--ind-ease); }
.hm-svc-cta { display: flex; justify-content: flex-end; align-items: center; gap: 10px; color: var(--ind-ink); text-align: right; }
.hm-svc-cta .brx-arrow { flex: none; transition: transform 200ms var(--ind-ease); }

/* The AI row has no photograph; a tiny workflow readout stands in. */
.hm-flow { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 100%; padding: 14px 16px; color: #fff; font-size: 10px; }
.hm-flow span { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--ind-rule-light); color: #fff; font-family: var(--ind-mono); }
.hm-flow span::before { content: ""; width: 6px; height: 6px; background: var(--ind-red); flex: none; }
.hm-flow span:last-child { border-color: rgba(232, 66, 66, 0.6); }

@media (hover: hover) and (pointer: fine) {
    .hm-svc-row:hover .hm-svc-n { color: var(--ind-red); -webkit-text-stroke-color: var(--ind-red); }
    .hm-svc-row:hover .hm-svc-thumb img { transform: scale(1.05); }
    .hm-svc-row:hover .brx-arrow { transform: translateX(4px); }
    .hm-svc-row:hover .hm-svc-cta { color: var(--ind-red); }
}
.hm-svc-row:focus-visible { outline: 2px solid var(--ind-red); outline-offset: 4px; }
@media (max-width: 1199px) { .hm-svc-row { grid-template-columns: 110px 1fr 220px; } .hm-svc-cta { grid-column: 2 / -1; justify-content: flex-start; } }
@media (max-width: 767px) {
    .hm-svc-row { grid-template-columns: 64px 1fr; gap: 12px 18px; }
    .hm-svc-n { font-size: 48px; }
    .hm-svc-thumb { grid-column: 1 / -1; grid-row: 2; }
    .hm-svc-cta { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- work --- */
.hm-work { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.hm-work-item {
    grid-column: span var(--span, 4);
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10.5;
    background: var(--color-surface-alt);
    border: 1px solid var(--ind-rule);
}
.hm-work-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 800ms var(--ind-ease); }
.hm-work-cap {
    position: absolute;
    left: 0;
    bottom: 0;
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 11px 16px;
    background: var(--ind-deep);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 220ms ease;
}
.hm-work-cap .ind-mono { color: var(--color-brand); }
@media (hover: hover) and (pointer: fine) {
    .hm-work-item:hover img { transform: scale(1.045); }
    .hm-work-item:hover .hm-work-cap { background: var(--ind-red); }
    .hm-work-item:hover .hm-work-cap .ind-mono { color: #fff; }
}
@media (max-width: 991px) { .hm-work-item { grid-column: span 6; } }
@media (max-width: 575px) { .hm-work { grid-template-columns: 1fr; gap: 14px; } .hm-work-item { grid-column: auto; } }

/* ------------------------------------------------------------- results --- */
.hm-results { background: var(--ind-deep); position: relative; overflow: hidden; }
.hm-results::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(40% 60% at 90% 0%, rgba(232, 66, 66, 0.18), transparent 70%),
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 80px 80px;
    pointer-events: none;
}
.hm-results > .brx-shell { position: relative; }
.hm-score .ind-score-cell { text-decoration: none; transition: background-color 220ms ease; }
.hm-score .ind-score-v { font-size: clamp(34px, 3.4vw, 54px); }
@media (hover: hover) and (pointer: fine) { .hm-score .ind-score-cell:hover { background: #0a3f55; } }
@media (max-width: 1199px) and (min-width: 992px) { .hm-score { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } }

/* --------------------------------------------------------- consult band -- */
.hm-band { background: var(--ind-red); color: #fff; padding: 92px 0; position: relative; overflow: hidden; }
.hm-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 14px);
    -webkit-mask-image: linear-gradient(to left, #000, transparent 60%);
            mask-image: linear-gradient(to left, #000, transparent 60%);
    pointer-events: none;
}
.hm-band > .brx-shell { position: relative; }
.hm-band-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 64px; align-items: end; }
.hm-band-h { font-size: clamp(28px, 3.2vw, 48px); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; color: #fff; margin: 0; max-width: 16ch; text-wrap: balance; }
.hm-band p { font-size: 18px; line-height: 1.6; color: rgba(255, 255, 255, 0.92); margin: 0 0 26px; }
.hm-band-btn { background: var(--ind-deep); color: #fff; }
@media (hover: hover) and (pointer: fine) { .hm-band-btn:hover { background: #041e29; color: #fff; } }
@media (max-width: 991px) { .hm-band { padding: 64px 0; } .hm-band-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ------------------------------------------------------------- contact --- */
.hm-contact { background: var(--ind-deep); }
.hm-contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 72px; align-items: start; }
@media (max-width: 991px) { .hm-contact-grid { grid-template-columns: 1fr; gap: 44px; } }

@media (prefers-reduced-motion: reduce) {
    .hm-svc-thumb img, .hm-work-item img, .hm-svc-n { transition: none; }
    .hm-wall-track { animation: none; }
}
