/* article.html · a quiet reading view. One ~68ch column; bold run-ins become margin notes on wide screens and inline
   callouts on phones; a hairline progress line at the top; a floating Contents pill with a popover (no sidebar);
   the "one-page brief" as a fill-in-the-blanks marked-up page inside the column. Header = the page's one colour wash. */

.ar { --ink-pen: #2b3fb8; --mark: var(--cat-writing-d); --cr: var(--cat-design); --cr-s: var(--cat-design-s); --cr-d: var(--cat-design-d); }

/* ── hairline progress ── */
.ar-prog { position: fixed; z-index: 39; left: 50%; top: var(--prog-top, 78px); width: min(calc(68ch + 40px), calc(100vw - 32px)); height: 2px; margin-left: calc(min(calc(68ch + 40px), calc(100vw - 32px)) / -2); border-radius: 2px; background: rgba(109, 40, 217, .12); pointer-events: none; opacity: 0; transition: opacity .3s ease; font-size: 19px; }
.ar-prog.is-on { opacity: 1; }
.ar-prog i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--cat-design), var(--cat-writing)); transform-origin: 0 50%; transform: scaleX(0); }

/* ═══ 1. header ═══ */
.ar-head { position: relative; overflow: clip; padding: clamp(108px, 11vw, 140px) 0 clamp(40px, 5vw, 64px); background: linear-gradient(180deg, #f1ecff 0%, #f7f3ff 70%, #fff 100%); }
.ar-head__wash { position: absolute; inset: 0; pointer-events: none; }
.ar-head__wash i { position: absolute; display: block; border-radius: 50%; filter: blur(60px); opacity: .55; }
.ar-head__wash i:nth-child(1) { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; right: -8vw; top: -18vw; background: var(--cat-design); }
.ar-head__wash i:nth-child(2) { width: 30vw; height: 30vw; max-width: 420px; max-height: 420px; right: 18vw; top: 10vw; background: var(--cat-writing); opacity: .35; }
.ar-head__wash i:nth-child(3) { width: 26vw; height: 26vw; max-width: 360px; max-height: 360px; left: -8vw; bottom: -14vw; background: #b9a8f5; opacity: .45; }
.is-live .ar-head__wash i:nth-child(1) { animation: ar-drift 16s ease-in-out infinite; }
.is-live .ar-head__wash i:nth-child(2) { animation: ar-drift 19s ease-in-out -6s infinite reverse; }
.is-live .ar-head__wash i:nth-child(3) { animation: ar-drift 13s ease-in-out -3s infinite; }
@keyframes ar-drift { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-6%, 8%, 0) scale(1.1); } }
.ar-head__in { position: relative; max-width: calc(68ch + 2 * var(--g)); }
.ar-crumbs { margin-bottom: 26px; }
.ar-head__cat { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 10px; border-radius: 999px; background: #fff; color: var(--cr-d); font-weight: 700; font-size: 14px; box-shadow: 0 6px 18px -10px rgba(109, 40, 217, .5); }
.ar-head__cat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cr); }
.ar-head__t { margin-top: 18px; font-family: var(--display); font-weight: 700; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
.ar-head__dek { margin-top: 18px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--text); max-width: 60ch; }
.ar-head__by { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 15px; color: var(--muted); }
.ar-head__by img { width: 36px; height: 36px; border-radius: 10px; }
.ar-head__by > span { display: grid; line-height: 1.3; }
.ar-head__by b { color: var(--ink); }
.ar-head__meta { display: inline-flex; gap: 8px; }

/* ═══ 2. reading column ═══ */
.ar-read { position: relative; padding: clamp(24px, 3vw, 40px) 0 clamp(56px, 6vw, 88px); }
.ar-col { max-width: calc(68ch + 2 * var(--g)); margin: 0 auto; padding: 0 var(--g); }
.ar-note { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 30px; padding: 8px 14px; border-radius: 12px; background: var(--paper); font-size: 14px; color: var(--muted); }
.ar-note svg { width: 16px; height: 16px; flex: none; }

.prose { font-size: 19px; line-height: 1.72; color: var(--text); }
.prose p { margin: 0 0 1.1em; }
.prose .lede { font-size: 21px; line-height: 1.6; color: var(--ink); }
.prose a { color: var(--cr-d); text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--cr) 55%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose b, .prose strong { color: var(--ink); }
.ch { padding-top: 2.2em; }
.ch h2 { margin-bottom: .7em; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 2.5vw, 33px); line-height: 1.12; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.list { margin: 0 0 1.2em; padding-inline-start: 1.3em; list-style: disc; }
.list--n { list-style: none; padding-inline-start: 0; counter-reset: n; }
.list li { margin-bottom: .55em; padding-inline-start: .2em; }
.list li::marker { color: var(--cr); }
.list--n li { position: relative; counter-increment: n; padding-inline-start: 2.2em; }
.list--n li::before { content: counter(n); position: absolute; left: 0; top: .2em; display: grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; background: var(--cr-s); color: var(--cr-d); font-family: var(--display); font-size: .8em; }

