/* JimGO Taxis: areas we cover. Surfaces square, buttons pill (design-plan.md). */

/* ---------- opener: town names pass like road signs, villages run along the foot ---------- */
.ao { position: relative; min-height: max(540px, 62svh); padding-top: calc(var(--head-h) + clamp(10px, 2.4vh, 32px)); display: flex; flex-direction: column; overflow: clip; isolation: isolate; background: radial-gradient(60% 80% at 78% 40%, rgba(232, 169, 65, .12), transparent 62%), linear-gradient(180deg, var(--tarmac), #1A1917); }
.ao::before { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: repeating-linear-gradient(-62deg, rgba(251, 229, 193, .028) 0 2px, transparent 2px 38px); animation: ao-hatch 18s linear infinite; }
@keyframes ao-hatch { to { background-position: 120px 0; } }
.ao-in { flex: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(28px, 4vw, 72px); align-items: center; padding-bottom: clamp(22px, 4vh, 44px); }
.ao-h1 { font-size: clamp(2.6rem, 4.6vw, 4.6rem); line-height: 1.02; margin-bottom: .14em; display: flow-root; }
/* masks reach out to the left only, so the heading is never wider than its own box */
.ao-m, .ao-slot { display: block; margin: 0 0 -.7em -.15em; padding: .2em .15em .5em; }
.ao-m { overflow: clip; }
.ao-m:first-child { margin-top: -.2em; }
.ao-m:last-child { margin-bottom: -.5em; }
.ao-slot { position: relative; display: grid; clip-path: inset(.17em -.2em .4em 0); }
.ao-slot > .ao-w { grid-area: 1 / 1; justify-self: start; }
.ao-w.is-parked { visibility: hidden; }
.ao-ch { white-space: pre; }
.ao-l { display: block; white-space: nowrap; }
.ao-w { display: inline-block; will-change: transform; }
.ao-tail { font-size: .5em; font-weight: 700; font-stretch: 96%; color: var(--cream); padding-top: .25em; }
.ao-lane { display: block; position: relative; height: 5px; margin: 20px 0 22px; overflow: hidden; background: rgba(251, 229, 193, .08); }
.ao-lane i { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--amber) 0 44px, transparent 44px 78px); background-size: 78px 5px; }
.ao .lede { margin-bottom: 1.4em; }

.ao-pair { position: relative; height: clamp(300px, 44vh, 430px); }
.ao-ph { position: absolute; margin: 0; background: var(--asphalt); box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .9); will-change: transform; }
.ao-a { left: 0; top: 0; width: 76%; height: 72%; }
.ao-a::before { content: ''; position: absolute; inset: 0; transform: translate(-16px, -16px); border: 2px solid var(--amber); z-index: -1; pointer-events: none; }
.ao-b { right: 0; bottom: 0; width: 52%; height: 60%; outline: 10px solid #1C1B19; }
.ao-img { position: absolute; inset: 0; overflow: hidden; }
.ao-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); will-change: transform; }
.ao-ph figcaption { position: absolute; left: 0; bottom: 0; padding: 8px 14px; background: rgba(18, 17, 16, .86); color: var(--text); font-size: .9rem; border-left: 3px solid var(--amber); }

.ao-foot { position: relative; }
.ao-marquee { padding: 2px 0; background: rgba(14, 13, 12, .55); }
.ao-marquee .marquee-track span, .ao-marquee .marquee-track span:nth-child(even) { font: 500 1.1rem/1 var(--body); font-stretch: 100%; color: var(--fog); -webkit-text-stroke: 0; padding: 15px 0; }
.ao-marquee .marquee-track span i { color: var(--amber); padding: 0 1.1em; }
/* the village marquee shows once the web fonts are in, so its names never shift as the fonts arrive */
@media (prefers-reduced-motion: no-preference) { html.js:not(.reveal-all) .ao-marquee:not(.is-ready) { visibility: hidden; } }

/* hidden start states (JS only) */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.reveal-all) .ao-h1 .ao-l { transform: translateY(140%); }
  html.js:not(.reveal-all) .ao-ph { clip-path: inset(0 100% 0 0); }
}

