/*
  Page styles for the AI On-Ramp pages (/ai/). Classes are prefixed ai- and
  read from the design system tokens in ds.css. The nav, footer, skip link and
  theme button match the rest of the site, restated here on the tokens because
  the other pages inline their styles.
*/

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }

/* The hidden attribute must win over the display values below. */
.ai-page [hidden] { display: none !important; }
/* Chrome links carry no underline; ds.css underlines every link by default. */
.ai-page .brand, .ai-page .nav-links a, .ai-page .btn.nav-cta, .ai-page .skip, .ai-page .crumbs a, .ai-page .ft-col a, .ai-page a.mg-btn, .ai-page a.mg-card, .ai-page .ai-card__link, .ai-page .ai-teamlist__name { text-decoration: none; }
.ai-page a.mg-btn:hover { text-decoration: none; }
/* .ai-page a sets the link colour and outranks the single-class button and skip styles, which left link-styled buttons as text the colour of their own fill. */
.ai-page a.mg-btn--primary, .ai-page a.mg-btn--primary:hover, .ai-page a.skip { color: var(--on-accent-solid); }
.ai-page a.mg-btn--secondary, .ai-page a.mg-btn--secondary:hover { color: var(--text-heading); }
.ai-page a.ai-band__cta { color: var(--green-800); }
.ai-page a.ai-band__cta:hover { color: var(--green-900); }
.ai-page a.ai-teamlist__name, .ai-page a.ai-teamlist__name:hover { color: var(--band-fg); }
.ai-page [tabindex="-1"]:focus { outline: none; }

/* Programmatic scrolling and focus land below the sticky nav, which is two rows tall on a phone. */
html.ai-page { scroll-padding-top: 132px; }

/* ---------------- shared site chrome ---------------- */

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 10px 14px; background: var(--accent-solid); color: var(--on-accent-solid); text-decoration: none; font-weight: var(--fw-semibold); }
.skip:focus { left: 8px; }

nav.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.nav-in { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 28px; min-height: 66px; padding: 10px var(--space-6); max-width: var(--container); margin: 0 auto; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.03em; text-decoration: none; margin-right: auto; color: var(--text-1); }
.brand b { color: var(--accent); font-weight: 800; }
.brand:hover { color: var(--text-1); text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.nav-links a { font-size: 14.5px; font-weight: var(--fw-medium); color: var(--text-2); text-decoration: none; padding-bottom: 2px; border-bottom: 1.5px solid transparent; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.nav-links a:hover { color: var(--text-1); text-decoration: none; }
.nav-links a[aria-current] { color: var(--text-1); border-bottom-color: var(--accent); }
.btn.nav-cta { display: inline-flex; align-items: center; font-size: 13.5px; font-weight: var(--fw-semibold); padding: 9px 16px; border: 1px solid var(--accent-solid); background: var(--accent-solid); color: var(--on-accent-solid); text-decoration: none; border-radius: var(--radius-md); transition: background var(--dur-fast) var(--ease); }
.btn.nav-cta:hover { background: var(--accent-solid-hover); color: var(--on-accent-solid); text-decoration: none; }
.theme-btn { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); padding: 7px 11px; cursor: pointer; border-radius: var(--radius-md); }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; font-weight: var(--fw-medium); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-current] { color: var(--accent); }

