/* ==========================================================================
   How I work with AI agents (how-i-work.html). Loaded after main.css and
   sheets.css. Uses the site tokens only: type --t-*, spacing --sp-*,
   --measure. Motion is transform/opacity (and SVG stroke) and every scene
   has a resolved still state for reduced motion and Pause Motion.
   ========================================================================== */

.mw { --mw-w: min(1180px, calc(100vw - 48px)); --mw-line: rgba(245,242,235,.10); --mw-card: rgba(245,242,235,.03); }
.mw-wrap { width: var(--mw-w); margin: 0 auto; }
.mw-section { padding: clamp(var(--sp-9), 14vh, 168px) 0 0; }
.mw-section > .mw-wrap > .kicker { margin-bottom: var(--sp-4); }
.mw-h2 { font-size: var(--t-h2); line-height: 1.06; letter-spacing: -.025em; max-width: 20ch; margin: 0; }
.mw-intro { font-size: var(--t-lede); line-height: 1.55; color: var(--gray); max-width: var(--measure); margin: var(--sp-5) 0 0; }
.mw-intro b { color: var(--ink); font-weight: 500; }

/* ---------- hero ---------- */
.mw-hero { min-height: 92svh; display: grid; align-items: center; padding: clamp(120px, 18vh, 180px) 0 var(--sp-8); }
.mw-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(var(--sp-6), 5vw, var(--sp-9)); align-items: center; }
.mw-hero h1 { font-size: var(--t-h1); max-width: 13ch; margin: 0; }
.mw-hero .mw-intro { margin-top: var(--sp-6); }
.mw-hero-meta { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); margin-top: var(--sp-7); }
.mw-hero-meta div { border-top: 1px solid var(--mw-line); padding-top: var(--sp-3); min-width: 120px; }
.mw-hero-meta b { display: block; font-family: var(--display); font-weight: 500; font-size: var(--t-h3); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mw-hero-meta span { display: block; margin-top: var(--sp-1); font-size: var(--t-caption); color: var(--gray); }

/* the loop: six steps on a ring, a pulse travelling round it */
.mw-ring { width: 100%; max-width: 520px; margin-left: auto; display: block; overflow: visible; }
.mw-ring .ring-track { fill: none; stroke: rgba(245,242,235,.12); stroke-width: 1.2; }
.mw-ring .ring-arc { fill: none; stroke: var(--shu); stroke-width: 1.6; stroke-linecap: round; }
.mw-ring .ring-node circle { fill: #0c0c0e; stroke: rgba(245,242,235,.34); stroke-width: 1.2; transition: stroke .5s, fill .5s, r .5s; }
.mw-ring .ring-node text { font-family: var(--sans); font-size: 15px; fill: var(--gray); letter-spacing: .02em; transition: fill .5s; }
.mw-ring .ring-node .n { font-size: 11px; letter-spacing: .14em; fill: rgba(245,242,235,.34); }
.mw-ring .ring-node.is-on circle { stroke: var(--shu); fill: rgba(195,21,55,.22); }
.mw-ring .ring-node.is-on text:not(.n) { fill: var(--ink); }
.mw-ring .ring-core text { font-family: var(--display); font-weight: 500; fill: var(--ink); letter-spacing: -.01em; }
.mw-ring .ring-core .sub { font-family: var(--sans); font-weight: 400; fill: var(--gray); font-size: 13px; letter-spacing: .02em; }
.mw-ring .pulse { fill: var(--shu-text); }
html.motion-paused .mw-ring .pulse { display: none; }
@media (prefers-reduced-motion: reduce) { .mw-ring .pulse { display: none; } }

/* ---------- 01 the loop: a pinned ring beside the steps ---------- */
.mw-loop { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(var(--sp-6), 6vw, var(--sp-10)); margin-top: var(--sp-8); align-items: start; }
.mw-loop-stage { position: sticky; top: 16vh; }
.mw-loop-stage .mw-ring { margin: 0; max-width: 460px; }
.mw-steps { list-style: none; margin: 0; padding: 0; counter-reset: mwstep; }
.mw-step { min-height: 46vh; display: flex; flex-direction: column; justify-content: center; padding: var(--sp-6) 0; border-top: 1px solid var(--mw-line); opacity: .34; transition: opacity .5s ease; }
.mw-step:last-child { border-bottom: 1px solid var(--mw-line); }
.mw-step.is-active { opacity: 1; }
.mw-step small { font-size: var(--t-label); letter-spacing: .2em; text-transform: uppercase; color: var(--shu-text); margin-bottom: var(--sp-3); }
.mw-step h3 { font-size: var(--t-h3); letter-spacing: -.02em; line-height: 1.12; margin: 0 0 var(--sp-3); }
.mw-step p { margin: 0; font-size: var(--t-body); line-height: 1.65; color: var(--gray); max-width: 52ch; }
.mw-step p b { color: var(--ink); font-weight: 500; }
.mw-step .mw-eg { margin-top: var(--sp-4); font-size: var(--t-small); color: rgba(245,242,235,.62); padding-left: var(--sp-4); border-left: 1px solid var(--shu); max-width: 52ch; line-height: 1.6; }

/* ---------- 02 recent work: four cards, each with a small working visual ---------- */
.mw-work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-8); }
.mw-card { position: relative; background: var(--mw-card); border-radius: 26px; box-shadow: inset 0 0 0 1px var(--mw-line); padding: var(--sp-6); display: flex; flex-direction: column; min-height: 460px; overflow: hidden; }
.mw-card .kicker { margin-bottom: var(--sp-3); }
.mw-card h3 { font-size: var(--t-h3); line-height: 1.12; letter-spacing: -.02em; margin: 0; max-width: 18ch; }
.mw-card > p { margin: var(--sp-3) 0 0; font-size: var(--t-small); line-height: 1.6; color: var(--gray); max-width: 46ch; }
.mw-card .mw-stat { margin-top: auto; padding-top: var(--sp-6); display: flex; align-items: baseline; gap: var(--sp-3); }
.mw-card .mw-stat b { font-family: var(--display); font-weight: 500; font-size: var(--t-stat); letter-spacing: -.04em; line-height: .95; font-variant-numeric: tabular-nums; }
.mw-card .mw-stat b i { font-style: normal; color: var(--shu-text); }
.mw-card .mw-stat span { font-size: var(--t-caption); color: var(--gray); max-width: 20ch; line-height: 1.45; }
.mw-card .pill-row { justify-content: flex-start; margin-top: var(--sp-5); }
.mw-viz { height: 150px; margin: var(--sp-5) 0 0; position: relative; }

