/* =============================================================
   Magic Weather — interactive guide (on top of style.css + docs.css)
   Real screenshots in device frames, numbered points, step lists,
   picture switchers, gesture demos, cards and the contents rail.
   ============================================================= */

.guide-shell { max-width: 1260px; }
.guide-shell .doc-hero { margin-bottom: 54px; }
.guide-hero-hint {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 26px;
  font-family: var(--t-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #88806a;
}
.guide-hero-hint span { display: inline-flex; align-items: center; gap: 8px; }
.guide-hero-hint i {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ember); color: #fff; font: 600 10px/1 var(--t-mono); font-style: normal;
}

.guide-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 60px; align-items: start; }

/* ---------- contents ---------- */
.g-toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: none; }
.g-toc::-webkit-scrollbar { display: none; }
.g-search { position: relative; display: block; margin-bottom: 16px; }
.g-search svg { position: absolute; left: 13px; top: 13px; color: #88806a; }
.g-search input {
  width: 100%; height: 42px; padding: 0 14px 0 38px; border-radius: 12px; outline: none;
  border: 1px solid var(--line-p); background: #fff; color: var(--ink-text);
  font: 500 14px/1 var(--t-body); transition: border-color .2s, box-shadow .2s;
}
.g-search input:focus { border-color: var(--ember); box-shadow: 0 0 0 4px rgba(217, 122, 71, .14); }
.g-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.g-toc li a {
  display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 10px;
  font: 500 14.5px/1.25 var(--t-body); color: #5a543f; transition: color .2s, background .2s;
}
.g-toc li a::before {
  counter-increment: toc; content: counter(toc, decimal-leading-zero);
  font: 500 11px/1 var(--t-mono); letter-spacing: .06em; color: #a39a84;
}
.g-toc li a:hover { color: var(--ink-text); background: rgba(20, 24, 40, .05); }
.g-toc li a.on { color: var(--ember-2); background: rgba(217, 122, 71, .11); }
.g-toc li a.on::before { color: var(--ember-2); }
.g-toc li.hide { display: none; }
.g-toc-cta {
  margin-top: 20px; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line-p);
  background: rgba(255, 255, 255, .6); font-size: 13.5px; line-height: 1.5; color: #5a543f;
}
.g-toc-cta a { color: var(--ember-2); font-weight: 600; }

