/* =========================================================
   Study Plan page (site/ccna/plan/). Tokens and shared pieces (.bp-*, .obj-*, bands, placards) are in site.css.
   ========================================================= */

/* ---------- header: copy + readiness panel ---------- */
.sp-wrap { padding-top: clamp(28px, calc(6 * var(--svh)), 64px); padding-bottom: clamp(28px, calc(6 * var(--svh)), 64px); }
.sp-head { display: grid; gap: 40px; }
@media (min-width: 1000px) { .sp-head { grid-template-columns: minmax(0, 6fr) minmax(360px, 5fr); gap: 64px; align-items: center; } }
.sp-title { font-size: clamp(40px, min(calc(10 * var(--vw)), calc(7.6 * var(--svh))), 70px); line-height: 1.02; letter-spacing: -.035em; max-width: 11em; text-wrap: balance; }
.sp-title em { display: block; color: var(--blue); }
.sp-sub { margin-top: 18px; font-size: 18px; color: var(--ink-2); max-width: 34em; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.ready { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-m); box-shadow: 6px 6px 0 var(--ink); }
.ready-bar { border-radius: calc(var(--r-m) - 2px) calc(var(--r-m) - 2px) 0 0; }
.ready-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--navy); color: #C3CEEE; font-size: 11px; }
.ready-bar h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; }
.ready-bar span { text-transform: uppercase; letter-spacing: .06em; }
.ready-main { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px 18px 8px; }
.ready-dial { position: relative; width: 150px; height: 88px; }
.ready-dial svg { width: 100%; height: 100%; overflow: visible; }
.rd-track, .rd-fill { fill: none; stroke-width: 12; stroke-linecap: round; }
.rd-track { stroke: var(--bg-2); }
.rd-fill { stroke: var(--led); stroke-dasharray: 0 100; transition: stroke-dasharray .9s var(--ease-out); }
.rd-needle { position: absolute; left: calc(50% - 2px); bottom: 10px; width: 4px; height: 58px; border-radius: 4px; background: var(--ink); transform-origin: 50% 100%; transform: rotate(-90deg); transition: transform .9s var(--ease-spring); }
.rd-needle::after { content: ""; position: absolute; left: -5px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.ready-num b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 52px; letter-spacing: -.04em; line-height: 1; color: var(--blue); }
.ready-num span { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); line-height: 1.4; }
.ready-stats { list-style: none; margin: 0; padding: 10px 18px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ready-stats li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.ready-stats b { font-size: 20px; font-weight: 700; }
.ready-stats span { font-size: 12px; color: var(--ink-2); }
.ready-stats li:first-child b { color: #0B8F4D; }
.ready-pace { display: grid; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--hair); }
.pace-date { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-ink); }
.pace-date .dp-btn { min-height: 40px; padding: 4px 12px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.pace-date .dp-btn:hover { background: var(--card); }
.pace-line { font-size: 15px; color: var(--ink-2); }
.pace-line b { color: var(--ink); font-family: var(--f-mono); }
@media (max-width: 480px) { .ready-main { grid-template-columns: 1fr; justify-items: center; text-align: center; } .ready-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- next up: the queue ---------- */
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .queue { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .queue { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qi { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card); box-shadow: var(--shadow-hard); }
.qi-head { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; }
.qi-n { color: var(--ink-3); }
.qi-id { padding: 1px 7px; border-radius: 5px; background: var(--navy); color: #fff; }
.qi-st { margin-left: auto; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; border: 1.5px solid var(--hair); color: var(--ink-2); }
.s-shaky .qi-st { border-color: var(--miss); color: var(--miss); }
.s-build .qi-st { border-color: var(--blue); color: var(--blue-ink); }
.qi-t { font-size: 20px; letter-spacing: -.02em; line-height: 1.15; }
.qi-why { font-size: 14.5px; color: var(--ink-2); }
.qi-go { display: grid; gap: 6px; margin-top: auto; padding-top: 6px; }
.q-done { padding: 22px; border: 2px dashed var(--led); border-radius: var(--r-m); background: var(--led-wash); font-size: 17px; grid-column: 1 / -1; }

/* evidence chip: station, meter, figure; links to the station */
.ev { display: grid; grid-template-columns: 86px 54px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 36px; padding: 5px 10px; border: 1.5px solid var(--hair); border-radius: 8px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: 13.5px; transition: border-color .2s, background-color .2s; }
.ev:hover, .ev:focus-visible { border-color: var(--blue); background: var(--card); }
.ev-k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-ink); white-space: nowrap; }
.ev-m { height: 7px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.ev-m i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--led); border-radius: 99px; }
.ev-t { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- all objectives ---------- */
.sp-bp { margin-top: 0; }
.bp-pips i.p-solid { background: var(--led); }
.bp-pips i.p-build { background: var(--blue-wash); border-color: var(--blue); }
.bp-pips i.p-shaky { background: #FFE3DF; border-color: var(--miss); }
.po-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 1000px) { .po-list { grid-template-columns: 1fr 1fr; } }
.po { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); border-left-width: 5px; }
.po.s-solid { border-left-color: var(--led); }
.po.s-build { border-left-color: var(--blue); }
.po.s-shaky { border-left-color: var(--miss); }
.po-top { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.po-top .obj-n, .po-top .obj-t, .po-top .obj-k { grid-area: auto; }
.po-ev { display: grid; gap: 5px; }
.po-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; }
.po-st { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.s-solid .po-st { color: #0B8F4D; }
.s-shaky .po-st { color: var(--miss); }
.po-flag { flex-basis: 100%; order: 3; font-size: 13.5px; color: var(--miss); }
.po-mark { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 10px 4px 6px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--card); font-family: var(--f-display); font-weight: 700; font-size: 13.5px; }
.po-mark .obj-box { width: 20px; height: 20px; }
.po-mark[aria-pressed="true"] { background: var(--led-wash); }
.po-mark[aria-pressed="true"] .obj-box { background: var(--led); }
.po-mark[aria-pressed="true"] .obj-box::after { content: ""; width: 9px; height: 5px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateY(-1px) rotate(-45deg); }

/* ---------- rules ---------- */
.rules { margin: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.rules > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.rules dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-ink); padding-top: 3px; }
.rules dd { margin: 0; font-size: 15.5px; }

/* =========================================================
   Motion (each section its own; plays once on this page):
     header      the readiness dial's needle sweeps up from zero; the stat tiles count in
     next up     queue cards feed in from the left like jobs into a print queue
     all         domain bars charge up from the bottom; objective rows patch in one by one
     rules       rows slide out from the rule line
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .js .rv:not(.in) { opacity: 0; }
  .fx-gauge .sp-head.in .sp-copy > * { animation: spin-up .8s var(--ease-out) backwards; }
  .fx-gauge .sp-head.in .sp-copy > :nth-child(2) { animation-delay: .08s; }
  .fx-gauge .sp-head.in .sp-copy > :nth-child(3) { animation-delay: .16s; }
  .fx-gauge .sp-head.in .sp-copy > :nth-child(4) { animation-delay: .24s; }
  @keyframes spin-up { from { opacity: 0; transform: translateY(18px); } }
  .fx-gauge .sp-head.in .ready { animation: readyin .8s var(--ease-out) .15s backwards; }
  @keyframes readyin { from { opacity: 0; transform: scale(.96); } }
  .fx-gauge .sp-head.in .ready-stats li { animation: tilein .5s var(--ease-spring) backwards; animation-delay: calc(.5s + var(--k, 0) * .07s); }
  .ready-stats li:nth-child(2) { --k: 1; } .ready-stats li:nth-child(3) { --k: 2; } .ready-stats li:nth-child(4) { --k: 3; }
  @keyframes tilein { from { opacity: 0; transform: translateY(10px); } }

  .fx-queue .queue.in .qi { animation: feed .6s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * .08s); }
  @keyframes feed { from { opacity: 0; transform: translateX(-40px); } }
  .fx-queue .head-row.in { animation: fadein .7s ease backwards; }

  .fx-patch .head-row.in { animation: fadein .7s ease backwards; }
  .fx-patch .bp.in .bp-seg { transform-origin: 50% 100%; animation: charge .6s var(--ease-spring) backwards; }
  .fx-patch .bp.in .bp-seg:nth-child(2) { animation-delay: .06s; } .fx-patch .bp.in .bp-seg:nth-child(3) { animation-delay: .12s; }
  .fx-patch .bp.in .bp-seg:nth-child(4) { animation-delay: .18s; } .fx-patch .bp.in .bp-seg:nth-child(5) { animation-delay: .24s; }
  .fx-patch .bp.in .bp-seg:nth-child(6) { animation-delay: .3s; }
  @keyframes charge { from { opacity: 0; transform: scaleY(.2); } }
  .fx-patch .bp.in:not(.settled) .po { animation: patchin .45s var(--ease-out) backwards; }
  .fx-patch .bp.in:not(.settled) .po:nth-child(2) { animation-delay: .05s; } .fx-patch .bp.in:not(.settled) .po:nth-child(3) { animation-delay: .1s; }
  .fx-patch .bp.in:not(.settled) .po:nth-child(4) { animation-delay: .15s; } .fx-patch .bp.in:not(.settled) .po:nth-child(5) { animation-delay: .2s; }
  .fx-patch .bp.in:not(.settled) .po:nth-child(n+6) { animation-delay: .25s; }
  @keyframes patchin { from { opacity: 0; transform: translateY(8px); } }

  .fx-rules .copy.in { animation: fadein .7s ease backwards; }
  .fx-rules .rules.in > div { transform-origin: 0 0; animation: ruleout .5s var(--ease-out) backwards; }
  .fx-rules .rules.in > div:nth-child(2) { animation-delay: .06s; } .fx-rules .rules.in > div:nth-child(3) { animation-delay: .12s; }
  .fx-rules .rules.in > div:nth-child(4) { animation-delay: .18s; } .fx-rules .rules.in > div:nth-child(5) { animation-delay: .24s; }
  .fx-rules .rules.in > div:nth-child(6) { animation-delay: .3s; } .fx-rules .rules.in > div:nth-child(7) { animation-delay: .36s; }
  @keyframes ruleout { from { opacity: 0; transform: translateY(-8px); } }
}
