/* TheAi.Biz — reset, typography, and the shared furniture every section uses. */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* Every grid/flex child that could hold long content. Without this a single
   unbreakable string blows the page out sideways at narrow widths. */
.grid > *, .row > * { min-width: 0; }

/* ---------- Focus ---------- */

:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 200;
  padding: 12px 20px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  font-size: var(--step-xs); font-weight: 600; text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}
.skip:focus-visible { top: 12px; }

/* ---------- Layout furniture ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-md { max-width: var(--measure-md); }
.wrap-sm { max-width: var(--measure-sm); }

.band { padding-block: var(--band-y); position: relative; }
.band-sm { padding-block: var(--band-y-sm); }
.band-sunk { background: var(--paper-sunk); border-block: 1px solid var(--line); }
section { scroll-margin-top: 84px; }

.band-head { max-width: 34ch; margin-bottom: clamp(36px, 5vw, 64px); }
.band-head.center { margin-inline: auto; text-align: center; max-width: 62ch; }
/* Centred heads set the headline on a short measure and the lede on a longer
   one. Constraining the whole block to the headline's measure made every lede
   read as a narrow four-line column. */
.band-head.center h2 { max-width: 22ch; margin-inline: auto; }
.band-head .lede { max-width: 58ch; }
.band-head.center .lede { margin-inline: auto; }
.lede + .lede { margin-top: .85em; }

/* ---------- Type ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px; background: var(--accent); flex: none;
}
.eyebrow.plain::before { display: none; }

.display {
  font-family: var(--font-display);
  font-size: var(--step-display);
  line-height: 1.02;
  letter-spacing: var(--tracking-display);
  font-weight: 500;
}
h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--step-h2);
  line-height: 1.08;
  letter-spacing: var(--tracking-h2);
  margin-bottom: 18px;
}
h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--step-h3);
  line-height: 1.18;
  letter-spacing: -0.018em;
}
h4, .h4 {
  font-size: var(--step-h4);
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.3;
}
.lede {
  font-size: var(--step-lede);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
}
.body-sm { font-size: var(--step-sm); line-height: 1.6; color: var(--ink-soft); }
.meta {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}
.label {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-faint);
}
.ember { color: var(--accent-strong); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--step-sm);
  font-weight: 600;
  letter-spacing: -0.006em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}
.btn svg { flex: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
  color: var(--accent-ink);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--btn-hover), var(--btn-hover));
  box-shadow: var(--glow-ember), inset 0 1px 0 rgba(255, 255, 255, .18);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--paper-raised);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.btn-ghost { color: var(--ink-soft); padding-inline: 16px; }
.btn-ghost:hover { background: var(--paper-sunk); color: var(--ink); }

.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; transform: translateY(-1px); box-shadow: var(--shadow-soft); }

.btn-lg { min-height: 52px; padding: 15px 30px; font-size: 1.0625rem; }
.btn-sm { min-height: 38px; padding: 8px 16px; font-size: var(--step-micro); }

.btn-arrow svg { transition: transform var(--t-base) var(--ease); }
.btn-arrow:hover svg { transform: translateX(3px); }

/* Text link that behaves like a button target */
.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--step-sm); font-weight: 600;
  color: var(--accent-strong); text-decoration: none;
}
.link-arrow svg { transition: transform var(--t-base) var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Small shared components ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  font-size: var(--step-micro);
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip-ember { border-color: var(--accent-tint-2); background: var(--accent-tint); color: var(--accent-strong); }
.chip-data  { border-color: var(--data-tint); background: var(--data-tint); color: var(--data); }

.dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--data);
  position: relative;
}
.dot-live::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; border: 1px solid var(--data);
  opacity: 0; animation: ping 2.6s var(--ease) infinite;
}
.dot-idle { background: var(--ink-faint); }
.dot-wait { background: var(--caution); }
@keyframes ping {
  0%   { opacity: .7; transform: scale(.7); }
  70%  { opacity: 0;  transform: scale(1.5); }
  100% { opacity: 0;  transform: scale(1.5); }
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.glyph {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--accent-strong);
  border: 1px solid var(--accent-tint-2);
}
.glyph svg { width: 22px; height: 22px; }
.glyph-data { background: var(--data-tint); color: var(--data); border-color: color-mix(in srgb, var(--data) 16%, transparent); }
.glyph-neutral { background: var(--paper-sunk); color: var(--ink-soft); border-color: var(--line); }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .06s; }
.reveal[data-delay="2"] { transition-delay: .12s; }
.reveal[data-delay="3"] { transition-delay: .18s; }
.reveal[data-delay="4"] { transition-delay: .24s; }
.reveal[data-delay="5"] { transition-delay: .30s; }
.reveal[data-delay="6"] { transition-delay: .36s; }

.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;
}

/* ---------- Reduced motion ----------
   One place. Everything animated in this build is either a transition, a
   keyframe animation, or a JS count-up that checks the same media query. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .link-arrow:hover svg, .btn-arrow:hover svg { transform: none; }
}
