/* =================================================================
   refine.css  -  editorial + mobile-first layer (v1.0)

   Loaded AFTER style.css. Nothing here removes motion: the compass
   HUD, decrypt sweeps, parallax dividers, rulers and GSAP reveals all
   still run. This file only:
     1. gives every home section a single, authored head (chapter
        numeral + headline + thesis) instead of eyebrow/H2/centered
        paragraph repeated under a banner that says the same thing,
     2. lays sections out phone-first (left-aligned reading column,
        swipeable cards, collapsible offering lists), then widens,
     3. styles the name-plated partner portraits (names live in the
        artwork, not in page text).
   ================================================================= */

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

/* ---------- 1. Editorial section head ----------------------------
   Phone: numeral + kicker on one line, headline, thesis below.
   ≥ 900px: numeral | headline column | thesis column.            */
.rf-head {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "num main"
        "thesis thesis";
    column-gap: 1rem;
    row-gap: 1.1rem;
    align-items: start;
    text-align: left;
    margin: 0 0 clamp(2rem, 5vw, 3.5rem);
    max-width: none;
}
.rf-num {
    grid-area: num;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.6rem, 9vw, 5.5rem);
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 1px var(--accent);
    opacity: 0.9;
    padding-top: 0.15em;
    user-select: none;
}
.rf-head-main { grid-area: main; min-width: 0; }
.rf-kicker {
    display: block;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.55rem;
}
.rf-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.9rem, 7.2vw, 3.6rem);
    line-height: 1.04;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 0;
    text-wrap: balance;
}
.rf-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}
.rf-thesis {
    grid-area: thesis;
    margin: 0;
    max-width: 46ch;
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1.02rem, 2.6vw, 1.2rem);
    line-height: 1.6;
    color: var(--ink-body);
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
    text-align: left;
}
@media (min-width: 900px) {
    .rf-head {
        grid-template-columns: auto minmax(0, 1.25fr) minmax(0, 1fr);
        grid-template-areas: "num main thesis";
        column-gap: clamp(1.5rem, 3vw, 3rem);
        align-items: end;
    }
    .rf-thesis { justify-self: end; }
}

/* ---------- 2. "How HKP delivers" section ------------------------ */
.menu-intro--monumental { text-align: left; }
.menu-intro--monumental .mim-tri-bar:first-child { margin-bottom: clamp(2rem, 5vw, 3.25rem); }

/* Explainers: swipeable cards on phones, three columns from 720px */
@media (max-width: 719px) {
    .mim-explainers {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 84%;
        grid-template-columns: none;
        gap: 0.9rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        margin-left: calc(var(--gutter) * -1);
        margin-right: calc(var(--gutter) * -1);
        padding: 0 var(--gutter) 1rem;
        scroll-padding: 0 var(--gutter);
        scrollbar-width: none;
    }
    .mim-explainers::-webkit-scrollbar { display: none; }
    .mim-explainers .me { scroll-snap-align: start; }
    .me .me-image { aspect-ratio: 16 / 10; }
}
.me .me-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--me-accent, var(--accent));
    text-decoration: none;
    min-height: 44px;
}
.rf-more span { transition: transform var(--t-fast) var(--ease); }
.rf-more:hover span { transform: translateX(4px); }

/* Swipe hint dots under the card rail (phones only, drawn by refine.js) */
.rf-swipe-hint {
    display: flex; gap: 6px; justify-content: center;
    margin: 0.25rem 0 0.5rem;
}
.rf-swipe-hint i {
    width: 18px; height: 2px; background: rgba(255,255,255,0.18);
    transition: background var(--t-fast) var(--ease), width var(--t-fast) var(--ease);
}
.rf-swipe-hint i.is-on { background: var(--accent); width: 32px; }
@media (min-width: 720px) { .rf-swipe-hint { display: none; } }

/* Offerings: <details> accordions. Collapsed on phones (refine.js),
   open and non-interactive-looking on desktop. */
