/* css/method.css: § 06, the Griffith Group methodology.
   Top: six equal columns in one row, split by thin vertical lines. Each column holds a small isometric icon,
   the step number and the step name.
   Below: the active step's large drawing on the left, its explanation on the right.
   A near-black highlight sits in the active column and slides to the next one when the step's timer ends
   (js/method.js). Steps run 1.5 times faster than round 6: 4 to 5.3 s each, builds in a third of a second.
   Under 861px the columns wrap three to a row; under 701px the drawing sits above its text. */

.method {
  --hl-bg: rgb(10 14 12 / .9);
  --hl-edge: transparent;
  --hl-ink: #f4f2ec;
  --hl-ease: cubic-bezier(.65, 0, .35, 1);
}
html[data-theme="dark"] .method { --hl-bg: rgb(2 5 4 / .82); --hl-edge: rgb(238 241 236 / .34); }

/* ---- the six columns */
.m-list {
  position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.m-row { position: relative; z-index: 1; display: flex; margin: 0; }
.m-row:not(:first-of-type) { border-left: 1px solid var(--line); }
.m-btn {
  display: flex; flex: 1; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; margin: 0; padding: 18px 14px 28px; border: 0; border-radius: 8px; background: none;
  font: 400 1rem/1.4 var(--f-body); text-align: center; color: var(--ink); cursor: pointer;
  transition: color .2s ease .08s, background-color .2s;
}
.m-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.m-ico { display: block; width: 108px; max-width: 100%; transition: transform .25s var(--ease-out); }
.m-ico .iso { display: block; width: 100%; height: auto; }
.m-num { font: 600 .8rem/1 var(--f-mono); letter-spacing: .04em; color: var(--muted); transition: color .2s ease .08s; }
.m-name { font: 700 1.08rem/1.2 var(--f-display); letter-spacing: -0.005em; text-wrap: balance; }

/* ---- the highlight, inset from the column lines, and the timer line along its bottom edge */
.m-hl {
  --ix: 6px; --iy: 7px;
  position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 0; pointer-events: none;
  border-radius: 8px; background: var(--hl-bg);
  box-shadow: inset 0 0 0 1px var(--hl-edge), 0 14px 30px -18px rgb(0 0 0 / .6);
}
/* Left and top move together, so the box slides to the next column at its own size and never stretches. */
.m-list.is-ready .m-hl { transition: left .37s var(--hl-ease), top .37s var(--hl-ease); }
.m-tick {
  position: absolute; left: 14px; right: 14px; bottom: 10px; height: 2px; border-radius: 2px;
  background: var(--sand); transform: scaleX(0); transform-origin: 0 50%;
}
.m-tick.run { animation: m-tick var(--ms, 4333ms) linear forwards; }
@keyframes m-tick { to { transform: scaleX(1); } }
.method.is-held .m-tick, .method.is-away .m-tick { animation-play-state: paused; }

.m-btn:not(.is-on):hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.m-btn.is-on { color: var(--hl-ink); cursor: default; }
.m-btn.is-on .m-num { color: var(--sand); }
.m-btn.is-on .m-ico { transform: translateY(-3px); }

/* ---- the stage: the large drawing on the left, the explanation on the right */
.m-stage { position: relative; margin-top: 36px; }
.m-panel { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.m-panel[hidden] { display: none; }
.m-art { padding: 18px 18px 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.m-art .iso { display: block; width: 100%; height: auto; }
.m-text { margin: 0; padding-bottom: 36px; font-size: clamp(1.3rem, 1.9vw, 1.7rem); line-height: 1.42; color: var(--muted); }
.m-text b { font-weight: 700; color: var(--ink); }
.m-text .term { color: var(--ink); }

.m-pause {
  position: absolute; right: 0; bottom: 0;
  padding: 7px 11px; border: 1px solid var(--line-2); border-radius: 4px; background: none;
  font: 500 .75rem/1 var(--f-mono); letter-spacing: .04em; color: var(--muted); cursor: pointer;
}
.m-pause:hover { color: var(--ink); border-color: var(--ink); }
.m-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The drawing builds piece by piece when its step comes up. js/method.js wraps each top-level piece in .m-b. */
.m-panel.is-in .m-b { animation: m-build .33s var(--ease-out) both; animation-delay: calc(min(var(--k), 16) * 40ms); }
.m-panel.is-in .m-text { animation: m-text .4s var(--ease-out) .1s both; }
@keyframes m-build { from { opacity: 0; transform: translateY(-9px); } }
@keyframes m-text { from { opacity: 0; transform: translateY(8px); } }

/* Labels inside the drawings (styled in css/site.css) fade in once the drawing has built. */
.m-panel.is-in .note { animation: m-note .3s var(--ease-out) .6s both; }
@keyframes m-note { from { opacity: 0; transform: translateY(4px); } }

/* The loops inside the large drawings run 1.5 times faster here than the same parts elsewhere on the page
   (css/site.css), so the decide story finishes inside its 5.3 s step. */
.m-art .iso .fstep { animation-duration: 1.6s; animation-delay: calc(var(--i) * .167s); }
.m-art .iso .pin { animation-duration: 1.2s; }
.m-art .iso .float { animation-duration: 1.467s; }
.m-art .iso .drop { animation-duration: 2s; }
.m-art .iso .tagpop { animation-duration: 2.133s; animation-delay: calc(var(--i) * .133s); }
.m-art .iso .spin { animation-duration: 3.333s; }
.m-art .iso .wire--on { animation-duration: .667s; }
.m-art .iso .dstep { animation-duration: 5.333s; animation-delay: calc(var(--i) * .2s); }
.m-art .iso .sign-go .sgn-l, .m-art .iso .sign-stop .sgn-r { animation-duration: 5.333s; }
.m-art .iso .dflag { animation-duration: 5.333s; animation-delay: .6s; }
.m-art .iso .v-go, .m-art .iso .v-stop { animation-duration: 5.333s; }

/* ---- calm (reduced motion or ?static): no timer, no sliding */
.method.is-calm .m-hl, .method.is-calm .m-ico { transition: none; }
.method.is-calm .m-tick, .method.is-calm .m-pause { display: none; }

/* ---- mid-size screens: smaller icons and type */
@media (max-width: 1100px) {
  .m-btn { padding: 16px 8px 26px; }
  .m-ico { width: 80px; }
  .m-name { font-size: .98rem; }
  .m-panel { gap: 36px; }
}
/* ---- tablets and phones: three columns to a row, two rows */
@media (max-width: 860px) {
  .m-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-row:nth-of-type(3n + 1) { border-left: 0; }
  .m-row:nth-of-type(n + 4) { border-top: 1px solid var(--line); }
  .m-ico { width: 76px; }
  .m-name { font-size: 1rem; }
}
@media (max-width: 700px) {
  .m-stage { margin-top: 24px; }
  .m-panel { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .m-art { padding: 10px 10px 2px; }
  .m-text { padding-bottom: 0; font-size: 1.2rem; }
  .m-pause { position: static; display: block; margin: 16px 0 0 auto; }
}
@media (max-width: 480px) {
  .m-hl { --ix: 4px; --iy: 5px; }
  .m-btn { gap: 6px; padding: 12px 6px 22px; }
  .m-ico { width: 60px; }
  .m-name { font-size: .9rem; }
  .m-tick { left: 10px; right: 10px; bottom: 9px; }
}
