/*
 * ai-gagement.com — the coming-soon page and the two legal pages (05-screens/25-website.md, AIG-324).
 *
 * Every value comes from the D3 token files, linked rather than copied (`site/tokens` points at
 * frontend/src/styles/d3/tokens/), so the site and the app cannot drift. A raw value names the
 * property it is excused for, in the same `--d3-allow-*` form the app uses, and
 * frontend/src/styles/d3/no-raw-values.test.ts holds this file to it.
 *
 * Absolute paths throughout: CloudFront answers an unknown path with /index.html, which must
 * still find its stylesheet from any depth.
 */
@import url('/tokens/colors.css');
@import url('/tokens/typography.css');
@import url('/tokens/spacing.css');

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, ul { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--text-link); }
a:hover { color: var(--text-link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, .joined:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* ---- the frame (spec 22, reused) ---- */
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(400px, 1fr) minmax(0, 1.3fr);
  --d3-allow-grid-template-columns: a column floor, and D3 ships no width scale;
}
.side { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-6) var(--space-12); }
.logo {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  --d3-allow-letter-spacing: the type scale carries sizes and weights, not tracking;
  color: var(--text-primary);
  text-decoration: none;
}
.logo img {
  display: block;
  width: 32px;
  --d3-allow-width: the supplied mark renders at 32px here;
  height: 32px;
  --d3-allow-height: the supplied mark renders at 32px here;
}
.logo .accent {
  color: #3686ff;
  --d3-allow-color: the blue of the product mark is a property of the supplied raster asset, not a D3 token;
}
.main { flex: 1; display: flex; align-items: center; }
.content {
  width: 100%;
  max-width: 440px;
  --d3-allow-max-width: no width token in the D3 scale;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.eyebrow {
  font-size: var(--text-micro);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  --d3-allow-letter-spacing: the type scale carries sizes and weights, not tracking;
  color: var(--text-tertiary);
}
h1 {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  --d3-allow-letter-spacing: the type scale carries sizes and weights, not tracking;
  text-wrap: balance;
}
.intro { display: flex; flex-direction: column; gap: var(--space-3); }
.lede { color: var(--text-secondary); }

.points { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.points li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  --d3-allow-grid-template-columns: a lead column wide enough for the longest lead, and D3 ships no width scale;
  gap: var(--space-3);
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}
.points b { color: var(--text-primary); font-weight: var(--weight-semibold); }
.platforms { font-size: var(--text-body-sm); color: var(--text-secondary); }

/* ---- the waitlist form ---- */
.waitlist { display: flex; flex-direction: column; gap: var(--space-3); }
.waitlist label { font-size: var(--text-caption); font-weight: var(--weight-semibold); }
.row { display: flex; gap: var(--space-2); }
.waitlist input[type=email] {
  flex: 1;
  min-width: 0;
  height: 44px;
  --d3-allow-height: the 44px hit target the record sets below 640px, kept at every width;
  padding: 0 var(--space-4);
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  --d3-allow-border: no border-width token in the D3 scale;
  border-radius: var(--radius-lg);
}
.waitlist input[aria-invalid=true] { border-color: var(--danger); }
.waitlist button {
  height: 44px;
  --d3-allow-height: the 44px hit target the record sets below 640px, kept at every width;
  padding: 0 var(--space-5);
  font: inherit;
  font-weight: var(--weight-semibold);
  color: var(--text-on-accent);
  background: var(--accent-primary);
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
}
.waitlist button:hover { background: var(--accent-primary-hover); }
.waitlist button:disabled { cursor: progress; }
.consent { font-size: var(--text-caption); color: var(--text-secondary); }
.error { font-size: var(--text-caption); color: var(--danger-fg); }
.gotcha {
  position: absolute;
  left: -10000px;
  --d3-allow-left: moves the honeypot off-screen; a position, not a design value;
}
.joined {
  padding: var(--space-4) var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  --d3-allow-border: no border-width token in the D3 scale;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  font-weight: var(--weight-semibold);
}

/* ---- footer ---- */
.foot { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-micro); color: var(--text-secondary); }
.foot .links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.foot a { color: var(--text-secondary); }

