/* Shared look for the handbook and setup guide pages: header, hero, overview cards, sticky step list,
   sections, screenshots, previous/next and footer. theme.css (loaded first) handles light mode. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0d14; --surface: #111827; --border: rgba(255, 255, 255, 0.08);
  --accent: #6366f1; --accent2: #8b5cf6; --text: #e2e8f0;
  --muted: #94a3b8; --dim: #64748b;
  --accent-text: #a5b4fc; --tint: rgba(99, 102, 241, 0.12);
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --header-h: 73px;
}
:root[data-theme="light"] {
  --accent-text: #4338ca; --tint: rgba(79, 70, 229, 0.08);
  --shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.3);
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header (same as setup.html) */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 13, 20, 0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; height: 72px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
}
.brand { text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 10px; }
.logo-text {
  font-weight: 700; font-size: 17px;
  background: linear-gradient(90deg, #fff, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#main-nav { margin-left: auto; display: flex; gap: 6px; }
#main-nav a { color: var(--muted); text-decoration: none; font-size: 13.5px; padding: 6px 14px; border-radius: 8px; }
#main-nav a:hover, #main-nav a.active { background: rgba(99, 102, 241, 0.15); color: var(--text); }
#main-nav a.active { font-weight: 600; color: var(--accent); }
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 8px; margin-left: auto;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.hamburger span { display: block; width: 100%; height: 2px; background: var(--text); border-radius: 2px; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-overlay { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.5); }
.nav-overlay.visible { display: block; }

/* Hero */
.hero {
  background: radial-gradient(ellipse 70% 60% at 50% -10%, rgba(99, 102, 241, 0.22), transparent 70%);
  padding: 72px 24px 40px; text-align: center;
}
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: #a5b4fc; background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  max-width: 780px; margin: 0 auto 18px;
}
.gradient {
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--muted); font-size: 1.125rem; max-width: 600px; margin: 0 auto 28px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 12px; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg, #fff, #e2e8f0); color: #0f172a; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* Overview: every feature at a glance */
.overview {
  max-width: 1200px; margin: 0 auto; padding: 16px 24px 72px; list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.overview a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.overview a:hover { border-color: var(--accent); transform: translateY(-2px); }
.overview strong { color: var(--text); font-size: 15px; }
.overview span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  color: var(--accent-text); background: var(--tint);
}

/* Tour: sticky feature list + content */
.layout {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 72px;
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 48px; align-items: start;
}
.toc { position: sticky; top: calc(var(--header-h) + 24px); }
.toc-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim);
  font-weight: 600; margin: 0 0 10px 12px;
}
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.toc a:hover { background: var(--surface); color: var(--text); }
.toc a.active { background: var(--tint); color: var(--text); }
.toc a.active .n { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.toc a.done .n { font-size: 0; }
.toc a.done .n::after { content: '✓'; font-size: 12px; }

.feature { margin-bottom: 88px; scroll-margin-top: calc(var(--header-h) + 24px); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.feature h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--text); margin-bottom: 6px; }
.lead { font-size: 1.125rem; font-weight: 500; color: var(--accent-text); margin-bottom: 14px; }
.feature p { color: var(--muted); max-width: 70ch; }
.feature .wins-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 24px; }
.wins { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 10px 0 32px; }
.wins li {
  position: relative; padding: 14px 16px 14px 46px; font-size: 14.5px; line-height: 1.5; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.wins li::before {
  content: '✓'; position: absolute; left: 14px; top: 14px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

/* Screenshots in a browser frame; the first one is full width, the rest pair up */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; }
.shots figure:first-child, .shots figure:nth-child(2):last-child { grid-column: 1 / -1; }
.shot {
  display: block; overflow: hidden; cursor: zoom-in; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.shot::before {
  content: ''; display: block; height: 24px; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 16px 12px, #f87171 4px, transparent 4.5px),
    radial-gradient(circle at 31px 12px, #fbbf24 4px, transparent 4.5px),
    radial-gradient(circle at 46px 12px, #34d399 4px, transparent 4.5px);
}
.shot:hover { border-color: var(--accent); transform: translateY(-2px); }
.shot img { display: block; width: 100%; height: auto; }
figcaption { font-size: 13.5px; color: var(--dim); text-align: center; margin-top: 10px; }
.shots { margin: 24px 0; }

/* Setup guide: instruction cards, lists, tips and code */
.feature > h3 { margin-top: 28px; }
.feature h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.feature :is(ol, ul:not(.wins)) { padding-left: 1.25rem; color: var(--muted); }
.feature :is(ol, ul:not(.wins)) li { margin-bottom: 6px; }
.feature strong { color: var(--text); font-weight: 600; }
.feature > p + p { margin-top: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin: 20px 0; }
.tip-box {
  background: rgba(139, 92, 246, 0.08); border-left: 3px solid var(--accent2);
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 20px 0; color: var(--text); font-size: 14px;
}
.tip-box > strong:first-child { color: #c4b5fd; margin-right: 6px; }
.code-block {
  background: #000; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px;
  font-family: ui-monospace, monospace; font-size: 13px; color: #a5b4fc; margin: 16px 0; overflow-x: auto;
}
code { font-family: ui-monospace, monospace; font-size: 0.92em; color: var(--accent-text); }
a.inline { color: var(--accent-text); }

/* Previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.pager a:hover { border-color: var(--accent); transform: translateY(-1px); }
.pager small { font-size: 12px; font-weight: 500; color: var(--dim); }
.pager .next { grid-column: 2; text-align: right; }

.cta {
  text-align: center; padding: 56px 24px; border-radius: 20px; border: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 24px);
  background: radial-gradient(ellipse 80% 90% at 50% 0%, rgba(99, 102, 241, 0.22), transparent 70%), var(--surface);
}
.cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 10px; }
.cta p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; }

/* Zoomed screenshot */
.zoom { margin: auto; border: 0; padding: 0; background: transparent; width: min(96vw, 1600px); max-width: none; cursor: zoom-out; }
.zoom::backdrop { background: rgba(5, 8, 15, 0.88); backdrop-filter: blur(4px); }
.zoom img { display: block; width: 100%; max-height: 84vh; object-fit: contain; border-radius: 10px; }
.zoom p { color: #e2e8f0; text-align: center; font-size: 14px; margin-top: 12px; }
.zoom p::after { content: ' · Click anywhere or press Esc to close'; color: #94a3b8; }

footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; color: var(--dim); font-size: 13px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand img { width: 32px; height: 32px; border-radius: 9px; }
footer a { color: var(--muted); text-decoration: none; margin: 0 10px; }
footer a:hover { color: #a5b4fc; }

@media (max-width: 1000px) {
  .overview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hamburger { display: flex; }
  #main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 45;
    flex-direction: column; padding: 16px; background: var(--surface);
    border-bottom: 1px solid var(--border); max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.3s, opacity 0.2s;
  }
  #main-nav.open { max-height: 280px; opacity: 1; }
  #main-nav a { padding: 12px 16px; }
  .header-inner { padding: 0 16px; }
  .hero { padding: 48px 16px 32px; }
  .overview { padding: 8px 16px 48px; gap: 10px; }
  .overview a { padding: 14px; }

  /* The feature list becomes a sticky, swipeable chip bar under the header */
  .layout { grid-template-columns: 1fr; gap: 0; padding: 0 16px 56px; }
  .toc {
    top: var(--header-h); z-index: 30; margin: 0 -16px 28px; padding: 10px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc-title { display: none; }
  .toc ol { flex-direction: row; gap: 8px; }
  .toc a { padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
  .feature, .cta { scroll-margin-top: calc(var(--header-h) + 72px); }
  .feature { margin-bottom: 64px; }
  .shots { grid-template-columns: 1fr; }
  .shots figure { grid-column: 1 / -1; }
}
/* Phones: overview shrinks to one-line rows; the tour below has the detail */
@media (max-width: 480px) {
  .overview { grid-template-columns: 1fr; gap: 8px; }
  .overview a { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
  .overview span:last-child { display: none; }
}