.rf-acc > summary { list-style: none; cursor: pointer; }
.rf-acc > summary::-webkit-details-marker { display: none; }
.rf-acc > summary { display: flex; align-items: center; gap: 0.75rem; min-height: 56px; }
.rf-acc .count { margin-left: auto; }
.rf-acc-icon {
    position: relative;
    width: 14px; height: 14px; flex: 0 0 14px;
}
.rf-acc-icon::before, .rf-acc-icon::after {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    height: 1.5px; background: var(--ml-line-accent, var(--accent));
    transition: transform var(--t-med) var(--ease);
}
.rf-acc-icon::after { transform: rotate(90deg); }
.rf-acc[open] .rf-acc-icon::after { transform: rotate(0deg); }
@media (min-width: 900px) {
    .rf-acc > summary { cursor: default; pointer-events: none; }
    .rf-acc-icon { display: none; }
}
@media (max-width: 899px) {
    .menu-27-grid { gap: 0 !important; }
    .rf-acc { border-bottom: 1px solid rgba(255,255,255,0.08); }
    .rf-acc > summary .label { font-size: 0.8rem; letter-spacing: 0.16em; line-height: 1.3; }
    .rf-acc[open] .menu-sub-band { padding-bottom: 1rem; }
}
.rf-acc-all .ml-num { color: var(--ml-line-accent, var(--accent)); }
.rf-acc-all .ml-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ml-line-accent, var(--accent));
}

