/* emod theme — layout & components built on tokens.css.
   Rules: 60/30/10 paper/ink/lime; one lime CTA per view; pills; warm shadows; sentence case. */

/* Anchor offset: the header is sticky (~73px), so jumping to an in-page anchor
   (e.g. the "What we do" cards -> /services/#ai-audit) must not park the target
   heading underneath it. */
html {
  scroll-padding-top: 88px;
}
:target,
.prose h2[id] {
  scroll-margin-top: 88px;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}
.section {
  padding-block: var(--space-9);
}
@media (max-width: 720px) {
  .section {
    padding-block: var(--space-8);
  }
}

/* Dark "stage" — one per page */
.stage {
  background: var(--bg-inverse);
  color: var(--text-inverse);
}
.stage h1,
.stage h2,
.stage h3 {
  color: var(--text-inverse);
}
.stage .lede,
.stage p {
  color: var(--text-inverse-secondary);
}

/* ---------- Type ---------- */
h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  color: var(--text-primary);
}
h1 {
  font: var(--text-h1);
  letter-spacing: var(--tracking-h);
}
h2 {
  font: var(--text-h2);
  letter-spacing: var(--tracking-h);
}
h3 {
  font: var(--text-h3);
}
h4 {
  font: var(--text-h4);
}
p {
  margin: 0 0 var(--space-4);
}
.display {
  font: var(--text-display-xl);
  letter-spacing: var(--tracking-display);
  margin: 0 0 var(--space-5);
}
.lede {
  font: var(--text-body-lg);
  color: var(--text-secondary);
  max-width: 60ch;
}
a {
  color: inherit;
}
.mono-label {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(
    --gray-500
  ); /* 4.85:1 on paper — WCAG AA at label size (gray-400 failed at 2.77:1) */
  display: inline-block;
}
.stage .mono-label {
  color: var(--lime-600);
}
.site-footer .mono-label {
  color: var(
    --text-inverse-secondary
  ); /* gray-500 would drop to ~3.8:1 on ink */
}

/* ---------- Buttons (pills) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font: 600 15px/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  padding: 14px 22px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}
.btn--primary {
  background: var(--accent);
  color: var(--text-on-lime);
  box-shadow: var(--shadow-lime);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.btn--primary:active {
  transform: translateY(1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stage .btn--ghost {
  color: var(--text-inverse);
  border-color: var(--border-inverse);
}
.btn .arrow {
  transition: transform var(--duration-base) var(--ease-out);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper-50) 92%, transparent);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: none;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
}
.nav__links a:hover,
.nav__links .current-menu-item a {
  color: var(--text-primary);
}
/* Desktop: nav is an inline row of links; the in-panel CTA is hidden. */
.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__menu-cta {
  display: none; /* desktop uses the separate .nav__cta on the right */
}
.nav__cta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
/* Hamburger toggle — shown only on mobile. */
.nav__toggle {
  display: none;
  appearance: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav__toggle-icon,
.nav__toggle-icon::before,
.nav__toggle-icon::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition:
    transform var(--duration-base) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}
.nav__toggle-icon {
  position: relative;
}
.nav__toggle-icon::before {
  position: absolute;
  top: -6px;
}
.nav__toggle-icon::after {
  position: absolute;
  top: 6px;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-icon {
  background: transparent;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 820px) {
  .nav__toggle {
    display: inline-flex;
  }
  .nav__cta {
    display: none; /* the CTA moves into the dropdown panel on mobile */
  }
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    padding: var(--space-5) var(--container-pad) var(--space-6);
    background: var(--paper-50);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
  }
  .nav__menu[data-open="true"] {
    display: flex;
  }
  .nav__links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    width: 100%;
  }
  .nav__links a {
    display: block;
    padding: var(--space-3) 0;
    font-size: 17px;
  }
  .nav__menu-cta {
    display: inline-flex;
    justify-content: center;
  }
}

/* Logo lockup */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
}
.logo__word {
  font: 700 26px/1 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.stage .logo__word,
.site-footer .logo__word {
  color: var(--text-inverse);
}
.logo__mark {
  width: 24px;
  height: 23px;
  display: inline-block;
  transform: translateY(2px);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-10) var(--space-9);
}
@media (max-width: 720px) {
  .hero {
    padding-block: var(--space-8);
  }
}
.hero .lede {
  margin-bottom: var(--space-6);
}
.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
/* Proof strip: three differentiators under the hero, lime-dot bulleted. */
.hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
}
.hero__proof li {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--gray-500); /* AA contrast, same rationale as .mono-label */
  position: relative;
  padding-left: 18px;
}
.hero__proof li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: var(--radius-full);
  background: var(--accent);
  box-shadow: var(--shadow-lime);
}

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: var(--space-5);
}
.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 860px) {
  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }
}
.card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}
/* Card-as-link (homepage services grid) keeps the card look, drops link styling. */
a.card {
  text-decoration: none;
  color: inherit;
}
a.card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card h3 {
  margin-bottom: var(--space-2);
}
.card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 15px;
}
.stage .card {
  background: var(--bg-inverse-surface);
  border-color: var(--border-inverse);
  box-shadow: none;
}
.stage .card p {
  color: var(--text-inverse-secondary);
}

