/* Find a pint (/find/here/). Tokens only, dark by default (DARK.md).
   finder.js sets data-state (start, live, noloc), data-compass (on, off) and
   data-arrived on .fh, --pace on the dial and --turn on the arrow. Live on a
   phone, the stage covers the screen (html.fh-full). */

.fh { padding: 0; }
.fh__stage { display: grid; align-items: center; min-height: calc(100svh - var(--header-h) - 34px); padding: clamp(28px, 5vw, 56px) var(--gutter); }
.fh__panel { width: min(100%, 620px); margin-inline: auto; text-align: center; }
.fh__panel[hidden] { display: none; }
.fh .h1 { color: var(--brand); }
.fh__lede { margin: 14px auto 0; font-size: clamp(1.1875rem, 2.4vw, 1.4375rem); }

/* Where to: the taproom, or the nearest place that pours */
.fh__pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0 0; padding: 0; border: 0; min-inline-size: 0; text-align: left; }
html:not(.js) .fh__pick { display: none; }
.fh__pick-h { grid-column: 1 / -1; margin: 0 0 8px; padding: 0; font-weight: 700; font-size: 1rem; text-align: center; }
.fh__pick-opt { position: relative; display: block; }
.fh__pick-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fh__pick-t { display: grid; gap: 2px; height: 100%; min-height: 64px; padding: 12px 16px; border: 2px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); }
.fh__pick-t strong { font-weight: 700; }
.fh__pick-t span { font-size: .9375rem; color: var(--muted); }
.fh__pick-opt input:hover + .fh__pick-t { border-color: var(--fg); }
.fh__pick-opt input:checked + .fh__pick-t { border-color: var(--sun); background: color-mix(in oklab, var(--sun) 12%, var(--surface)); }
.fh__pick-opt input:focus-visible + .fh__pick-t { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 420px) { .fh__pick { grid-template-columns: 1fr; } }

/* Where it will take you */
.fh__target { margin: 26px auto 0; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 8px; justify-items: center; }
.fh__target-to { margin: 0; font-weight: 600; }
.fh__when { margin: 0; font-weight: 700; color: var(--fg); }
.fh__when::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--warn); vertical-align: .05em; }
.fh__when[data-open="true"]::before { background: var(--ok); }
.fh__when[data-open="unknown"]::before { display: none; }

.fh__go { margin: 26px 0 0; }
.fh__start-btn { min-height: 64px; min-width: 220px; font-size: 1.25rem; }
.fh__start-btn svg { width: 22px; height: 22px; }
/* The Start button needs JavaScript; the note about phones shows on a mouse or trackpad. */
html:not(.js) .fh__go, html.js .fh__nojs { display: none; }
.fh__desk, .fh__nojs { margin: 14px auto 0; font-weight: 600; }
.fh__desk { display: none; }
@media (pointer: fine) { .fh__desk { display: block; } }
.fh__alt { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; margin: 22px 0 0; }
.fh__alt svg, .fh__dirs svg { width: 18px; height: 18px; }
.fh__privacy { margin: 22px 0 0; font-size: .9375rem; color: var(--muted); }

/* ---- Live ---- */
.fh__live { display: grid; gap: clamp(10px, 2.2vh, 20px); justify-items: center; }
.fh__top { width: 100%; display: grid; justify-items: center; gap: 8px; }
.fh__stop { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border: 2px solid var(--line-strong); border-radius: var(--radius-pill); background: transparent; color: var(--fg); font: inherit; font-weight: 700; cursor: pointer; }
.fh__stop svg { width: 18px; height: 18px; }
.fh__stop:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fh__head { display: grid; gap: 6px; justify-items: center; }
.fh__to { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 1.25rem; line-height: 1.2; }
.fh__to:focus { outline: none; }

.fh__dial { --pace: 2.4s; position: relative; width: min(74vw, 46vh, 360px); aspect-ratio: 1; display: grid; place-items: center; }
.fh__ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in oklab, var(--sun) 55%, transparent); opacity: 0; }
.fh__arrow { position: relative; width: 52%; height: 52%; fill: var(--sun); transform: rotate(var(--turn, 0deg)); filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55)); }
.fh__north { position: absolute; top: 8%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cream); color: var(--ground); font-weight: 800; font-size: .9375rem; }
.fh__north[hidden] { display: none; }
.fh[data-compass="off"] .fh__arrow { width: 36%; height: 36%; }
.fh[data-compass="off"] .fh__dial::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 2px solid var(--line-strong); }
.fh__pint { position: absolute; width: 40%; height: 40%; opacity: 0; color: var(--sun-ink); }
.fh__burst { position: absolute; inset: 0; pointer-events: none; }
.fh__burst i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--cream); opacity: 0; }

