/* Orla · components — port of The Marketing Cartel's components (E02), dark only, black & white. Consumes tokens.css. Motion: transform/opacity only.
   Contents: 0 utilities · 1 buttons · 2 proof badge (#37) · 3 chips & device tags · 4 navbar (#21 #19 #33)
   · 5 dropdown panel (#20) · 6 theme toggle · 7 marquee · 8 device frame · 9 section header */

/* ---------- 0 · utilities --------------------------------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--wide { width: min(100% - 2 * var(--gutter), var(--container-wide)); margin-inline: auto; }

/* grain: a static 128px noise tile, blended over whatever it sits on (never animated) */
.has-grain { position: relative; isolation: isolate; }
.has-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("textures/grain.png") 0 0 / 128px 128px repeat;
  mix-blend-mode: var(--grain-blend);
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 2;
}

/* ---------- 1 · buttons ----------------------------------------------------------------------------- */
.btn {
  --btn-h: 52px;
  --btn-px: 22px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 0;
  border-radius: var(--r-button);
  background: none;
  font: var(--w-ui) var(--text-sm) / 1 var(--font-sans);
  letter-spacing: -.004em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--d-micro) var(--e-out);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.btn[aria-disabled="true"], .btn:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.btn--sm { --btn-h: 40px; --btn-px: 16px; gap: var(--space-2); font-size: .875rem; }
.btn--lg { --btn-h: 58px; --btn-px: 26px; font-size: var(--text-body); }

/* primary: the adapted sphere gradient + grain; hover = a second gradient layer fading in (opacity only) */
.btn--primary {
  color: var(--on-brand);
  background: var(--grad-brand);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / .6), inset 0 -1px 0 oklch(0% 0 0 / .14), var(--sh-2);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--grad-brand-hover);
  opacity: 0;
  transition: opacity var(--d-ui) var(--e-out);
}
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: url("textures/grain.png") 0 0 / 128px 128px repeat;
  mix-blend-mode: multiply;
  opacity: .14;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .btn--primary:hover::before { opacity: 1; } }   /* hover gated: no sticky hover after a tap */
:root:not([data-input="pointer"]) .btn--primary:focus-visible::before { opacity: 1; }
.btn--primary:disabled, .btn--primary[aria-disabled="true"] { opacity: .6; }

/* ghost: quiet, identified by its label; the hover wash is a pseudo-layer (opacity) */
.btn--ghost {
  color: var(--fg);
  background: color-mix(in oklab, var(--fg) 4%, transparent);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.btn--ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in oklab, var(--fg) 7%, transparent);
  opacity: 0;
  transition: opacity var(--d-micro) var(--e-out);
}
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover::before { opacity: 1; } }

/* trailing arrow: nudges on hover (transform) */
.btn__arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: -10px;
  border-radius: var(--r-full);
  background: oklch(17% 0.006 85 / .09);
  box-shadow: inset 0 0 0 1px oklch(17% 0.006 85 / .08);
}
.btn--ghost .btn__arrow { background: color-mix(in oklab, var(--fg) 7%, transparent); box-shadow: none; }
.btn__arrow svg { width: 14px; height: 14px; transition: transform var(--d-ui) var(--e-spring); }
@media (hover: hover) and (pointer: fine) { .btn:hover .btn__arrow svg { transform: translate(2px, -2px); } }
.btn--sm .btn__arrow { width: 22px; height: 22px; margin-right: -6px; }
.btn--sm .btn__arrow svg { width: 11px; height: 11px; }


/* ---------- 3 · chips & device tags ---------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-full);
  background: var(--bg-sunken);
  font: var(--w-ui) var(--text-xs) / 1 var(--font-sans);
  color: var(--fg-muted);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: var(--r-md);
  background: var(--frost-bg);
  -webkit-backdrop-filter: blur(var(--frost-blur));
  backdrop-filter: blur(var(--frost-blur));
  box-shadow: inset 0 0 0 1px var(--frost-line), var(--sh-2);
  font: var(--w-ui) var(--text-sm) / 1.15 var(--font-sans);
  color: var(--fg);
  white-space: nowrap;
}
.tag__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--fg-accent);
}
.tag__icon svg { width: 17px; height: 17px; }
.tag__value { display: block; font: 780 1.0625rem / 1 var(--font-sans); letter-spacing: -.02em; }
.tag__label { display: block; margin-top: 3px; font: var(--w-ui) .75rem / 1 var(--font-sans); color: var(--fg-muted); }

/* ---------- 4–5 · navbar + dropdown: desktop only → components.desktop.css. The phone top bar + menu sheet: chapter 11. */


/* ---------- 9 · section header: number chip + eyebrow + title (used by the guide and later sections) ---- */
.sec-head { display: grid; gap: var(--space-4); }
.sec-head__meta { display: flex; align-items: center; gap: var(--space-3); }
.sec-num {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--fg-accent);
  font: 700 .75rem / 1 var(--font-mono);
  letter-spacing: .02em;
}