/* ---- sample panel (decision 0157, spec 22's shipped copy) ---- */
.sample {
  margin: var(--space-4) var(--space-4) var(--space-4) 0;
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-8);
  background: var(--navy-950);
  color: var(--text-on-navy);
  border-radius: var(--radius-xl);
}
[data-theme=dark] .sample {
  border: 1px solid var(--border-inverse);
  --d3-allow-border: no border-width token in the D3 scale;
}
.sample .eyebrow { color: var(--text-on-navy-secondary); }
.sample h2 {
  max-width: 17ch;
  --d3-allow-max-width: a measure for the panel heading, and D3 ships no width scale;
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  --d3-allow-letter-spacing: the type scale carries sizes and weights, not tracking;
}
.sample .intro p {
  max-width: 46ch;
  --d3-allow-max-width: a reading measure, and D3 ships no width scale;
  color: var(--text-on-navy-secondary);
}
.thread {
  max-width: 32.5rem;
  --d3-allow-max-width: no width token in the D3 scale;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--surface-card);
  color: var(--text-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.head { display: flex; align-items: center; gap: var(--space-3); }
.avatar {
  width: 36px;
  --d3-allow-width: the avatar size that spec 22 draws in its panel, and D3 ships no size scale;
  height: 36px;
  --d3-allow-height: the avatar size that spec 22 draws in its panel, and D3 ships no size scale;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}
.who { display: flex; flex-direction: column; line-height: var(--leading-snug); }
.who b { font-size: var(--text-body-sm); }
.who span { font-size: var(--text-caption); color: var(--text-secondary); }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  --d3-allow-padding: the 2px block padding of a badge sits below the D3 space scale;
  border-radius: var(--radius-full);
  font-size: var(--text-micro);
  font-weight: var(--weight-semibold);
}
.tone { margin-left: auto; background: var(--sentiment-neutral-bg); color: var(--text-secondary); }
.handle { color: var(--text-link); font-weight: var(--weight-medium); }
.draft { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunken); }
.draft-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-micro); color: var(--text-secondary); }
.ai { background: var(--emerald-50); color: var(--emerald-700); }
.mono { font-family: var(--font-mono); }
.draft p { font-size: var(--text-body-sm); }
.draft p.not-sent { font-size: var(--text-micro); font-weight: var(--weight-bold); text-transform: uppercase; color: var(--text-secondary); }
.actions { display: flex; gap: var(--space-2); }
.pic {
  height: 34px;
  --d3-allow-height: a picture of the small app button, which is 34px tall;
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}
.pic.go { background: var(--accent-primary); color: var(--text-on-accent); }
.pic.edit { background: var(--gray-100); color: var(--text-primary); }
.rules { display: flex; flex-direction: column; gap: var(--space-2); }
.rules small { font-size: var(--text-caption); color: var(--text-on-navy-secondary); }
.rules ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rules li {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-inverse);
  --d3-allow-border: no border-width token in the D3 scale;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
}

/* ---- legal pages ---- */
.legal {
  max-width: 68ch;
  --d3-allow-max-width: the reading measure spec 25 sets, and D3 ships no width scale;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.doc { display: flex; flex-direction: column; gap: var(--space-4); }
.doc h1 { font-size: var(--text-h1); }
.doc h2 { margin-top: var(--space-4); font-size: var(--text-h3); font-weight: var(--weight-bold); }
.doc h3 { font-size: var(--text-body); font-weight: var(--weight-semibold); }
.doc code { font-family: var(--font-mono); font-size: var(--text-body-sm); }
.doc .updated { color: var(--text-secondary); font-size: var(--text-body-sm); }
.doc ul { padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); }
.doc address { font-style: normal; }
.table-wrap { overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
.doc th, .doc td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-default);
  --d3-allow-border-bottom: no border-width token in the D3 scale;
}
.doc th { font-weight: var(--weight-semibold); }

@media (max-width: 1279px) { .sample { padding: var(--space-10); } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sample { display: none; }
  .side { padding: var(--space-5); }
  .main { justify-content: center; }
}
@media (max-width: 639px) {
  .row { flex-direction: column; }
  .waitlist input[type=email] { flex: none; width: 100%; }
  .points li { grid-template-columns: 1fr; gap: 0; }
  .foot .links { flex-direction: column; }
  .foot a {
    display: inline-block;
    min-height: 44px;
    --d3-allow-min-height: the 44px hit target the record sets below 640px;
    line-height: 44px;
    --d3-allow-line-height: centres the link text in its 44px hit target;
  }
  .legal { padding: var(--space-5) var(--space-4) var(--space-10); }
  a.logo {
    min-height: 44px;
    --d3-allow-min-height: the 44px hit target the record sets below 640px;
  }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
