/* Pattern-specific styles — added per task */

/* ── Shared components (editorial direction) ───── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--off-white); color: var(--ink); }

.btn-sm { min-height: 44px; padding: 0 20px; font-size: 14px; }

/* on dark cards */
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-on-dark { background: transparent; color: var(--paper); border-color: #6B665E; }
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: var(--paper); }

.eyebrow {
    margin: 0;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--accent-text);
}

/* #8A857C is only ~3.4:1 on cream — too low for 12px text, so the
   "muted" eyebrow uses the body muted instead. */
.eyebrow--muted { color: var(--muted); }
.eyebrow--on-dark { color: var(--accent-on-dark); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin-top: 16px;
}

.chips li {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12.5px;
    color: #3A3835;
}

/* ── Header ────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.2s ease;
    padding-inline: max(20px, calc((100% - 1200px) / 2));
    padding-block: 20px;
}

.site-header.is-scrolled {
    box-shadow: 0 1px 0 var(--line);
}

/* Wordmark — core Site Title block, set in the display serif */
.site-logo {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.site-logo a {
    color: var(--ink);
    text-decoration: none;
}

.site-logo a:hover { color: var(--accent); }

.header-nav { gap: 28px; }

.primary-nav .wp-block-navigation-item__content {
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.primary-nav .wp-block-navigation__container { gap: 28px; }

.primary-nav .wp-block-navigation-item__content:hover,
.primary-nav .wp-block-navigation-item__content[aria-current="page"] {
    color: var(--accent-text);
}

.primary-nav .wp-block-navigation-item__content[aria-current="page"] {
    position: relative;
}

.primary-nav .wp-block-navigation-item__content[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--accent-text);
}

/* Mobile overlay menu */
.primary-nav .wp-block-navigation__responsive-container.is-menu-open {
    background: var(--paper) !important;
    padding: 24px;
}

.primary-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 400;
}

/* 44px touch target; display stays WP's (hidden on desktop) */
.primary-nav .wp-block-navigation__responsive-container-open,
.primary-nav .wp-block-navigation__responsive-container-close {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .header-cv { display: none; }
}

@media (max-width: 768px) {
    .site-header { padding-block: 12px; }
    .site-logo { font-size: 18px; }
}

/* ── Footer ────────────────────────────────────── */
.site-footer {
    margin-top: 96px;
    padding: 64px max(20px, calc((100% - 1200px) / 2)) 32px;
    background: var(--off-white);
    border-top: 1px solid var(--line);
    font-size: 15px;
    color: var(--muted);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr));
    gap: 40px 24px;
}

.site-footer__name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

.site-footer__name:hover { color: var(--accent); }

.site-footer__tagline {
    margin-top: 12px;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1.3;
    color: #2E2C29;
}

.site-footer__meta { margin-top: 8px; font-size: 14px; }

