/*
  Belle McCaffrey Design System: components
  Requires tokens.css first:
    <link rel="stylesheet" href="../tokens.css">
    <link rel="stylesheet" href="components.css">
  Every class starts with "bm-". Components read only semantic tokens (--color-*),
  so they work in light and dark automatically.
*/

/* ---------- Layout helpers ---------- */
.bm-wrap { width: min(var(--content-width), 100% - 2 * var(--gutter)); margin-inline: auto; }
.bm-section { padding-block: var(--space-24); }
.bm-section--alt { background: var(--color-bg-alt); }
.bm-section--surface { background: var(--color-surface); }
@media (max-width: 720px) { .bm-section { padding-block: var(--space-16); } }

/* ---------- Type ---------- */
.bm-label {
  font-family: var(--font-body); font-size: var(--size-label); font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-label);
  line-height: 1.6; margin: 0 0 var(--space-3);
}
.bm-display { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--size-display); line-height: var(--leading-tight); letter-spacing: var(--tracking-heading); color: var(--color-heading); margin: 0; }
.bm-h1 { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--size-h1); line-height: var(--leading-tight); letter-spacing: var(--tracking-heading); color: var(--color-heading); margin: 0 0 var(--space-5); text-wrap: balance; }
.bm-h2 { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--size-h2); line-height: var(--leading-heading); color: var(--color-heading); margin: 0 0 var(--space-3); text-wrap: balance; }
.bm-h3 { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--size-h3); line-height: var(--leading-heading); color: var(--color-heading); margin: 0 0 var(--space-2); }
.bm-h1 em, .bm-h2 em, .bm-h3 em, .bm-display em { font-style: italic; color: var(--color-heading-accent); }
.bm-lead { font-size: var(--size-lead); color: var(--color-text-muted); max-width: var(--reading-width); margin: 0; }
.bm-body { font-size: var(--size-body); line-height: var(--leading-body); color: var(--color-text); max-width: var(--reading-width); }
.bm-muted { color: var(--color-text-muted); }

/* ---------- Buttons ---------- */
.bm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-body); font-weight: var(--weight-button); font-size: var(--size-small); line-height: 1.2;
  text-decoration: none; border-radius: var(--radius-pill); padding: 13px 24px; min-height: 44px; box-sizing: border-box; border: 1.5px solid transparent;
  cursor: pointer; transition: transform var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
.bm-btn:hover { transform: translateY(-1px); }
.bm-btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.bm-btn--primary:hover { background: var(--color-primary-hover); }
.bm-btn--secondary { background: transparent; color: var(--color-heading); border-color: var(--color-heading); }
.bm-btn--secondary:hover { background: var(--color-accent-soft); }
.bm-btn--light { background: var(--color-inverse-text); color: var(--bm-emerald-700); }
.bm-btn--light:hover { background: #fff; }
.bm-btn--ghost { background: transparent; color: var(--color-inverse-text); border-color: color-mix(in srgb, var(--color-inverse-text) 50%, transparent); }
.bm-btn--ghost:hover { background: color-mix(in srgb, var(--color-inverse-text) 10%, transparent); }
.bm-btn--sm { padding: 10px 18px; font-size: var(--size-caption); }
.bm-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (prefers-reduced-motion: reduce) { .bm-btn:hover { transform: none; } }

/* ---------- Pills, badges, tags, chips ---------- */
.bm-pill { display: inline-block; background: var(--color-inverse-text); color: var(--bm-emerald-700); font-weight: var(--weight-label); font-size: var(--size-caption); padding: 8px 18px; border-radius: var(--radius-pill); }
.bm-badge { display: inline-block; font-size: 13px; font-weight: var(--weight-label); padding: 4px 12px; border-radius: var(--radius-pill); background: var(--color-accent-soft); color: var(--color-on-accent-soft); }
.bm-tag { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--size-caption); font-weight: var(--weight-label); color: var(--color-label); }
.bm-tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--color-label)); }
.bm-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.bm-chips li { background: var(--color-accent-soft); color: var(--color-on-accent-soft); font-weight: var(--weight-label); font-size: var(--size-caption); padding: 7px 14px; border-radius: var(--radius-pill); }
.bm-chips--quiet li { background: transparent; color: var(--color-heading); box-shadow: inset 0 0 0 1.5px var(--color-border); }