/* card A: one frame parts into four depth layers */
.viz-layers { perspective: 700px; }
.viz-layers i { position: absolute; left: 18%; right: 18%; top: 22px; height: 104px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(245,242,235,.22); background: linear-gradient(180deg, rgba(245,242,235,.07), rgba(245,242,235,.015)); transform-origin: 50% 50%; transition: transform 1.1s cubic-bezier(.16,1,.3,1), opacity .8s; }
.viz-layers i:nth-child(1) { background: linear-gradient(180deg, rgba(245,242,235,.12), rgba(245,242,235,.03)); }
.viz-layers i:nth-child(4) { box-shadow: inset 0 0 0 1px var(--shu); background: rgba(195,21,55,.10); }
.viz-layers i { top: 6px; height: 96px; }
.viz-legend { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; display: flex; justify-content: center; gap: var(--sp-4); font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase; color: var(--gray); opacity: 0; transition: opacity .6s .6s; }
.viz-legend span:last-child { color: var(--shu-text); }
.mw-card.is-in .viz-legend { opacity: 1; }
.mw-card.is-in .viz-layers i:nth-child(1) { transform: translate3d(-66px, -10px, -120px) rotateY(22deg); }
.mw-card.is-in .viz-layers i:nth-child(2) { transform: translate3d(-22px, -3px, -40px) rotateY(22deg); }
.mw-card.is-in .viz-layers i:nth-child(3) { transform: translate3d(22px, 3px, 40px) rotateY(22deg); }
.mw-card.is-in .viz-layers i:nth-child(4) { transform: translate3d(66px, 10px, 120px) rotateY(22deg); }

/* card B: one reference sheet becomes a grid of sheets */
.viz-grid { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(4, 1fr); gap: 5px; }
.viz-grid i { border-radius: 3px; background: rgba(245,242,235,.10); transform: scale(.2); opacity: 0; transition: transform .6s cubic-bezier(.2,1.4,.3,1), opacity .4s; transition-delay: calc(var(--k) * 22ms + 200ms); }
.viz-grid i.ref { background: var(--shu); transform: scale(1); opacity: 1; transition-delay: 0s; }
.mw-card.is-in .viz-grid i { transform: scale(1); opacity: 1; }