/* ---------- set piece: the town finder ---------- */
.af { overflow: clip; padding-block: clamp(36px, 5vh, 80px); }
.af .af-head { align-items: flex-end; margin-bottom: clamp(18px, 2.6vh, 28px); }
.af-head .af-search { flex: 0 1 420px; }
.af-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(28px, 4vw, 72px); align-items: start; }
.af-map-col { position: sticky; top: 104px; }
.af-map { position: relative; height: min(calc(100svh - 310px), 640px); min-height: 420px; background: var(--sea); overflow: hidden; border: 1px solid rgba(251, 229, 193, .1); }
.af-map svg { width: 100%; height: 100%; }
.af-svg { --k: 1.25; }
.af-svg .m-coastline, .af-svg .m-contour, .af-svg .m-border, .af-svg .m-river, .af-svg .m-rail, .af-svg .m-road { vector-effect: non-scaling-stroke; }
.af-svg .m-town, .af-svg .m-town:not(.is-major) { display: inline; }
.af-svg .m-town text, .af-svg .m-town[data-town] text { transform: none; }
.af-svg .m-town text { font-size: calc(14.5px * var(--k)); stroke-width: calc(4px * var(--k)); transition: fill .4s; }
.af-svg .m-town.is-major text { font-size: calc(17px * var(--k)); }
.af-svg .m-dot { r: calc(3.4px * var(--k)); transition: fill .4s; }
.af-svg .m-town.is-major .m-dot { r: calc(5px * var(--k)); stroke-width: calc(2px * var(--k)); }
.af-svg .m-town.is-lit text { fill: var(--amber); font-weight: 600; }
.af-svg .m-town.is-lit .m-dot { fill: var(--amber); }
.af-svg .m-region { font-size: calc(20px * var(--k)); }
.af-svg .m-town.is-out { visibility: hidden; }
.af-ring { fill: none; stroke: var(--amber); opacity: 0; pointer-events: none; }
.af-reset { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid rgba(251, 229, 193, .3); background: none; color: var(--cream); font-weight: 600; cursor: pointer; transition: border-color .3s, color .3s; }
.af-reset:hover { border-color: var(--amber); color: var(--amber); }
.no-js .af-reset { display: none; }

.af-search label { color: var(--cream); }
.af-search input { background: var(--asphalt); color: var(--cream); border-color: rgba(251, 229, 193, .2); }
.af-search input::placeholder { color: rgba(184, 177, 165, .8); }
.no-js .af-search { display: none; }
.af-card { position: relative; margin: 0 0 18px; padding: 18px 22px; background: var(--asphalt); border-left: 4px solid var(--amber); overflow: hidden; isolation: isolate; }
.af-card::after { content: ''; position: absolute; z-index: -1; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 2px dashed rgba(232, 169, 65, .18); animation: af-spin 36s linear infinite; }
@keyframes af-spin { to { transform: rotate(360deg); } }
.af-name { font-size: clamp(1.5rem, 2vw, 1.95rem); line-height: 1.08; margin-bottom: 4px; }
.af-meta { margin: 0 0 6px; color: var(--amber); font-weight: 600; font-size: .95rem; }
.af-line { color: var(--text); margin-bottom: 12px; }
.af-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
/* each group's name starts its own row of chips, so the panel stays one screen tall */
.af-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.af-group + .af-group { margin-top: 10px; }
.af-gh { font: 700 1.02rem/1.2 var(--display); font-stretch: 92%; color: var(--amber); margin: 0 6px 0 0; }
.af-chips { display: contents; }
.af-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 15px; border-radius: 999px; border: 1px solid rgba(251, 229, 193, .24); color: var(--cream); text-decoration: none; font-weight: 500; font-size: .96rem; transition: background-color .3s, color .3s, border-color .3s; }
.af-chip:hover { border-color: var(--amber); color: var(--amber); }
.af-chip.is-on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.af-chips li.is-hide { display: none; }
.af-group.is-hide { display: none; }
.af-none { margin: 10px 0 0; color: var(--fog); }