/* ---------- 3. Helms Standard ------------------------------------ */
.helms-standard-intro.rf-head { text-align: left; max-width: none; }
.helms-standard-intro.rf-head p.rf-thesis { margin: 0; max-width: 46ch; font-size: clamp(1.02rem, 2.6vw, 1.2rem); }
@media (max-width: 767px) {
    /* The crosshair + rulers are a 2-D chart; stacked into one column
       the vertical axis just strikes through the paragraphs. Keep the
       frame, drop the axes, and read each quadrant as a left-aligned
       entry with its image on the side. */
    .hs-cross-x, .hs-cross-y, .hs-origin, .hs-axis-label,
    .hs-ruler-left, .hs-ruler-right { display: none !important; }
    .helms-standard-grid { gap: 0 !important; }
    .hs-card {
        display: grid !important;
        grid-template-columns: 76px 1fr;
        grid-template-areas: "coord coord" "icon title" "body body";
        column-gap: 1rem;
        row-gap: 0.6rem;
        align-items: center;
        text-align: left !important;
        padding: 1.5rem 0.25rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .hs-card .hs-coord { grid-area: coord; justify-content: flex-start; margin: 0 !important; }
    .hs-card .hs-icon  { grid-area: icon; width: 76px !important; height: 76px !important; margin: 0 !important; }
    .hs-card .hs-icon img { width: 100%; height: 100%; object-fit: cover; }
    .hs-card h3 { grid-area: title; margin: 0 !important; font-size: 1.3rem; text-align: left; }
    .hs-card p  { grid-area: body; margin: 0 !important; text-align: left; max-width: none; }
}

/* ---------- 4. Leadership preview: name-plated trio -------------- */
.rf-lp { text-align: left; }
.rf-lp .rf-head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.rf-trio {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0.5rem var(--gutter) 1.25rem;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
}
.rf-trio::-webkit-scrollbar { display: none; }
@media (min-width: 720px) {
    .rf-trio {
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: visible;
        margin: 0;
        padding: 0.5rem 0 1rem;
        gap: clamp(1rem, 2.5vw, 2rem);
    }
}
.rf-trio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
}
.rf-trio-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 512 / 612;
    object-fit: cover;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 4px 14px rgba(0,0,0,0.4);
    transition: transform var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease);
}
a.rf-trio-card:hover img,
a.rf-trio-card:focus-visible img {
    transform: translateY(-4px);
    box-shadow: 0 26px 60px rgba(0,0,0,0.7), 0 0 0 1px var(--accent);
}
.rf-trio-role {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    padding-left: 0.85rem;
    border-left: 2px solid var(--accent);
}
.rf-lp-foot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
}
.rf-lp-foot .lp-count { text-align: left; margin: 0; letter-spacing: 0.14em; font-size: 0.8rem; }
@media (min-width: 720px) {
    .rf-lp-foot { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- 5. Careers ------------------------------------------ */
.careers-head.rf-head { text-align: left; }
@media (max-width: 767px) {
    .careers-copy, .careers-copy p { text-align: left !important; }
    .careers-img { max-width: none !important; aspect-ratio: 4 / 3; overflow: hidden; }
    .careers-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
    .careers-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- 6. Leadership page: plated cards --------------------- */
/* Names are in the portrait; the card meta shows role only. */
.partner-card--plated .partner-portrait { aspect-ratio: 512 / 612; }
.partner-card--plated .partner-portrait img { object-position: center bottom; }


/* Phones: two-up grid with even rows. The base sheet shrinks
   portraits to a max-width and centres them, which leaves ragged
   staggered cards; fill the column instead. */
@media (max-width: 599px) {
    .partners-grid { gap: 1.75rem 0.85rem !important; align-items: start; }
    .partner-portrait { max-width: none !important; margin: 0 0 0.75rem !important; }
    .partner-meta { text-align: left !important; align-items: flex-start !important; }
    .partner-name { font-size: 1.05rem !important; }
    .partner-title { font-size: 0.78rem !important; }
}

/* ---------- 7. Parallax dividers: tighter on phones -------------- */
@media (max-width: 640px) {
    .parallax-divider h2.text-glow {
        font-size: clamp(1.7rem, 8vw, 2.4rem) !important;
        line-height: 1.12;
        padding: 0 1.25rem;
        text-wrap: balance;
    }
}

/* ---------- 8. Hero: phone ergonomics ---------------------------- */
@media (max-width: 640px) {
    /* Three line pills as an even row of tap targets instead of a
       narrow centred stack. */
    .hero-ctas .cta--lines {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
    }
    .hero-ctas .hero-line-pill {
        flex-direction: column;
        justify-content: center;
        gap: 0.45rem;
        padding: 0.7rem 0.3rem 0.65rem;
        border-left-width: 1px;
        border-top: 3px solid var(--line-accent);
        min-height: 76px;
        width: 100%;
        letter-spacing: 0.12em;
        font-size: 0.66rem;
    }
    .hero-ctas .hero-line-pill .arrow { display: none; }
    .hero-ctas { width: 100%; }
    .hero-ctas .cta--secondary, .hero-ctas .cta--secondary .magnetic { width: 100%; }
    .hero-ctas .cta--secondary .btn { width: 100%; justify-content: center; min-height: 48px; }
}

/* ---------- 9. Fixes ------------------------------------------- */
/* a.no-rule { padding: 0 } (0,1,1) outranked .btn (0,1,0), so every
   <a class="btn no-rule"> collapsed to a thin strip. Restore. */
.btn.no-rule { padding: 0.95rem 1.9rem; min-height: 48px; }
@media (max-width: 640px) { .btn.no-rule { padding: 1rem 1.6rem; } }
.btn.btn-small.no-rule { padding: 0.6rem 1.25rem; min-height: 0; }

/* Leadership head inherits the old .lp-compact-inner h2 sizing. */
.rf-lp .rf-title { font-size: clamp(1.9rem, 7.2vw, 3.6rem); margin: 0; }
.rf-lp .rf-thesis { margin: 0; font-size: clamp(1.02rem, 2.6vw, 1.2rem); color: var(--ink-body); }

/* Quadrant coordinate labels read left on phones. */
@media (max-width: 767px) {
    .hs-card .hs-coord { justify-self: start; text-align: left; }
}

/* Plated bio portrait: frame to the artwork, no empty bar. */
.bio-portrait--plated { aspect-ratio: 512 / 612; height: auto !important; }
.bio-portrait--plated img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* Senior row: match the plated portraits' ratio so the row stays level. */
#senior-partners .partner-portrait { aspect-ratio: 512 / 612; }
.lp-compact-inner.rf-lp { max-width: var(--max-w); text-align: left; }
.leadership-preview--compact:has(.rf-lp) { padding: clamp(3.5rem, 7vw, 6rem) 0; }
@media (min-width: 900px) { .rf-head { align-items: center; } .rf-num { align-self: center; } }
.careers-copy, .careers-copy p { text-align: left !important; }
.careers-copy .careers-cta { text-align: left; justify-content: flex-start; display: flex; }

/* Header bar had zero side padding on phones: wordmark touched the
   screen edge. */
@media (max-width: 1099px) {
    .site-header .container.bar { padding-left: var(--gutter); padding-right: var(--gutter); }
}

/* Careers photo is a square two-shot; a 3:4 frame cut both people. */
.careers-img { aspect-ratio: 1 / 1; max-width: 520px; }
.careers-img img { object-position: center 20%; }

/* =================================================================
   v1 copy on the v2 home: extra blocks
   ================================================================= */
#divider-approach { background-image: url('/images/helm.jpg'); }
@media (max-width: 767px) { #divider-approach { background-image: url('/images/hands2mobile.jpg'); } }

/* H&P monogram in the hero (square, framed artwork) */
.rf-hp-logo img {
    width: clamp(200px, 36vh, 380px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    filter: drop-shadow(0 18px 40px rgba(0,0,0,0.6));
}

/* Bullet lists inside domain cards and the criteria card */
.rf-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.rf-list li {
    position: relative;
    padding: 0.62rem 0 0.62rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: 'Source Serif 4', serif;
    font-size: 0.98rem;
    color: var(--ink);
    line-height: 1.4;
}
.rf-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 1.08rem;
    width: 0.65rem; height: 1px;
    background: var(--me-accent, var(--accent));
}

/* Leadership blurbs under the plated portraits */
.rf-trio-blurb {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink-body);
}

/* Worldview: prose + criteria card */
.rf-worldview, .rf-approach { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.rf-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}
@media (min-width: 900px) { .rf-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.rf-prose {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(1.25rem, 3.6vw, 1.75rem);
    line-height: 1.45;
    color: var(--ink);
    text-wrap: pretty;
}
.rf-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.08);
    border-top: 3px solid var(--accent);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.rf-card-img { aspect-ratio: 16 / 7; overflow: hidden; }
.rf-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-card-body { padding: clamp(1.25rem, 3vw, 2rem); }
.rf-card-body h3 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.35rem, 3.5vw, 1.7rem);
    margin: 0 0 0.75rem;
    color: var(--ink);
}
.rf-card-body p { color: var(--ink-body); line-height: 1.65; margin: 0 0 1rem; }

/* Approach: three numbered steps */
.rf-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    counter-reset: none;
}
@media (min-width: 900px) { .rf-steps { grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); } }
.rf-step {
    position: relative;
    padding: 1.6rem 0 1.6rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 900px) { .rf-step { padding: 1.8rem 0 0; border-top: 2px solid var(--accent); } }
.rf-step-num {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 2.6rem;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--accent);
    margin-bottom: 0.6rem;
}
.rf-step h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin: 0 0 0.5rem;
    color: var(--ink);
}
.rf-step p { margin: 0; color: var(--ink-body); line-height: 1.65; max-width: 40ch; }

/* Careers: three traits */
.rf-traits {
    display: grid;
    gap: 0;
    margin: 0.5rem 0 1.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.rf-trait { padding: 1.1rem 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.rf-trait h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin: 0 0 0.35rem;
    color: var(--accent);
}
.careers-copy .rf-trait p { margin: 0 !important; font-size: 0.98rem; }
.rf-step p, .rf-card-body p { font-family: 'Source Serif 4', serif; font-size: 1rem; }

/* V3: in-page anchors land below the fixed header */
section[id], article[id] { scroll-margin-top: calc(var(--header-h, 88px) + 12px); }