/* ---------- Tagline pair (always both lines together) ---------- */
.bm-tagline { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: clamp(2.125rem, 3.4vw, 2.75rem); line-height: 1.12; color: var(--color-heading-strong); margin: 0; text-wrap: balance; }
.bm-tagline__second { display: block; font-style: italic; color: var(--color-heading-accent); }

/* ---------- Closing pair (label lead-in + heading line) ---------- */
.bm-closing { margin: var(--space-8) 0 0; }
.bm-closing__lead { display: block; font-size: var(--size-label); font-weight: var(--weight-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-label); line-height: 1.6; }
.bm-closing__line { display: block; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: clamp(1.625rem, 2.8vw, 2.125rem); line-height: 1.2; color: var(--color-heading-strong); margin-top: var(--space-2); }

/* ---------- Motto quote ---------- */
.bm-motto { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--size-lead); margin: 0; }
.bm-motto__mark { font-family: var(--font-heading); font-size: 3.25rem; line-height: 0.7; color: var(--color-heading-accent); }
.bm-motto__mark--close { font-size: 2.75rem; line-height: 0; align-self: flex-end; margin-bottom: 0.15em; }
.bm-inverse .bm-motto__mark { color: var(--color-inverse-accent); }

/* ---------- Checklist ---------- */
.bm-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.bm-checks li { position: relative; padding-left: 30px; font-weight: var(--weight-button); color: var(--color-text); }
.bm-checks li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; border-radius: 50%;
  background-color: var(--color-accent-soft);
  -webkit-mask: none;
}
.bm-checks li::after {
  content: ""; position: absolute; left: 5px; top: calc(0.3em + 4px); width: 8px; height: 5px;
  border-left: 2px solid var(--color-on-accent-soft); border-bottom: 2px solid var(--color-on-accent-soft); transform: rotate(-45deg);
}

/* ---------- Device frames ---------- */
.bm-phone { background: var(--color-device); padding: 7px; border-radius: 34px; box-shadow: var(--shadow-device); margin: 0; }
.bm-phone > img, .bm-phone > .bm-screen { display: block; width: 100%; height: auto; border-radius: 28px; }
.bm-phones { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 18px; /* --n: @kind other */ align-items: start; }
.bm-phones > :nth-child(even) { margin-top: 36px; }
.bm-tablet { background: var(--color-device); padding: 10px; border-radius: 22px; box-shadow: var(--shadow-device); margin: 0; }
.bm-tablet > img, .bm-tablet > .bm-screen { display: block; width: 100%; height: auto; border-radius: 14px; }
.bm-browser { background: var(--color-surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-device); margin: 0; border: 1px solid var(--color-border); }
.bm-browser__bar { display: flex; gap: 7px; padding: 12px 14px; background: var(--color-bg-alt); }
.bm-browser__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--color-border); }
.bm-browser > img, .bm-browser > .bm-screen { display: block; width: 100%; height: auto; }
.bm-screen { background: linear-gradient(170deg, var(--color-accent-soft), var(--color-surface)); }
@media (max-width: 720px) { .bm-phones { --n: 2 !important; /* @kind other */ } .bm-phones > :nth-child(even) { margin-top: 24px; } }

/* ---------- Cards ---------- */
.bm-card { background: var(--color-surface); border-radius: var(--radius-2xl); padding: clamp(24px, 4vw, 48px); }
.bm-card--raised { box-shadow: var(--shadow-card); }

