/* mitec — component styles
   ──────────────────────────────────────────────────────────────────────────
   Every rule here reads semantic --color-* tokens only, so a component drops
   into a light section or a forest band without knowing which it is. The old
   `.mt-on-light` scope is gone: dark areas now declare [data-surface="dark"]
   and the whole token set remaps underneath them (DESIGN.md §3).
   ────────────────────────────────────────────────────────────────────────── */

/* ---------------------------------------------------------------- reset & base */
*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scrollbar-color: var(--color-border-strong) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  /* clip, not hidden: hidden makes a scroll container, which would break the
     portal's position: sticky stage. */
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  font-weight: var(--weight-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  margin: 0;
}
p { margin: 0; text-wrap: pretty; }
a { color: var(--color-link); text-decoration: none; transition: color var(--dur) var(--ease-out); }
a:hover { color: var(--color-link-hover); }

/* Browser surfaces belong to the palette too, not to the browser's defaults. */
::selection { background: var(--color-tonal); color: var(--color-tonal-text); }
body { caret-color: var(--color-cta); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--color-focus-halo);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- layout */
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }

/* Instagram signature: a fine 28px grid, forest surfaces only (DESIGN.md §8). */
.texture-grid {
  background-image:
    linear-gradient(var(--color-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ---------------------------------------------------------------- Icon
   Lucide glyph as a CSS mask so it always inherits currentColor — never a
   hand-drawn path, never a Unicode glyph standing in for an icon. */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
/* Forced colours paint every background with the canvas colour, which would
   blank these mask-drawn glyphs. Opt them out and paint them in the system
   colour of what they sit in (currentColor would be the unforced brand ink). */
@media (forced-colors: active) {
  .icon { forced-color-adjust: none; background-color: CanvasText; }
  a .icon { background-color: LinkText; }
  button .icon { background-color: ButtonText; }
}
/* Forward/next points LEFT on an RTL page (DESIGN.md §5). */
.icon-arrow-left       { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/arrow-left.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/arrow-left.svg); }
.icon-arrow-up-left    { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/arrow-up-left.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/arrow-up-left.svg); }
.icon-layout-dashboard { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/layout-dashboard.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/layout-dashboard.svg); }
.icon-shield-check     { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/shield-check.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/shield-check.svg); }
.icon-trending-up      { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/trending-up.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/trending-up.svg); }
.icon-headset          { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/headset.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/headset.svg); }
.icon-clock            { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/clock.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/clock.svg); }
.icon-image            { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/image.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/image.svg); }
.icon-menu             { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/menu.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/menu.svg); }
.icon-x                { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/x.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/x.svg); }
.icon-plus             { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/plus.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/plus.svg); }
.icon-minus            { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/minus.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/minus.svg); }
.icon-check            { -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/check.svg); mask-image: url(https://cdn.jsdelivr.net/npm/lucide-static@0.544.0/icons/check.svg); }

/* ---------------------------------------------------------------- Logo
   No official mark was supplied — the wordmark is set in type. The amber
   full stop is the one place amber appears on light, and it survives the
   contrast bar as --color-highlight-text (#8C5313, 5.80:1) rather than the
   raw amber-400, which would fail at 2.07:1. */
.logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--logo-size, 22px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--color-text-primary);
  direction: ltr; /* the wordmark is Latin runs; keep it from reordering on an RTL page */
}
.logo:hover { color: var(--color-text-primary); }
.logo__mi { color: var(--color-cta); }
.logo__dot { color: var(--color-highlight-text); font-weight: 800; }
.logo__team { color: var(--color-text-muted); font-weight: 500; font-size: 0.62em; letter-spacing: .02em; margin-inline-start: 1px; }

/* ---------------------------------------------------------------- Button
   Four levels, flat fills only. No gradient, no glow, no coloured shadow.
   Solid buttons keep a transparent 1px border so they stay visible in
   forced-colors mode. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  line-height: 1;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--color-surface-sunken);
  color: var(--color-text-disabled);
  cursor: not-allowed;
}
.btn--sm { padding: 8px 16px; font-size: var(--text-body-sm); gap: 7px; }
.btn--sm .icon { width: 15px; height: 15px; }
.btn--md { padding: 11px 20px; font-size: var(--text-body); gap: 9px; }
.btn--md .icon { width: 17px; height: 17px; }
.btn--lg { padding: 15px 30px; font-size: var(--text-body-lg); gap: 10px; }
.btn--lg .icon { width: 19px; height: 19px; }

.btn--primary { background: var(--color-cta); color: var(--color-cta-text); }
.btn--primary:hover { background: var(--color-cta-hover); color: var(--color-cta-text); }
.btn--primary:active { background: var(--color-cta-active); }

.btn--tonal { background: var(--color-tonal); color: var(--color-tonal-text); }
.btn--tonal:hover { background: var(--color-tonal-hover); color: var(--color-tonal-text); }

.btn--outline { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn--outline:hover { background: var(--color-surface-sunken); color: var(--color-text-primary); }

/* ---------------------------------------------------------------- Badge / chip */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  line-height: 1.4;
  white-space: nowrap;
  background: var(--color-tonal);
  color: var(--color-tonal-text);
}
.badge .icon { width: 14px; height: 14px; }
.badge--highlight { background: var(--color-highlight-soft); color: var(--color-highlight-text); }

