/* Case-study story components — shared by every case page.
   Each page defines the colour tokens (--ink, --ivory, --muted, --dim, --line, --line2, --panel, --panel2,
   --accent, --warn, --serif, --sans, --mono, --display, --ease, --grainimg); this file only adds the pieces. */
:root {
    --stage: linear-gradient(135deg, #DFE3EA 0%, #C9D3E3 30%, #EADCD0 70%, #D8D9DE 100%);
}

/* chapter nav on the left, the story on the right */
[data-layout] { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(36px, 4.4vw, 76px); width: var(--shell); margin-inline: auto; }
[data-content] { min-width: 0; }
[data-content] > section > div { width: 100% !important; }
[data-toc] { position: sticky; top: 112px; align-self: start; display: flex; flex-direction: column; gap: 15px; margin-top: clamp(150px, 19vh, 196px); }
[data-toc] a { font-family: var(--sans); font-size: 14px; line-height: 1.3; color: rgba(220,229,234,.5); transition: color .3s ease; }
[data-toc] a:hover { color: var(--ivory); }
[data-toc] a[aria-current="true"] { color: var(--ivory); font-weight: 600; }

/* story blocks: a short heading on the left, the body on the right */
[data-split], [data-demo] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr); gap: 16px clamp(28px, 3.6vw, 56px); align-items: start; }
[data-main] { display: flex; flex-direction: column; gap: 22px; }
[data-side] { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; color: var(--ivory) !important; }
[data-body] { font-size: 17px; line-height: 1.66; color: rgba(220,229,234,.76); }
/* One quiet highlight for key sentences: body-sized, white, medium weight, a thin accent rule.
   Size stays reserved for hierarchy (title > turn > side heading > body); the highlight is carried by
   brightness and the rule, so it never reads as a new heading. Statement, pull quote and closer share it. */
[data-statement], [data-pull] blockquote, [data-closer] { max-width: 62ch; font-family: var(--sans); font-size: 19px; font-weight: 500; font-style: normal; letter-spacing: -.01em; line-height: 1.5; color: var(--ivory); }
[data-statement], [data-pull], [data-closer] { margin: 0; padding: 0 0 0 18px; border: 0; border-left: 2px solid var(--accent); }
[data-pull] blockquote { padding: 0; border: 0; }
[data-turn] { padding-top: clamp(36px, 4vw, 56px); border-top: 1px solid var(--line); }
[data-turn] h3 { max-width: 24ch; font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.08; }
[data-pull] figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* spectrum: the two ends of a tension, and where the design landed */
[data-spectrum] { display: flex; flex-direction: column; gap: 16px; padding: 22px 0 6px; }
[data-spec-ends] { display: flex; justify-content: space-between; gap: 28px; color: var(--muted); font-size: 15.5px; line-height: 1.45; }
[data-spec-ends] > span:last-child { text-align: right; }
[data-spec-ends] [data-win] { color: var(--ivory); font-weight: 600; }
[data-spec-track] { position: relative; height: 2px; border-radius: 2px; background: var(--line); }
[data-spec-track]::before, [data-spec-track]::after { content: ""; position: absolute; top: -5px; width: 1px; height: 12px; background: var(--dim); }
[data-spec-track]::before { left: 0; } [data-spec-track]::after { right: 0; }
[data-spec-knob] { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 999px; background: var(--ivory); box-shadow: 0 0 0 6px rgba(220,229,234,.12); transition: left 1.4s var(--ease) .25s; }
[data-spectrum][data-in] [data-spec-knob] { left: var(--at); }
[data-spectrum]:not([data-balance]) [data-spec-track] { background: linear-gradient(90deg, var(--line) 0%, var(--line) 50%, rgba(220,229,234,.5) 100%); }
[data-balance] [data-spec-ends] span { max-width: 26ch; }
[data-balance] [data-spec-ends] b { display: block; margin-bottom: 6px; color: var(--ivory); font-weight: 600; }
[data-balance] [data-spec-track] { background: var(--line); }
[data-balance] [data-spec-knob] { background: var(--ivory); box-shadow: 0 0 0 6px rgba(220,229,234,.12); }