/* Fact box */
.bm-facts { background: var(--color-surface-raised); border-radius: var(--radius-lg); padding: 22px 24px; font-size: var(--size-small); margin: 0; }
.bm-facts dt { font-size: 12px; font-weight: var(--weight-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-label); }
.bm-facts dd { margin: 2px 0 14px; font-weight: var(--weight-button); color: var(--color-text); }
.bm-facts dd:last-child { margin-bottom: 0; }

/* Process steps (numbered: use only for real sequences) */
.bm-steps { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--space-4); list-style: none; padding: 0; margin: 0; counter-reset: step; }
.bm-steps li { background: var(--color-surface-raised); border-radius: var(--radius-lg); padding: 22px 20px 20px; counter-increment: step; }
.bm-steps li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary); color: var(--color-on-primary); font-weight: var(--weight-label); margin-bottom: 14px; }
.bm-steps strong { display: block; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--size-h3); color: var(--color-heading); margin-bottom: 6px; }
.bm-steps span { font-size: var(--size-small); color: var(--color-text-muted); }

/* Result cards (outlined) */
.bm-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.bm-result { border: 1.5px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; }
.bm-result strong { display: block; color: var(--color-heading); font-weight: var(--weight-label); margin-bottom: 4px; }
.bm-result span { font-size: var(--size-small); color: var(--color-text-muted); }

/* Flow diagram */
.bm-flow { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; }
.bm-flow li { position: relative; text-align: center; padding: 0 10px; }
.bm-flow li:not(:last-child)::after { content: ""; position: absolute; top: 31px; left: calc(50% + 38px); right: calc(-50% + 38px); height: 2px; background: repeating-linear-gradient(90deg, var(--color-label) 0 6px, transparent 6px 11px); }
.bm-flow__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary); color: var(--color-on-primary); }
.bm-flow li:last-child .bm-flow__icon { background: var(--color-accent-soft); color: var(--color-on-accent-soft); }
.bm-flow__icon svg { width: 28px; height: 28px; }
.bm-flow strong { display: block; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: 1.375rem; color: var(--color-heading); margin-bottom: 4px; }
.bm-flow span { display: block; font-size: 15px; color: var(--color-text-muted); line-height: 1.5; }

/* Skill card + tools panel */
.bm-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.bm-skill { background: var(--color-surface); border-radius: var(--radius-xl); padding: 26px; }
.bm-skill h4 { font-family: var(--font-body); font-size: var(--size-label); font-weight: var(--weight-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-label); margin: 0 0 10px; }
.bm-skill ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-weight: var(--weight-button); }
.bm-tools { background: var(--color-surface); border-radius: var(--radius-xl); padding: 30px 32px; }
.bm-tools__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.bm-tools h4 { font-family: var(--font-body); font-size: var(--size-label); font-weight: var(--weight-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-label); margin: 0 0 10px; }

/* Contact card */
.bm-contact { display: flex; align-items: center; gap: 18px; background: var(--color-surface); color: var(--color-text); text-decoration: none; border-radius: var(--radius-lg); padding: 18px 22px; transition: transform var(--duration-fast) var(--ease); }
.bm-contact:hover { transform: translateY(-2px); }
.bm-contact__icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--color-primary); color: var(--color-on-primary); display: grid; place-items: center; }
.bm-contact__icon svg { width: 22px; height: 22px; }
.bm-contact small { display: block; font-size: 12px; font-weight: var(--weight-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-label); }
.bm-contact b { font-size: 1.1875rem; font-weight: var(--weight-button); word-break: break-word; }
.bm-contacts { display: grid; gap: 14px; }

