/* clankford.ie, Our town (/team): round 36 T2 "Walk the town, one area at a time" (Michal, 21 Oct 2026), built in
 * round 37. The markup is lib/clankford-site-town.js; the drawings are views/clankford-site/_town-*.html, made from
 * the roster by scripts/clankford-town/build_town.py; the walk is town.js; the team card, the chat and the live
 * feed are site.js's.
 *
 * The stops along the top are the tabs (Book a call's ruler: a dashed road, a lit length up to where you are).
 * Under them the stage: the five panels side by side on one track, one shown. Picking a stop slides the track:
 * one walk down the street of about 0.7s, then still. Reduced motion: no slide. No script: no stops, and the five
 * panels stand one under the other. Each panel draws its area twice: .tw-art--wide (the street) from 1200px,
 * .tw-art--tall below it (each room its own small drawing: three or two across on a tablet, stacked on a phone).
 *
 * Area colours are the Clank Floor's own precinct colours (site.css --e-*), data, not UI: they only ever say which
 * area a stop, a room or a list belongs to. Green is the floor's "working right now"; nothing here is amber. */

.tw-area--hq { --area: var(--e-hq); --area-light: var(--e-hq-light); }
.tw-area--delivery { --area: var(--e-delivery); --area-light: var(--e-delivery-light); }
.tw-area--clients { --area: var(--e-clients); --area-light: var(--e-clients-light); }
.tw-area--newbiz { --area: var(--e-newbiz); --area-light: var(--e-newbiz-light); }
.tw-area--works { --area: var(--e-works); --area-light: var(--e-works-light); }
/* the town board's rows (headquarters) each walk to an area, so each wears that area's colour */
.tw-board[data-walk="delivery"] { --area: var(--e-delivery); --area-light: var(--e-delivery-light); }
.tw-board[data-walk="clients"] { --area: var(--e-clients); --area-light: var(--e-clients-light); }
.tw-board[data-walk="newbiz"] { --area: var(--e-newbiz); --area-light: var(--e-newbiz-light); }
.tw-board[data-walk="works"] { --area: var(--e-works); --area-light: var(--e-works-light); }

/* the hero, tighter than the kit's so the street and Clankford are in the first screen */
.tw-hero { padding: clamp(36px, 4vw, 56px) 0 0; }
.tw-hero h1 { max-width: 15em; font-size: clamp(2.4rem, 4vw, 3.6rem); }
.tw-hero .kicker { margin-bottom: 12px; }
.tw-hero .hero__side .lead + .lead { margin-top: 10px; }
.tw { padding: clamp(24px, 2.6vw, 36px) 0 clamp(48px, 6vw, 88px); }