footer.ft { background: var(--surface-sunken); border-top: 1px solid var(--border); padding: 52px 0 40px; }
.ft-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 34px; padding-bottom: 34px; border-bottom: 1px solid var(--border); }
.ft-grid p { margin: 12px 0 0; font-size: 15px; color: var(--text-2); max-width: 34ch; line-height: 1.55; }
.ft-col .ft-h { font-family: var(--font-mono); font-size: 11px; font-weight: var(--fw-medium); letter-spacing: .13em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.ft-col a { display: block; font-size: 15px; color: var(--text-2); text-decoration: none; margin-bottom: 9px; }
.ft-col a:hover { color: var(--accent); }
.ft-base { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 22px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* The design system's light-mode yellow status text is 4.2:1 on its tint; 4.5:1 is the floor, so it is one step darker here. Dark mode passes as delivered. */
.ai-page .mg-status--tag.mg-status--yellow { color: #6f5319; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mg-status--tag.mg-status--yellow { color: var(--status-yellow-fg); } }
:root[data-theme="dark"] .mg-status--tag.mg-status--yellow { color: var(--status-yellow-fg); }

/* ---------------- sections ---------------- */

.ai-hero { padding: var(--space-10) 0 var(--space-9); border-bottom: 1px solid var(--border); }
.ai-hero .mg-h1 { margin-top: var(--space-5); max-width: 20ch; }
.ai-hero__lede { margin-top: var(--space-5); max-width: var(--measure); }
.ai-hero__note { margin-top: var(--space-4); max-width: var(--measure); color: var(--text-2); }
.ai-lockup { margin: var(--space-5) 0 0; line-height: 0; }
.ai-lockup img { height: 64px; width: auto; max-width: 100%; }
.ai-lockup__dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-lockup__light { display: none; } :root:not([data-theme="light"]) .ai-lockup__dark { display: inline; } }
:root[data-theme="dark"] .ai-lockup__light { display: none; }
:root[data-theme="dark"] .ai-lockup__dark { display: inline; }

.ai-sec { padding: var(--space-10) 0; }
.ai-sec--tight { padding: var(--space-8) 0; border-top: 1px solid var(--border); }
.ai-sec__head { display: flex; flex-direction: column; gap: var(--space-5); margin-bottom: var(--space-7); }
.ai-two { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--space-5) var(--space-9); align-items: start; }
.ai-two__body { max-width: var(--measure); display: grid; gap: var(--space-4); }

.ai-band { background: var(--band-bg); color: var(--band-fg); padding: var(--space-10) 0; }
.ai-band .mg-h2, .ai-band .mg-h3 { color: var(--band-fg); }
.ai-band .mg-eyebrow { color: var(--band-muted); }
.ai-band__lede { color: var(--green-100); margin-top: var(--space-4); max-width: 52ch; }
.ai-band__cta { margin-top: var(--space-6); background: var(--gray-25); color: var(--green-800); }
.ai-band__cta:hover:not(:disabled) { background: var(--green-100); color: var(--green-900); }
.ai-band__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7) var(--space-9); align-items: start; }
.ai-band--check { padding: var(--space-9) 0; }
.ai-band__back { align-self: end; justify-self: end; }
.ai-band__back a { color: var(--band-muted); }
.ai-band__back a:hover { color: var(--band-fg); }

.ai-teamlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--green-600); }
.ai-teamlist__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-4); align-items: center; padding: var(--space-4) 0; border-bottom: 1px solid var(--green-600); }
.ai-teamlist__name { grid-column: 1; color: var(--band-fg); font-weight: var(--fw-semibold); text-decoration: none; }
.ai-teamlist__name:hover { color: var(--band-fg); text-decoration: underline; }
.ai-teamlist__row .mg-caption { grid-column: 1; color: var(--band-muted); }
.ai-teamlist__row .ai-price { grid-column: 2; grid-row: 1; color: var(--band-fg); text-align: right; }
.ai-teamlist__row .mg-status { grid-column: 2; grid-row: 2; justify-self: end; }

/* ---------------- coming-soon list on the hub ---------------- */
.ai-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-8); align-items: start; }
.ai-grid.ai-grid--stack { grid-template-columns: minmax(0, 1fr); }
.ai-soon { margin-top: var(--space-8); }
.ai-split .ai-soon { margin-top: 0; }
.ai-soon__intro { color: var(--text-2); margin: var(--space-2) 0 var(--space-4); max-width: 60ch; }
.ai-soonlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); border-top: 1px solid var(--border); }
.ai-soonlist__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: baseline; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.ai-soonlist__name { grid-column: 1; font-weight: var(--fw-semibold); }
.ai-page a.ai-soonlist__name { text-decoration: none; }
.ai-page a.ai-soonlist__name:hover { text-decoration: underline; }
.ai-soonlist__row .mg-caption { grid-column: 1; }
.ai-soonlist__row .ai-price { grid-column: 2; grid-row: 1 / span 2; align-self: start; text-align: right; max-width: 14ch; }

/* ---------------- filter chips ---------------- */

