/* Guide page. Builds on style.css tokens. */
:root {
  --app-bg: #faf8ff;
  --app-red: #ef5350;
  --app-green: #66bb6a;
  --ink-strong: #1b1b21;
  --pill: #e8eefc;
  --pill-ink: #2c4a8a;
  --bezel: #202124;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink-strong: #f0f3f6;
    --pill: #1c2a44;
    --pill-ink: #a8c2ff;
    --bezel: #3a3d42;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

main.guide { max-width: 980px; }
.site-nav { max-width: 980px; align-items: center; }
.site-nav .nav-cta { margin-left: auto; }

section { margin-top: 64px; }
section > h2 { border-top: 0; margin: 0 0 6px; padding: 0; font-size: 1.6rem; }
.sub { color: var(--muted); margin: 0 0 24px; }
.ui { font-weight: 600; white-space: nowrap; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: var(--bg);
  font-weight: 700; text-decoration: none;
}
.btn-sm { padding: 6px 14px; font-size: .9rem; }
.fine { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* Screens */
.phone {
  display: block; width: 100%; max-width: 230px; height: auto; margin: 0 auto;
  border: 6px solid var(--bezel); border-radius: 26px;
  box-shadow: var(--shadow); background: var(--app-bg);
}
.crop {
  display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); background: var(--app-bg);
}
.dialog { border: 0; border-radius: 8.8% / 9.4%; max-width: 260px; }
.dialog.tall { border-radius: 8.8% / 4.4%; max-width: 230px; }
.sheet { border-radius: 6.9% 6.9% 14px 14px / 6.1% 6.1% 14px 14px; }
.strip {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 10px; background: var(--app-bg);
}

/* Hero */
.hero { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 4px 0 8px; color: var(--ink-strong); }
.hero .lede { font-size: 1.25rem; margin: 0 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0; }
@media (min-width: 760px) { .hero { grid-template-columns: 1.3fr 1fr; } }

/* Principles */
.ideas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding: 0; list-style: none; }
.ideas li { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin: 0; }
.ideas svg { width: 40px; height: 40px; display: block; margin-bottom: 10px; }
.ideas b { display: block; font-size: 1.1rem; color: var(--ink-strong); }
.ideas span { color: var(--muted); }

/* Swipe tiles */
.swipes { display: grid; gap: 28px 24px; grid-template-columns: 1fr; margin: 0; }
@media (min-width: 720px) { .swipes { grid-template-columns: 1fr 1fr; } }
.swipe { margin: 0; }
.stage {
  position: relative; overflow: hidden; aspect-ratio: 6 / 1;
  background: var(--app-bg); border: 1px solid var(--border); border-radius: 12px;
}
.row, .band, .finger { animation: 4.4s ease-in-out infinite; }
.row { position: absolute; inset: 0; }
.row img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.row .after { opacity: 0; }
.band {
  position: absolute; top: 0; height: 47%; width: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff;
}
.band svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.finger {
  position: absolute; top: 50%; width: 15%; aspect-ratio: 1; max-width: 46px; opacity: 0;
  border-radius: 50%; background: rgba(30, 30, 40, .22);
  box-shadow: 0 0 0 2px rgba(30, 30, 40, .45), 0 2px 8px rgba(0, 0, 0, .25);
  transform: translate(-50%, -50%);
}
.two .finger { width: 11%; max-width: 32px; top: 30%; }
.two .finger + .finger { top: 74%; }
.left .row { animation-name: slide-left; }
.right .row { animation-name: slide-right; }
.left .band { right: 0; background: var(--app-red); animation-name: band; }
.right .band { left: 0; background: var(--app-green); animation-name: band; }
.left .finger { left: 72%; animation-name: finger; }
.right .finger { left: 26%; animation-name: finger; }
.row .before { animation: swap-out 4.4s infinite; }
.row .after { animation: swap-in 4.4s infinite; }
.swipe:nth-child(2) * { animation-delay: .6s; }
.swipe:nth-child(3) * { animation-delay: 1.2s; }
.swipe:nth-child(4) * { animation-delay: 1.8s; }