/* the stops: five on a dashed road */
.tw-street { --at: 0; position: relative; margin: 0 0 14px; scroll-margin-top: 88px; }
.tw-street__road { position: absolute; left: 0; right: 0; top: 22px; height: 2px; background: repeating-linear-gradient(90deg, var(--hud-soft) 0 8px, transparent 8px 15px); }
.tw-street__fill {
  position: absolute; left: 0; top: 0; height: 2px; width: calc((var(--at) + 0.5) * 100% / var(--n));
  background: var(--hud); box-shadow: 0 0 10px var(--hud-glow); transition: width 0.7s var(--ease);
}
.tw-street__me {
  position: absolute; top: -16px; left: calc((var(--at) + 0.5) * 100% / var(--n)); width: 2px; height: 34px; margin-left: -1px;
  background: var(--hud-ice); box-shadow: 0 0 12px var(--hud-glow); transition: left 0.7s var(--ease);
}
.tw-street__stops { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.tw-stop {
  display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 44px; padding: 10px 6px 6px;
  border: 0; border-radius: 8px; background: none; color: var(--hud-dim); cursor: pointer;
  font: 600 1.02rem/1.25 var(--body); text-align: center;
}
.tw-stop__dot {
  position: relative; width: 26px; height: 26px; margin-bottom: 4px; border-radius: 50%;
  border: 2px solid var(--area); background: var(--hud-bg);
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tw-stop__sub { font-size: 0.86rem; font-weight: 500; color: var(--hud-dim); }
.tw-stop__short { display: none; }
.tw-stop:hover { color: var(--hud-text); }
.tw-stop:hover .tw-stop__dot { box-shadow: 0 0 0 4px var(--hud-faint); }
.tw-stop[aria-selected="true"] { color: var(--hud-text); }
.tw-stop[aria-selected="true"] .tw-stop__dot { background: var(--area); box-shadow: 0 0 0 5px var(--hud-faint), 0 0 20px var(--area); }
.tw-stop:focus-visible { outline: 2px solid var(--hud); outline-offset: 2px; }
/* a stop with a team working right now (the live feed, site.js, lit by town.js): the floor's green pip on its dot */
.tw-stop__dot::after {
  content: ''; position: absolute; right: -5px; top: -5px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--hud-bg); background: var(--hud-ok); box-shadow: 0 0 8px var(--hud-ok-glow);
  opacity: 0; transform: scale(0.4); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.tw-stop.is-working .tw-stop__dot::after { opacity: 1; transform: none; }
html:not(.js) .tw-street { display: none; }

/* the stage and the track */
.tw-stage {
  position: relative; overflow: hidden; border: 1px solid var(--hud-soft); border-radius: 12px; background: var(--hud-bg);
  box-shadow: 0 0 0 1px var(--hud-faint), 0 24px 60px rgba(0, 0, 0, 0.35); /* design-check-ignore: a shadow, not a colour */
}
.js .tw-stage { transition: height 0.5s var(--ease); }
.js .tw-track { display: flex; align-items: flex-start; transition: transform 0.7s var(--ease); will-change: transform; }
.js .tw-panel { flex: 0 0 100%; min-width: 0; }
.js .tw-panel.is-away { visibility: hidden; }
html:not(.js) .tw-panel + .tw-panel { border-top: 1px solid var(--hud-soft); }
.tw-panel__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; padding: 16px clamp(16px, 2vw, 24px) 14px; border-bottom: 1px solid var(--hud-faint); }
.tw-panel__head h2 { font-size: clamp(1.7rem, 2.4vw, 2.3rem); color: var(--area-light); }
.tw-panel__head p { max-width: 72ch; color: var(--hud-dim); line-height: 1.5; }
.tw-fig { margin: 0; }
.tw-art { position: relative; line-height: 0; }
.tw-svg { display: block; width: 100%; height: auto; }
.tw-art--tall { display: none; background: #0b1726; } /* design-check-ignore: the drawings' own ground */
.tw-cell { position: relative; min-width: 0; }
/* under 1200px the street drawing's words would shrink under 13px: the rooms are drawn one by one instead,
   three or two across on a tablet, one under the other on a phone, and the words stay about 14px (13.8px on a
   390px phone, the name plates' 13.5 in a 340 wide drawing) */
@media (max-width: 1199px) {
  .tw-art--wide { display: none; }
  .tw-art--tall { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
}
.tw-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.tw-svg .tw-n { font-family: var(--body); font-weight: 600; letter-spacing: 0; }
.tw-svg .fl-t { font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; }
.tw-svg .rm-edge { transition: stroke-width 0.15s var(--ease), stroke 0.25s var(--ease); }
.tw-svg .rm.is-hot .rm-edge { stroke-width: 10; }
/* a room whose team is working right now: its walls in the floor's green (CSS beats the drawing's own stroke) */
.tw-svg .rm.is-working .rm-edge { stroke: var(--hud-ok); }

/* every room, every row of the town board and the empty plot are real buttons laid over the drawing */
.tw-room, .tw-board, .tw-plot {
  position: absolute; display: block; margin: 0; padding: 0; border: 2px solid transparent; border-radius: 10px;
  background: transparent; cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tw-room:hover, .tw-room.is-open, .tw-board:hover, .tw-plot:hover {
  border-color: var(--area-light); background: var(--hud-wash);
  box-shadow: 0 0 22px color-mix(in srgb, var(--area) 30%, transparent);
}
.tw-room:focus-visible, .tw-board:focus-visible, .tw-plot:focus-visible { outline: 3px solid var(--hud-ice); outline-offset: 2px; border-color: var(--area-light); }
.tw-room.is-working, .tw-board.is-working { border-color: var(--hud-ok); box-shadow: 0 0 16px var(--hud-ok-glow); }
.tw-room--hq { border-radius: 50%; }
.tw-plot { border-radius: 12px; }

/* walk on: the next area and the one before, under the drawing */
.tw-walks { display: flex; justify-content: space-between; gap: 12px; padding: 12px clamp(12px, 2vw, 20px); border-top: 1px solid var(--hud-faint); }
.tw-walk {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--hud-soft); border-radius: 6px; background: transparent;
  color: var(--hud-text); font: 600 0.98rem/1.2 var(--body); cursor: pointer;
}
.tw-walk--next { margin-left: auto; }
.tw-walk:hover { border-color: var(--hud); background: var(--hud-wash); }
.tw-walk:focus-visible { outline: 2px solid var(--hud-ice); outline-offset: 3px; }
html:not(.js) .tw-walks { display: none; }

/* under the stage: how to use it, and the live count (site.js fills it when the feed answers) */
.tw-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; max-width: none; padding: 14px 0 0; font-size: 0.95rem; color: var(--hud-dim); }
.tw-live { display: inline-flex; align-items: center; gap: 8px; color: var(--hud-text); }
.tw-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hud-ok); box-shadow: 0 0 8px var(--hud-ok-glow); }
.tw-live[hidden] { display: none; }