.site-footer__label {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-footer__col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-footer a:not(.site-footer__name) {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer a:not(.site-footer__name):hover { color: var(--accent-text); }

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 24px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.site-footer__cookies {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.site-footer__cookies:hover { color: var(--accent-text); }

@media (max-width: 1024px) {
    .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .site-footer { margin-top: 64px; padding-top: 48px; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px 16px; }
    .site-footer__col ul { gap: 12px; }
    .site-footer__col a { display: inline-block; padding-block: 2px; }
}

/* ═══════════════════════════════════════════════════
   HOME — editorial (front-page.html, patterns/home-*.php)
   ═══════════════════════════════════════════════════ */
.h-wrap {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

@media (min-width: 1240px) {
    .h-wrap { padding-inline: 0; }
}

.h-section { padding-top: 96px; }

.h-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 36px;
}

.h-head--split {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.h-head--split > div { display: flex; flex-direction: column; gap: 10px; }

.h-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.h-title--sm { font-size: clamp(30px, 3vw, 40px); }

.h-more {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-text);
    white-space: nowrap;
}

.h-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

/* Hero */
.h-hero { padding: 72px 0 96px; }

.h-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 24px;
    align-items: center;
}

.h-hero__copy {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.h-hero__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(42px, 5.8vw, 84px);
    font-weight: 400;
    line-height: 1.0;
    letter-spacing: -0.02em;
}

.h-hero__title em {
    font-style: italic;
    color: var(--accent);
}

.h-hero__lead {
    font-size: 20px;
    line-height: 1.5;
    color: #3A3835;
    max-width: 620px;
}

.h-hero__meta {
    list-style: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

/* inline items so separators wrap with the text, never lead a line */
.h-hero__meta li { display: inline; }

.h-hero__meta li + li::before {
    content: "\00A0\00B7\00A0 ";
}

.h-hero__photo { display: flex; justify-content: flex-end; }

.h-hero__photo img {
    width: 100%;
    max-width: 440px;
    aspect-ratio: 440 / 560;
    height: auto;
    object-fit: cover;
    object-position: center top;
    border-radius: 20px;
}

/* Proof numbers + logos */
.h-proof__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    padding: 40px 0;
    border-block: 1px solid var(--line);
}

.h-proof__grid > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.h-stat {
    font-family: var(--font-display);
    font-size: clamp(40px, 3.6vw, 52px);
    font-weight: 300;
    line-height: 1;
    white-space: nowrap;
}

.h-proof__grid dd {
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

.h-logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 40px;
}

.h-logos__label {
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.h-logos__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 56px;
    list-style: none;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--muted-2);
}

/* Selected work cards */
.h-cases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.h-case {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.2s;
}

.h-case:hover {
    color: var(--ink);
    border-color: var(--ink);
    transform: translateY(-2px);
}

/* Typographic covers until real product imagery exists */
.h-case__cover {
    height: 240px;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 300;
    line-height: 1.1;
}

.h-case__cover--jti       { background: #1B2A26; color: #9FB8AE; }
.h-case__cover--nespresso { background: #2B2622; color: #BFB3A4; }
.h-case__cover--danone    { background: #23262B; color: #A9B0BA; }

.h-case__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    flex: 1;
}

.h-case__meta {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.h-case__title {
    margin: 0;
    font-family: var(--font);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.h-case__text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

.h-case__metric {
    margin-top: auto;
    padding-top: 6px;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 300;
    color: var(--accent);
}

.h-case__metric span {
    font-family: var(--font);
    font-size: 14px;
    color: var(--muted);
}

/* Experience */
.h-exp {
    list-style: none;
    border-top: 1px solid var(--line);
}

.h-exp__row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 160px;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--line);
}

.h-exp__when {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.h-exp__when span {
    display: block;
    font-size: 13px;
}

.h-exp__company {
    margin: 0;
    font-family: var(--font);
    font-size: 20px;
    font-weight: 600;
}

.h-exp__role {
    margin-top: 4px;
    font-size: 15px;
    color: var(--muted);
}

.h-exp__bullets {
    margin-top: 14px;
    padding-left: 18px;
    font-size: 15px;
    line-height: 1.55;
    color: #2E2C29;
}

.h-exp__bullets li { margin-bottom: 6px; }

.h-exp__metric {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 300;
    color: var(--accent);
    text-align: right;
}

.h-exp__metric span {
    display: block;
    font-family: var(--font);
    font-size: 13px;
    color: var(--muted);
}

/* Skills */
.h-skills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
}

.h-skills__cat {
    margin: 0 0 14px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--accent-text);
}

.h-skills ul {
    list-style: none;
    font-size: 15px;
    line-height: 1.7;
    color: #2E2C29;
}

/* Beyond the day job + recent writing */
.h-beyond {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 1fr) minmax(0, 6fr);
    gap: 24px;
}

.h-beyond__intro {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.h-beyond__intro .h-actions { margin-top: 8px; }

.h-beyond__text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.h-beyond__writing { grid-column: 3; }

.h-beyond__writing .eyebrow { margin-bottom: 14px; }

.writing-list {
    list-style: none;
    border-top: 1px solid var(--line);
}

.writing-list li { border-bottom: 1px solid var(--line); }

.writing-list__item {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0;
    color: var(--ink);
    text-decoration: none;
}

.writing-list__item:hover { color: var(--accent); }

.writing-list__title {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.35;
}

.writing-list__date {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 3px;
}

/* Education / certifications / languages */
.h-creds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
}

.h-creds .eyebrow { margin-bottom: 18px; }

.h-dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 24px;
    font-size: 15px;
}

.h-dl dt {
    padding-top: 3px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.h-dl dd span {
    display: block;
    font-size: 14px;
    color: var(--muted);
}

/* Contact card */
.h-contact-wrap { padding-top: 96px; }

.h-contact {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 1fr) minmax(0, 4fr);
    gap: 24px;
    align-items: center;
    padding: 72px;
    background: var(--ink);
    color: var(--paper);
    border-radius: 24px;
}