/* bold run-ins: inline callouts by default (phones) */
.prose .ri__k { display: inline-block; margin-inline-end: 6px; padding: 1px 9px; border-radius: 8px; background: var(--cr-s); color: var(--cr-d); font-size: .86em; line-height: 1.6; }
/* wide screens: the run-in moves into the left margin as a note with a hairline to its line */
@media (min-width: 1180px) {
  .ri { position: relative; min-height: 2.4em; }
  .prose .ri__k { position: absolute; top: .18em; right: calc(100% + 30px); width: 172px; margin: 0; padding: 0; background: none; color: var(--cr-d); font-size: 14.5px; line-height: 1.35; text-align: right; }
  .list--n .ri { padding-inline-start: 2.2em; }
  .ri__k::after { content: ""; position: absolute; top: .65em; left: calc(100% + 8px); width: 20px; height: 1.5px; background: var(--cr); transform-origin: 0 50%; }
  .list:not(.list--n) .ri__k::after { width: calc(20px + 1.3em); }
  .js .ri__k { opacity: 0; transform: translateX(-14px); transition: opacity .6s ease, transform .8s var(--spring); }
  .js .ri__k::after { transform: scaleX(0); transition: transform .6s var(--spring) .25s; }
  .js .ri.is-in .ri__k { opacity: 1; transform: none; }
  .js .ri.is-in .ri__k::after { transform: scaleX(1); }
}

/* FAQ inside the column */
.ch--faq .acc { margin-top: .4em; }
.ch--faq .acc__q { font-size: 18.5px; }
.ch--faq .acc__a p { font-size: 17.5px; line-height: 1.65; }

/* ── the one-page brief: a marked-up page with underlined slots ── */
.brief { position: relative; margin: .4em 0 1.4em; padding: 26px clamp(18px, 3vw, 34px) 24px; border-radius: 6px; background: #fffdf7;
  box-shadow: 0 1px 2px rgba(3, 21, 20, .08), 0 18px 40px -26px rgba(3, 21, 20, .5), inset 0 0 0 1px rgba(3, 21, 20, .06); }