[data-eyebrow] { margin-bottom: 14px; color: var(--accent); font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
[data-title] { max-width: 20ch; font-family: var(--display); font-size: clamp(2.2rem, 4.6vw, 4rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; }
[data-it] { font-family: var(--serif); font-style: italic; font-weight: 400; line-height: 1.14; letter-spacing: -.01em; }
[data-turn] [data-eyebrow] { margin-bottom: 12px; }
[data-side-cap] { padding-top: 4px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
[data-figcap] { margin-top: 12px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
[data-big] { display: flex; align-items: baseline; gap: 10px; font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
[data-big] span { color: var(--accent); }
[data-next] { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding-bottom: 4px; border-bottom: 1px solid currentColor; color: var(--accent); font-size: 15.5px; }
[data-next]:hover { color: var(--ivory); }
[data-chain-label] { margin-bottom: -8px; color: var(--muted); font-size: 14px; font-weight: 600; }
[data-spec-ends] > span { max-width: 30ch; }
[data-spec-ends] b { display: block; margin-bottom: 5px; font-weight: 600; color: rgba(220,229,234,.84); }
[data-spec-ends] [data-win] b { color: var(--ivory); }
[data-spec-ends] [data-risk] { font-style: normal; color: inherit; }
[data-spec-ends] [data-win]:has(b) { font-weight: 400; color: var(--muted); }
[data-chain] span[style*="var(--mono)"] { font-family: var(--sans) !important; font-size: 12.5px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--muted) !important; }
[data-chain] [data-arrow] span[style*="var(--warn)"] { color: var(--warn) !important; }
[data-poles] [data-spec-track] { background: var(--line); }
[data-poles] [data-spec-ends] b { color: var(--ivory); }
[data-poles] [data-spec-knob] { background: var(--ink); box-shadow: 0 0 0 2px var(--ivory), 0 0 0 8px rgba(220,229,234,.08); }
[data-shift] li { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.3fr); gap: 14px; align-items: baseline; padding: 15px 0; border-top: 1px solid var(--line2); font-size: 16.5px; line-height: 1.45; }
[data-shift] li:last-child { border-bottom: 1px solid var(--line2); }
[data-shift] li > span:first-child { color: var(--muted); }
[data-shift] li > span:last-child { color: var(--ivory); font-weight: 600; }
[data-shift] i { font-style: normal; color: var(--dim); text-align: center; }
[data-olist] li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--line2); color: rgba(220,229,234,.86); font-size: 16.5px; line-height: 1.5; }
[data-olist] li:last-child { border-bottom: 1px solid var(--line2); }
[data-olist] li > span { color: var(--dim); font-family: var(--sans); font-size: 14px; font-weight: 600; }
[data-metrics2] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
[data-metrics2] > div { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
[data-metrics2] [data-metric] { font-family: var(--display); font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; color: var(--accent); }
[data-metrics2] h4 { margin-top: 8px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
[data-metrics2] p { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
[data-row3] li > h4:last-child { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.3; }

/* three changes in a row, no boxes */
[data-row3] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
[data-row3] li { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
[data-row3] [data-n] { font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1; color: var(--dim) !important; }
[data-row3] h4 { margin-top: 6px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
[data-row3] p { color: var(--muted); font-size: 15.5px; line-height: 1.6; }

/* stage: a soft grainy gradient behind the white UI screenshots */
[data-stage] { position: relative; isolation: isolate; overflow: hidden; padding: clamp(14px, 3.2vw, 46px); border-radius: 10px; background: var(--stage); }
[data-stage]::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grainimg); opacity: .5; mix-blend-mode: overlay; pointer-events: none; }
[data-shot] { position: relative; overflow: hidden; border-radius: 6px; background: #F2F2F2; box-shadow: 0 0 0 1px rgba(16,24,32,.08), 0 24px 50px -26px rgba(16,24,32,.55); }
[data-shot] img { width: 100%; height: auto; }

/* version list on the left, the screenshot it picks on the right */
[data-demo] [data-stage] { padding: clamp(12px, 1.9vw, 26px); }
[data-cap] { display: flex; flex-direction: column; gap: 12px; }
[data-cap] p { max-width: 44ch; color: var(--ivory); font-size: 16.5px; line-height: 1.6; }
[data-bar] { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: clamp(12px, 1.8vw, 20px); }
[data-seg] { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.62); box-shadow: inset 0 0 0 1px rgba(16,24,32,.10), 0 1px 2px rgba(16,24,32,.06); }
[data-seg] [role="tab"] { appearance: none; border: 0; border-radius: 999px; background: transparent; color: #26303B; font: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2; padding: 9px 16px; cursor: pointer; transition: background .3s ease, color .3s ease; }
[data-seg] [role="tab"]:hover { background: rgba(255,255,255,.95); }
[data-seg] [role="tab"][aria-selected="true"] { background: #0B1014; color: #fff; }
[data-seg] [role="tab"]:focus-visible, [data-swap-step]:focus-visible { outline: 2px solid #0B1014; outline-offset: 2px; }
[data-steps] { display: inline-flex; align-items: center; gap: 8px; }
[data-count] { min-width: 3.6em; color: #3A4552; font-family: var(--sans); font-size: 13px; text-align: right; }
[data-swap-step] { appearance: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 999px; background: #fff; color: #0B1014; cursor: pointer; box-shadow: 0 0 0 1px rgba(16,24,32,.10), 0 4px 12px -4px rgba(16,24,32,.25); transition: background .3s ease, color .3s ease; }
[data-swap-step]:hover { background: #0B1014; color: #fff; }
[data-swap-step]::before { content: ""; width: 7px; height: 7px; border-top: 1.7px solid currentColor; border-right: 1.7px solid currentColor; transform: translateX(-1.5px) rotate(45deg); }
[data-swap-step="-1"]::before { transform: translateX(1.5px) rotate(-135deg); }
[data-swap-step][data-hint] { animation: ring 1.3s ease-out 2; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(11,16,20,.45), 0 4px 12px -4px rgba(16,24,32,.25); } 100% { box-shadow: 0 0 0 14px rgba(11,16,20,0), 0 4px 12px -4px rgba(16,24,32,.25); } }
[data-swap-next] { cursor: pointer; }
[data-pin] { display: inline-grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 999px; background: #0B1014; color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 500; font-style: normal; box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(16,24,32,.3); }
/* Screenshots stay clean: no boxes or numbers on the image. Hovering (or tapping) a note spotlights
   its area — the rest of the screenshot dims — and the note's dot lights up. */
[data-region] { position: absolute; border-radius: 8px; pointer-events: none; transition: box-shadow .45s var(--ease); }
:has(> [data-region]) { overflow: hidden; }
[data-region] [data-pin] { display: none !important; }
[data-anno-root][data-focus] [data-region][data-hot] { box-shadow: 0 0 0 200vmax rgba(8,12,16,.5); }
[data-anno] [data-pin] { width: 9px; height: 9px; margin-top: .55em; font-size: 0; color: transparent; background: rgba(220,229,234,.34); box-shadow: none; transition: background .3s ease, box-shadow .3s ease; }
[data-anno][data-hot] [data-pin] { background: var(--accent); box-shadow: 0 0 0 4px rgba(127,212,230,.18); }
[data-notes] { display: flex; flex-direction: column; gap: 10px; }
[data-notes] li { display: flex; align-items: flex-start; gap: 14px; padding: 15px 16px; border: 1px solid var(--line2); border-radius: 8px; transition: border-color .3s ease, background .3s ease, opacity .3s ease; }
[data-notes] li[data-hot] { border-color: var(--line); background: var(--panel); }
[data-anno-root][data-focus] [data-notes] li:not([data-hot]) { opacity: .45; }
[data-notes]::after { content: "Hover a note to see it on the screen"; padding-left: 2px; color: var(--dim); font-size: 13px; line-height: 1.4; }
@media (hover: none) { [data-notes]::after { content: "Tap a note to see it on the screen"; } }
[data-note-h] { color: var(--ivory); font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
[data-note-t] { margin-top: 4px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
@media (max-width: 620px) { [data-pin] { width: 22px; height: 22px; font-size: 11px; } [data-anno] [data-pin] { width: 9px; height: 9px; font-size: 0; } }
[data-vlabel] { display: inline-flex; align-items: center; gap: 8px; color: var(--muted) !important; font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
[data-vlabel] i { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
[data-swap-stack] { display: grid; }
[data-swap-stack] > * { grid-area: 1 / 1; }
[data-swap-frame] { transition: opacity .5s var(--ease), visibility .5s; }
[data-swap-frame][data-on="0"] { opacity: 0; visibility: hidden; }

/* before / after: drag anywhere on the screenshot */
[data-ba] { position: relative; overflow: hidden; aspect-ratio: 1440 / 1024; border-radius: 6px; background: #F2F2F2; box-shadow: 0 0 0 1px rgba(16,24,32,.08), 0 24px 50px -26px rgba(16,24,32,.55); cursor: ew-resize; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
[data-ba] img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
[data-ba-after] { clip-path: inset(0 0 0 var(--x)); }
[data-ba-bar] { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(5,7,10,.08), 0 0 22px rgba(5,7,10,.3); pointer-events: none; }
[data-ba-bar] i { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 999px; background: #fff; box-shadow: 0 6px 20px rgba(5,7,10,.35); }
[data-ba-bar] i::before, [data-ba-bar] i::after { content: ""; position: absolute; top: 50%; margin-top: -5px; border: 5px solid transparent; }
[data-ba-bar] i::before { left: 7px; border-right-color: #0B1014; }
[data-ba-bar] i::after { right: 7px; border-left-color: #0B1014; }
[data-ba-tag] { position: absolute; top: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(5,7,10,.66); color: #fff; font-size: 14px; line-height: 1.2; pointer-events: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .3s ease; }
[data-ba-tag="before"] { left: 12px; }
[data-ba-tag="after"] { right: 12px; }
[data-ba]:focus-visible { outline: 1px solid var(--ivory); outline-offset: 4px; }


/* Scrollable frames inside the story (long page captures, wide diagrams, phone rows) keep scrolling,
   but never show a scrollbar gutter — with a mouse attached macOS draws it as a white strip. */
[data-content] * { scrollbar-width: none; }
[data-content] *::-webkit-scrollbar { display: none; width: 0; height: 0; }

@media (max-width: 1100px) {
  [data-layout] { grid-template-columns: 1fr !important; }
  [data-toc] { display: none !important; }
}
@media (max-width: 1000px) {
  [data-demo] { grid-template-columns: 1fr !important; }
  [data-split] { grid-template-columns: 1fr !important; }
  [data-split] > span:empty { display: none; }
  [data-row3] { grid-template-columns: 1fr !important; }
  [data-metrics2] { grid-template-columns: 1fr !important; }
}
@media (max-width: 620px) {
  [data-statement], [data-pull] blockquote, [data-closer] { font-size: 18px; }
  [data-long] { display: none; }
  [data-seg] [role="tab"] { padding: 8px 13px; }
}