.ai-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ai-filter__label { margin-right: var(--space-2); }
.ai-chip { border-color: var(--border-strong); }
.ai-chip:hover { border-color: var(--role); color: var(--role); }
.ai-chip.is-on { background: var(--role); border-color: var(--role); color: var(--gray-0); }

/* ---------------- product grid and cards ---------------- */

.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.ai-card { position: relative; padding: var(--space-6); gap: var(--space-3); }
.ai-card:hover { border-color: var(--role); }
.ai-card:focus-within { border-color: var(--role); }
.ai-card__cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius-md); }
.ai-card__icon { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--role-tint); color: var(--role); }
.ai-card__link { color: var(--text-heading); text-decoration: none; }
.ai-card__link::after { content: ""; position: absolute; inset: 0; }
.ai-card__link:hover { color: var(--text-heading); text-decoration: underline; }
.ai-card__footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); }
.ai-card__roles { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ai-empty { margin-top: var(--space-4); }

.ai-icon { width: 24px; height: 24px; }
.ai-icon--tag { width: 13px; height: 13px; }
.ai-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-roletag { color: var(--role); border-color: var(--role); }
.ai-price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); color: var(--text-heading); }

/* ---------------- product page ---------------- */

.ai-phead { padding: var(--space-8) 0 var(--space-9); border-bottom: 1px solid var(--border); }
.ai-phead__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-7) var(--space-9); align-items: start; margin-top: var(--space-6); }
.ai-phead__main { display: grid; gap: var(--space-5); }
.ai-promise { max-width: var(--measure); }
.ai-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, max-content)); gap: var(--space-4) var(--space-8); margin: 0; }
.ai-facts dt { margin-bottom: 4px; }
.ai-facts dd { margin: 0; font-size: var(--fs-body); color: var(--text-1); }
.ai-facts .ai-price { font-size: var(--fs-h4); }
.ai-cover { width: 100%; max-width: 420px; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); justify-self: end; }
.ai-cta { display: grid; gap: var(--space-3); justify-items: start; max-width: 480px; }
.ai-cta__note { max-width: 44ch; }

.ai-form { display: grid; gap: var(--space-4); justify-items: start; width: 100%; max-width: 480px; }
.ai-form .mg-field { width: 100%; }
.ai-form__title { margin: 0; }
.ai-form__note { max-width: 44ch; }
.ai-form--notify { padding: var(--space-6); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-lg); }

.ai-faq { border-top: 1px solid var(--border); padding: var(--space-3) 0; }
.ai-faq:last-child { border-bottom: 1px solid var(--border); }
.ai-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; }
.ai-faq summary::-webkit-details-marker { display: none; }
.ai-faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); flex: none; }
.ai-faq[open] summary::after { content: "\2212"; }
.ai-faq p { margin-top: var(--space-3); }

.ai-signup__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7) var(--space-9); align-items: start; }
.ai-signup__lede { margin-top: var(--space-4); max-width: 52ch; }

/* ---------------- readiness check ---------------- */

.ai-check { padding: var(--space-8) 0 var(--space-10); }
.ai-check__panel { max-width: var(--container-narrow); margin: 0 auto; display: grid; gap: var(--space-6); }
.ai-check__intro { display: grid; gap: var(--space-5); justify-items: start; }
.ai-check__intro .mg-lead { max-width: var(--measure); }
.ai-check__notice { padding: var(--space-3) var(--space-4); background: var(--accent-tint); border-radius: var(--radius-md); color: var(--accent); font-size: var(--fs-small); }
.ai-progress { display: grid; gap: var(--space-2); }
.ai-progress__bar { height: 6px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.ai-progress__fill { height: 100%; width: 0; background: var(--accent-solid); transition: width var(--dur-base) var(--ease); }
.ai-q { display: grid; gap: var(--space-5); }
.ai-q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--space-3); }
.ai-q legend { padding: 0; margin-bottom: var(--space-4); }
.ai-opt { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; font-size: var(--fs-body); line-height: var(--lh-dense); color: var(--text-1); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.ai-opt:hover { border-color: var(--text-3); }
.ai-opt:has(input:checked) { border-color: var(--accent-solid); background: var(--accent-tint); }
.ai-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ai-opt input { margin: 3px 0 0; accent-color: var(--accent-solid); flex: none; }
.ai-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.ai-scale .ai-opt { justify-content: center; padding: var(--space-4) var(--space-2); font-family: var(--font-mono); }
.ai-scale .ai-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ai-scale .ai-opt:has(input:checked) { background: var(--accent-solid); color: var(--on-accent-solid); }
.ai-scale-ends { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-3); }
.ai-q__nav { display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; }
.ai-q__error { color: var(--status-red-fg); font-size: var(--fs-small); }

