/* Hermes iOS app tour. Plain CSS, no external fonts. */
.tour-page {
  --ink: #16161a;
  --ink-soft: #4a4a55;
  --ink-faint: #7b7b88;
  --paper: #f5f5f7;
  --card: #ffffff;
  --line: rgba(20, 20, 40, 0.1);
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --phone-h: min(840px, calc(100vh - 228px));
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, ui-sans-serif, sans-serif;
  min-width: 320px;
}
@supports (height: 100svh) {
  .tour-page { --phone-h: min(840px, calc(100svh - 228px)); }
}

.tour-page .skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 50;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}
.tour-page .skip-link:focus { left: 8px; }

/* ---------- site bar ---------- */
.tour-sitebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.tour-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.tour-brand strong { color: var(--accent); }
.tour-site-nav { display: flex; align-items: center; gap: 18px; font-size: 0.92rem; }
.tour-site-nav a { color: var(--ink-soft); text-decoration: none; }
.tour-site-nav a:hover { color: var(--ink); }
.tour-site-nav .official-link { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }

/* ---------- intro ---------- */
.tour-main { max-width: 1240px; margin: 0 auto; padding: 16px 20px 40px; }
.tour-intro { text-align: center; margin: 0 auto 14px; max-width: 720px; }
.tour-kicker { margin: 0 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.tour-intro h1 { max-width: none; margin: 0 auto; font-size: clamp(1.5rem, 2.4vw, 1.95rem); letter-spacing: -0.025em; line-height: 1.1; }
.tour-lede { text-wrap: balance; margin: 4px auto 0; color: var(--ink-soft); font-size: 0.93rem; line-height: 1.45; }

/* ---------- layout ---------- */
.tour-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 270px;
  gap: 28px;
  align-items: start;
}

