/* =====================================================================
   v5 — the page speaks the product's own language.
   An agent reads a page as numbered controls: "[4] Search videos".
   So the words that matter are marked the same way, the questions are
   controls you open, and nothing is decoration for its own sake.
   ===================================================================== */

/* ---------- marked words: a control the agent has picked out ---------- */
/* reads like the agent's own view of a page: "[3] understands" in a box */
mark.hl, .lede mark.hl, .duo mark.hl, .ft-cta h2 mark.hl {
  --mc: var(--blue);
  --mb: color-mix(in srgb, var(--blue) 6%, transparent);
  position: relative; display: inline; white-space: normal;
  margin: 0 .02em; padding: .02em .16em .02em .12em; border-radius: .16em;
  color: inherit; background: none !important; background-color: transparent !important;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  box-shadow: inset 0 0 0 1px transparent;
  transition: color .5s var(--ease), background-color .5s var(--ease), box-shadow .5s var(--ease);
  transition-delay: calc(.9s + var(--d, 0) * .5s);
  animation: none;
}
.lede mark.hl { font-weight: 600; color: var(--ink); }
.duo mark.hl { color: inherit; white-space: nowrap; }
[data-theme="dark"] mark.hl, [data-theme="dark"] .duo mark.hl { --mc: #9DB0FF; --mb: rgb(157 176 255 / .08); }
/* the number, inline and always there: only the box and the ink arrive */
mark.hl::before {
  /* a no-break space glues the number to the first word */
  content: "[" attr(data-n) "]\00a0";
  display: inline; vertical-align: .32em;
  font: 600 max(10px, .36em) / 1 var(--mono); letter-spacing: 0; color: var(--mc); opacity: .55;
  transition: opacity .5s var(--ease); transition-delay: inherit;
}
/* the old brush stroke and wavy underline */
.duo .hl::after, .duo mark.hl::after, .hl-u::after { display: none !important; }
/* picked out */
.hero.in .lede mark.hl, .lit mark.hl {
  color: var(--mc); background-color: var(--mb) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 40%, transparent);
}
.hero.in .lede mark.hl::before, .lit mark.hl::before { opacity: 1; }
/* pointing at it: the control is focused, as when the agent acts on it */
@media (hover: hover) {
  .hero.in .lede mark.hl:hover, .lit mark.hl:hover { background-color: color-mix(in srgb, var(--mc) 13%, transparent) !important; box-shadow: inset 0 0 0 1px var(--mc); transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  mark.hl, mark.hl::before { transition: none; }
}

/* ---------- navigation: the current section sits on a soft pill ---------- */
.nav-ind { bottom: calc(50% - 16px); height: 32px; border-radius: 99px; background: color-mix(in srgb, var(--blue) 11%, transparent); }
[data-theme="dark"] .nav-ind { background: rgb(157 176 255 / .14); }
nav[data-nav] a { position: relative; z-index: 1; }

/* ---------- links: colour, not underlines ---------- */
.strip span, .qa2 a, .sec-aside a, .doc a { text-decoration: none; }
.strip span { padding: 1px 8px; border-radius: 99px; background: rgb(255 255 255 / .18); }
.qa2 a, .sec-aside a { color: var(--blue); font-weight: 600; border-radius: 4px; transition: background-color .2s; }
.qa2 a:hover, .sec-aside a:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
[data-theme="dark"] .qa2 a, [data-theme="dark"] .sec-aside a { color: #9DB0FF; }

/* ---------- questions: one ruled list, like an index; a row opens in place ---------- */
.qa2 {
  --q-line: color-mix(in srgb, var(--ink) 14%, transparent); --q-on: var(--blue);
  display: block; max-width: none; border-top: 1px solid var(--q-line);
}
[data-theme="dark"] .qa2 { --q-on: #9DB0FF; }
.q { border-bottom: 1px solid var(--q-line); interpolate-size: allow-keywords; }
.q summary {
  display: grid; grid-template-columns: 72px 1fr 24px; align-items: center; gap: 0 16px;
  padding: 26px 4px; cursor: pointer; list-style: none;
  font-size: clamp(19px, .9rem + .55vw, 24px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.25;
  transition: color .25s var(--ease);
}
.q summary::-webkit-details-marker { display: none; }
.q summary:focus-visible { outline: 2px solid var(--q-on); outline-offset: 4px; border-radius: 6px; }
.q-n { font: 500 13px/1 var(--mono); color: color-mix(in srgb, var(--ink) 45%, transparent); transition: color .25s; }
.q-t { min-width: 0; }
/* plus that turns into a minus */
.q-x { position: relative; justify-self: end; width: 16px; height: 16px; color: var(--ink); }
.q-x::before, .q-x::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; border-radius: 2px; background: currentColor; transition: transform .35s var(--ease); }
.q-x::after { transform: rotate(90deg); }
.q[open] .q-x::after { transform: rotate(0deg); }
.q-a p { margin: 0; padding: 0 44px 30px 92px; max-width: 64ch; font-size: 16.5px; line-height: 1.65; color: var(--ink-2); }
.q[open] .q-n, .q[open] summary { color: var(--q-on); }
@media (hover: hover) {
  .q summary:hover, .q summary:hover .q-n { color: var(--q-on); }
}
/* the answer slides open where the browser can animate to auto height */
.q::details-content { block-size: 0; overflow: clip; transition: block-size .4s var(--ease), content-visibility .4s allow-discrete; }
.q[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) { .q::details-content { transition: none; } }
@media (max-width: 760px) {
  .q summary { grid-template-columns: 40px 1fr 18px; gap: 0 10px; padding: 20px 0; font-size: 17.5px; }
  .q-a p { padding: 0 0 22px 50px; font-size: 15.5px; }
}

/* ---------- phones: the hero drawing stays, under the words ---------- */
@media (max-width: 760px) {
  .hero .stack-iso, .hero .stack-cap { display: block !important; }
  .hero .stack-iso { margin: -28px -8px 0; }
  .hero .stack-iso svg { max-height: 62vh; }
  .hero .stack-cap { margin-top: 4px; font-size: 13px; }
}
/* section headings mark as soon as they scroll in */
.sec-head mark.hl, .sec-head .duo mark.hl { transition-delay: calc(.3s + var(--d, 0) * .4s); }

/* ---------- footer: a flat blue block, read the way the agent reads a page ---------- */
.fx {
  --fx-bg: #2E4BFF; --fx-ink: #fff; --fx-dim: rgb(255 255 255 / .62); --fx-line: rgb(255 255 255 / .22);
  position: relative; margin: 0; padding: clamp(56px, 6vw, 88px) 0 24px;
  background: var(--fx-bg); color: var(--fx-ink);
  border-radius: clamp(24px, 3vw, 40px) clamp(24px, 3vw, 40px) 0 0;
}
[data-theme="dark"] .fx { --fx-bg: #2540F0; }
.fx a, .fx button { color: inherit; }
.fx-k { margin: 0 0 14px; font: 500 12.5px/1 var(--mono); letter-spacing: .02em; color: var(--fx-dim); }
.fx-h {
  margin: 0; font-family: var(--sans); font-weight: 500; letter-spacing: -0.055em; line-height: .9;
  font-size: clamp(48px, 1.4rem + 4.6vw, 104px); color: var(--fx-ink);
}
/* the two next steps, as numbered controls */
.fx-acts { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--fx-line); }
.fx-acts li { border-bottom: 1px solid var(--fx-line); }
.fx-act {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 0 20px;
  padding: 18px 0; text-decoration: none;
}
a.fx-act { transition: padding .35s var(--ease), background-color .35s var(--ease); }
.fx-n { font: 500 13px/1 var(--mono); color: var(--fx-dim); }
.fx-t { font-size: clamp(19px, .9rem + .7vw, 26px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
code.fx-t { font-family: var(--mono); font-weight: 500; font-size: clamp(12.5px, .45rem + .45vw, 15px); letter-spacing: 0; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.fx-s { grid-column: 2; grid-row: 2; margin-top: 4px; font-size: 13.5px; color: var(--fx-dim); }
.fx-arr, .fx-copy { grid-column: 3; grid-row: 1 / span 2; }
.fx-n { grid-row: 1 / span 2; }
.fx-top { margin: 0; }
.fx > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: clamp(32px, 6vw, 96px); align-items: end; }
.fx-index, .fx-base { grid-column: 1 / -1; }
.fx-arr { font-size: 28px; line-height: 1; transition: transform .35s var(--ease); }
.fx-copy {
  height: 40px; padding: 0 18px; border: 1px solid var(--fx-ink); border-radius: 99px; background: none;
  font: 600 13.5px var(--sans); cursor: pointer; transition: background-color .2s, color .2s;
}
.fx-copy:hover { background: var(--fx-ink); color: var(--fx-bg); }
@media (hover: hover) {
  a.fx-act:hover { padding-left: 16px; padding-right: 16px; background: rgb(255 255 255 / .08); }
  a.fx-act:hover .fx-arr { transform: translateX(6px); }
}
/* the rest of the page, as an index */
.fx-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 4vw, 64px); margin-top: clamp(44px, 5vw, 72px); }
.fx-index nav, .fx-index > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fx-index a, .fx-link {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 3px 0; border: 0; background: none;
  font: 500 16px / 1.3 var(--sans); letter-spacing: -0.015em; text-decoration: none; cursor: pointer;
  transition: opacity .2s;
}
.fx-index a span, .fx-link span { min-width: 34px; font: 500 12px/1 var(--mono); color: var(--fx-dim); }
@media (hover: hover) { .fx-index:hover a, .fx-index:hover .fx-link { opacity: .55; } .fx-index a:hover, .fx-index .fx-link:hover { opacity: 1; } }
.fx a:focus-visible, .fx button:focus-visible { outline: 2px solid var(--fx-ink); outline-offset: 3px; border-radius: 4px; }
/* base line */
.fx-base {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: clamp(40px, 4.5vw, 64px);
  padding-top: 18px; border-top: 1px solid var(--fx-line); font-size: 13.5px; color: var(--fx-dim);
}
.fx-mark { display: inline-flex; align-items: center; gap: 10px; color: var(--fx-ink); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.fx-mark svg { width: 24px; height: 18px; }
.fx-sum { font: 500 12.5px var(--mono); }
.fx-top-link { margin-left: auto; text-decoration: none; }
@media (max-width: 760px) {
  .fx > .wrap { grid-template-columns: 1fr; }
  .fx-acts { margin-top: 32px; }
  .fx-act { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 16px 0; }
  .fx-index { grid-template-columns: 1fr 1fr; }
  .fx-index > div { grid-column: 1 / -1; }
  .fx-top-link { margin-left: 0; }
}

/* a marked heading word is its own box in the line, so it can never ride up into the line above */
.duo mark.hl { display: inline-block; line-height: 1.12; padding: 0 .16em .02em .12em; margin-top: .2em; }

/* ---------- see it as your agent does ---------- */
.view-sw { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; }
.view-q { font: 500 12.5px/1.2 var(--mono); letter-spacing: .02em; color: var(--ink-2); }
.view-q::before { content: "↳ "; color: var(--blue); }
.view-btns { position: relative; display: inline-flex; padding: 3px; border-radius: 99px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.view-btns button {
  position: relative; z-index: 1; height: 30px; padding: 0 14px; border: 0; border-radius: 99px; background: none; cursor: pointer;
  font: 600 12.5px/1 var(--mono); letter-spacing: .02em; color: var(--ink-2); transition: color .25s, background-color .25s;
}
.view-btns button[aria-checked="true"] { background: var(--ink); color: var(--page, #F5F4F0); }
.view-btns button[data-view="agent"][aria-checked="true"] { background: var(--blue); color: #fff; }
.view-btns button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* the sweep that rewrites the page */
.ag-sweep { position: fixed; inset: 0 0 auto; z-index: 90; height: 0; pointer-events: none; }
.ag-sweep.go { animation: ag-sweep .62s cubic-bezier(.6, 0, .3, 1) forwards; }
.ag-sweep::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--blue); box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 30%, transparent); }
@keyframes ag-sweep { 0% { height: 0; opacity: 1; } 85% { height: 100vh; opacity: 1; } 100% { height: 100vh; opacity: 0; } }

/* agent view: the page as text */
.agent-view body, .agent-view body :where(p, h1, h2, h3, li, a, button, summary, span, b, mark, small, label, code) {
  font-family: var(--mono) !important; letter-spacing: 0 !important; font-stretch: normal !important;
}
.agent-view .hero h1 { font-size: clamp(34px, 1rem + 3vw, 58px) !important; line-height: 1.08 !important; text-transform: none !important; font-weight: 600 !important; }
.agent-view .hero h1 *, .agent-view .hero h1 { color: var(--ink) !important; }
.agent-view .v4 .duo, .agent-view .fx-h { font-size: clamp(26px, .9rem + 1.8vw, 40px) !important; line-height: 1.2 !important; font-weight: 600 !important; }
.agent-view .hero-sub { font-size: 20px !important; }
.agent-view .ag-h { color: var(--blue); font-weight: 500; }
/* heading marks hang in the margin, like markdown in an editor */
.agent-view :is(h1, h2, h3):has(> .ag-h) { position: relative; }
.agent-view .ag-h { position: absolute; right: 100%; top: 0; margin-right: .45em; font-size: .55em; line-height: 2.1; white-space: nowrap; }
@media (max-width: 1360px) { .agent-view .ag-h { position: static; display: block; font-size: 13px; line-height: 1; margin: 0 0 10px; } }
[data-theme="dark"].agent-view .ag-h { color: #9DB0FF; }
.agent-view mark.hl::before { display: none; }
/* pictures set aside: the agent reads what they say, not how they look */
.agent-view .stack-iso svg, .agent-view .iso, .agent-view .v4 .pn-art svg { opacity: .14; filter: grayscale(1); transition: opacity .3s; }
.agent-view .stack-iso { outline: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent); outline-offset: 6px; position: relative; }
.agent-view .stack-iso::after { content: "figure · exploded drawing · 5 layers · not needed to act"; position: absolute; z-index: 2; left: 8px; top: 8px; font: 500 12px var(--mono); color: var(--ink-2); }
.agent-view .btn, .agent-view .fx-copy { border-radius: 4px !important; }

/* the hints */
.ag-layer { position: absolute; left: 0; top: 0; width: 100%; z-index: 60; pointer-events: none; }
.ag-n {
  position: absolute; padding: 2px 5px 2px; border-radius: 4px; background: var(--blue); color: #fff;
  font: 600 11px/1 var(--mono); letter-spacing: 0; white-space: nowrap;
  box-shadow: 0 0 0 2px var(--page, #F5F4F0);
  animation: ag-in .32s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 12ms);
}
[data-theme="dark"] .ag-n { background: #8EA2FF; color: #0A0C13; }
@keyframes ag-in { from { opacity: 0; transform: translateY(4px) scale(.8); } }

/* the status chip */
.agent-chip {
  position: fixed; left: 50%; bottom: 18px; z-index: 70; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 99px;
  background: var(--ink); color: var(--page, #F5F4F0); font: 500 13px/1 var(--mono);
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / .35);
}
.agent-chip[hidden] { display: none; }
.agent-chip b { font-weight: 700; }
.ag-dot { width: 8px; height: 8px; border-radius: 50%; background: #39D98A; animation: ag-blink 1.6s ease-in-out infinite; }
@keyframes ag-blink { 50% { opacity: .35; } }
.agent-chip button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: rgb(255 255 255 / .14); color: inherit; font: 600 12.5px/1 var(--mono); cursor: pointer; }
[data-theme="dark"] .agent-chip button { background: rgb(0 0 0 / .12); }
.agent-chip kbd { padding: 2px 5px; border-radius: 4px; background: rgb(255 255 255 / .18); font: 500 11px/1 var(--mono); }
@media (prefers-reduced-motion: reduce) { .ag-n, .ag-dot { animation: none; } }
@media (max-width: 760px) {
  .view-sw { margin-top: 18px; }
  .agent-chip { bottom: 12px; gap: 10px; padding-left: 12px; font-size: 12px; white-space: nowrap; }
  .agent-chip kbd { display: none; }
}
/* agent view: the live tags replace the page's own printed numbers */
.agent-view .q-n, .agent-view .fx-n, .agent-view .fx-index a > span, .agent-view .fx-link > span, .agent-view .fx-sum { visibility: hidden; }
.ag-n.ag-inv, [data-theme="dark"] .ag-n.ag-inv { background: #fff; color: #2E4BFF; box-shadow: 0 0 0 2px #2E4BFF; }