.ai-result { display: grid; gap: var(--space-8); }
.ai-result .mg-h3 { margin-bottom: var(--space-4); }
.ai-result__head { display: grid; gap: var(--space-3); padding-bottom: var(--space-6); border-bottom: var(--border-rule) solid var(--role); }
.ai-result__head .mg-h1 { color: var(--role); }
.ai-bars { display: grid; gap: var(--space-4); }
.ai-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 48px; align-items: center; gap: var(--space-3); }
.ai-bar__track, .ai-bar__fill { display: block; }
.ai-bar__track { height: 12px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ai-bar__fill { height: 100%; background: var(--role); border-radius: var(--radius-sm); }
.ai-bar__num { text-align: right; }
.ai-bar__blurb { grid-column: 1 / -1; margin-top: -6px; }
.ai-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: var(--space-4); }
.ai-steps li { position: relative; padding-left: 40px; counter-increment: step; line-height: var(--lh-body); }
.ai-steps li::before { content: "0" counter(step); position: absolute; left: 0; top: 2px; font-family: var(--font-mono); font-size: var(--fs-eyebrow); color: var(--role); letter-spacing: .06em; }
.ai-reco { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-6); border: 1px solid var(--border); border-top: var(--border-bar) solid var(--role); border-radius: var(--radius-lg); background: var(--surface); }
.ai-share { display: grid; gap: var(--space-4); }
.ai-share__row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.ai-share__link { flex: 1 1 260px; font-family: var(--font-mono); font-size: var(--fs-caption); }
.ai-share canvas { display: none; }
.ai-share__preview { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ai-result__email { padding: var(--space-6); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-lg); display: grid; gap: var(--space-4); }
.ai-result__email .ai-form { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.ai-result__email .ai-form .mg-field { grid-column: 1; }
.ai-result__email .ai-form button { grid-column: 2; }
.ai-result__email .ai-form__note { grid-column: 1 / -1; }
.ai-result__foot { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); }

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  .ai-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-split { grid-template-columns: minmax(0, 1fr); }
  .ai-grid.ai-grid--stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .ai-two, .ai-band__grid, .ai-signup__grid, .ai-phead__grid { grid-template-columns: 1fr; }
  .ai-cover { justify-self: start; }
  .ai-band__back { justify-self: start; }
  .ai-result__email .ai-form { grid-template-columns: 1fr; }
  .ai-result__email .ai-form button { grid-column: 1; }
}

@media (max-width: 660px) {
  .mg-h1 { font-size: clamp(30px, 8.6vw, 44px); }
  .mg-h2 { font-size: clamp(26px, 7vw, 32px); }
  .wrap { padding: 0 var(--space-4); }
  .nav-in { padding: 12px var(--space-4); gap: 8px 18px; }
  .theme-btn { order: 4; }
  .nav-links { order: 3; flex: 1 1 calc(100% - 90px); min-width: 0; flex-wrap: nowrap; overflow-x: auto; gap: 18px; padding-bottom: 2px; scrollbar-width: none; }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a { white-space: nowrap; }
  .ai-hero { padding: var(--space-8) 0 var(--space-7); }
  .ai-sec, .ai-band { padding: var(--space-8) 0; }
  .ai-grid, .ft-grid, .ai-soonlist { grid-template-columns: 1fr; }
  .ai-grid.ai-grid--stack { grid-template-columns: 1fr; }
  .ai-bar { grid-template-columns: 72px minmax(0, 1fr) 40px; }
  .ai-reco { grid-template-columns: 1fr; }
  .ai-scale { gap: 4px; }
  .ai-scale .ai-opt { padding: var(--space-3) 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