/* card C: a sentence loses its tells, one by one */
.viz-voice { display: grid; align-content: center; gap: var(--sp-3); font-size: var(--t-small); line-height: 1.5; }
.viz-voice p { margin: 0; color: var(--gray); }
.viz-voice s { color: var(--shu-text); text-decoration-thickness: 1.5px; transition: opacity .6s; }
.viz-voice .after { color: var(--ink); opacity: 0; transform: translateY(8px); transition: opacity .7s .9s, transform .8s .9s cubic-bezier(.16,1,.3,1); }
.mw-card.is-in .viz-voice .after { opacity: 1; transform: none; }
.viz-voice .before span { background: linear-gradient(rgba(245,242,235,.45), rgba(245,242,235,.45)) 0 58% / 0% 1.5px no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .8s .3s cubic-bezier(.65,0,.35,1); }
.mw-card.is-in .viz-voice .before span { background-size: 100% 1.5px; }
.mw-card.is-in 
/* card D: many one-off sizes settle onto six */
.viz-type { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.viz-type i { flex: 1; border-radius: 3px 3px 0 0; background: rgba(245,242,235,.16); height: calc(var(--h) * 1%); transition: height 1.2s cubic-bezier(.16,1,.3,1), background .6s; transition-delay: calc(var(--k) * 12ms + 200ms); }
.mw-card.is-in .viz-type i { height: calc(var(--t) * 1%); }
.mw-card.is-in .viz-type i.hi { background: var(--shu); }

/* ---------- 03 where judgment stays: three lanes ---------- */
.mw-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-8); }
.mw-lane { border-radius: 22px; padding: var(--sp-6) var(--sp-5); box-shadow: inset 0 0 0 1px var(--mw-line); background: var(--mw-card); }
.mw-lane h3 { font-size: var(--t-h4); margin: 0 0 var(--sp-1); letter-spacing: -.01em; }
.mw-lane > p { margin: 0 0 var(--sp-5); font-size: var(--t-caption); color: var(--gray); }
.mw-lane ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.mw-lane li { font-size: var(--t-small); line-height: 1.45; padding: var(--sp-3) var(--sp-4); border-radius: 12px; background: rgba(245,242,235,.04); color: rgba(245,242,235,.86); }
.mw-lane--me { box-shadow: inset 0 0 0 1px rgba(195,21,55,.55); background: rgba(195,21,55,.06); }
.mw-lane--me li { background: rgba(195,21,55,.12); }
.mw-authority { margin-top: var(--sp-5); display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-4); align-items: center; font-size: var(--t-caption); color: var(--gray); }
.mw-authority i { display: block; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(245,242,235,.2), var(--shu)); transform-origin: 0 50%; transition: transform 1.4s cubic-bezier(.65,0,.35,1) .3s; }
.mw-anim .mw-authority:not(.is-in) i { transform: scaleX(0); }
.mw-anim .mw-lanes:not(.is-in) li { opacity: 0; transform: translateY(14px); }
.mw-lanes li { transition: opacity .5s ease, transform .6s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--k, 0) * 70ms + 150ms); }

/* ---------- 04 rules: numbered list ---------- */
.mw-rules { margin-top: var(--sp-8); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-8); counter-reset: mwrule; }
.mw-rule { display: grid; grid-template-columns: 48px 1fr; gap: var(--sp-2) var(--sp-4); padding: var(--sp-5) 0; border-top: 1px solid var(--mw-line); }
.mw-rule::before { counter-increment: mwrule; content: counter(mwrule, decimal-leading-zero); font-size: var(--t-caption); color: var(--shu-text); letter-spacing: .06em; padding-top: 4px; grid-row: span 2; }
.mw-rule h3 { font-size: var(--t-h4); margin: 0; letter-spacing: -.01em; line-height: 1.25; }
.mw-rule p { margin: 0; font-size: var(--t-small); color: var(--gray); line-height: 1.6; max-width: 48ch; }