/* ---------- 11 · phone chrome (<1024px): top bar · bottom sheet · menu (E04) --------------------------- */
.nav__menu, .nav__menu-nojs, .action-bar, .menu__theme { display: none; }
@media (max-width: 1023.98px) {
  html { scroll-padding-top: calc(var(--topbar-h) + var(--space-4)); scrollbar-gutter: stable; }   /* no reflow when a sheet locks the page (classic scrollbars) */

  /* the top bar: full width, frost, ~56px under the status bar */
  .site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: var(--z-nav);
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--frost-bg);
    -webkit-backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    box-shadow: inset 0 -1px 0 var(--frost-line);
    transition: transform var(--d-ui) var(--e-out);
  }
  .nav { display: flex; align-items: center; gap: 2px; height: var(--topbar-h); padding-inline: var(--gutter) calc(var(--gutter) - 6px); }
  .nav__logo { display: inline-flex; align-items: center; gap: 9px; height: 44px; margin-right: auto; color: var(--fg); }
  .nav__logo svg { width: 32px; height: 32px; }
  .nav__wordmark { font: 780 1.0625rem / 1 var(--font-sans); letter-spacing: -.024em; }
  /* the full name from 350 px; "Marketing Cartel" below (measured 2026-10-07: room 155 px at 320, the full name needs 168) */
  .nav__wordmark .wm-short { display: none; }
  @media (max-width: 349.98px) { .nav__wordmark .wm-full { display: none; } .nav__wordmark .wm-short { display: inline; } }
  .nav__capsule, .nav__actions > .btn, .nav-panel, .nav-bridge { display: none; }
  .nav__actions { display: flex; align-items: center; gap: 2px; }
  .theme-toggle, .nav__menu, .nav__menu-nojs { width: 44px; height: 44px; }
  .nav__menu, .nav__menu-nojs {
    display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-button);
    background: none; color: var(--fg); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .nav__menu svg, .nav__menu-nojs svg { width: 22px; height: 22px; }
  .js .nav__menu-nojs, html:not(.js) .nav__menu { display: none; }

  /* bottom sheet: a native modal <dialog> that rises from the bottom (transform only). @starting-style gives the
     entry; transition-behavior keeps it on screen while it slides out. */
  .sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: min(88svh, 760px);
    margin: 0;
    padding: 0 var(--gutter);
    border: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--panel-bg);
    color: var(--fg);
    box-shadow: var(--sh-3);
    overflow: auto;
    overscroll-behavior: contain;
    transform: translateY(0);
    transition: transform var(--d-ui) var(--e-out), overlay var(--d-ui) allow-discrete, display var(--d-ui) allow-discrete;
  }
  .sheet:not([open]) { transform: translateY(100%); }
  @starting-style { .sheet[open] { transform: translateY(100%); } }
  .sheet::backdrop {
    background: oklch(0% 0 0 / .6);
    opacity: 1;
    transition: opacity var(--d-ui) var(--e-out), overlay var(--d-ui) allow-discrete, display var(--d-ui) allow-discrete;
  }
  .sheet:not([open])::backdrop { opacity: 0; }
  @starting-style { .sheet[open]::backdrop { opacity: 0; } }
  html.has-sheet { overflow: hidden; }
  .sheet__grip { width: 40px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--hair-strong); opacity: .5; }
  .sheet__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-inline: calc(-1 * var(--gutter)); padding: 4px calc(var(--gutter) - 6px) 4px var(--gutter); background: var(--panel-bg); }
  .sheet__title { font: var(--w-strong) var(--text-xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
  .sheet__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-button); background: none; color: var(--fg); cursor: pointer; }
  .sheet__close svg { width: 22px; height: 22px; }
  /* the action stays in reach: the foot sticks to the sheet's bottom edge while the links scroll */
  .sheet__foot { position: sticky; bottom: 0; display: grid; gap: var(--space-1); margin: var(--space-6) calc(-1 * var(--gutter)) 0; padding: var(--space-3) var(--gutter) calc(var(--space-2) + var(--safe-b)); background: var(--panel-bg); box-shadow: 0 -1px 0 var(--hair); }
  .sheet__foot .btn { width: 100%; justify-content: center; }
  .sheet__tel { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font: var(--w-ui) var(--text-body) / 1 var(--font-sans); color: var(--fg); }
  .sheet__tel svg { width: 18px; height: 18px; color: var(--brand); }

  /* the menu: the desktop dropdown groups; Services as tiles, the rest as rows */
  .menu__group { margin: var(--space-5) 0 var(--space-2); font: var(--w-strong) var(--text-xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
  .menu > .menu__group:first-child { margin-top: var(--space-1); }
  .menu__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .menu__tiles > li { display: grid; }
  .menu-tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-3);
    min-height: 88px; padding: 14px; border-radius: var(--r-md);
    background: var(--bg-sunken); font: var(--w-strong) var(--text-body) / 1.2 var(--font-sans); color: var(--fg);
  }
  .menu-tile__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
  .menu-tile__icon svg { width: 18px; height: 18px; }
  .menu__rows { border-top: 1px solid var(--hair); }
  .menu__rows--top { margin-top: var(--space-5); }
  .menu-row { display: flex; align-items: center; min-height: 50px; border-bottom: 1px solid var(--hair); font: var(--w-ui) 1.0625rem / 1.2 var(--font-sans); color: var(--fg); }
  /* Orla: the menu is just the 3 pages, so they get big rows; the page you are on wears a dot instead of the arrow */
  .menu__rows--pages { margin-top: var(--space-2); }
  .menu-row--page { justify-content: space-between; gap: var(--space-3); min-height: 64px; font: var(--w-strong) 1.5rem / 1.1 var(--font-sans); letter-spacing: -.01em; }
  .menu-row--page svg { flex: none; width: 20px; height: 20px; color: var(--fg-muted); }
  .menu-row--page[aria-current] svg { display: none; }
  .menu-row--page[aria-current]::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--brand); }
  .menu-tile:active, .menu-row:active { transform: scale(.98); }
  @media (prefers-reduced-motion: reduce) { .sheet, .sheet::backdrop { transition: none; } }
}

