/* ==========================================================================
   Headbench - shared styles for index.html and contact.html
   Page-specific differences are scoped with a body class:
     .page-home     homepage
     .page-contact  contact page
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
    --red: #c8102e;
    --red-dark: #a50d26;
    --ink: #16161a;
    --body: #3f3f47;
    --muted: #71717c;
    --rule: #e3e3e8;
    --tint: #f6f6f8;
    --hard: #b52532;
    --soft: #4a76a8;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* geometric face matching the headbench wordmark */
    --brand: "Poppins", "Century Gothic", Futura, var(--sans);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

body {
    font-family: var(--sans);
    margin: 0;
    background: #ffffff;
    color: var(--body);
    font-size: 17px;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.75rem;
}

/* ---------- hero ---------- */
.hero {
    background: linear-gradient(180deg, var(--tint) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--rule);
}

.intro {
    padding: 3.5rem 0 3.25rem;
}

.intro-top {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    margin-bottom: 2.5rem;
}

/* on the contact page the wordmark sits above the portrait row,
   and nothing follows the row, so the spacing swaps ends */
.page-contact .wordmark { margin-bottom: 2.5rem; }
.page-contact .intro-top { margin-bottom: 0; }

/* ---------- wordmark ---------- */
.wordmark {
    font-family: var(--brand);
    font-weight: 700;
    font-size: 2.75rem;
    line-height: 1;
    letter-spacing: -0.025em;
    margin: 0 0 0.7rem;
}
a.wordmark {
    display: inline-block;
    text-decoration: none;
}
.wordmark .wm-head { color: var(--red); }
.wordmark .wm-bench { color: var(--ink); }

/* ---------- portrait ---------- */
.portrait-block {
    margin: 0;
    flex-shrink: 0;
    width: 148px;
}
.portrait {
    width: 148px;
    height: auto;              /* natural aspect, never crops the face */
    border-radius: 8px;
    display: block;
    background: var(--tint);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.14);
}
.portrait-block figcaption {
    margin-top: 0.65rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--muted);
    text-align: center;
}
.page-contact .portrait-block,
.page-contact .portrait { width: 124px; }

/* ---------- headings and text ---------- */
.role {
    font-size: 1rem;
    color: var(--muted);
    margin: 0;
}
.role .sep {
    color: var(--red);
    margin: 0 0.45rem;
}

.lead {
    font-weight: 600;
    font-size: 1.42rem;
    line-height: 1.45;
    color: var(--ink);
    margin: 0 0 1.6rem;
    letter-spacing: -0.022em;
}

.intro p + p {
    margin-top: 1.2rem;
}

.page-title {
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 0.6rem;
    letter-spacing: -0.028em;
}

h2 {
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.22;
    color: var(--ink);
    margin: 0 0 1.35rem;
    letter-spacing: -0.026em;
}

.eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 0.6rem;
}

.callout {
    border-left: 3px solid var(--red);
    padding: 0.15rem 0 0.15rem 1.4rem;
    margin: 2rem 0;
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--ink);
    letter-spacing: -0.015em;
}

/* ---------- sections ---------- */
section {
    padding: 3.5rem 0;
}
section + section {
    border-top: 1px solid var(--rule);
}
section.tinted {
    background: var(--tint);
    border-top: 1px solid var(--rule);
}

/* ---------- healthbench grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 470px;
    margin: 2.25rem auto 1.75rem;
}
.cell {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* the raised key-cap look of the original booklet tiles */
    background: linear-gradient(163deg, #fdfdfe 0%, #ececef 100%);
    border: 3px solid var(--soft);
    border-radius: 14px;
    box-shadow: 5px 6px 10px rgba(0, 0, 0, 0.17);
    font-size: 0.95rem;
    text-align: center;
    color: var(--soft);
}
.cell.hard {
    border-color: var(--hard);
    color: var(--hard);
}
.cell.core {
    border-color: #8e8e96;
    gap: 0.35rem;
}
.cell.core img {
    width: 28px;
    height: auto;
}
.cell.core span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
}
.cell.core span em {
    font-style: normal;
    color: var(--red);
}

.legend {
    display: flex;
    flex-wrap: wrap;           /* labels stack rather than overflow a narrow phone */
    justify-content: center;
    gap: 0.5rem 2rem;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 2.25rem;
}
.legend b { font-weight: 600; }
.legend .hard b { color: var(--hard); }
.legend .soft b { color: var(--soft); }

/* ---------- numbered list ---------- */
.items {
    list-style: none;
    padding: 0;
    margin: 0;
}
.items li {
    display: flex;
    gap: 1.15rem;
    padding: 1.35rem 0;
    border-top: 1px solid var(--rule);
}
.items li:first-child {
    border-top: none;
    padding-top: 0.25rem;
}
.items .num {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--red);
    line-height: 1.5;
    flex-shrink: 0;
}
.items h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 0.3rem;
}
.items p {
    margin: 0;
    font-size: 0.97rem;
}

/* ---------- button (link on the homepage, submit on the contact page) ---------- */
.btn {
    display: inline-block;
    padding: 0.8rem 2.1rem;
    background: var(--red);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.28);
    transition: background 0.2s, transform 0.1s;
}
.btn:hover {
    background: var(--red-dark);
}
.btn:active {
    transform: translateY(1px);
}
.btn:disabled {
    background: #a6a6ae;
    box-shadow: none;
    cursor: not-allowed;
}
a.btn {
    margin-top: 1.75rem;
}

/* ---------- contact form ---------- */
.form-section {
    padding: 3rem 0 3.5rem;
}
form {
    max-width: 520px;
}
label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}
input, textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    margin-bottom: 1.15rem;
    border: 1px solid #cfcfd6;
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 1rem;
    color: var(--ink);
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
    height: 140px;
    resize: vertical;
    line-height: 1.6;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.13);
}
.hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: -0.4rem 0 1.15rem;
}
.error {
    color: var(--red);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: none;
}
.success {
    color: #1c7a3e;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: none;
}

/* ---------- footer ---------- */
footer {
    padding: 3rem 0 2.75rem;
    border-top: 1px solid var(--rule);
    text-align: center;
}
.bottom-letters {
    font-size: 1.55rem;
    letter-spacing: 0.45rem;
    color: var(--ink);
}
.bottom-letters a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s;
}
.bottom-letters a:hover {
    color: var(--red);
}
.colophon {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 1.6rem;
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
    body { font-size: 16px; }
    .wrap { padding: 0 1.25rem; }

    .intro { padding: 2.75rem 0; }
    .intro-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .portrait-block figcaption { text-align: left; }
    .page-contact .wordmark { margin-bottom: 1.75rem; }

    .wordmark { font-size: 2.15rem; }
    .lead { font-size: 1.2rem; }
    .page-title { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    .callout { font-size: 1.05rem; }

    section { padding: 2.75rem 0; }
    .form-section { padding: 2.25rem 0 2.75rem; }

    .grid { gap: 0.6rem; }
    .cell {
        font-size: 0.76rem;
        border-width: 2px;
        border-radius: 10px;
        box-shadow: 3px 4px 7px rgba(0, 0, 0, 0.16);
    }
    .cell.core img { width: 22px; }
    .cell.core span { font-size: 0.62rem; }
    .legend { gap: 0.4rem 1.25rem; }

    /* 9 wide-tracked letters must still fit a 320px phone */
    .bottom-letters { font-size: 1.2rem; letter-spacing: 0.26rem; }
}