/* the list, folded: every team and crew member in words (and where a card falls back to) */
.tw-list { margin-top: 22px; border-top: 1px solid var(--hud-faint); }
.tw-list > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--hud-text);
}
.tw-list > summary::-webkit-details-marker { display: none; }
.tw-list > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--hud); border-bottom: 2px solid var(--hud); transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
.tw-list[open] > summary::before { transform: rotate(45deg); }
.tw-list > summary:focus-visible { outline: 2px solid var(--hud); outline-offset: 2px; border-radius: 4px; }
.tw-list__body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; padding: 8px 0 12px; }
.tw-list__area h3 { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.5rem; }
.tw-list__sw { width: 12px; height: 12px; border-radius: 3px; background: var(--area); }
.tw-list__team { margin-top: 16px; scroll-margin-top: 96px; }
.tw-list__team h4 { font-size: 1rem; color: var(--hud-text); }
.tw-list__team ul { margin: 6px 0 0; padding: 0; list-style: none; }
.tw-list__team li { padding: 4px 0; font-size: 0.9rem; line-height: 1.45; color: var(--hud-dim); }
.tw-list__team li b { display: block; color: var(--hud-text); font-weight: 600; }
.tw-list__team li.is-lead b { color: var(--hud-bright); }
@media (max-width: 1100px) { .tw-list__body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* a phone: the stops as a row of five short marks */
@media (max-width: 760px) {
  .tw-stop { padding: 10px 2px 4px; font-size: 0.82rem; }
  .tw-stop__sub { display: none; }
  .tw-stop__long { display: none; }
  .tw-stop__short { display: inline; }
  .tw-stop__dot { width: 22px; height: 22px; }
  .tw-street__road { top: 20px; }
  .tw-panel__head { padding: 14px 16px 12px; }
  .tw-panel__head p { font-size: 0.95rem; }
  .tw-list__body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .tw-stop { font-size: 0.76rem; } }
@media (prefers-reduced-motion: reduce) {
  .js .tw-track, .js .tw-stage, .tw-street__fill, .tw-street__me, .tw-stop__dot, .tw-stop__dot::after, .tw-svg .rm-edge { transition: none; }
}
