/* ==========================================================================
   /help/: how to use the app, step by step, with pictures.

   Page-scoped: every selector starts hp-, so nothing here can reach another
   page. Colours come from the site's tokens (css/styles.css) except the
   guide ring, which is the demo's blue on purpose: every button in the
   product is gold, and a gold ring around a gold button reads as the button.

   The reader is 55+, often on a phone, holding a box of prints. So: one
   thing at a time, 18px body text, captions a notch bigger, and nothing to
   press that is under 44px tall.
   ========================================================================== */

:root {
  --hp-ring: #2B6CB0;
  --hp-ring-ink: #FFFFFF;
  --hp-ring-halo: rgba(43, 108, 176, 0.42);
  --hp-ring-fade: rgba(43, 108, 176, 0);
  --hp-stage: #EFE6D6;
  --hp-tile: #FFFDF8;
  --hp-tile-hover: #FFF8EA;
}

[data-theme="dark"] {
  --hp-ring: #8FBDF0;
  --hp-ring-ink: #10233A;
  --hp-ring-halo: rgba(143, 189, 240, 0.4);
  --hp-ring-fade: rgba(143, 189, 240, 0);
  --hp-stage: #221D19;
  --hp-tile: #262220;
  --hp-tile-hover: #2E2925;
}

/* 16px gutters on a phone: the site default (1.2rem = 21.6px) leaves the
   screenshots too narrow to read at 390px. */
@media (max-width: 640px) {
  .hp-hero .container,
  .hp-ways .container,
  .hp-path .container,
  .hp-section .container,
  .hp-stuck .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------------------------------------------------------------- Hero -- */

.hp-hero {
  padding: 3.2rem 0 2.4rem;
  text-align: center;
  position: relative;
}

.hp-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.hp-hero h1 {
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.12;
  margin-bottom: 0.6rem;
}

.hp-lede {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0 auto 0.6rem;
  max-width: 34ch;
}

/* The header's Help link lands on this page, so the FAQ and a person are
   named right under the lede for anyone who came with a question rather
   than a task. */
.hp-asklines {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 auto 2rem;
}

.hp-asklines a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- the search box ---- */

.hp-search {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  text-align: left;
}

.hp-search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hp-search__field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 1.1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hp-search__field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-warm);
}

.hp-search__icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--text-muted);
}

.hp-search__input {
  flex: 1;
  min-width: 0;
  height: 60px;
  border: none;
  outline: none;
  background: none;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}

.hp-search__input::placeholder { color: var(--text-muted); }
.hp-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.hp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  justify-content: center;
}

.hp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.3rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--hp-tile);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.hp-chip:hover,
.hp-chip:focus-visible {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.hp-chip--path b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFDF8;
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

/* ---- the results panel ---- */

.hp-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 40;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.hp-results[hidden] { display: none; }

.hp-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 56px;
  padding: 0.65rem 1rem;
  border: none;
  border-top: 1px solid var(--border-light);
  background: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.hp-result:first-child { border-top: none; }

.hp-result:hover,
.hp-result.is-cursor {
  background: var(--accent-light);
  text-decoration: none;
}

.hp-result__title { flex: 1; min-width: 0; }
.hp-result__title b { color: var(--accent); font-weight: 700; }

.hp-result__where {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hp-result__step {
  flex: none;
  min-width: 4.2rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.hp-result__step.is-empty { background: none; }

/* ------------------------------------------------------- Two ways in ---- */

.hp-ways { padding: 2.6rem 0 1rem; }

.hp-ways__grid {
  display: grid;
  gap: 2.4rem;
}

@media (min-width: 900px) {
  .hp-ways__grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

.hp-ways h2 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.hp-ways__line {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.1rem;
}

/* ---- nine numbered path tiles ---- */

.hp-ptiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.hp-ptile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 56px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--hp-tile);
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color 0.18s, border-color 0.18s, transform 0.18s;
}

.hp-ptile:hover,
.hp-ptile:focus-visible {
  background: var(--hp-tile-hover);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateX(3px);
}

.hp-ptile__num {
  flex: none;
  width: 2.1rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.hp-ptile__text { display: block; min-width: 0; }

.hp-ptile__title {
  display: block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.02rem;
}

.hp-ptile__line {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ---- one tile per part of the app ---- */

.hp-stiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 0.5rem;
}

.hp-stile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  min-height: 56px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--hp-tile);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.18s, border-color 0.18s;
}

.hp-stile:hover,
.hp-stile:focus-visible {
  background: var(--hp-tile-hover);
  border-color: var(--accent);
  text-decoration: none;
}

.hp-stile__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
}