.brief::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(10px, 1.6vw, 18px); width: 1.5px; background: rgba(212, 101, 143, .45); }
.brief__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.brief__k { font-family: var(--display); font-size: 21px; color: var(--ink); }
.brief__count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brief__count span { display: inline-block; min-width: 1.1em; font-weight: 700; color: var(--mark); }
.brief__count span.m-pop { animation-duration: .4s; }
.brief__rows { display: grid; gap: 2px; }
.brief__row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 26px; column-gap: 8px; align-items: end; padding: 8px 0 6px; }
.brief__lab { grid-column: 1 / -1; font-size: 15.5px; line-height: 1.35; color: var(--ink); cursor: text; }
.brief__lab b { font-weight: 700; }
.brief__slot { position: relative; display: block; }
.brief__in { width: 100%; height: 38px; padding: 4px 2px 2px; border: 0; border-radius: 0; background: transparent; font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", var(--ui); font-size: 17px; font-weight: 400; color: var(--ink-pen); outline: none; }
.brief__in::placeholder { color: rgba(43, 63, 184, .35); }
.brief__slot::before, .brief__slot::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: rgba(3, 21, 20, .35); }
.brief__slot::after { height: 2.5px; background: var(--mark); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--spring); }
.brief__slot:focus-within::after { transform: scaleX(1); }
.brief__slot:focus-within { outline: none; }
.brief__in:focus-visible { outline: none; }
.brief__slot:has(.brief__in:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 25%, transparent); border-radius: 4px; }
.brief__caret { position: absolute; left: -2px; bottom: -14px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--mark); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .35s var(--spring); }
.brief__slot:focus-within .brief__caret { opacity: 1; transform: none; }
.brief__tick { width: 24px; height: 24px; margin-bottom: 6px; fill: none; stroke: var(--cat-admin-d); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .45s var(--spring); }
.brief__row.is-filled .brief__tick { stroke-dashoffset: 0; }
.brief__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 20px; }
.brief__msg { flex: 1 1 220px; font-size: 14px; color: var(--muted); }
.brief__msg.is-ok { color: var(--cat-admin-d); font-weight: 700; }
[data-brief-copy][data-done] { background: var(--cat-admin-d); }
.brief__fb { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--mark); }
.brief__fbl { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.brief__out { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: var(--paper); font: 14.5px/1.5 var(--ui); color: var(--ink); resize: vertical; }

@media (min-width: 640px) {
  .brief__row { grid-template-columns: minmax(0, 15.5em) minmax(0, 1fr) 26px; column-gap: 14px; }
  .brief__lab { grid-column: auto; padding-bottom: 9px; }
}

/* tail */
.ar-tail { margin-top: 2.2em; padding-top: 18px; border-top: 1px solid var(--line); }
.ar-rev { font-size: 15px; color: var(--muted); font-style: italic; }

/* ── Contents pill + popover ── */
.ar-toc { position: fixed; z-index: 30; right: max(16px, calc(var(--g) - 8px)); bottom: 20px; opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .35s ease, transform .5s var(--spring); }
.ar-toc.is-on { opacity: 1; transform: none; pointer-events: auto; }
.ar-toc__b { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 20px 0 12px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 16px 34px -14px rgba(3, 21, 20, .6); transition: transform .35s var(--spring); }
.ar-toc__b:active { transform: scale(.95); }
.ar-toc__ring svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.ar-toc__ring circle { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 3; }
.ar-toc__ring .ar-toc__fill { stroke: #c4b5fd; stroke-dasharray: 56.55; stroke-dashoffset: 56.55; stroke-linecap: round; }
.ar-toc__pop { position: absolute; right: 0; bottom: calc(100% + 12px); width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow: auto; padding: 16px 10px 10px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-l), inset 0 0 0 1px var(--line); transform-origin: 90% 100%; }
.ar-toc__pop:not([hidden]) { animation: ar-pop .35s var(--spring) both; }
@keyframes ar-pop { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.ar-toc__h { padding: 0 12px 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.ar-toc__list { counter-reset: t; }
.ar-toc__list a { position: relative; display: flex; gap: 10px; align-items: baseline; min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 15px; line-height: 1.35; color: var(--text); text-decoration: none; counter-increment: t; }
.ar-toc__list a::before { content: counter(t); flex: none; width: 1.5em; font-family: var(--display); font-size: 13px; color: var(--faint); }
.ar-toc__list a:hover { background: var(--paper); }
.ar-toc__list a[aria-current="true"] { background: var(--cr-s); color: var(--cr-d); font-weight: 700; }
.ar-toc__list a[aria-current="true"]::before { color: var(--cr-d); }

/* ═══ 3. related ═══ */
.ar-rel { padding: clamp(56px, 6vw, 88px) 0 24px; border-top: 1px solid var(--line); }
.ar-rel__h { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.025em; color: var(--ink); }
.ar-rel__list { display: grid; gap: 14px; margin: 26px 0 16px; }
.ar-rel [data-bc="industry"] { --c: var(--cat-tech); --cs: var(--cat-tech-s); --cd: var(--cat-tech-d); --c2: var(--cat-finance); }
.ar-rel [data-bc="pricing"] { --c: var(--cat-marketing); --cs: var(--cat-marketing-s); --cd: var(--cat-marketing-d); --c2: var(--sun); }
.ar-rel [data-bc="hiring"] { --c: var(--cat-engineering); --cs: #fdeccb; --cd: var(--cat-engineering-d); --c2: var(--coral); }
.rcard { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "art m" "art t"; column-gap: 16px; row-gap: 4px; align-items: start; padding: 16px; border-radius: 20px; text-decoration: none; color: inherit; box-shadow: inset 0 0 0 1px var(--line); transition: transform .45s var(--spring), box-shadow .3s; }
.rcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-s), inset 0 0 0 1px var(--c); }
.rcard__art { grid-area: art; width: 56px; height: 56px; border-radius: 16px; background: radial-gradient(110% 110% at 20% 15%, var(--c) 0 40%, var(--cd) 100%); transition: transform .5s var(--spring); }
.rcard:hover .rcard__art { transform: rotate(-8deg) scale(1.05); }
.rcard__m { grid-area: m; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: var(--muted); }
.rcard__c { font-weight: 700; color: var(--cd); }
.rcard__t { grid-area: t; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); }
@media (min-width: 900px) {
  .ar-rel__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rcard { grid-template-columns: 1fr; grid-template-areas: "art" "m" "t"; row-gap: 10px; padding: 20px; }
}

/* ═══ 4. CTA ═══ */
.ar-cta { padding: 24px 0 clamp(72px, 8vw, 120px); }
.ar-cta__card { display: grid; gap: 22px; align-items: center; padding: clamp(26px, 4vw, 48px); border-radius: 28px; background: linear-gradient(120deg, #f4efff, #fde9f2); box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .12); }
.ar-cta__t { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.02; letter-spacing: -.03em; color: var(--ink); }
.ar-cta__p { margin-top: 12px; max-width: 34em; font-size: 18px; color: var(--text); }
.ar-cta__b { display: flex; flex-wrap: wrap; gap: 10px; }
body[data-page="article"] .btn--acc { background: var(--cat-design-d); }
@media (min-width: 960px) { .ar-cta__card { grid-template-columns: 1fr auto; } }

@media (max-width: 639px) {
  .prose { font-size: 18px; }
  .prose .lede { font-size: 19.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .ar-head__wash i { animation: none !important; }
  .js .ri__k { opacity: 1 !important; transform: none !important; }
  .js .ri__k::after { transform: none !important; }
}

/* phone pass: the Contents pill clears the home indicator and tucks away while reading down (article.js) */
@media (max-width: 767px) {
  .ar-toc { bottom: max(20px, calc(env(safe-area-inset-bottom) + 10px)); }
  .ar-toc.is-on.is-tuck { opacity: 0; transform: translateY(24px); pointer-events: none; }
}