.h-contact__copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.h-contact__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(32px, 3.4vw, 48px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--paper);
}

.h-contact__text {
    font-size: 17px;
    line-height: 1.5;
    color: #C9C3B8;
}

.h-contact__actions {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Home — tablet */
@media (max-width: 1024px) {
    .h-proof__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .h-cases { grid-template-columns: 1fr; }
    .h-case { flex-direction: row; }
    .h-case__cover { width: 38%; height: auto; min-height: 220px; flex-shrink: 0; }
    .h-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h-beyond { grid-template-columns: 1fr; gap: 48px; }
    .h-beyond__writing { grid-column: auto; }
    .h-creds { grid-template-columns: 1fr 1fr; }
    .h-contact { grid-template-columns: 1fr; padding: 56px; }
    .h-contact__actions { grid-column: auto; flex-direction: row; flex-wrap: wrap; }
}

/* Home — mobile (matches the 390px artboard) */
@media (max-width: 768px) {
    .h-section, .h-contact-wrap { padding-top: 64px; }
    .h-hero { padding: 8px 0 28px; }
    .h-hero__grid { grid-template-columns: 1fr; gap: 18px; }
    .h-hero__photo { order: -1; justify-content: stretch; }
    .h-hero__photo img {
        max-width: none;
        aspect-ratio: 350 / 300;
        object-position: center 20%;
        border-radius: 16px;
    }
    .h-hero__copy { gap: 18px; }
    .h-hero__lead { font-size: 16px; }
    .h-hero__copy .h-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .h-hero__meta { font-size: 13px; }

    .h-proof__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; padding: 24px 0; }
    .h-proof__grid > div:last-child { display: none; }
    .h-stat { font-size: 36px; }
    .h-proof__grid dd { font-size: 13px; }
    .h-logos { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 20px; }
    .h-logos__label { font-size: 12px; }
    .h-logos__list { font-size: 17px; gap: 8px 20px; }

    .h-head--split { flex-direction: column; align-items: flex-start; }
    .h-case { flex-direction: column; }
    .h-case__cover { width: auto; height: 160px; min-height: 0; font-size: 24px; padding: 18px; }
    .h-case__body { padding: 18px; }
    .h-case__title { font-size: 18px; }
    .h-case__metric { font-size: 26px; }

    .h-exp__row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
    .h-exp__metric { text-align: left; order: -1; font-size: 26px; }
    .h-exp__metric span { display: inline; margin-left: 8px; }
    .h-exp__when { order: -2; }

    .h-skills { grid-template-columns: 1fr; gap: 28px; }
    .h-creds { grid-template-columns: 1fr; gap: 40px; }
    .h-dl { grid-template-columns: 100px 1fr; }

    .writing-list__item { flex-direction: column; gap: 6px; }

    .h-contact { padding: 40px 24px; border-radius: 20px; }
    .h-contact__actions { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════
   INNER PAGES — editorial (page-*.html). Work/About/Contact follow the
   redesign canvas; Teaching/Writing/Projects/Now use the same language.
   Reuses .h-wrap, .h-section, .h-head, .h-title, .h-more, .h-dl,
   .h-contact, .eyebrow, .btn, .chips from the home block.
   ═══════════════════════════════════════════════════ */

/* Page head — eyebrow + display H1, optional aside or portrait */
.p-head { padding: 56px 0 72px; }

.p-head__grid {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 1fr) minmax(0, 3fr);
    gap: 24px;
    align-items: end;
}

.p-head__main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.p-head__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(42px, 4.6vw, 64px);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.p-head__title em {
    font-style: italic;
    color: var(--accent);
}

.p-head__aside {
    grid-column: 3;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.p-head__aside a { font-weight: 600; }

/* About variant: copy left, portrait right */
.p-head__grid--photo {
    grid-template-columns: minmax(0, 7fr) minmax(0, 1fr) minmax(0, 4fr);
    align-items: start;
}

.p-head__grid--photo .p-head__main { gap: 24px; }

.p-head__photo {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.p-head__photo img {
    width: 100%;
    aspect-ratio: 384 / 460;
    object-fit: cover;
    object-position: center top;
    border-radius: 16px;
}

.p-head__photo figcaption {
    font-size: 13px;
    color: var(--muted);
}

.p-lead {
    font-size: 19px;
    line-height: 1.6;
    color: #2E2C29;
}

.p-par {
    font-size: 16px;
    line-height: 1.65;
    color: #2E2C29;
}

/* Work — case index */
.p-index {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    padding: 24px 0;
    border-block: 1px solid var(--line);
}

.p-index a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    text-decoration: none;
}

.p-index a:hover { color: var(--accent); }

.p-index span {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

/* Case study (Work + Projects) */
.p-case {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 96px;
    padding-top: 48px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 96px;
}

nav + .p-case,
.p-case--first {
    margin-top: 88px;
    padding-top: 0;
    border-top: 0;
}

.p-case__head {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 24px;
    align-items: end;
}

.p-case__intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.p-case__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(30px, 3.2vw, 44px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.p-case__role {
    font-size: 15px;
    color: var(--muted);
}

.p-case__nums {
    display: flex;
    justify-content: flex-end;
    gap: 32px;
}

.p-case__nums dt {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    color: var(--accent);
    white-space: nowrap;
}

.p-case__nums dd {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.p-case__cta { display: flex; justify-content: flex-end; }

/* Typographic covers until real product imagery exists (same palette as home) */
.p-cover {
    height: 440px;
    display: flex;
    align-items: flex-end;
    padding: 32px;
    border-radius: 16px;
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.01em;
}

.p-cover--jti       { background: #1B2A26; color: #9FB8AE; }
.p-cover--nespresso { background: #2B2622; color: #BFB3A4; }
.p-cover--danone    { background: #23262B; color: #A9B0BA; }
.p-cover--ecom      { background: #E8E3DA; color: #5B5852; }
.p-cover--urbanrace { background: #1B2A26; color: #9FB8AE; }

.p-case__cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.p-case__cols p {
    font-size: 15.5px;
    line-height: 1.6;
    color: #2E2C29;
}

.p-lbl {
    margin: 0 0 8px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--muted);
}

.p-case .chips { margin-top: -16px; }

/* Cards — beliefs, side projects, contact lanes, resources */
.p-cards {
    display: grid;
    gap: 20px;
}

.p-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.p-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
}

a.p-card { transition: border-color 0.15s, transform 0.2s; }

a.p-card:hover {
    color: var(--ink);
    border-color: var(--ink);
    transform: translateY(-2px);
}

.p-card__meta {
    font-size: 12px;
    color: var(--muted);
}

.p-card__title {
    margin: 0;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.p-cards--2 .p-card__title { font-size: 20px; }

.p-card__text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

.p-card__go {
    margin-top: auto;
    padding-top: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-text);
}

/* Work — Also built */
.p-also {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: 24px;
    margin-top: 96px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.p-also__text {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

/* About — story rows (also Teaching courses) */
.p-story {
    list-style: none;
    border-top: 1px solid var(--line);
}

.p-story__row {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--line);
}

.p-story__row > div {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 820px;
}

.p-story__row .chips { margin-top: 4px; }

.p-story__when {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.p-story__when span {
    display: block;
    font-size: 13px;
}

.p-story__title {
    margin: 0;
    font-family: var(--font);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
}

/* About — teaching / writing / building */
.p-trio {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.p-trio > div {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
}

.p-trio .p-par { font-size: 15.5px; }

.p-trio__title {
    margin: 0;
    font-family: var(--font);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

/* Label column + content (About Now, Writing topics) */
.p-split {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: 24px;
    padding-block: 40px;
    border-block: 1px solid var(--line);
}

.p-split__note {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.p-topics { margin-top: 0; }

/* Now — label/value grid (full on /now, compact on /about) */
.p-now {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 48px;
    border-top: 1px solid var(--line);
}

.p-now > div {
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
}

.p-now dt {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.p-now dd {
    font-size: 17px;
    line-height: 1.6;
    color: #2E2C29;
}

.p-now--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 32px;
    border-top: 0;
}

.p-now--compact > div { padding: 0; border-bottom: 0; }
.p-now--compact dt { font-size: 11px; }
.p-now--compact dd { font-size: 15px; line-height: 1.5; }

/* Contact */
.p-contact {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 1fr) minmax(0, 5fr);
    gap: 24px;
}

.p-contact__intro {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.p-contact__intro .p-head__aside {
    font-size: 17px;
    max-width: 520px;
}

.p-contact__dl { margin-top: 8px; }

.p-contact__opts {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
}

.p-contact__opts .p-card { gap: 10px; padding: 28px; }
.p-contact__opts .p-card__title { font-size: 20px; }

/* Inner pages — tablet */
@media (max-width: 1024px) {
    .p-head__grid,
    .p-head__grid--photo,
    .p-contact { grid-template-columns: 1fr; }
    .p-head__aside,
    .p-head__photo,
    .p-contact__opts { grid-column: auto; }
    .p-head__aside { max-width: 620px; }
    .p-head__photo { max-width: 420px; }

    .p-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .p-case__head { grid-template-columns: 1fr; }
    .p-case__nums, .p-case__cta { justify-content: flex-start; }
    .p-case__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
    .p-cover { height: 340px; }

    .p-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .p-trio { grid-template-columns: 1fr; gap: 48px; }
    .p-also, .p-split { grid-template-columns: 1fr; }
    .p-now--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Inner pages — mobile */
@media (max-width: 768px) {
    .p-head { padding: 24px 0 48px; }
    .p-head__main { gap: 16px; }
    .p-head__title { font-size: 40px; }
    .p-lead { font-size: 17px; }
    .p-par { font-size: 15.5px; }
    .p-head__photo { order: -1; max-width: none; }
    .p-head__photo img { aspect-ratio: 350 / 300; object-position: center 20%; }

    .p-index { grid-template-columns: 1fr; gap: 16px; padding: 20px 0; }
    .p-case, .p-also { margin-top: 64px; }
    .p-case { gap: 28px; padding-top: 40px; scroll-margin-top: 72px; }
    nav + .p-case, .p-case--first { margin-top: 56px; }
    .p-case__nums dt { font-size: 34px; }
    .p-case__cols { grid-template-columns: 1fr; row-gap: 24px; }
    .p-cover { height: 200px; padding: 20px; font-size: 30px; }
    .p-case .chips { margin-top: -4px; }

    .p-cards--2, .p-cards--3 { grid-template-columns: 1fr; }
    .p-story__row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
    .p-story__title { font-size: 20px; }
    .p-now, .p-now--compact { grid-template-columns: 1fr; }
    .p-now > div { padding: 22px 0; }
    .p-now dd { font-size: 16px; }
    .p-now--compact { gap: 20px; }
    .p-contact__opts .p-card { padding: 22px; }
}

/* ── Case-study pages (/work/ploom-app, /work/nespresso-iot) ── */
.c-head { padding-top: 40px; }

.c-back {
    display: inline-block;
    margin-bottom: 28px;
    font-size: 14px;
    text-decoration: none;
}

.c-head__lead {
    max-width: 720px;
    font-size: 17px;
    line-height: 1.5;
    color: var(--muted);
}

.c-head__nums {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.c-head__nums dt,
.c-results dt {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 300;
    line-height: 1;
    color: var(--accent);
    white-space: nowrap;
}

.c-head__nums dd,
.c-results dd {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}

.c-cover { height: 560px; }

.c-facts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    margin-top: 40px;
    padding: 24px 0;
    border-block: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.5;
}

.c-facts dt,
.c-next__label {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Title left (4 cols), body right (cols 6–12) */
.c-row {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 1fr) minmax(0, 7fr);
    gap: 24px;
    margin-top: 96px;
}

.c-row__body { grid-column: 3; }

.c-row__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(28px, 2.6vw, 36px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.c-row__note {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

div.c-row__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.c-par {
    font-size: 17px;
    line-height: 1.65;
    color: #2E2C29;
}

.c-block {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 80px;
}

.c-block .h-head { margin-bottom: 0; }
.c-block .chips { margin-top: 0; }

.c-diagram {
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.c-diagram svg { width: 100%; height: auto; }

.c-diagram figcaption {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.c-decisions {
    list-style: none;
    border-bottom: 1px solid var(--line);
}

.c-decisions li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
}

.c-decisions h3 {
    margin: 0;
    font-family: var(--font);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
}

.c-decisions p {
    font-size: 15.5px;
    line-height: 1.55;
    color: #2E2C29;
}

.c-decisions .c-why { font-size: 14px; color: var(--muted); }

.c-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
}

.c-squads { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.c-next {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 96px;
}

.c-next__card,
.c-next__cta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    border-radius: 16px;
}

.c-next__card {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.15s;
}

.c-next__card:hover { color: var(--ink); border-color: var(--ink); }

.c-next__label { margin-bottom: 0; }

.c-next__title {
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1.15;
}

.c-next__cta {
    align-items: flex-start;
    background: var(--ink);
    color: var(--paper);
}

.c-next__text { font-size: 15px; color: #C9C3B8; }
.c-next__cta .btn { margin-top: 8px; }

/* Work page — link from each summary to its full case */
.p-case__more { align-self: flex-start; margin-top: -16px; }

@media (max-width: 1024px) {
    .c-head__nums { grid-column: auto; flex-direction: row; gap: 32px; }
    .c-cover { height: 380px; }
    .c-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .c-row { grid-template-columns: 1fr; gap: 20px; margin-top: 72px; }
    .c-row__body { grid-column: auto; }
    .c-squads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .c-head { padding-top: 16px; }
    .c-back { margin-bottom: 20px; }
    .c-head__lead, .c-par { font-size: 16px; }
    .c-head__nums dt, .c-results dt { font-size: 36px; }
    .c-cover { height: 200px; }
    .c-facts { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
    .c-row { margin-top: 56px; }
    .c-block { margin-top: 56px; }
    /* Diagrams keep a readable size and scroll sideways inside their card */
    .c-diagram { padding: 20px; }
    .c-diagram__scroll { overflow-x: auto; }
    .c-diagram svg { width: 820px; max-width: none; }
    .c-results { grid-template-columns: 1fr; gap: 24px; }
    .c-squads { grid-template-columns: 1fr; }
    .c-next { grid-template-columns: 1fr; margin-top: 64px; }
    .c-next__card, .c-next__cta { padding: 24px; }
    .c-next__title { font-size: 22px; }
    .p-case__more { margin-top: -4px; }
}

/* ── Cover photos (jmassena_cover_img) ──────────────
   Photo sits behind the label; the flat colour stays as the loading fallback.
   A bottom-left gradient keeps the light label readable on dark photos. */
.p-cover,
.h-case__cover {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.p-cover img,
.h-case__cover img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.p-cover::after,
.h-case__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top right, rgba(10, 12, 11, 0.55), rgba(10, 12, 11, 0) 60%);
}

/* Light cover: dark label on cream, no gradient needed */
.p-cover--ecom::after { display: none; }

/* Home cards: keep the label in the left half so it never runs into the photo's subject */
.h-case__cover span { max-width: 50%; }

/* ── Text pages (templates/page.html: legal, accessibility) ── */
.text-page { padding-top: 56px; }

.text-page__title { max-width: 900px; margin-bottom: 48px; }

.text-page__body { max-width: 720px; }

.text-page__body > * + * { margin-top: 16px; }

.text-page__body h2 {
    margin-top: 48px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.text-page__body h3 {
    margin-top: 32px;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 600;
}

.text-page__body p,
.text-page__body li {
    font-size: 17px;
    line-height: 1.7;
    color: #2E2C29;
}

.text-page__body ul { padding-left: 22px; }

.text-page__body li + li { margin-top: 6px; }

.text-page__body a {
    color: var(--accent-text);
    text-underline-offset: 3px;
}

.text-page__body .text-page__meta {
    font-size: 14px;
    color: var(--muted);
}

.text-page__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.text-page__body th,
.text-page__body td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

@media (max-width: 768px) {
    .text-page { padding-top: 24px; }
    .text-page__title { margin-bottom: 32px; }
    .text-page__body h2 { font-size: 24px; margin-top: 40px; }
    .text-page__body p, .text-page__body li { font-size: 16px; }
}

/* Footer legal links (bottom row) */
.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
}

.site-footer .site-footer__legal a { color: var(--muted); }

.site-footer .site-footer__legal a:hover { color: var(--accent-text); }

.site-footer__legal .site-footer__cookies { font-size: 14px; }

@media (max-width: 768px) {
    .site-footer__bottom { flex-direction: column; align-items: flex-start; }
    .site-footer__legal a,
    .site-footer__legal .site-footer__cookies { padding-block: 4px; }
}

/* Writing list fallback when the ProductPulse feed is unavailable */
.writing-empty {
    font-size: 17px;
    color: var(--muted);
    padding-top: var(--space-4);
}

.writing-empty a { color: var(--accent); }