/* ---------------------------------------------------------------- Card
   Light cards are a real surface with a forest-tinted shadow. Forest tiles
   carry a --forest-line border because the fill contrast alone is 1.14:1
   and would otherwise vanish against the band behind it (DESIGN.md §6). */
.card { border-radius: var(--radius-card); padding: var(--pad-card); }
.card--pad-lg { padding: var(--pad-card-lg); }
.card--pad-0 { padding: 0; }

.card--surface {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-body);
  box-shadow: var(--shadow-card);
}
.card--forest {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-body);
}
.card--interactive { transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out); }
.card--surface.card--interactive:hover { border-color: var(--color-border-hover); box-shadow: var(--shadow-elevated); }
.card--forest.card--interactive:hover { background: var(--color-brand-hover); }

.card-title { font-size: var(--text-h4); color: var(--color-text-primary); }

/* ---------------------------------------------------------------- SectionHeading */
.section-heading { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; text-align: start; max-width: 62ch; }
.section-heading--center { align-items: center; text-align: center; margin-inline: auto; }
.section-heading__eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-eyebrow);
  color: var(--color-tonal-text);
}
.section-heading__title { font-family: var(--font-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); color: var(--color-text-primary); margin: 0; }
.section-heading__title--display-1 { font-weight: 800; font-size: var(--text-display-1); }
.section-heading__title--display-3 { font-weight: 700; font-size: var(--text-display-3); }
.section-heading__sub { font-size: var(--text-lead); font-weight: 400; color: var(--color-text-secondary); line-height: var(--lh-tight); max-width: 52ch; }

/* The one amber moment: a highlighter stroke under a single headline phrase.
   Amber never becomes text on light — it sits behind ink at 13.30:1. */
.headline-mark {
  background: linear-gradient(transparent 55%, var(--color-highlight-soft) 55%);
  padding-inline: .08em;
}

/* ---------------------------------------------------------------- Client strip */
.logo-strip { display: flex; align-items: center; gap: var(--space-6) var(--space-7); flex-wrap: wrap; padding: var(--space-5) 0; }
.logo-strip__label { font-size: var(--text-caption); font-weight: var(--weight-bold); color: var(--color-text-muted); }
.logo-strip__names { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.logo-strip__name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-body-lg); color: var(--color-text-muted); letter-spacing: -0.01em; transition: color var(--dur) var(--ease-out); }
.logo-strip__name:hover { color: var(--color-text-primary); }

/* ---------------------------------------------------------------- Stats
   A white card on the canvas. Numerals carry the brand colour, not the action
   colour — they are not clickable. No buttons live in here (DESIGN.md §5). */
.stat-block { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.stat-block__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-stat);
  line-height: 1.05;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}
.stat-block__label { font-family: var(--font-body); font-size: var(--text-body-sm); color: var(--color-text-secondary); line-height: 1.4; }

.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-6);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------- Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--color-surface-sunken); }
.tabs__btn {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 700;
  background: transparent;
  color: var(--color-text-secondary);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.tabs__btn:hover { color: var(--color-text-primary); }
.tabs__btn.is-active { background: var(--color-surface); color: var(--color-text-primary); box-shadow: var(--shadow-card); }

/* ---------------------------------------------------------------- NavBar */
.navbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-8);
  padding: var(--space-3) var(--gutter);
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.navbar__menu { display: flex; align-items: center; gap: var(--space-7); margin-inline: auto; }
.navbar__link {
  position: relative;
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-body); font-size: var(--text-body); font-weight: 500;
  color: var(--color-text-secondary);
}
.navbar__link:hover { color: var(--color-text-primary); }
.navbar__link::after { content: ''; position: absolute; inset-inline: 0; bottom: 6px; height: 2px; border-radius: 2px; background: transparent; }
.navbar__link.is-active { font-weight: 700; color: var(--color-text-primary); }
.navbar__link.is-active::after { background: var(--color-cta); }
.navbar__cta { flex: 0 0 auto; }
.navbar__toggle {
  display: none; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text-primary); cursor: pointer;
}

/* ---------------------------------------------------------------- Footer */
.footer { padding: var(--space-9) var(--gutter) var(--space-7); }
.footer__inner { display: flex; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; align-items: center; }
.footer__nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--text-body-sm); }
.footer__nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-text-secondary); }
.footer__nav a:hover { color: var(--color-text-primary); }
.footer__copy { font-size: var(--text-caption); color: var(--color-text-muted); }

/* ---------------------------------------------------------------- image placeholder
   Stand-in for the real screenshots. Inside a forest tile the tokens remap,
   so it reads correctly on both grounds without a second rule. */
.img-slot {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
  border: 1px dashed var(--color-border-strong);
}
.img-slot .icon { width: 26px; height: 26px; }
.img-slot__label { font-size: var(--text-caption); max-width: 92%; line-height: 1.4; }
.img-slot--circle { border-radius: 50%; }

/* ---------------------------------------------------------------- utilities */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Fixed, not absolute: focus can reach it (wrapping round from the end of
   the page) while the page is scrolled far down, and it must show there too. */
.skip-link {
  position: fixed; inset-inline-start: var(--space-4); top: -60px; z-index: 50;
  background: var(--color-cta); color: var(--color-cta-text); font-weight: var(--weight-bold);
  padding: 12px 18px; border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease-out);
}
/* The global a:hover would otherwise repaint this label green-on-green (1.3:1),
   because .skip-link carries a fill but no hover colour of its own. */
.skip-link:hover { color: var(--color-cta-text); }
.skip-link:focus { top: var(--space-4); }
