/* /flow/ page styles. Base rules match the other pages (see /finds/index.html). */
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:Nunito,system-ui,sans-serif; background:#f6efe3; color:#2a1c16; line-height:1.5; }
a { color:inherit; }
.bar { background:#2a1c16; color:#fff6e8; display:flex; justify-content:flex-end; gap:12px; padding:10px 16px; flex-wrap:wrap; }
.bar a { color:#fff6e8; font-weight:800; font-size:14px; text-decoration:none; }
.banner { position:relative; min-height:300px; background:url("/banner.jpg") center 40%/cover no-repeat,#3a2a22; color:#fff; overflow:hidden; }
.banner::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(20,10,18,.5),rgba(20,10,18,.08) 62%); z-index:1; }
.inner { position:relative; z-index:5; width:min(920px,calc(100% - 32px)); margin:0 auto; padding:72px 0 32px; }
h1 { font-family:Fraunces,Georgia,serif; font-size:clamp(30px,5.5vw,54px); line-height:1; max-width:18ch; text-shadow:0 6px 24px rgba(0,0,0,.4); }
.sub { margin-top:12px; font-weight:800; font-size:18px; max-width:36ch; text-shadow:0 2px 10px rgba(0,0,0,.45); }
.url { display:inline-block; margin-top:12px; background:#fff6e8; color:#2a1c16; padding:6px 12px; border-radius:999px; font-weight:800; }
.wrap { width:min(920px,calc(100% - 32px)); margin:22px auto 48px; }
h2 { font-family:Fraunces,Georgia,serif; font-size:24px; margin-bottom:8px; }
h3 { font-family:Fraunces,Georgia,serif; font-size:19px; margin-bottom:6px; }
.card { background:#fffaf2; border:3px solid #2a1c16; border-radius:18px; padding:16px; box-shadow:5px 5px 0 #e36b4a; margin-bottom:16px; }
.small { font-size:14px; }
.foot { border-top:3px solid #2a1c16; padding:18px 16px 28px; text-align:center; font-weight:800; }
.foot .small { font-weight:600; margin-top:6px; }
@media (max-width:700px){ .banner{min-height:240px} }

/* Toggle */
.tabs { display:flex; gap:10px; margin:18px 0 14px; flex-wrap:wrap; }
.tabs button { font:inherit; font-weight:800; font-size:16px; color:#2a1c16; background:#fff6e8; border:3px solid #2a1c16; border-radius:999px; padding:8px 18px; cursor:pointer; }
.tabs button[aria-selected="true"] { background:#e36b4a; color:#fff; box-shadow:3px 3px 0 #2a1c16; }
.tabs button:focus-visible, .view:focus-visible { outline:3px solid #2f7d62; outline-offset:3px; }
.view { border-radius:18px; }
.caption { margin-top:10px; }

/* Diagram: one column on phones, a 4 + 4 snake on wider screens */
.flow { display:grid; grid-template-columns:minmax(0,1fr); justify-items:stretch; }
.node { position:relative; border-radius:16px; padding:12px 14px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:4px; }
.node .name { font-family:Fraunces,Georgia,serif; font-weight:700; font-size:18px; line-height:1.15; }
.node .desc { font-size:14px; line-height:1.35; }
.link { position:relative; height:36px; }
.link::before { content:""; position:absolute; left:50%; top:4px; bottom:8px; border-left:3px dashed currentColor; transform:translateX(-50%); }
.link::after { content:""; position:absolute; left:50%; bottom:0; transform:translateX(-50%); border:7px solid transparent; border-top:9px solid currentColor; border-bottom:0; }
.mover { position:absolute; left:50%; top:0; width:12px; height:12px; margin:-6px 0 0 -6px; border-radius:50%; background:#e36b4a; animation:moveY 2.4s linear infinite; }

/* Ghost: semi-transparent, dashed */
.ghost { color:rgba(42,28,22,.45); }
.ghost .node { border:2px dashed rgba(227,107,74,.7); background:rgba(255,250,242,.55); color:#2a1c16; }
.ghost .node .desc { color:#4a3a32; }
.ghost .mover { opacity:.7; }
.ghost .p4 .mover { animation-delay:.3s; } .ghost .p6 .mover { animation-delay:.6s; } .ghost .p8 .mover { animation-delay:.9s; }
.ghost .p10 .mover { animation-delay:1.2s; } .ghost .p12 .mover { animation-delay:1.5s; } .ghost .p14 .mover { animation-delay:1.8s; }

/* Solid (live) */
.solid { color:#2a1c16; }
.solid .link::before { border-left-style:solid; }
.solid .node { background:#fffaf2; border:3px solid #2a1c16; box-shadow:4px 4px 0 #e36b4a; transition:box-shadow .3s ease; }
.solid .node.hit { box-shadow:4px 4px 0 #2f7d62; }
.count { display:inline-block; min-width:2.2em; padding:1px 10px; border-radius:999px; background:#2a1c16; color:#fff6e8; font-weight:800; font-size:14px; }
.count[hidden] { display:none; }
.solid .mover { animation:moveY 1.4s ease-in-out 1 forwards; background:#2f7d62; }
.live-card { margin-top:18px; }
.status { font-weight:800; }
.recent { list-style:none; margin-top:8px; }
.recent li { display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px dashed rgba(42,28,22,.25); overflow-wrap:anywhere; }
.recent .when { white-space:nowrap; font-size:14px; color:#5a4a42; }

@keyframes moveY { from { top:0; } to { top:calc(100% - 8px); } }
@keyframes moveX { from { left:0; } to { left:calc(100% - 10px); } }
@keyframes moveXr { from { left:100%; } to { left:10px; } }

@media (min-width:760px) {
  .flow { grid-template-columns:repeat(3, minmax(0,1fr) 46px) minmax(0,1fr); grid-template-rows:auto 46px auto; align-items:stretch; }
  .p1{grid-area:1/1} .p2{grid-area:1/2} .p3{grid-area:1/3} .p4{grid-area:1/4} .p5{grid-area:1/5} .p6{grid-area:1/6} .p7{grid-area:1/7}
  .p8{grid-area:2/7} .p9{grid-area:3/7} .p10{grid-area:3/6} .p11{grid-area:3/5} .p12{grid-area:3/4} .p13{grid-area:3/3} .p14{grid-area:3/2} .p15{grid-area:3/1}
  .link.fwd, .link.back { height:auto; align-self:center; height:24px; }
  .link.fwd::before, .link.back::before { left:4px; right:8px; top:50%; bottom:auto; border-left:0; border-top:3px dashed currentColor; transform:translateY(-50%); }
  .solid .link.fwd::before, .solid .link.back::before { border-top-style:solid; }
  .link.fwd::after { left:auto; right:0; bottom:auto; top:50%; transform:translateY(-50%); border:7px solid transparent; border-left:9px solid currentColor; border-right:0; }
  .link.back::before { left:8px; right:4px; }
  .link.back::after { left:0; bottom:auto; top:50%; transform:translateY(-50%); border:7px solid transparent; border-right:9px solid currentColor; border-left:0; }
  .link.fwd .mover, .link.back .mover { top:50%; }
  .link.fwd .mover { animation-name:moveX; }
  .link.back .mover { animation-name:moveXr; }
}

/* Reduced motion: nothing moves, everything still reads */
@media (prefers-reduced-motion:reduce) {
  .mover { display:none; }
  .floaters .dot, .face svg { animation:none !important; }
  .solid .node { transition:none; }
}