/* ---------- gazetteer (paper) ---------- */
.gz { overflow: clip; isolation: isolate; }
.gz::before { content: ''; position: absolute; z-index: -1; right: -12%; top: -20%; width: 70%; height: 130%; pointer-events: none; background: repeating-radial-gradient(circle at 80% 30%, rgba(29, 28, 26, .055) 0 1.5px, transparent 1.5px 42px); animation: gz-drift 24s ease-in-out infinite alternate; }
@keyframes gz-drift { to { transform: translate(-4vw, 3vh) scale(1.06); } }
/* the gazetteer flows in rows: the towns, then the villages, each in columns that read down */
.gz-cols { display: grid; gap: clamp(30px, 5vh, 52px); }
.gz-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; margin-bottom: 4px; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 3px no-repeat; font-size: clamp(1.6rem, 2.2vw, 2rem); line-height: 1.1; }
.gz-h b { font: 820 1.6em/1 var(--display); font-stretch: 78%; color: #A86F12; }
.gz-list { list-style: none; margin: 0; padding: 0; }
.gz-list { columns: 4; column-gap: clamp(24px, 3vw, 44px); }
.gz-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 0 10px; padding: 12px 0 4px; border-bottom: 1px solid rgba(29, 28, 26, .14); break-inside: avoid; }
.gz-letter { font: 820 2.1rem/1 var(--display); font-stretch: 78%; color: #A86F12; padding-top: 2px; }
.gz-name { font: 760 1.3rem/1.1 var(--display); font-stretch: 90%; color: var(--ink); margin: 2px 0 4px; }
.gz-body p { margin: 0; color: #3A362F; font-size: 1rem; line-height: 1.5; }
.gz-body .gz-go { display: flex; flex-wrap: wrap; gap: 0 20px; }
.gz-go a { display: inline-flex; align-items: center; min-height: 44px; color: #8A5A0E; font-weight: 600; font-size: .96rem; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 0 2px no-repeat; transition: background-size .4s var(--ease); }
.gz-go a:hover { background-size: 100% 2px; }
.gz-item { transition: background-color 1.2s var(--ease); }
.gz-item:target, .gz-item.is-glow { background: rgba(232, 169, 65, .16); }

/* ---------- the six location pages: panels that open out ---------- */
.lc { overflow: clip; }
.lc-panels { display: flex; gap: 12px; height: min(60vh, 520px); }
.lc-p { flex: 1 1 0; min-width: 0; transition: flex-grow .8s var(--ease); }
.lc-p.is-on { flex-grow: 2.3; }
.lc-a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; overflow: hidden; color: var(--cream); text-decoration: none; isolation: isolate; background: var(--asphalt); }
.lc-img { position: absolute; inset: -6% 0; z-index: -2; overflow: hidden; }
.lc-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.2s var(--ease); }
.lc-p.is-on .lc-img img { transform: scale(1.16); }
.lc-a::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(18, 17, 16, .94) 0%, rgba(18, 17, 16, .5) 44%, rgba(18, 17, 16, .05) 75%); }
.lc-a::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--amber); transform: scaleX(0); transform-origin: 0 50%; transition: transform .7s var(--ease); }
.lc-p.is-on .lc-a::after { transform: scaleX(1); }
.lc-body { display: grid; gap: 6px; padding: 20px 20px 18px; }
.lc-t { font: 760 clamp(1.2rem, 1.55vw, 1.55rem)/1.08 var(--display); font-stretch: 88%; }
.lc-l { color: var(--text); font-size: .95rem; line-height: 1.45; }
.lc-go { display: inline-flex; align-items: center; gap: .45em; color: var(--amber); font-weight: 600; font-size: .95rem; }
.lc-go .ic { transition: transform .35s var(--ease); }
.lc-a:hover .lc-go .ic { transform: translateX(5px); }

.lc-far { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 32px; margin-top: clamp(26px, 4.5vh, 44px); padding: 28px 30px 32px; background: var(--asphalt); overflow: hidden; }
.lc-far p { margin: 0; font: 720 clamp(1.2rem, 1.7vw, 1.6rem)/1.3 var(--display); font-stretch: 92%; color: var(--cream); }
.lc-far-road { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.lc-far-road .road-line { display: block; height: 4px; }
.lc-far-car { position: absolute; left: 0; bottom: -3px; width: 120px; height: 10px; background: radial-gradient(60% 100% at 100% 50%, rgba(251, 229, 193, .95), rgba(251, 229, 193, 0) 70%); filter: blur(1px); transform: translateX(-140px); }

@media (prefers-reduced-motion: reduce) {
  .ao::before, .af-card::after, .gz::before { animation: none; }
  .lc-p { transition: none; }
  .lc-far-car { display: none; }
}

@media (max-width: 1080px) {
  .gz-list { columns: 2; }
}
@media (max-width: 960px) {
  .ao-in { grid-template-columns: minmax(0, 1fr); }
  .ao-pair { height: 300px; margin-bottom: 8px; }
  .af-grid { grid-template-columns: minmax(0, 1fr); }
  .af-map-col { position: relative; top: 0; }
  .af-map { height: min(64svh, 560px); min-height: 0; }
  .af-head .af-search { flex: 1 1 100%; }
  .af-svg { --k: 2; }
  .lc-panels { display: grid; grid-template-columns: 1fr 1fr; height: auto; }
  .lc-a { min-height: 240px; }
}
@media (max-width: 760px) {
  .ao-h1 { font-size: clamp(2.3rem, 10.6vw, 3rem); }
  .ao-l { white-space: normal; }
  .ao-w { white-space: nowrap; font-size: min(1em, 9.4vw); }
  .ao-tail { font-size: .56em; }
  .ao .lede { font-size: 1.02rem; }
  .ao-a::before { transform: translate(-8px, -8px); }
  .ao-a { left: 8px; }
  .gz-list { columns: 1; }
  .gz-item { grid-template-columns: 36px minmax(0, 1fr); }
  .gz-letter { font-size: 1.7rem; }
  .lc-panels { grid-template-columns: 1fr; }
  .lc-a { min-height: 200px; }
  .lc-far { grid-template-columns: 1fr; padding: 22px 20px 28px; }
}