/* The readout */
.fh__read { display: grid; gap: 4px; justify-items: center; min-height: 9.5rem; align-content: start; }
.fh__dist { margin: 0; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(4rem, 19vw, 7.5rem); line-height: .9; color: var(--brand); font-variant-numeric: tabular-nums; }
.fh__dir { margin: 0; font-weight: 700; font-size: 1.1875rem; }
.fh__dir[hidden] { display: none; }
.fh__acc { margin: 0; font-weight: 600; font-size: .9375rem; color: var(--warn); }
.fh__acc[hidden], .fh__arrived[hidden] { display: none; }
.fh__arrived { margin: 4px 0 0; font-family: var(--font-warm); font-size: clamp(1.375rem, 5vw, 1.75rem); line-height: 1.15; }

.fh__actions { display: flex; justify-content: center; }
.fh__dirs { min-height: 56px; padding-inline: 28px; font-size: 1.125rem; }
.fh__notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .875rem; color: var(--muted); }
.fh__notes li[hidden] { display: none; }

/* Arrived: the stage turns Parish yellow and the arrow becomes a pint */
.fh[data-arrived="true"] .fh__stage { background: var(--sun); color: var(--sun-ink); --fg: var(--sun-ink); --muted: var(--sun-ink); --focus: var(--sun-ink); --line-strong: color-mix(in oklab, var(--sun-ink) 45%, transparent); --btn-bg: var(--sun-ink); --btn-ink: var(--sun); }
.fh[data-arrived="true"] .fh__dist { color: var(--sun-ink); }
.fh[data-arrived="true"] .fh__arrow, .fh[data-arrived="true"] .fh__north, .fh[data-arrived="true"] .fh__dial::before { opacity: 0; }
.fh[data-arrived="true"] .fh__pint { opacity: 1; }
.fh[data-arrived="true"] .fh__ring { border-color: color-mix(in oklab, var(--sun-ink) 40%, transparent); }
.fh[data-arrived="true"] .fh__when::before { box-shadow: 0 0 0 2px var(--sun-ink); }
.fh[data-arrived="true"] .fh__burst i { background: var(--sun-ink); }

/* No location */
.fh__noloc .lede { margin: 14px auto 0; }
.fh__noloc .h2:focus { outline: none; }
.fh__noloc [data-retry][hidden] { display: none; }

/* Phones: live, the finder takes the whole screen */
@media (max-width: 767px) {
  html.fh-full { overflow: clip; }
  html.fh-full .fh__stage { position: fixed; inset: 0; z-index: 200; min-height: 0; overflow: auto; overscroll-behavior: none; background: var(--ground); padding: max(16px, env(safe-area-inset-top)) var(--gutter) max(16px, env(safe-area-inset-bottom)); }
  html.fh-full .fh[data-arrived="true"] .fh__stage { background: var(--sun); }
}

/* ---- Motion: the radar pulse (full motion only; quickens as you close
   in through --pace), and a small burst on arrival. Reduced motion shows
   two still rings and no burst; the arrow still turns. ---- */
html[data-motion="reduce"] .fh__ring:nth-child(1) { opacity: .5; transform: scale(.62); }
html[data-motion="reduce"] .fh__ring:nth-child(2) { opacity: .3; transform: scale(.94); }
@keyframes fh-pulse { from { transform: scale(.3); opacity: .9; } to { transform: scale(1); opacity: 0; } }
@keyframes fh-burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-170px) scale(.4); } }
@keyframes fh-pint { 0% { transform: scale(.4) rotate(-12deg); } 60% { transform: scale(1.12) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
html[data-motion="full"]:not(.save-data) .fh[data-state="live"] .fh__ring { animation: fh-pulse var(--pace) cubic-bezier(.2, .6, .3, 1) infinite; }
html[data-motion="full"]:not(.save-data) .fh[data-state="live"] .fh__ring:nth-child(2) { animation-delay: calc(var(--pace) / -3); }
html[data-motion="full"]:not(.save-data) .fh[data-state="live"] .fh__ring:nth-child(3) { animation-delay: calc(var(--pace) / -1.5); }
html[data-motion="full"] .fh.is-cheering .fh__burst i { animation: fh-burst .9s var(--ease-out) both; }
html[data-motion="full"] .fh.is-cheering .fh__pint { animation: fh-pint .7s var(--ease-out) both; }
html[data-motion="full"] .fh__pint { transition: opacity .3s; }
html.save-data .fh__ring:nth-child(1) { opacity: .5; transform: scale(.62); }
html.save-data .fh__ring:nth-child(2) { opacity: .3; transform: scale(.94); }