@keyframes slide-left  { 0%,14% { transform: translateX(0); } 46%,58% { transform: translateX(-37%); } 65% { transform: translateX(2%); } 71%,100% { transform: translateX(0); } }
@keyframes slide-right { 0%,14% { transform: translateX(0); } 46%,58% { transform: translateX(37%); } 65% { transform: translateX(-2%); } 71%,100% { transform: translateX(0); } }
@keyframes band   { 0%,14% { width: 0; opacity: .25; } 30% { opacity: 1; } 46%,58% { width: 37%; opacity: 1; } 65%,100% { width: 0; opacity: 1; } }
@keyframes finger { 0%,6% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } 13% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 57% { opacity: 1; } 61%,100% { opacity: 0; } }
@keyframes swap-out { 0%,59% { opacity: 1; } 60%,93% { opacity: 0; } 100% { opacity: 1; } }
@keyframes swap-in  { 0%,59% { opacity: 0; } 60%,93% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .stage * { animation: none !important; }
  .left .row { transform: translateX(-30%); }
  .right .row { transform: translateX(30%); }
  .band { width: 30%; }
  .finger { opacity: 1; }
}

.swipe figcaption { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin-top: 10px; align-items: baseline; }
.gesture {
  grid-row: span 2; align-self: center;
  background: var(--pill); color: var(--pill-ink); font-weight: 700; font-size: .9rem;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.swipe strong { font-size: 1.05rem; color: var(--ink-strong); }
.effect { color: var(--muted); font-size: .92rem; }
.tip { margin-top: 24px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }

/* Row anatomy */
.anatomy { display: grid; gap: 20px; grid-template-columns: 1fr; margin: 0; align-items: center; }
@media (min-width: 760px) { .anatomy { grid-template-columns: 1.6fr 1fr; } }
.arows { display: grid; gap: 10px; }
.arow { position: relative; }
.arow i {
  position: absolute; transform: translate(-50%, -50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--pill-ink); color: #fff; font: 700 13px/24px system-ui, sans-serif; font-style: normal; text-align: center;
  box-shadow: 0 0 0 2px var(--app-bg);
}
@media (prefers-color-scheme: dark) { .arow i { background: #2c4a8a; } }
.legend { margin: 0; padding: 0; list-style: none; counter-reset: n; display: grid; gap: 6px; }
.legend li { counter-increment: n; display: flex; gap: 10px; align-items: baseline; margin: 0; }
.legend li::before {
  content: counter(n); flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pill); color: var(--pill-ink); font: 700 12px/22px system-ui, sans-serif; text-align: center;
}
.hands { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 32px; }
.hands figure { margin: 0; }
.hands .phone { max-width: 190px; }
.hands figcaption { text-align: center; margin-top: 10px; }

/* Scenarios */
.scenario {
  border: 1px solid var(--border); border-radius: 20px; padding: 24px;
  margin-top: 24px; background: var(--bg);
}
.scenario h3 { margin: 0; font-size: 1.3rem; color: var(--ink-strong); }
.scenario .when { color: var(--muted); margin: 2px 0 20px; font-size: .95rem; }
.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); counter-reset: s; }
.board > li { margin: 0; counter-increment: s; display: flex; flex-direction: column; gap: 12px; }
.board > li > p { margin: 0; }
.board > li > img { order: 1; }
.board > li > .aside { order: 2; }
.board > li > p::before {
  content: counter(s); display: inline-block; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
  background: var(--accent); color: var(--bg); font: 700 12px/22px system-ui, sans-serif; text-align: center; vertical-align: 1px;
}
.board .aside { color: var(--muted); font-size: .92rem; }
.board .aside::before { content: none; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.timeline li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; margin: 0; align-items: start; }
.timeline time { font-weight: 700; color: var(--accent); padding-top: 2px; }
.timeline p { margin: 8px 0 0; }
.timeline li > p, .timeline li > div > p:first-child { margin-top: 0; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }
.timeline { max-width: 600px; }
.timeline .pair { display: grid; gap: 6px; }
.timeline .arrow { text-align: center; color: var(--muted); line-height: 1; }
.split { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .split { grid-template-columns: 1.4fr 1fr; } }

.flow { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .flow { grid-template-columns: 1fr 1fr; } }
.lane { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.lane b { display: block; margin-bottom: 6px; color: var(--ink-strong); }
.lane ol { margin: 0; padding-left: 20px; }
.loop {
  margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  font-weight: 700;
}
.loop span { background: var(--pill); color: var(--pill-ink); padding: 6px 14px; border-radius: 999px; }
.loop em { font-style: normal; color: var(--muted); }

/* Warnings */
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rules li {
  margin: 0; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px; background: var(--caution-bg); border: 1px solid var(--caution-border);
}
.rules svg { flex: none; width: 24px; height: 24px; fill: currentColor; margin-top: 1px; }

.cta { text-align: center; padding: 40px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.cta h2 { margin-top: 0; }
