/*
  Base styles: reset, primitives, header, footer, buttons, section rhythm.
  Structural only. All colors, fonts, radii, and motion come from tokens.css.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-1);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  margin: 0;
}

p,
ul,
ol {
  margin: 0;
}

.container {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Section rhythm */
.section {
  padding-block: 88px;
  border-top: 1px solid var(--edge-soft);
}

.section h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  max-width: 22ch;
  text-wrap: balance;
}

.section-sub {
  color: var(--text-2);
  font-size: 1.05rem;
  max-width: 44rem;
  margin-top: 14px;
}

@media (max-width: 767px) {
  .section {
    padding-block: 64px;
  }
}

/* Band sections: rounded boxes inset from the page edge.
   band-ink is the dark register; band-tint is the warm clay register. */
.band-wrap {
  padding-inline: 16px;
  padding-block: 8px;
}

.band {
  border-radius: var(--radius-band);
  max-width: 1240px;
  margin-inline: auto;
}

.band .container {
  padding-block: 72px;
}

.band h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  max-width: 24ch;
  text-wrap: balance;
}

.band-ink {
  background: var(--band-bg);
  color: var(--band-text);
}

.band-ink .section-sub {
  color: var(--band-muted);
}

.band-tint {
  background: var(--tint-bg);
  border: 1px solid var(--tint-edge);
}

/* Stamp: small seal-style label used on tint surfaces */
.stamp {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tint-strong);
  border: 1px solid var(--tint-strong);
  border-radius: 4px;
  padding: 4px 10px;
}

@media (max-width: 767px) {
  .band .container {
    padding-block: 52px;
  }
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: var(--radius-s);
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: transparent;
  color: var(--text-1);
  border-color: var(--edge);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-0);
  background: color-mix(in srgb, var(--surface-0) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark::after {
  content: ".";
  color: var(--accent);
}

/* Header wordmark runs at 2x the base size; the footer keeps the base */
.site-header .wordmark {
  font-size: 2.6rem;
  line-height: 1;
  padding-block: 10px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a:not(.btn) {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--t-fast) var(--ease);
}

.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] {
  color: var(--text-1);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: var(--accent-2-line);
}

.site-nav .btn {
  padding: 10px 18px;
  font-size: 0.95rem;
}

/* Industries dropdown. A disclosure: the link goes to /industries, the
   chevron button opens the list. Hover opens it on pointer devices. */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-s);
  color: var(--text-2);
  cursor: pointer;
}

.chev {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t-fast) var(--ease);
}

.submenu-toggle[aria-expanded="true"] .chev {
  transform: translateY(2px) rotate(225deg);
}

.submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item.is-open .submenu {
  display: block;
}

@media (min-width: 768px) {
  .submenu {
    position: absolute;
    top: 100%;
    left: -14px;
    min-width: 230px;
    margin-top: 10px;
    padding: 8px;
    background: var(--surface-0);
    border: 1px solid var(--edge);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-2);
  }

  /* Invisible bridge so the pointer can travel from the link to the menu */
  .submenu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
  }

  .site-nav .submenu a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-s);
    color: var(--text-1);
    font-size: 0.93rem;
    white-space: nowrap;
  }

  .site-nav .submenu a:hover {
    background: var(--surface-1);
  }

  .submenu-all {
    border-top: 1px solid var(--edge-soft);
    margin-top: 6px;
    padding-top: 6px;
  }

  .site-nav .submenu-all a {
    color: var(--text-2);
  }
}

@media (min-width: 768px) and (hover: hover) {
  .nav-item:not(.is-dismissed):hover .submenu {
    display: block;
  }

  .nav-item:not(.is-dismissed):hover .chev {
    transform: translateY(2px) rotate(225deg);
  }
}

@media (max-width: 1100px) and (min-width: 768px) {
  .site-nav {
    gap: 18px;
  }

  .site-nav a:not(.btn) {
    font-size: 0.88rem;
  }
}

/* Mobile nav */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--radius-s);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-1);
  transition: transform var(--t-fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface-1);
    border-bottom: 1px solid var(--edge);
    padding: 8px 24px 20px;
    /* The sticky header never scrolls with the page, so a tall open menu
       scrolls inside itself */
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a:not(.btn) {
    padding: 12px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--edge-soft);
  }

  .site-nav .btn {
    margin-top: 16px;
  }

  .nav-item {
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--edge-soft);
  }

  .nav-item > a:not(.btn) {
    flex: 1;
    border-bottom: 0;
  }

  .submenu-toggle {
    width: 44px;
    height: 44px;
  }

  .submenu {
    flex-basis: 100%;
    padding: 0 0 10px 14px;
  }

  .site-nav .submenu a {
    display: block;
    padding: 9px 0;
    font-size: 1rem;
    border-bottom: 0;
  }
}

/* Footer: the ink register, full bleed */
.site-footer {
  background: var(--band-bg);
  color: var(--band-text);
  padding-block: 56px 32px;
}

.site-footer .wordmark::after {
  color: var(--accent-2-line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .wordmark {
  margin: 0;
}

.footer-tag {
  color: var(--band-muted);
  font-size: 0.95rem;
  max-width: 30ch;
  margin-top: 12px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-head {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--band-muted);
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--band-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-head-legal {
  margin-top: 18px;
}

.footer-col a:hover {
  color: var(--band-text);
}

.footer-legal {
  color: var(--band-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--band-edge);
  margin-top: 44px;
  padding-top: 20px;
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Cookie notice (analytics.js). A floating card raised off the bottom edge
   so iOS Safari's toolbar never swallows its taps. */
.consent-note {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  background: var(--surface-0);
  border: 1px solid var(--edge);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  font-size: 0.86rem;
  color: var(--text-1);
}

.consent-note p {
  line-height: 1.45;
}

.consent-note a {
  color: var(--accent);
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.consent-actions .btn {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.86rem;
  touch-action: manipulation;
}