.eyebrow {
  margin-bottom: var(--space-3);
}

/* Live/status dot */
.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  box-shadow: var(--shadow-lime);
  display: inline-block;
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: var(--space-4);
}
.field label {
  display: block;
  font: 600 13px/1.4 var(--font-sans);
  margin-bottom: 6px;
  color: var(--text-primary);
}
.field input,
.field textarea {
  width: 100%;
  font: var(--text-body);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.field textarea {
  min-height: 140px;
  resize: vertical;
}
.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.form-note {
  font: var(--text-body-sm);
  color: var(
    --text-secondary
  ); /* real content (privacy note) — needs full AA contrast */
  margin-top: var(--space-3);
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-inverse);
  color: var(--text-inverse-secondary);
  padding-block: var(--space-8);
}
.site-footer a {
  color: var(--text-inverse-secondary);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text-inverse);
}
.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer__links {
  display: flex;
  flex-wrap: wrap; /* was overflowing the viewport on mobile (~390px) */
  gap: var(--space-3) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

/* Interior page H1 (Services/About/Contact/Privacy/Legal via page.php).
   Uses the standard h1 scale — never the .display hero size. */
.page-title {
  max-width: 22ch;
  margin-bottom: var(--space-6);
}

/* prose (page content) */
.prose {
  max-width: 68ch;
}
.prose h2 {
  margin-top: var(--space-8);
}
.prose ul {
  padding-left: 1.2em;
}
.prose li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}
/* Inline content links: brand accent, no default underline (underline on hover
   for affordance). Excludes .btn so buttons keep their own styling. */
.prose a:not(.btn) {
  color: var(--text-accent);
  text-decoration: none;
  font-weight: 600;
}
.prose a:not(.btn):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Wide prose (Services): the container spans the full 1160px so the service
   blocks can breathe, while plain text children stay at a readable measure. */
.prose--wide {
  max-width: none;
}
.prose--wide > p,
.prose--wide > ul,
.prose--wide > h2 {
  max-width: 68ch;
}

/* ---------- Service blocks (Services page) ---------- */
.svc-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: var(--space-7) 0 var(--space-8);
}
.svc {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-7);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-md);
}
.svc h2 {
  margin-top: var(
    --space-2
  ); /* override .prose h2's section spacing inside blocks */
  margin-bottom: var(--space-3);
}
.svc__intro p {
  color: var(--text-secondary);
}
.svc__intro p:last-child {
  margin-bottom: 0;
}
.svc__aside {
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--space-6);
}
.svc__label {
  display: block;
  margin-bottom: var(--space-2);
}
.svc__list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5);
}
.svc__list:last-child {
  margin-bottom: 0;
}
.svc__list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: 15px;
}
.svc__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
}
@media (max-width: 860px) {
  .svc {
    grid-template-columns: 1fr;
    gap: var(--space-5);
    padding: var(--space-6);
  }
  .svc__aside {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-5);
  }
}

/* ---------- FAQ (native <details>, individually outlined) ---------- */
.faq {
  max-width: 68ch;
  margin-top: var(--space-6);
  margin-bottom: var(
    --space-7
  ); /* separate the accordion from the CTA that follows */
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* Each question is its own thin-outlined card. */
.faq__item {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.faq__item[open] {
  border-color: var(--gray-300);
}
/* Keep <summary> as its default display (list-item) so the native toggle keeps
   working in Safari — setting display:flex/grid on a <summary> breaks it there.
   The +/- marker is positioned absolutely instead of via flex. */
.faq__q {
  cursor: pointer;
  font: 600 17px/1.4 var(--font-sans);
  color: var(--text-primary);
  padding: var(--space-4) var(--space-7) var(--space-4) var(--space-5);
  list-style: none; /* Firefox marker */
  position: relative;
}
.faq__q::-webkit-details-marker {
  /* Safari marker */
  display: none;
}
.faq__q::after {
  content: "+";
  position: absolute;
  right: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500); /* AA-adjacent; it signals open/close state */
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}
.faq__item[open] .faq__q::after {
  content: "\2013"; /* en dash */
}
.faq__q:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-md);
}
.faq__a {
  padding: 0 var(--space-5) var(--space-4);
  color: var(--text-secondary);
}
.faq__a p {
  margin: 0;
  max-width: 60ch;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  background: var(--ink-900);
  color: var(--paper-50);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