/* ---------- Inverse band (hero, contact) ---------- */
.bm-inverse { background: var(--color-inverse-bg); color: var(--color-inverse-text); }
.bm-inverse .bm-label { color: var(--color-inverse-accent); }
.bm-inverse .bm-h1, .bm-inverse .bm-h2, .bm-inverse .bm-display { color: var(--color-inverse-text); }
.bm-inverse em { color: var(--color-inverse-accent); }
.bm-inverse .bm-lead, .bm-inverse .bm-muted { color: var(--color-inverse-muted); }
.bm-inverse .bm-contact { background: var(--bm-neutral-paper); color: var(--bm-neutral-ink); }
.bm-inverse .bm-contact small { color: var(--bm-emerald-600); }
.bm-inverse .bm-contact__icon { background: var(--bm-emerald-700); color: var(--bm-neutral-cream); }

/* ---------- Navigation ---------- */
.bm-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--color-inverse-bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--color-inverse-text); }
.bm-nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-height); gap: 16px; }
.bm-nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: 1.375rem; }
.bm-nav__brand img { height: 30px; width: auto; }
.bm-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 15px; font-weight: var(--weight-button); }
.bm-nav ul a { color: inherit; text-decoration: none; opacity: 0.85; }
.bm-nav ul a:hover { opacity: 1; }
@media (max-width: 720px) { .bm-nav ul { display: none; } }

/* ---------- Hero ---------- */
.bm-hero { padding-block: 72px 88px; overflow: hidden; }
.bm-hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.bm-hero__roles { font-size: 1.25rem; font-weight: var(--weight-button); margin: 0 0 18px; opacity: 0.92; }
.bm-hero__statement { font-family: var(--font-heading); font-weight: var(--weight-heading-light); font-size: var(--size-statement); line-height: 1.18; margin: 36px 0 0; text-wrap: balance; }
.bm-hero .bm-motto { margin-top: 28px; padding-top: 24px; border-top: 1px solid color-mix(in srgb, var(--color-inverse-text) 22%, transparent); }
.bm-hero .bm-btn-row { margin-top: 32px; }
.bm-arch { position: relative; justify-self: center; width: min(100%, 420px); margin: 0; }
.bm-arch > img, .bm-arch > .bm-arch__placeholder { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-arch); border: 5px solid var(--bm-emerald-600); }
.bm-arch__placeholder { background: linear-gradient(170deg, var(--bm-mint-300), var(--bm-emerald-600)); }
.bm-arch__tag { position: absolute; left: -18px; bottom: 28px; background: var(--bm-neutral-paper); color: var(--bm-emerald-700); font-weight: var(--weight-label); font-size: var(--size-caption); padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-float); }
@media (max-width: 960px) {
  .bm-hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .bm-arch { order: -1; width: min(70%, 320px); }
  .bm-flow { grid-template-columns: 1fr; gap: 14px; }
  .bm-flow li { display: grid; grid-template-columns: 64px 1fr; gap: 4px 18px; text-align: left; padding: 0; }
  .bm-flow li .bm-flow__icon { grid-row: span 2; margin: 0; }
  .bm-flow li:not(:last-child)::after { top: 68px; bottom: -14px; left: 31px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--color-label) 0 6px, transparent 6px 11px); }
  .bm-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .bm-hero { padding-block: 48px 64px; }
  .bm-arch__tag { left: 50%; transform: translateX(-50%); bottom: -14px; white-space: nowrap; }
  .bm-steps { grid-template-columns: 1fr; }
}

/* ---------- Split section (sticky heading left, story right) ---------- */
.bm-split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: start; }
.bm-split__aside { position: sticky; top: calc(var(--nav-height) + 40px); }
.bm-split__body p { margin: 0 0 20px; font-size: 1.25rem; }
@media (max-width: 960px) { .bm-split { grid-template-columns: 1fr; gap: 28px; } .bm-split__aside { position: static; } }

/* ---------- Footer ---------- */
.bm-footer { background: var(--color-inverse-bg-strong); color: color-mix(in srgb, var(--color-inverse-text) 72%, transparent); font-size: var(--size-caption); padding-block: 22px; }
.bm-footer .bm-wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.bm-footer img { height: 24px; width: auto; }