/* ---------- directory ---------- */
.tour-directory {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 14px 10px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  scrollbar-width: thin;
}
.directory-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px 10px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: default;
}
.screen-count { font-weight: 500; letter-spacing: 0; text-transform: none; }
.directory-group h3 { margin: 12px 6px 4px; font-size: 0.72rem; font-weight: 600; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.directory-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.directory-item:hover { background: #f2f2f6; color: var(--ink); }
.directory-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- device ---------- */
.tour-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.device {
  --w: calc(var(--phone-h) * 633 / 1375);
  position: relative;
  width: calc(var(--w) + 24px);
  padding: 12px;
  border-radius: calc(var(--w) * 0.165);
  background: linear-gradient(145deg, #2c2c31, #0e0e10 45%, #1d1d21);
  box-shadow:
    0 0 0 1.5px #4a4a52 inset,
    0 0 0 4px #121214,
    0 30px 60px -18px rgba(20, 20, 40, 0.45),
    0 12px 24px -10px rgba(20, 20, 40, 0.3);
  outline: none;
}
.device-screen {
  position: relative;
  width: var(--w);
  aspect-ratio: 633 / 1375;
  overflow: hidden;
  border-radius: calc(var(--w) * 0.14);
  background: #fff;
  isolation: isolate;
}
.screen-loading { margin: 0; padding: 40% 12% 0; color: var(--ink-faint); text-align: center; font-size: 0.9rem; }
.screen-pane { position: absolute; inset: 0; animation: pane-in 0.22s ease-out both; }
.screen-pane.is-back { animation-name: pane-back; }
@keyframes pane-in { from { opacity: 0; transform: translateX(5%); } to { opacity: 1; transform: none; } }
@keyframes pane-back { from { opacity: 0; transform: translateX(-5%); } to { opacity: 1; transform: none; } }
.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.viewport.scrolls { overflow-y: auto; }
.viewport::-webkit-scrollbar { display: none; }
.canvas { position: relative; width: 100%; }
.canvas > img.base, .top-strip, .layer-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.fixed-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.top-strip, .layer-img { position: absolute; left: 0; top: 0; }
/* iOS-style scroll edge: content fades softly under the pinned bar */
.top-strip { -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
.fixed-layer .hotspot { pointer-events: auto; }

/* hotspots */
.hotspot {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.hotspot:hover { background: rgba(79, 70, 229, 0.08); }
.hotspot:active { background: rgba(20, 20, 40, 0.12); }
.hotspot:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -2px; }
.hotspot.backdrop { border-radius: 0; z-index: 1; }
.hotspot.backdrop:hover, .hotspot.backdrop:active { background: transparent; }
.show-targets .hotspot:not(.backdrop) { background: rgba(79, 70, 229, 0.14); box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.65); }
.hotspot.pulse { animation: pulse 1.6s ease-in-out 3; }
@keyframes pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(79, 70, 229, 0); }
  50% { box-shadow: inset 0 0 0 3px rgba(79, 70, 229, 0.7); background: rgba(79, 70, 229, 0.12); }
}

/* demo overlays */
.typing-field, .timer-patch { position: absolute; z-index: 4; display: flex; align-items: center; white-space: nowrap; overflow: hidden; pointer-events: none; }
.typing-field { color: #1c1c1e; }
.typing-field::after { content: ""; width: 1.5px; height: 1.1em; margin-left: 1px; background: #4f46e5; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.timer-patch { justify-content: flex-end; color: #8a8a8e; font-variant-numeric: tabular-nums; }
.stream-bubble { position: absolute; z-index: 2; overflow: hidden; pointer-events: none; }
.stream-bubble > img { position: absolute; max-width: none; }
.stream-mask { position: absolute; pointer-events: none; }

.stage-hint { margin: 2px 0 0; color: var(--ink-faint); font-size: 0.85rem; text-align: center; min-height: 1.2em; }

/* ---------- guide ---------- */
.tour-guide {
  position: sticky;
  top: 84px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.guide-group { margin: 0 0 4px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tour-guide h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.guide-desc { margin: 8px 0 16px; color: var(--ink-soft); line-height: 1.5; font-size: 0.95rem; }
.guide-actions { display: flex; gap: 8px; }
.guide-button {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.guide-button:hover { background: #f4f4f8; }
.guide-button-primary { border-color: transparent; background: var(--ink); color: #fff; }
.guide-button-primary:hover { background: #2b2b33; }
.guide-button:disabled { opacity: 0.45; cursor: default; }
.guide-demo {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.guide-demo:hover { background: #e2e5ff; }
.guide-toggle { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--ink-soft); font-size: 0.9rem; cursor: pointer; }
.guide-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.guide-keys { margin: 12px 0 0; color: var(--ink-faint); font-size: 0.8rem; }
.guide-keys kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #fafafa; font: inherit; font-size: 0.75rem; }

/* ---------- notes & footer ---------- */
.tour-notes { max-width: 760px; margin: 36px auto 0; color: var(--ink-faint); font-size: 0.85rem; line-height: 1.55; text-align: center; }
.tour-notes p { margin: 6px 0; }
.tour-notes a { color: var(--ink-soft); }
.noscript-note { text-align: center; color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .tour-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .tour-directory { grid-column: 1 / -1; position: static; max-height: none; order: 3; }
  .directory-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); column-gap: 10px; }
}
@media (max-width: 760px) {
  .tour-page { --phone-h: min(720px, calc(100vh - 196px), calc((100vw - 64px) * 1375 / 633)); }
  .tour-sitebar { padding: 10px 14px; }
  .tour-brand { font-size: 0.95rem; white-space: nowrap; }
  .tour-brand img { width: 24px; height: 24px; }
  .tour-site-nav .official-link { padding: 6px 10px; font-size: 0.82rem; white-space: nowrap; }
  .tour-lede { display: none; }
  .tour-main { padding: 14px 14px 32px; }
  .tour-site-nav a:not(.official-link) { display: none; }
  .tour-intro { margin-bottom: 14px; }
  .tour-lede { font-size: 0.95rem; }
  .tour-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .tour-guide { position: static; order: 2; }
  .tour-directory { order: 3; padding: 10px; }
  .directory-toggle { cursor: pointer; padding: 8px 6px; }
  .directory-toggle::after { content: "▾"; margin-left: 6px; }
  .directory-toggle[aria-expanded="true"]::after { content: "▴"; }
  .directory-list { display: none; grid-template-columns: 1fr 1fr; }
  .directory-list.open { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-pane, .hotspot.pulse, .typing-field::after { animation: none; }
}
