/* MexSEO brand v3 · Cut Corner. Loaded last on every page.
   Rules: mostly black and white; signal red only for the dot, "SEO" in the logo, the main button and small accents.
   White text on red (5:1). Red text only on light backgrounds or as large type; on black, accents become white. */

/* ---------- base ---------- */
body { background: var(--paper); }
h1, h2, h3, h4, .promo-title, .display, .h2, .h3, .page-hero__title { font-stretch: normal; font-weight: 800; letter-spacing: -0.03em; }
.display { letter-spacing: -0.045em; }
a { color: var(--ink); text-decoration-color: var(--lamp); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline-color: var(--lamp); }
.dark :focus-visible, .site-footer :focus-visible, .page-hero :focus-visible, .cta :focus-visible { outline-color: #fff; }
::selection { background: var(--lamp); color: #fff; }
.skip-link { background: var(--lamp); color: #fff; }
.dark a:not(.btn) { color: #fff; }

/* eyebrows: sentence case with a small red dot, never the tiny uppercase label */
.eyebrow { font-family: var(--font); font-size: 0.95rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--slate); display: inline-flex; align-items: center; gap: 0.5rem; }
.eyebrow--lamp { color: var(--lamp-hot) !important; }
.eyebrow--lamp::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--lamp); flex: none; }
.dark .eyebrow--lamp, .page-hero .eyebrow--lamp, .cta .eyebrow--lamp, .callout--key .eyebrow { color: #fff !important; }
.lit { color: var(--lamp); text-shadow: none; }
.dark .lit, .page-hero .lit, .cta .lit { color: #fff; text-decoration: underline; text-decoration-color: var(--lamp); text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }
.mono, .meta, .crumbs, .tag, .sample-note, .field__input--mono, .searchbar input, .prose code, .site-footer__title { font-family: var(--font); }
.meta { font-size: 0.85rem; letter-spacing: 0; text-transform: none; }
.lede { color: var(--slate); }

/* ---------- logo ---------- */
.logo img { height: 2.25rem; width: auto; display: block; }
.site-footer .logo img { height: 2.1rem; }

/* ---------- header: white ---------- */
.site-header { background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid transparent; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav__link { color: var(--ink); font-weight: 500; border-radius: 8px; }
.nav__link:hover { color: var(--ink); background: var(--snow); }
.nav__item.is-current > .nav__link { color: var(--ink); box-shadow: inset 0 -2px 0 var(--lamp); border-radius: 0; }
.nav__menu { background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 50px -20px rgba(19, 19, 21, 0.3); border-radius: 14px; }
.nav__menu a { color: var(--ink) !important; }
.nav__menu a:hover { background: var(--snow); }
.nav__menu a[aria-current="page"] { background: var(--glow); }
.nav__menu small { color: var(--slate); }
.menu-toggle { color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; font-weight: 700; }
.site-header :focus-visible { outline-color: var(--lamp); }
@media (max-width: 1000px) {
  .site-header.is-open { background: #fff; }
}

/* ---------- buttons ---------- */
.btn { border-radius: 10px; font-stretch: normal; }
.btn--lamp { background: var(--lamp); color: #fff; box-shadow: none; }
.btn--lamp:hover { background: var(--lamp-hot); box-shadow: none; }
.btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.6); background: transparent; }
.btn--ghost:hover { border-color: #fff; background: #fff; color: var(--ink); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--outline { color: var(--ink); border: 2px solid var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.more { font-stretch: normal; text-decoration: none; }

/* ---------- tags, chips, pickers ---------- */
.tag { font-size: 0.8rem; font-weight: 600; letter-spacing: 0; text-transform: none; background: var(--snow); }
.tag--lamp { background: var(--lamp) !important; color: #fff !important; }
.chips a, .chips span { font-weight: 500; border-color: #c9c9cf; }
.chips a:hover { border-color: var(--ink); }
.chips a.is-active { background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }
.pick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick input:focus-visible + span { outline-color: var(--lamp); }
.subnav a.is-active { background: var(--ink); color: #fff; }
.qa details[open] summary::after { background: var(--glow); }
.sample-note { background: var(--ink); color: #fff; letter-spacing: 0; text-transform: none; font-size: 0.8rem; }
.toast { background: var(--ink); color: #fff; }

/* ---------- the old spotlight effects are gone ---------- */
.beam, .floor-glow, .steps__beam { display: none !important; }
.visual-panel { background: var(--night-2); }
.visual-panel--light { background: var(--snow); }

/* ---------- forms ---------- */
.field__input { border-color: #9a9aa2; }
.field__input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(215, 38, 45, 0.35); }
.form-card .enquiry-card__eyebrow { color: var(--lamp-hot); }
.caret { background: var(--lamp); }
.searchbar { box-shadow: 0 0 0 2px var(--ink); }
.searchbar:focus-within { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px rgba(215, 38, 45, 0.35); }

/* the cut corner: the top-right corner is bitten out and the red dot sits in it (as in the logo) */
.cc { position: relative; --cut: 56px; --dotd: 36px; }
.cc > .form-card, .cc > .cc-body { -webkit-mask: radial-gradient(circle var(--cut) at 100% 0, transparent calc(var(--cut) - 0.5px), #000 var(--cut)); mask: radial-gradient(circle var(--cut) at 100% 0, transparent calc(var(--cut) - 0.5px), #000 var(--cut)); }
.cc-dot { position: absolute; right: 5px; top: 5px; width: var(--dotd); height: var(--dotd); border-radius: 50%; background: var(--lamp); pointer-events: none; }
.cta .cc { --cut: 64px; --dotd: 42px; }
.cta .cta__stage .cc-dot { top: calc(2rem + 6px); right: 6px; }
.enquiry-card .enquiry-card__head { padding-right: 2.5rem; }

/* ---------- surfaces ---------- */
.page-hero { background: var(--night); }
.page-hero::before { background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.3px); background-size: 22px 22px; }
.page-hero a:not(.btn):not(.chips a):not(.more):not(.term) { color: #fff; }
.crumbs { font-size: 0.85rem; letter-spacing: 0; }
.cover { background: radial-gradient(circle at var(--sx, 80%) var(--sy, 20%), rgba(215, 38, 45, 0.35), transparent 40%), var(--night); font-family: var(--font); }
.avatar { background: var(--night); color: #fff; font-stretch: normal; }

/* ---------- article ---------- */
.prose { color: #2a2a2e; }
.prose h2, .prose h3 { font-stretch: normal; }
.prose a { color: var(--ink); text-decoration-color: var(--lamp); }
.prose a.term { text-decoration-color: var(--lamp); }
.prose blockquote { border-left-color: var(--lamp); background: var(--snow); }
.prose th { font-size: 0.85rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.callout li::before { background: var(--lamp); box-shadow: none; }
.toc a.is-active { border-left-color: var(--lamp); }
.read-progress { background: var(--lamp); box-shadow: none; }

/* ---------- footer ---------- */
.site-footer { color: var(--mist); }
.site-footer__title { font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: #fff; }
.site-footer a:hover { text-decoration-color: var(--lamp); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- page-type details ---------- */
/* glossary term: the "What is X?" heading reads as a heading, not a tiny label */
.definition__q { font-family: var(--font); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--lamp-hot); }
.definition { box-shadow: 0 0 0 1px var(--line), 0 24px 60px -30px rgba(19, 19, 21, 0.45); }
.definition a.term { text-decoration-color: var(--lamp); }
.definition .aka { font-family: var(--font); font-size: 0.85rem; letter-spacing: 0; }
/* 404: on black, accents are white; the red dot carries the colour */
.lost__code { font-family: var(--font); font-size: 0.95rem; letter-spacing: 0; color: #fff; display: inline-flex; align-items: center; gap: 0.5rem; }
.lost__code::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--lamp); }
.lost .lit, .s-hero .lit { color: #fff; text-decoration: underline; text-decoration-color: var(--lamp); text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }
.lost h1 { font-stretch: normal; }
.lost__spot { display: none; }
.s-hero .eyebrow--lamp { color: #fff !important; }
/* red text: deep red on light surfaces, a light red on black surfaces (both pass contrast) */
:root { --lamp-text: #b01d23; }
.dark, .page-hero, .s-hero, .lost, .cta, .svc-mini, .aside-cta, .card-dark, .callout--key, .visual-panel, .site-footer, .band, .tool-more .svc-mini, .start, .out, .fit__icon, .tool-links__icon, .formula, .formula-list { --lamp-text: #ff8a8f; }
.eyebrow--lamp { color: var(--lamp-text) !important; }
.dark .eyebrow--lamp, .page-hero .eyebrow--lamp, .cta .eyebrow--lamp, .callout--key .eyebrow, .s-hero .eyebrow--lamp, .svc-mini .eyebrow--lamp, .aside-cta .eyebrow--lamp { color: #fff !important; }

/* ---------- inner-page heroes are white, like the home page (2026-11-20, one look across the site) ---------- */
.page-hero { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); --lamp-text: #b01d23; }
.page-hero::before { display: none; }
.page-hero .lede, .page-hero .muted, .page-hero .meta, .page-hero .person__role, .page-hero .eyebrow:not(.eyebrow--lamp) { color: var(--slate); }
.page-hero .eyebrow--lamp { color: var(--lamp-text) !important; }
.page-hero a:not(.btn):not(.chips a):not(.more):not(.term) { color: var(--ink); }
.page-hero .lit { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lamp); text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }
.page-hero .crumbs { color: var(--slate); }
.page-hero .crumbs a:hover { color: var(--ink) !important; }
.page-hero :focus-visible { outline-color: var(--lamp); }
.page-hero .btn--ghost { color: var(--ink); border-color: var(--ink); }
.page-hero .btn--ghost:hover { background: var(--ink); color: #fff; }
.page-hero .chips a, .page-hero .chips span { background: #fff; color: var(--ink) !important; border-color: #c9c9cf; }
.page-hero .definition, .page-hero .card, .page-hero .form-card:not(.h-formcard .form-card) { box-shadow: 0 0 0 1px var(--line), 0 24px 60px -34px rgba(19, 19, 21, 0.35); }

/* ==========================================================================
   Human touch, round 2 (2026-11-20): warmer details on the inner pages.
   Shared pieces only (appended; nothing above is changed). Each template CSS decides where they are used.
   ========================================================================== */
/* hand-drawn strokes, drawn once as SVG: a double-pass underline and a loose loop (stretch to fit the word) */
:root {
  --hand-underline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 12.5C46 7 112 5.5 197 8.5M20 16.5C74 12 132 11.5 184 13.5' fill='none' stroke='%23D7262D' stroke-width='3' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  --hand-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cpath d='M112 7C55 3 9 17 8 41c-1 24 52 35 106 33 50-2 80-17 78-38-2-21-44-31-101-25' fill='none' stroke='%23D7262D' stroke-width='3' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

/* the lit word in a hero headline gets the hand-drawn underline instead of a ruler-straight one (one accent per page) */
.hand-lit .lit, .tl-hero .page-hero__title .lit {
  color: inherit; text-decoration: none;
  background: var(--hand-underline) no-repeat left bottom / 100% 0.36em;
  padding-bottom: 0.1em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (forced-colors: active) {
  .hand-lit .lit, .tl-hero .page-hero__title .lit { text-decoration: underline; }
}
/* the same stroke as inline SVG, where there is no lit word (glossary terms) */
.hand { display: block; fill: none; stroke: var(--lamp); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; pointer-events: none; }
.hand--ink { stroke: var(--ink); }
@media (forced-colors: active) { .hand { stroke: CanvasText; } }

/* one highlighted sentence or pull quote per long page, always existing copy */
/* a 1px hairline above and a small red dot to start it; no side-bar accent */
.pull::before { content: ""; display: block; width: 0.55rem; height: 0.55rem; margin-bottom: 0.9rem; border-radius: 50%; background: var(--lamp); }
.pull { padding-top: 1.1rem; border-top: 1px solid var(--line); color: var(--ink); font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.8rem); font-weight: 400; line-height: 1.34; letter-spacing: -0.018em; max-width: 36ch; }
.hl { color: var(--ink); font-weight: 500; background: linear-gradient(transparent 58%, var(--glow) 58%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* small typographic details: hanging punctuation (where supported), no lone last words, figures that line up */
p, li, dd, blockquote, summary { hanging-punctuation: first allow-end last; }
p, dd, li { text-wrap: pretty; }
table, .tnum, output, time { font-variant-numeric: tabular-nums lining-nums; }
/* white heroes: cards that used to sit on black get a grey panel so they still read as cards */
.page-hero .gl-def .definition, .page-hero .cc > .definition { background: var(--snow); }