.hp-stile__glyph { width: 21px; height: 21px; }

.hp-stile__text { display: block; min-width: 0; }

.hp-stile__name {
  display: block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.98rem;
}

.hp-stile__line {
  display: block;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text-muted);
  margin-top: 0.08rem;
}

/* ------------------------------------------------------- The sections --- */

.hp-path,
.hp-section { padding: 3.4rem 0; }

.hp-path h2 {
  font-size: clamp(1.7rem, 4.4vw, 2.2rem);
  margin-bottom: 0.4rem;
}

.hp-section__head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.hp-section__head h2 {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  margin: 0;
}

.hp-section__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
}

.hp-section__glyph { width: 25px; height: 25px; }

.hp-section__line {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0.15rem 0 0;
}

.hp-path .hp-section__line { margin-bottom: 2rem; }

/* ---- "on the path" chips back to the nine ---- */

.hp-onpath {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.8rem;
}

.hp-onpath__label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hp-onpath__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ------------------------------------------------------------ A topic --- */

.hp-topics {
  display: grid;
  gap: 2.6rem;
}

.hp-topic {
  padding-top: 0.2rem;
  border-radius: var(--radius-lg);
  transition: box-shadow 0.4s ease;
}

.hp-topic.is-target {
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 0 1px var(--accent);
}

.hp-topic__head { margin-bottom: 0.9rem; }

.hp-steppill {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.5rem;
}

.hp-topic__head h3 {
  font-size: clamp(1.3rem, 3.6vw, 1.6rem);
  line-height: 1.2;
  margin: 0;
}

.hp-topic__line {
  color: var(--text-secondary);
  font-size: 1.02rem;
  margin: 0.3rem 0 0;
  max-width: 52ch;
}

.hp-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

@media (min-width: 880px) {
  .hp-guide {
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr);
    gap: 1.8rem;
    align-items: start;
  }
}

.hp-player { margin: 0; }

/* ---- the stage ---- */

.hp-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--hp-stage);
  box-shadow: var(--shadow-sm);
}

/* The iPhone shots are 640x1386. A 16:10 stage would print them the size of
   a postage stamp, so that one player wears the phone's own shape and is
   capped at a hand's width. */
.hp-player--portrait .hp-stage {
  aspect-ratio: 640 / 1386;
  max-width: 264px;
  margin: 0 auto;
}

.hp-player--portrait .hp-controls { justify-content: center; }
.hp-player--portrait .hp-ctl--play { margin-left: 0; }

