/* The AI page (/intelligence), laid out like the owner's mockup 1473 (24 Oct 2026): a centred header, stage tabs with icons, then a grid of cards
   per stage. A card is an amber outline icon, a title, a two-line promise, a divider, and one foot row: "Data used" and its value at the left,
   "How it works ›" at the right (the long text opens under it). Every step is shown; none is folded away. Built from the site's own tokens
   (styles.css, effects.css); only what they lack is here. Guarded by test/unit/website/intelligence-page.test.js. */

/* Header, centred. */
.ai-hero { display: grid; justify-items: center; text-align: center; gap: 10px; padding-block: 40px 8px; }
.ai-kicker { font: 600 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.ai-hero h1 { margin: 0; font-size: clamp(2rem, 4.6vw, 3.3rem); text-wrap: balance; }
.ai-hero .lede { margin: 0; max-width: 72ch; }
.ai-which { margin: 0; max-width: 62ch; color: var(--muted); font-size: .88rem; }

/* The six stages as tabs: icon and name, the one in view underlined. */
.ai-tabs { margin-top: 26px; border-bottom: 1px solid var(--line-strong); }
.ai-journey { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ai-journey a { display: flex; align-items: center; gap: 10px; padding: 14px 20px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.ai-journey .node { display: grid; place-items: center; width: 24px; height: 24px; }
.ai-journey .node svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ai-journey a:hover { color: var(--ink); }
.ai-journey a[aria-current] { color: var(--signal); border-bottom-color: var(--signal); }
.ai-journey a:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; border-radius: 6px; }

/* A stage: its title (the last word in italics), one promise line, then the cards. */
.ai-section { scroll-margin-top: 24px; }
.ai-head { margin-bottom: 22px; }
.ai-head h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -.02em; }
.ai-head h2 em { font-style: italic; }
.ai-head .lede { margin: 4px 0 0; font-size: 1.1rem; }
.ai-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.ai-cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* One AI step. */
.ai-step { display: flex; flex-direction: column; gap: 8px; padding: 24px 24px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ico { display: block; width: 40px; height: 40px; margin-bottom: 10px; }
.ico svg { width: 36px; height: 36px; fill: none; stroke: var(--signal); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ai-step h3 { margin: 0; font: 600 1.18rem/1.25 var(--display); letter-spacing: -.01em; }
.ai-step .promise-line { margin: 0 0 8px; color: var(--muted); font-size: 1rem; line-height: 1.5; }

/* The foot: a divider, the data used at the left, "How it works" at the right; the long text opens below. */
.ai-step details { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.ai-step summary { cursor: pointer; list-style: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ai-step summary::-webkit-details-marker { display: none; }
.data-used { display: grid; gap: 2px; min-width: 0; font-size: .92rem; line-height: 1.35; color: var(--ink); }
.data-used small { font-size: .82rem; color: var(--muted); }
.data-used .never { color: var(--muted); font-size: .85rem; }
.how { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: .92rem; color: var(--ink); }
.chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.ai-step details[open] .chev { transform: rotate(90deg); }
.ai-step summary:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; border-radius: 6px; }
.ai-step details p { margin: 12px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }

/* One line about the data, under the first stage. */
.ai-data-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 0; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .95rem; }
.ai-data-line svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ai-data-line a { margin-left: auto; color: var(--teal); text-decoration: none; font-size: .9rem; }
.ai-data-line a:hover { text-decoration: underline; }

/* Prepare: the CV and cover letter, drawn, with what each gives you. */
.ai-feature { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; margin-bottom: 18px; padding: 22px 26px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.ai-ill { grid-row: 1 / 3; width: 100%; max-width: 330px; height: auto; align-self: center; }
.ai-feature .f { display: flex; gap: 14px; }
.ai-feature .f .ico { flex: none; width: 34px; height: 34px; margin: 0; }
.ai-feature .f .ico svg { width: 30px; height: 30px; }
.ai-feature b { font-size: 1.02rem; }
.ai-feature .f p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.ai-feature .line { grid-column: 2; margin: 18px 0 0; color: var(--muted); font-size: .9rem; align-self: end; }
.ai-feature .how { grid-column: 3; justify-self: end; align-self: end; margin: 18px 0 0; text-decoration: none; }

@media (max-width: 900px) {
  .ai-cards, .ai-cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-feature { grid-template-columns: 1fr 1fr; gap: 18px; }
  .ai-ill { grid-column: 1 / -1; grid-row: auto; justify-self: center; }
  .ai-feature .line { grid-column: 1; }
  .ai-feature .how { grid-column: 2; }
}
@media (max-width: 640px) {
  .ai-cards, .ai-cards:has(> :nth-child(4):last-child) { grid-template-columns: 1fr; }
  /* On a phone the tabs sit in six equal columns, the icon over the name. */
  .ai-journey { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
  .ai-journey a { flex-direction: column; gap: 4px; padding: 10px 2px; font-size: .74rem; text-align: center; }
  .ai-step { padding: 20px 20px 16px; }
  .ai-feature { grid-template-columns: 1fr; }
  .ai-feature .line, .ai-feature .how { grid-column: 1; justify-self: start; }
  .ai-data-line a { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
.promise .icon svg { width: 22px; height: 22px; fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