/* ---------- chapters ---------- */
.chapter { padding: 26px 0 84px; border-bottom: 1px solid var(--line-p); scroll-margin-top: 92px; }
.chapter:first-child { padding-top: 0; }
.chapter:last-child { border-bottom: 0; }
.chapter.hide { display: none; }
.ch-num { font: 500 12px/1 var(--t-mono); letter-spacing: .24em; color: var(--ember-2); }
.chapter h2 {
  font-family: var(--t-display); font-weight: 500; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.05;
  letter-spacing: -.025em; color: var(--ink-text); margin: 14px 0 14px;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
}
.chapter h2 em { font-style: italic; font-weight: 300; color: var(--ember-2); }
.chapter h3.g-sub {
  font-family: var(--t-display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; color: var(--ink-text);
  margin: 44px 0 6px; font-variation-settings: 'opsz' 36, 'SOFT' 100;
}
.ch-intro { color: #4a4536; font-size: 18px; line-height: 1.6; max-width: 720px; margin: 0 0 34px; }
.ch-intro b, .g-note b { color: var(--ink-text); font-weight: 600; }
.g-note { color: #5a543f; font-size: 15.5px; line-height: 1.6; max-width: 720px; margin: 0 0 22px; }
.g-empty { padding: 40px 0; }

/* ---------- screen explorer: screenshot + numbered points + steps ---------- */
.explore { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 44px; align-items: start; }
.explore + .explore, .g-cards + .explore, .explore + .g-cards { margin-top: 40px; }
.explore .dev { position: sticky; top: 96px; display: grid; justify-items: center; gap: 4px; }
.explore.wide { grid-template-columns: minmax(0, 1fr); gap: 26px; }
.explore.wide .dev { position: relative; top: 0; justify-items: stretch; }
.explore.wide .tour-btn { justify-self: start; }
.explore.wide .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tour-btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; cursor: pointer;
  font: 500 11px/1 var(--t-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ember-2);
  padding: 10px 14px; border-radius: 99px; border: 1px solid rgba(184, 97, 46, .45); background: transparent;
  transition: background .2s, color .2s;
}
.tour-btn:hover { background: rgba(217, 122, 71, .10); }
.tour-btn.playing { background: var(--ember-2); color: #fff; border-color: var(--ember-2); }

/* device frames */
.g-phone {
  --w: min(300px, 76vw);
  position: relative; width: var(--w); padding: calc(var(--w) * .03); border-radius: calc(var(--w) * .17);
  background: linear-gradient(160deg, #2a2d3a, #0b0d14 55%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, var(--shadow-paper), 0 2px 0 rgba(0, 0, 0, .25);
}
.g-phone .screen { position: relative; aspect-ratio: 1206 / 2622; border-radius: calc(var(--w) * .142); overflow: hidden; background: #111; }
.g-watch {
  --w: min(214px, 56vw);
  position: relative; width: var(--w); margin: 34px 30px 34px 10px; padding: calc(var(--w) * .075);
  border-radius: calc(var(--w) * .27); background: linear-gradient(160deg, #3a3d48, #0d0f15 60%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, var(--shadow-paper);
}
.g-watch::before, .g-watch::after {
  content: ''; position: absolute; left: 14%; right: 14%; height: 44px; background: linear-gradient(#22252f, #14161d);
}
.g-watch::before { bottom: 100%; border-radius: 16px 16px 0 0; margin-bottom: -6px; z-index: -1; }
.g-watch::after { top: 100%; border-radius: 0 0 16px 16px; margin-top: -6px; z-index: -1; }
.g-watch .crown { position: absolute; right: -9px; top: 27%; width: 10px; height: 16%; border-radius: 3px 5px 5px 3px; background: linear-gradient(90deg, #2c2f3a, #5a5e6c); }
.g-watch .side { position: absolute; right: -6px; top: 54%; width: 6px; height: 18%; border-radius: 2px 4px 4px 2px; background: #2c2f3a; }
.g-watch .screen { position: relative; aspect-ratio: 416 / 496; border-radius: calc(var(--w) * .2); overflow: hidden; background: #000; }
.g-mac {
  position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #1c1e27;
  box-shadow: 0 0 0 1px rgba(20, 24, 40, .16), var(--shadow-paper);
}
.g-mac .bar { display: flex; gap: 7px; align-items: center; height: 30px; padding: 0 13px; background: linear-gradient(#e9e2d6, #ddd5c7); }
.g-mac .bar i { width: 11px; height: 11px; border-radius: 50%; background: #ee6a5e; }
.g-mac .bar i:nth-child(2) { background: #f5bd4f; }
.g-mac .bar i:nth-child(3) { background: #61c454; }
.g-mac .screen { position: relative; aspect-ratio: var(--shot-ratio, 1800 / 1054); background: #111; }
.g-tv { position: relative; width: 100%; padding: 10px 10px 12px; border-radius: 16px; background: linear-gradient(#20232d, #0b0d13); box-shadow: var(--shadow-paper); margin-bottom: 30px; }
.g-tv .screen { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.g-tv .stand { position: absolute; left: 50%; top: 100%; width: 24%; height: 20px; transform: translateX(-50%); background: linear-gradient(#1b1e27, #3a3d49); clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); }
/* a wide screen's strip: nothing special on a computer, pans sideways on a phone */
.g-pan { width: 100%; }
.shot { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .16s ease; }
.shot.swap { opacity: 0; }

/* numbered points */
.spots { position: absolute; inset: 0; z-index: 20; }
.spot { position: absolute; width: 0; height: 0; }
.spot button {
  position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--ember); color: #fff; font: 600 11px/26px var(--t-mono); text-align: center;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 3px 12px rgba(0, 0, 0, .45);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .25s;
}
.spot button::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--ember); opacity: 0;
  animation: g-ring 2.6s infinite; animation-delay: calc(var(--k) * .18s);
}
@keyframes g-ring { 0% { transform: scale(.6); opacity: .85; } 80%, 100% { transform: scale(1.55); opacity: 0; } }
.spot.on button { transform: scale(1.28); }
.spots.focus .spot:not(.on) button { opacity: .4; transform: scale(.8); }
.spotlight {
  position: absolute; inset: 0; z-index: 15; pointer-events: none; background: rgba(8, 10, 18, .58); opacity: 0; transition: opacity .35s;
  -webkit-mask: radial-gradient(circle var(--sr, 60px) at var(--sx, 50%) var(--sy, 50%), transparent 70%, #000 100%);
          mask: radial-gradient(circle var(--sr, 60px) at var(--sx, 50%) var(--sy, 50%), transparent 70%, #000 100%);
}
.spotlight.on { opacity: 1; }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 15px 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line-p); background: rgba(255, 255, 255, .72);
  transition: border-color .25s, background-color .25s, transform .3s ease;
}
.step:hover { border-color: rgba(20, 24, 40, .2); }
.step:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.step.on { border-color: rgba(217, 122, 71, .65); background: #fff; transform: translateX(4px); box-shadow: 0 10px 26px -14px rgba(98, 70, 30, .35); }
.step i {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 11px/1 var(--t-mono); font-style: normal;
  background: rgba(20, 24, 40, .07); color: #5a543f; transition: background .25s, color .25s;
}
.step.on i { background: var(--ember); color: #fff; }
.step b { display: block; font: 600 16px/1.3 var(--t-body); color: var(--ink-text); }
.step p { margin: 5px 0 0; color: #5a543f; font-size: 14.5px; line-height: 1.5; }
.step-count { display: none; }

/* picture switcher (themes, Earth layers) */
.g-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 330px; margin: 0 0 16px; }
.g-chips button {
  cursor: pointer; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line-p); background: rgba(255, 255, 255, .7);
  font: 600 13px/1 var(--t-body); color: #5a543f; transition: background .2s, color .2s, border-color .2s;
}
.g-chips button:hover { border-color: rgba(184, 97, 46, .5); color: var(--ember-2); }
.g-chips button.on { background: var(--ink); border-color: var(--ink); color: var(--star); }
.g-variant-note { margin: 16px 0 0; max-width: 320px; min-height: 3em; text-align: center; font-size: 14.5px; line-height: 1.5; color: #5a543f; }
.explore.is-switch { grid-template-columns: auto minmax(0, 1fr); }

/* ---------- cards ---------- */
.g-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-card { padding: 22px; border-radius: 18px; border: 1px solid var(--line-p); background: rgba(255, 255, 255, .72); }
.g-card.full { grid-column: 1 / -1; }
.g-card svg.g-ic { width: 24px; height: 24px; color: var(--ember-2); }
.g-card h3 { font: 600 17px/1.25 var(--t-body); color: var(--ink-text); margin: 14px 0 8px; }
.g-card p, .g-card li { color: #5a543f; font-size: 14.5px; line-height: 1.55; }
.g-card p { margin: 0; }
.g-card p + p { margin-top: 8px; }
.g-card ul { margin: 8px 0 0; padding-left: 18px; }
.g-card li { margin: 4px 0; }
.g-card b { color: var(--ink-text); font-weight: 600; }
.g-tag { display: inline-block; margin-top: 12px; font: 500 10px/1 var(--t-mono); letter-spacing: .14em; text-transform: uppercase; color: #88806a; }
.g-phrases { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.g-phrases span { font: 500 14px/1.2 var(--t-body); padding: 9px 13px; border-radius: 99px; background: rgba(20, 24, 40, .06); color: var(--ink-text); }
.g-phrases span::before { content: '“'; color: var(--ember-2); }
.g-phrases span::after { content: '”'; color: var(--ember-2); }
.k {
  font: 500 11.5px/1 var(--t-mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-p);
  color: var(--ink-text); background: #fff; white-space: nowrap;
}

/* widget pictures */
.g-widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.g-widget { margin: 0; padding: 14px 14px 16px; border-radius: 18px; border: 1px solid var(--line-p); background: rgba(255, 255, 255, .72); text-align: center; }
.g-widget img { display: block; width: 100%; height: 150px; object-fit: contain; border-radius: 14px; }
.g-widget figcaption { margin-top: 12px; font-size: 14px; line-height: 1.45; color: #5a543f; }
.g-widget figcaption b { display: block; color: var(--ink-text); font-weight: 600; font-size: 15px; }

/* ---------- gesture demos ---------- */
.g-gestures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.g-gesture { padding: 16px; border-radius: 18px; border: 1px solid var(--line-p); background: rgba(255, 255, 255, .72); text-align: center; }
.g-gesture b { display: block; font: 600 15px/1.2 var(--t-body); color: var(--ink-text); }
.g-gesture > span { display: block; font-size: 13.5px; line-height: 1.45; color: #5a543f; margin-top: 4px; }
.g-stage { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: #0a0d18; margin-bottom: 14px; }
.g-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-stage .label {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%); white-space: nowrap; opacity: 0;
  font: 500 10px/1 var(--t-mono); letter-spacing: .12em; text-transform: uppercase; color: #1a1d2c; background: var(--ember-soft);
  padding: 6px 8px; border-radius: 6px;
}
.g-finger {
  position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px; border-radius: 50%; opacity: 0;
  background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 6px rgba(255, 255, 255, .28), 0 4px 14px rgba(0, 0, 0, .45);
}
.g-spin .g-finger { animation: gg-spin 2.8s infinite; }
.g-spin img { animation: gg-spin-img 2.8s infinite; }
@keyframes gg-spin { 0% { left: 72%; opacity: 0; } 14% { opacity: 1; } 64% { left: 28%; opacity: 1; } 80%, 100% { left: 28%; opacity: 0; } }
@keyframes gg-spin-img { 0%, 14% { transform: scale(1.5) translateX(8%); } 64%, 100% { transform: scale(1.5) translateX(-8%); } }
.g-pinch .g-finger { animation: gg-p1 2.8s infinite; }
.g-pinch .g-finger + .g-finger { animation-name: gg-p2; }
.g-pinch img { animation: gg-zoom 2.8s infinite; }
@keyframes gg-p1 { 0% { left: 43%; top: 43%; opacity: 0; } 14% { opacity: 1; } 64% { left: 25%; top: 25%; opacity: 1; } 80%, 100% { left: 25%; top: 25%; opacity: 0; } }
@keyframes gg-p2 { 0% { left: 57%; top: 57%; opacity: 0; } 14% { opacity: 1; } 64% { left: 75%; top: 75%; opacity: 1; } 80%, 100% { left: 75%; top: 75%; opacity: 0; } }
@keyframes gg-zoom { 0%, 14% { transform: scale(1); } 64%, 100% { transform: scale(1.6); } }
.g-tap .g-finger { animation: gg-tap 2.4s infinite; }
.g-tap .label { animation: gg-label 2.4s infinite; }
@keyframes gg-tap { 0%, 22% { opacity: 0; transform: scale(1); } 32% { opacity: 1; transform: scale(.78); } 48% { transform: scale(1); } 74%, 100% { opacity: 0; } }
@keyframes gg-label { 0%, 44% { opacity: 0; } 54%, 86% { opacity: 1; } 100% { opacity: 0; } }
.g-hold .g-finger { animation: gg-hold 3s infinite; }
.g-hold .g-line { position: absolute; top: 8%; bottom: 8%; left: 30%; width: 0; border-left: 2px dashed rgba(255, 255, 255, .9); opacity: 0; animation: gg-line 3s infinite; }
@keyframes gg-hold { 0% { left: 30%; opacity: 0; transform: scale(1); } 10% { opacity: 1; transform: scale(.8); } 34% { left: 30%; } 72% { left: 70%; opacity: 1; transform: scale(.8); } 86%, 100% { left: 70%; opacity: 0; } }
@keyframes gg-line { 0%, 26% { left: 30%; opacity: 0; } 34% { left: 30%; opacity: 1; } 72% { left: 70%; opacity: 1; } 86%, 100% { left: 70%; opacity: 0; } }
.g-swipe .g-finger { animation: gg-swipe 2.6s infinite; }
@keyframes gg-swipe { 0% { top: 72%; opacity: 0; } 14% { opacity: 1; } 64% { top: 30%; opacity: 1; } 80%, 100% { top: 30%; opacity: 0; } }
.g-swipe img { animation: gg-scroll 2.6s infinite; }
@keyframes gg-scroll { 0%, 14% { transform: translateY(0); } 64%, 100% { transform: translateY(-14%); } }
.g-stage.tall img { height: 130%; object-position: top; }
@media (prefers-reduced-motion: reduce) {
  .g-finger, .g-stage img, .g-stage .label, .g-hold .g-line, .spot button::after { animation: none !important; }
  .g-finger { opacity: .9; }
}

/* FAQ uses docs.css's .faq; a little room inside the chapter */
.chapter .faq p a { color: var(--ember-2); border-bottom: 1px solid rgba(184, 97, 46, .4); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .guide-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .g-toc {
    position: sticky; top: 64px; z-index: 50; max-height: none; margin: 0 -32px 26px; padding: 10px 32px;
    background: rgba(244, 236, 225, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-p);
  }
  .g-toc ol { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .g-toc ol::-webkit-scrollbar { display: none; }
  .g-toc li a { white-space: nowrap; border: 1px solid var(--line-p); padding: 9px 12px; background: rgba(255, 255, 255, .6); }
  .g-toc-cta, .g-search { display: none; }
  .g-gestures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-cards.three, .g-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .g-toc { margin: 0 -22px 22px; padding: 10px 22px; top: 58px; }
  .chapter { padding: 22px 0 60px; }
  .ch-intro { font-size: 16.5px; margin-bottom: 26px; }
  .explore, .explore.is-switch { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; }
  .explore .dev { position: relative; top: 0; }
  .explore .dev .tour-btn, .explore.wide .tour-btn { justify-self: center; margin-bottom: 12px; }
  .explore.wide .dev { justify-items: center; width: 100%; }
  .g-phone { --w: min(248px, 64vw); }
  /* the Mac window and the TV are too small to read at phone width: keep them 620px wide
     and let the strip pan sideways (the guide scrolls it to each point) */
  .g-pan {
    width: auto; justify-self: stretch; margin: 0 -22px; padding: 6px 22px 8px; overflow-x: auto; scrollbar-width: none;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  }
  .g-pan::-webkit-scrollbar { display: none; }
  .g-pan .g-mac, .g-pan .g-tv { width: 620px; }
  .g-pan .g-tv { margin-bottom: 26px; }
  .g-watch { --w: min(190px, 52vw); margin: 34px 26px 34px 6px; }
  /* phones: the steps become a swipe rail right under the screenshot */
  .explore .steps, .explore.wide .steps {
    justify-self: stretch; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    overscroll-behavior-x: contain; margin: 18px -22px 0; padding: 2px 22px 6px; scroll-padding: 0 22px;
  }
  .explore .steps::-webkit-scrollbar { display: none; }
  .explore .step { flex: 0 0 min(84%, 380px); scroll-snap-align: start; align-content: start; padding: 14px 16px; }
  .explore .step.on { transform: none; }
  .step-count {
    display: flex; justify-self: stretch; justify-content: space-between; align-items: center; margin-top: 10px; width: 100%;
    font: 500 11px/1 var(--t-mono); letter-spacing: .14em; text-transform: uppercase; color: #88806a;
  }
  .step-count b { color: var(--ember-2); }
  .g-cards, .g-cards.three { grid-template-columns: minmax(0, 1fr); }
  .g-search input { font-size: 16px; }
}
@media (max-width: 480px) { .g-widgets { grid-template-columns: minmax(0, 1fr); } }