.hp-stage__layer {
  position: absolute;
  inset: 0;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hp-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hp-frame.is-active { opacity: 1; }

/* A frame the capture lane has not shot yet: hold the space, say so, and
   never pretend there is a picture. */
.hp-frame[data-hp-missing] {
  background: repeating-linear-gradient(
    135deg,
    var(--bg-accent),
    var(--bg-accent) 12px,
    var(--bg-warm) 12px,
    var(--bg-warm) 24px
  );
}

/* ---- the ring ---- */

.hp-ring {
  position: absolute;
  display: none;
  box-sizing: border-box;
  border: 3px solid var(--hp-ring);
  border-radius: 10px;
  pointer-events: none;
  animation: hp-pulse 1.6s ease-out infinite;
}

.hp-ring.is-on { display: block; }

/* The numbered chip hangs BESIDE the ring, level with its top edge and
   clear of it, so it never covers the thing it points at: on a small target
   (a year on the rail, a Yes, a tick box) a chip over the corner used to hide
   the target whole once the picture zoomed. On the left by default; on the
   right when the target sits against the left of the picture; inside the
   ring only when there is room on neither side, which only a target as wide
   as the picture has, and there the chip covers nothing that matters. */
.hp-ring b {
  position: absolute;
  top: -13px;
  left: -32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--hp-ring);
  color: var(--hp-ring-ink);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.hp-ring--side-right b { left: auto; right: -32px; }
.hp-ring--tuck-x b { left: 3px; right: auto; }
.hp-ring--tuck-y b { top: 3px; }

@keyframes hp-pulse {
  0% { box-shadow: 0 0 0 0 var(--hp-ring-halo); }
  70% { box-shadow: 0 0 0 15px var(--hp-ring-fade); }
  100% { box-shadow: 0 0 0 0 var(--hp-ring-fade); }
}

/* ---- back / dots / next / play ---- */

.hp-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.hp-ctl {
  min-height: 44px;
  padding: 0 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--hp-tile);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
}

.hp-ctl:hover:not(:disabled),
.hp-ctl:focus-visible {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.hp-ctl:disabled { opacity: 0.4; cursor: default; }

.hp-ctl--play { margin-left: auto; }
.hp-ctl--play[aria-pressed="true"] {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.hp-dots {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.hp-dot {
  width: 30px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
}

.hp-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--border);
  transition: background-color 0.2s, transform 0.2s;
}

.hp-dot:hover::after { background: var(--text-muted); }

.hp-dot.is-active::after {
  background: var(--accent);
  transform: scale(1.35);
}

/* ---- the captions beside the picture ---- */

.hp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  counter-reset: none;
}

.hp-stepbtn {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.hp-stepbtn--static { cursor: default; }

button.hp-stepbtn:hover {
  background: var(--hp-tile-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.hp-stepbtn.is-active {
  background: var(--hp-tile);
  border-color: var(--border);
  color: var(--text-primary);
  font-weight: 600;
}

.hp-stepbtn__num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: var(--bg-accent);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
}

.hp-stepbtn.is-active .hp-stepbtn__num {
  background: var(--hp-ring);
  color: var(--hp-ring-ink);
}

.hp-stepbtn__text { min-width: 0; }

/* ------------------------------------------------------- The Mac apps --- */

.hp-apps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

/* Three cards: one column, then three across from 900px. Two across would
   leave the third alone on a row. */
@media (min-width: 900px) {
  .hp-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.hp-app {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  height: 100%;
  padding: 1.1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--hp-tile);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.18s, border-color 0.18s;
}

.hp-app:hover,
.hp-app:focus-visible {
  background: var(--hp-tile-hover);
  border-color: var(--accent);
  text-decoration: none;
}

.hp-app__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

/* A column, so the link sits on the card's bottom edge and the three links
   line up whatever the length of the line above them. */
.hp-app__text {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
}

.hp-app__name {
  display: block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.05rem;
}

.hp-app__line {
  display: block;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0.2rem 0 0.4rem;
}

.hp-app__go {
  display: block;
  margin-top: auto;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------------------------------------------------------- Still stuck - */

.hp-stuck {
  padding: 3.4rem 0 4.4rem;
  text-align: center;
  background-color: var(--bg-warm);
}

.hp-stuck h2 {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  margin-bottom: 0.4rem;
}

.hp-stuck__line {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hp-stuck__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.hp-stuck__buttons .btn { min-height: 52px; }

@media (max-width: 520px) {
  .hp-stuck__buttons .btn {
    width: 100%;
    max-width: 22rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ------------------------------------------------------- Reduced motion - */

@media (prefers-reduced-motion: reduce) {
  .hp-ring { animation: none; box-shadow: none; }
  .hp-stage__layer { transition: none; }
  .hp-frame { transition: none; }
  .hp-ptile:hover { transform: none; }
  .hp-topic { transition: none; }
}