/* ---------- 05 on a team ---------- */
.mw-team { margin-top: var(--sp-8); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.mw-team article { border-radius: 22px; padding: var(--sp-6) var(--sp-5); box-shadow: inset 0 0 0 1px var(--mw-line); background: var(--mw-card); }
.mw-team svg { width: 44px; height: 44px; display: block; margin-bottom: var(--sp-5); fill: none; stroke: rgba(245,242,235,.72); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mw-team svg .hot { stroke: var(--shu); }
.mw-team h3 { font-size: var(--t-h4); margin: 0 0 var(--sp-2); letter-spacing: -.01em; line-height: 1.25; }
.mw-team p { margin: 0; font-size: var(--t-small); color: var(--gray); line-height: 1.6; }

/* ---------- toolkit ---------- */
.mw-tools { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mw-tools span { font-size: var(--t-caption); padding: 9px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--mw-line); color: rgba(245,242,235,.8); }
.mw-tools span b { color: var(--gray); font-weight: 400; margin-right: 6px; }

/* ---------- sheet visuals (inside .osheet) ---------- */
.osheet .mw-flow text { font-family: var(--sans); fill: var(--gray); font-size: 15px; }
.osheet .mw-flow .strong { font-family: var(--display); fill: var(--ink); font-weight: 500; font-size: 17px; }
.osheet .mw-flow .hot { fill: var(--shu-text); }
.osheet .mw-ladder { display: grid; gap: var(--sp-3); }
.osheet .mw-ladder div { display: grid; grid-template-columns: 96px 1fr auto; align-items: baseline; gap: var(--sp-4); border-top: 1px solid var(--os-line); padding-top: var(--sp-3); }
.osheet .mw-ladder small { font-size: var(--t-caption); color: var(--gray); letter-spacing: .04em; }
.osheet .mw-ladder span { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osheet .mw-ladder em { font-style: normal; font-size: var(--t-caption); color: var(--gray); font-variant-numeric: tabular-nums; }

/* ---------- phones and narrow screens: everything stacks ---------- */
@media (max-width: 900px) {
  .mw-hero { min-height: auto; }
  .mw-hero-grid { grid-template-columns: 1fr; }
  .mw-ring { margin: var(--sp-6) auto 0; max-width: 380px; }
  .mw-loop { grid-template-columns: 1fr; }
  .mw-loop-stage { display: none; }
  .viz-type { gap: 1px; }
  .mw-step { min-height: 0; opacity: 1; }
  .mw-work { grid-template-columns: 1fr; }
  .mw-card { min-height: 0; padding: var(--sp-5); }
  .mw-lanes { grid-template-columns: 1fr; }
  .mw-rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .mw-step { opacity: 1; }
  .viz-layers i, .viz-legend, .viz-grid i, .viz-voice .after, .viz-type i, .mw-lanes li, .mw-authority i, .viz-voice .before span { transition: none !important; }
}

/* ---- One working session, played back (v0.216): frameless log lines ---- */
.mw-log-sec { padding-top: clamp(80px, 12vh, 140px); }
.mw-log {
  list-style: none; width: var(--grid-w, 1180px); margin: clamp(40px, 6vh, 64px) auto 0; padding: 0;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--t-small); line-height: 1.5;
}
.mw-log li {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 4rem; gap: var(--sp-5); align-items: baseline;
  padding: 14px 0; border-top: 1px solid rgba(245,242,235,.07); color: var(--ink-2);
}
.mw-log li:last-child { border-bottom: 1px solid rgba(245,242,235,.07); }
.lg-t { color: var(--shu-text); letter-spacing: .04em; }
.lg-t::before { content: "› "; color: var(--gray-3); }
.lg-s { justify-self: end; color: var(--gray); font-size: var(--t-caption); }
.lg-s::before { content: "✓ "; color: #3f9a5a; }
.lg-s--me { color: var(--ink); }
.lg-s--me::before { content: "● "; color: var(--shu-text); }
/* playback: lines type out one after another, each ends with its status */
.mw-log.lg-anim li { opacity: .18; }
.mw-log.lg-anim .lg-x { clip-path: inset(0 100% 0 0); }
.mw-log.lg-anim .lg-s { opacity: 0; }
.mw-log.lg-anim li.lg-on { opacity: 1; transition: opacity .25s ease; }
.mw-log.lg-anim li.lg-on .lg-x { clip-path: inset(0 0 0 0); transition: clip-path var(--lg-d, .9s) steps(var(--lg-n, 40), end); }
.mw-log.lg-anim li.lg-on .lg-x::after { content: ""; display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--ink-2); animation: lgCaret .9s steps(1) infinite; }
.mw-log.lg-anim li.lg-done .lg-x::after { display: none; }
.mw-log.lg-anim li.lg-done .lg-s { opacity: 1; transition: opacity .3s ease; }
@keyframes lgCaret { 50% { opacity: 0; } }
@media (max-width: 760px) {
  .mw-log li { grid-template-columns: 1fr auto; row-gap: 4px; }
  .lg-t { grid-column: 1; } .lg-s { grid-column: 2; grid-row: 1; } .lg-x { grid-column: 1 / -1; }
}