/* ---------- 12 · phone action bar + top bar behaviour (<1024px, E04; SPEC §3.3) ------------------------- */
@media (max-width: 1023.98px) {
  .action-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px var(--gutter) calc(8px + var(--safe-b));
    background: var(--frost-bg);
    -webkit-backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    backdrop-filter: blur(var(--frost-blur)) saturate(140%);
    box-shadow: inset 0 1px 0 var(--frost-line);
    transform: translateY(calc(100% + 2px));
    transition: transform var(--d-ui) var(--e-out);
  }
  .action-bar[data-state="shown"] { transform: none; }
  .action-bar__cta { flex: 1; min-height: 48px; justify-content: center; }
  .action-bar__cta .lbl-short { display: none; }
  .action-bar__tel, .action-bar__menu {
    display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border: 0;
    border-radius: var(--r-button); background: var(--bg-sunken); color: var(--fg); cursor: pointer;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--fg) 8%, transparent);
  }
  .action-bar__tel { color: var(--brand); }
  .action-bar__tel svg, .action-bar__menu svg { width: 21px; height: 21px; }
  .action-bar__tel:active, .action-bar__menu:active, .action-bar__cta:active { transform: scale(.97); }
  /* the page end keeps the bar's height free: the footer's last line is never under it */
  .site-footer { padding-bottom: calc(var(--bar-h) + var(--safe-b) + var(--space-6)); }

  /* the top bar (logo · theme · ☰) hides on scroll down, returns on scroll up. ☰ also lives in the action bar, which
     comes after the hero CTA and steps aside at #contact; while it is shown the top gives its ☰ up — one ☰ on screen,
     never two (Arthur 29/09). The theme toggle is on top and in the menu */
  html.topbar-hidden .site-nav { transform: translateY(-100%); }
  html.bar-visible .site-nav .nav__menu { visibility: hidden; }   /* hidden, not display:none: its 44px slot stays, so the theme toggle beside it does not jump (CLS 0.0007 on every page without a hero CTA, where the bar appears on the first scroll while the top bar is still on screen) */
  .menu__theme { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-5); padding-block: 2px; border-block: 1px solid var(--hair); font: var(--w-ui) 1.0625rem / 1.2 var(--font-sans); }

  @media (max-width: 359.98px) {
    .action-bar__cta .lbl-long { display: none; }
    .action-bar__cta .lbl-short { display: inline; }
  }
  /* wider phones and tablets: the bar's content stays a thumb-sized group in the middle */
  @media (min-width: 640px) { .action-bar { justify-content: center; } .action-bar__cta { flex: 0 1 26rem; } }
  /* landscape phones: a slimmer bar (the hit areas stay ≥ 44px) */
  @media (max-height: 500px) {
    .action-bar { padding-block: 4px calc(4px + var(--safe-b)); }
    .action-bar__cta, .action-bar__tel, .action-bar__menu { min-height: 44px; height: 44px; }
    .action-bar__tel, .action-bar__menu { width: 44px; }
  }
  @media (prefers-reduced-motion: reduce) { .action-bar, .site-nav { transition: none; } }
}


/* ---------- 14 · phone buttons (<1024px): labels may wrap (text at 200%), small buttons keep a 44px target ---- */
@media (max-width: 1023.98px) {
  /* text at 200% (iOS/Android large text): a long word breaks instead of pushing past the screen */
  h1, h2, h3, h4, p, li, dd, dt, blockquote, label { overflow-wrap: break-word; }
  .btn { white-space: normal; text-align: center; line-height: 1.15; padding-block: 8px; }
  .btn--sm { --btn-h: 44px; }
}


/* ---------- page chrome shared by every page (moved here from the legacy home/hero.css so `bare` pages get it) ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-nav) + 10);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-inverse);
  color: var(--fg-inverse);
  font: var(--w-ui) var(--text-sm) / 1 var(--font-sans);
  transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; }
.anchor-top { position: absolute; top: 0; }
/* the navbar lockup (phones: TMC's 32px symbol box would squeeze the wordmark) */
.nav__logo .nav__lockup { height: 22px; width: auto; }

