# #028 — Subway Wayfinding Manual

> Massimo Vignelli 1970 NYC transit signage: stark black bands, thick white rules, Helvetica grids, and colored route bullets.

## Metadata

- **Index**: #028
- **Slug**: `subway-wayfinding-manual`
- **Kind**: `style`
- **Family**: Transit & Signage
- **Theme**: `mixed`
- **Mobile Strength**: `native-first`
- **Tags**: `transit-signage`, `vignelli`, `wayfinding`, `swiss-grotesque`, `route-bullets`
- **Best For**: Public transit & mobility apps, Design system archives, City guides & event schedules, High-legibility directional dashboards
- **Real-World Inspiration**: [Standards Manual](https://standardsmanual.com/)
- **Detail Page**: https://templates.michaelpitts.net/t/subway-wayfinding-manual
- **Live Demo**: https://templates.michaelpitts.net/demos/subway-wayfinding-manual.html
- **JSON API**: https://templates.michaelpitts.net/api/templates/subway-wayfinding-manual

## Why This Aesthetic Is Unique

Brings the clarity of iconic municipal wayfinding to the web with unmistakable circular line bullets, directional arrows, and uncompromising black-and-white signage grids.

## Color Palette

| Role | Name | Hex |
|------|------|-----|
| `canvas` | Enamel Sign White | `#FFFFFF` |
| `surface` | Signage Black | `#111111` |
| `ink` | Standard Black | `#111111` |
| `accent` | IRT Broadway Red | `#EE352E` |
| `muted` | Platform Concrete | `#6E6E6E` |

## Typography

- **Display**: `Inter`
- **Body**: `Inter`
- **Mono**: `IBM Plex Mono`
- **Scale Notes**: Tight-tracked grotesque sans (Helvetica/Inter 700–800) with strict top-rule alignment, large circular route glyphs, and crisp directional arrows.
- **Google Fonts**: https://fonts.googleapis.com/css2?family=Inter:wght@500;700;800&family=IBM+Plex+Mono:wght@500&display=swap
  ```html
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@500;700;800&family=IBM+Plex+Mono:wght@500&display=swap">
  ```

## Layout Architecture

Authentic overhead subway sign preview banner anchored by thick 4px horizontal rules, followed by an interactive station directory and route-line bullet filter grid.

## Interaction & Micro-Motion Rules

Interactive overhead sign specimen builder and route-line filter (1/2/3, A/C/E, 4/5/6, N/Q/R, L) that dynamically updates the live black-enamel station sign and transfer list.

## Mobile & Responsive Rules

Route bullets remain large >=44px circular tap targets on 390px screens, while the live overhead sign scales fluidly without horizontal overflow.

## Agent Guardrails

### DO
- Anchor black signage headers with a crisp horizontal white stripe above the primary station name.
- Use authentic solid circular route bullets with high-contrast centered single letters or numerals.
- Align every column to a strict left-flushed Swiss typographic baseline.

### DON'T
- Never use serif fonts, soft gradients, or playful hand-drawn illustrations.
- Avoid low-contrast pastel route badges; transit colors must be vivid and immediately scannable.

## Complete Standalone Starter Code

File: `demos/subway-wayfinding-manual.html`

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>NYC Transit Graphics Standards Manual — 1970 Edition</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<style>
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --white: #ffffff;
    --paper: #f7f7f5;
    --black: #0a0a0a;
    --gray-dark: #262626;
    --gray-mid: #666666;
    --rule: #d4d4d0;
    --irt-red: #ee352e;
    --ind-blue: #0039a6;
    --lex-green: #00933c;
    --bmt-yellow: #fccc0a;
    --canarsie-gray: #808183;
    --font: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  }
  html, body {
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    line-height: 1.45;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }

  /* Signature Vignelli Top Rule & Masthead */
  .top-rule {
    height: 10px;
    background: var(--black);
    width: 100%;
  }
  header {
    border-bottom: 2px solid var(--black);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .masthead {
    text-decoration: none;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .masthead-mark {
    display: flex;
    gap: 3px;
  }
  .mini-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
  }
  .masthead-text {
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  .masthead-text span {
    display: block;
    font-weight: 500;
    font-size: 0.68rem;
    color: var(--gray-mid);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .nav-links {
    display: none;
    list-style: none;
    gap: 24px;
  }
  .nav-links a {
    text-decoration: none;
    color: var(--black);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
  }
  .nav-links a:hover { border-bottom-color: var(--black); }
  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    padding: 0 12px;
    cursor: pointer;
  }
  .mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--white);
    border-bottom: 2px solid var(--black);
    padding: 0 20px 12px;
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--black);
    font-weight: 700;
    font-size: 0.86rem;
    border-top: 1px solid var(--rule);
  }

  /* Main Container */
  .container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 72px;
  }
  .plate-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 4px solid var(--black);
    margin-bottom: 24px;
  }
  .plate-id {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .plate-meta {
    font-size: 0.76rem;
    color: var(--gray-mid);
  }
  h1 {
    font-size: clamp(2rem, 5.5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin-bottom: 14px;
    max-width: 18ch;
  }
  .intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 36px;
  }
  .intro-copy {
    font-size: 0.96rem;
    color: var(--gray-dark);
    max-width: 58ch;
  }
  .bullet-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  /* Authentic Circular Route Bullets */
  .bullet {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--white);
    flex-shrink: 0;
    user-select: none;
  }
  .bullet.sm { width: 26px; height: 26px; font-size: 0.82rem; }
  .bullet.lg { width: 46px; height: 46px; font-size: 1.45rem; }
  .b-red { background: var(--irt-red); }
  .b-blue { background: var(--ind-blue); }
  .b-green { background: var(--lex-green); }
  .b-yellow { background: var(--bmt-yellow); color: var(--black); }
  .b-gray { background: var(--canarsie-gray); }

  /* Live Overhead Sign Specimen */
  .specimen-section {
    margin-bottom: 48px;
  }
  .sign-frame {
    background: #e9e9e6;
    padding: 20px 14px;
    border: 1px solid var(--black);
    margin-bottom: 20px;
  }
  .overhead-sign {
    background: var(--black);
    color: var(--white);
    border-top: 6px solid var(--white);
    padding: 18px 20px 24px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    transition: background 0.2s, color 0.2s;
  }
  .overhead-sign.classic-white {
    background: var(--white);
    color: var(--black);
    border: 2px solid var(--black);
    border-top: 10px solid var(--black);
  }
  .sign-rule {
    height: 2px;
    background: currentColor;
    margin-bottom: 14px;
    opacity: 0.9;
  }
  .sign-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .sign-station {
    font-size: clamp(1.55rem, 4.8vw, 2.85rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.06;
    word-break: break-word;
  }
  .sign-arrow {
    font-size: clamp(1.6rem, 4.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
  }
  .sign-bottom-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .sign-bullets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .sign-direction {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    opacity: 0.9;
  }

  /* Builder Controls */
  .builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--black);
    background: var(--paper);
  }
  .field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
  }
  .text-input, .select-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
  }
  .toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .style-btn {
    min-height: 44px;
    padding: 0 14px;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
  }
  .style-btn.active {
    background: var(--black);
    color: var(--white);
  }
  .bullet-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .bullet-pick-btn {
    min-width: 44px;
    min-height: 44px;
    border: 2px solid transparent;
    background: var(--white);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 3px;
  }
  .bullet-pick-btn[aria-pressed="true"] {
    border-color: var(--black);
    background: #e4e4df;
  }
  .bullet-pick-btn[aria-pressed="false"] .bullet {
    opacity: 0.35;
  }

  /* Station Directory Filter */
  .directory-section {
    margin-bottom: 48px;
  }
  .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }
  .filter-btn {
    min-height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }
  .filter-btn.active {
    background: var(--black);
    color: var(--white);
  }
  .station-table {
    border-top: 3px solid var(--black);
  }
  .station-row {
    width: 100%;
    min-height: 58px;
    padding: 12px 10px;
    background: var(--white);
    border: none;
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
    color: var(--black);
    transition: background 0.12s;
  }
  .station-row:hover { background: var(--paper); }
  .station-name {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.015em;
  }
  .station-borough {
    display: block;
    font-size: 0.74rem;
    color: var(--gray-mid);
    font-weight: 500;
  }
  .station-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
  }

  /* Grid Standards Plate */
  .plate-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    border-top: 3px solid var(--black);
    padding-top: 24px;
  }
  .plate-card {
    border: 1px solid var(--black);
    padding: 18px;
    background: var(--white);
  }
  .plate-card h3 {
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
  }
  .plate-card p {
    font-size: 0.86rem;
    color: var(--gray-dark);
    margin-bottom: 14px;
  }
  .plate-card svg {
    width: 100%;
    height: auto;
    display: block;
  }

  footer {
    border-top: 4px solid var(--black);
    padding: 24px 20px;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.76rem;
    font-weight: 600;
  }

  @media (min-width: 760px) {
    .nav-links { display: flex; }
    .menu-toggle { display: none; }
    .mobile-menu { display: none !important; }
    .intro-grid { grid-template-columns: 1.2fr 1fr; align-items: end; }
    .builder-grid { grid-template-columns: 1fr 1fr; }
    .builder-full { grid-column: 1 / -1; }
    .plate-grid { grid-template-columns: 1fr 1fr; }
    .sign-frame { padding: 32px; }
    .overhead-sign { padding: 24px 32px 30px; }
  }
</style>
</head>
<body>
<div class="top-rule"></div>
<header>
  <div class="header-inner">
    <a href="#top" class="masthead">
      <div class="masthead-mark" aria-hidden="true">
        <span class="mini-dot b-red"></span>
        <span class="mini-dot b-blue"></span>
        <span class="mini-dot b-green"></span>
        <span class="mini-dot b-yellow"></span>
      </div>
      <div class="masthead-text">
        NYCTA Graphics Standards
        <span>Unimark International &middot; 1970</span>
      </div>
    </a>
    <nav>
      <ul class="nav-links">
        <li><a href="#builder">Sign Builder</a></li>
        <li><a href="#directory">Station Directory</a></li>
        <li><a href="#standards">Grid Plates</a></li>
      </ul>
    </nav>
    <button class="menu-toggle" id="menuToggle" aria-expanded="false" aria-controls="mobileMenu">Menu</button>
  </div>
  <div class="mobile-menu" id="mobileMenu">
    <a href="#builder">Sign Specimen Builder</a>
    <a href="#directory">Station Directory</a>
    <a href="#standards">Typography &amp; Grid Plates</a>
  </div>
</header>

<main class="container" id="top">
  <div class="plate-bar">
    <span class="plate-id">Section 01 &middot; Visual Identification System</span>
    <span class="plate-meta">New York City Transit Authority &middot; Standard Medium</span>
  </div>

  <section class="intro-grid">
    <div>
      <h1>Subway Wayfinding Manual</h1>
      <p class="intro-copy">
        Designed by Massimo Vignelli and Bob Noorda to bring modular order to 468 stations. Every porcelain-enamel sign is constructed from a single typographic grid, directional arrow set, and color-coded trunk line bullet.
      </p>
    </div>
    <div class="bullet-strip" aria-label="Primary NYC Subway Route Bullets">
      <span class="bullet b-red">1</span>
      <span class="bullet b-red">2</span>
      <span class="bullet b-red">3</span>
      <span class="bullet b-blue">A</span>
      <span class="bullet b-blue">C</span>
      <span class="bullet b-blue">E</span>
      <span class="bullet b-green">4</span>
      <span class="bullet b-green">5</span>
      <span class="bullet b-green">6</span>
      <span class="bullet b-yellow">N</span>
      <span class="bullet b-yellow">Q</span>
      <span class="bullet b-yellow">R</span>
      <span class="bullet b-gray">L</span>
    </div>
  </section>

  <!-- Interactive Sign Specimen Builder -->
  <section class="specimen-section" id="builder">
    <div class="plate-bar">
      <span class="plate-id">Plate 04 &middot; Live Overhead Sign Specimen</span>
      <span class="plate-meta">Porcelain Enamel on 16-Gauge Steel</span>
    </div>

    <div class="sign-frame">
      <div class="overhead-sign" id="overheadSign" aria-live="polite">
        <div class="sign-rule"></div>
        <div class="sign-top-row">
          <div class="sign-station" id="signStation">14 St–Union Sq</div>
          <div class="sign-arrow" id="signArrow">&rarr;</div>
        </div>
        <div class="sign-bottom-row">
          <div class="sign-bullets" id="signBullets"></div>
          <div class="sign-direction" id="signDirection">Downtown &amp; Brooklyn</div>
        </div>
      </div>
    </div>

    <div class="builder-grid">
      <div>
        <label class="field-label" for="stationInput">Station Legend</label>
        <input type="text" id="stationInput" class="text-input" value="14 St–Union Sq" maxlength="32">
      </div>
      <div>
        <label class="field-label" for="directionSelect">Directional Copy &amp; Arrow</label>
        <select id="directionSelect" class="select-input">
          <option value="Downtown & Brooklyn|→">→ Downtown &amp; Brooklyn</option>
          <option value="Uptown & The Bronx|←">← Uptown &amp; The Bronx</option>
          <option value="Manhattan & Queens|↑">↑ Manhattan &amp; Queens</option>
          <option value="Express Platform|↓">↓ Express Platform</option>
          <option value="Street Exit|↗">↗ Street Exit</option>
        </select>
      </div>
      <div class="builder-full">
        <span class="field-label">Active Route Bullets (Tap to Toggle)</span>
        <div class="bullet-picker" id="bulletPicker"></div>
      </div>
      <div class="builder-full">
        <span class="field-label">Enamel Plate Polarity</span>
        <div class="toggle-row">
          <button type="button" class="style-btn active" id="modeBlack">1979 Black Enamel</button>
          <button type="button" class="style-btn" id="modeWhite">1970 Vignelli White</button>
        </div>
      </div>
    </div>
  </section>

  <!-- Interactive Station Directory Filter -->
  <section class="directory-section" id="directory">
    <div class="plate-bar">
      <span class="plate-id">Plate 12 &middot; Station Directory Index</span>
      <span class="plate-meta">Select any station to load onto overhead sign</span>
    </div>

    <div class="filter-bar" role="group" aria-label="Filter stations by trunk line">
      <button type="button" class="filter-btn active" data-filter="all">All Lines</button>
      <button type="button" class="filter-btn" data-filter="red"><span class="bullet sm b-red">1</span> Broadway–7 Av</button>
      <button type="button" class="filter-btn" data-filter="blue"><span class="bullet sm b-blue">A</span> 8 Av Express</button>
      <button type="button" class="filter-btn" data-filter="green"><span class="bullet sm b-green">4</span> Lexington Av</button>
      <button type="button" class="filter-btn" data-filter="yellow"><span class="bullet sm b-yellow">N</span> Broadway BMT</button>
      <button type="button" class="filter-btn" data-filter="gray"><span class="bullet sm b-gray">L</span> 14 St–Canarsie</button>
    </div>

    <div class="station-table" id="stationList"></div>
  </section>

  <!-- Standards Manual Grid Plates -->
  <section id="standards">
    <div class="plate-bar">
      <span class="plate-id">Plate 18 &middot; Modular Construction Grids</span>
      <span class="plate-meta">Unit Module = 1&frac12; Inches (38.1 mm)</span>
    </div>
    <div class="plate-grid">
      <div class="plate-card">
        <h3>Typographic Proportion (Standard Medium)</h3>
        <p>Cap height is fixed at 2 units above baseline; circular route discs occupy exactly 3 vertical units aligned beneath the primary horizontal rule.</p>
        <svg viewBox="0 0 360 150" role="img" aria-label="Typographic proportion diagram">
          <rect x="0" y="0" width="360" height="150" fill="#f7f7f5" stroke="#0a0a0a" stroke-width="1.5"/>
          <g stroke="#d4d4d0" stroke-width="1">
            <line x1="0" y1="30" x2="360" y2="30"/>
            <line x1="0" y1="60" x2="360" y2="60"/>
            <line x1="0" y1="90" x2="360" y2="90"/>
            <line x1="0" y1="120" x2="360" y2="120"/>
            <line x1="60" y1="0" x2="60" y2="150"/>
            <line x1="120" y1="0" x2="120" y2="150"/>
            <line x1="180" y1="0" x2="180" y2="150"/>
            <line x1="240" y1="0" x2="240" y2="150"/>
            <line x1="300" y1="0" x2="300" y2="150"/>
          </g>
          <rect x="16" y="18" width="328" height="6" fill="#0a0a0a"/>
          <text x="16" y="76" font-family="Inter, Helvetica, Arial, sans-serif" font-size="38" font-weight="700" letter-spacing="-1.5" fill="#0a0a0a">Canal St</text>
          <circle cx="38" cy="114" r="19" fill="#0039a6"/>
          <text x="38" y="122" text-anchor="middle" font-family="Inter, Helvetica, sans-serif" font-size="22" font-weight="700" fill="#ffffff">A</text>
          <circle cx="84" cy="114" r="19" fill="#0039a6"/>
          <text x="84" y="122" text-anchor="middle" font-family="Inter, Helvetica, sans-serif" font-size="22" font-weight="700" fill="#ffffff">C</text>
          <text x="242" y="118" font-family="Inter, Helvetica, sans-serif" font-size="11" font-weight="700" fill="#666666">3U DISC / 2U CAP</text>
        </svg>
      </div>
      <div class="plate-card">
        <h3>Directional Arrow Geometry</h3>
        <p>45-degree chamfered heads constructed on a 7&times;7 square grid ensure immediate legibility at 60 feet along poorly lit station platforms.</p>
        <svg viewBox="0 0 360 150" role="img" aria-label="Directional arrow geometric grid">
          <rect x="0" y="0" width="360" height="150" fill="#0a0a0a"/>
          <g stroke="#2a2a2a" stroke-width="1">
            <line x1="40" y1="25" x2="320" y2="25"/>
            <line x1="40" y1="50" x2="320" y2="50"/>
            <line x1="40" y1="75" x2="320" y2="75"/>
            <line x1="40" y1="100" x2="320" y2="100"/>
            <line x1="40" y1="125" x2="320" y2="125"/>
            <line x1="90" y1="15" x2="90" y2="135"/>
            <line x1="180" y1="15" x2="180" y2="135"/>
            <line x1="270" y1="15" x2="270" y2="135"/>
          </g>
          <!-- Authentic Vignelli Arrow -->
          <polygon points="86,65 232,65 196,29 224,29 270,75 224,121 196,121 232,85 86,85" fill="#ffffff"/>
          <text x="20" y="138" font-family="Inter, Helvetica, sans-serif" font-size="10" font-weight="600" fill="#a3a3a3">ANGLE 45° &middot; STROKE 20% HEIGHT</text>
        </svg>
      </div>
    </div>
  </section>
</main>

<footer>
  <span>NEW YORK CITY TRANSIT AUTHORITY GRAPHICS STANDARDS MANUAL</span>
  <span>ARCHIVE SPECIMEN &middot; 1970 / 1979</span>
</footer>

<script>
(function () {
  const menuToggle = document.getElementById('menuToggle');
  const mobileMenu = document.getElementById('mobileMenu');
  menuToggle.addEventListener('click', () => {
    const open = mobileMenu.classList.toggle('open');
    menuToggle.setAttribute('aria-expanded', String(open));
  });
  mobileMenu.querySelectorAll('a').forEach(a => a.addEventListener('click', () => {
    mobileMenu.classList.remove('open');
    menuToggle.setAttribute('aria-expanded', 'false');
  }));

  const routes = [
    { id: '1', cls: 'b-red', trunk: 'red' },
    { id: '2', cls: 'b-red', trunk: 'red' },
    { id: '3', cls: 'b-red', trunk: 'red' },
    { id: 'A', cls: 'b-blue', trunk: 'blue' },
    { id: 'C', cls: 'b-blue', trunk: 'blue' },
    { id: 'E', cls: 'b-blue', trunk: 'blue' },
    { id: '4', cls: 'b-green', trunk: 'green' },
    { id: '5', cls: 'b-green', trunk: 'green' },
    { id: '6', cls: 'b-green', trunk: 'green' },
    { id: 'N', cls: 'b-yellow', trunk: 'yellow' },
    { id: 'Q', cls: 'b-yellow', trunk: 'yellow' },
    { id: 'R', cls: 'b-yellow', trunk: 'yellow' },
    { id: 'L', cls: 'b-gray', trunk: 'gray' }
  ];

  const stations = [
    { name: '14 St–Union Sq', borough: 'Manhattan · Transfer Hub', lines: ['4','5','6','N','Q','R','L'], dir: 'Downtown & Brooklyn|→' },
    { name: 'Times Sq–42 St', borough: 'Manhattan · Midtown West', lines: ['1','2','3','N','Q','R'], dir: 'Uptown & The Bronx|←' },
    { name: '34 St–Penn Station', borough: 'Manhattan · 8 Av / 7 Av', lines: ['1','2','3','A','C','E'], dir: 'Express Platform|↓' },
    { name: 'Grand Central–42 St', borough: 'Manhattan · Lexington Av', lines: ['4','5','6'], dir: 'Uptown & The Bronx|←' },
    { name: 'West 4 St–Wash Sq', borough: 'Manhattan · Greenwich Village', lines: ['A','C','E'], dir: 'Downtown & Brooklyn|→' },
    { name: 'Bedford Av', borough: 'Brooklyn · Williamsburg', lines: ['L'], dir: 'Manhattan & Queens|↑' },
    { name: 'Canal St', borough: 'Manhattan · SoHo / Chinatown', lines: ['A','C','E','N','Q','R','6'], dir: 'Downtown & Brooklyn|→' },
    { name: 'Fulton St', borough: 'Manhattan · Financial District', lines: ['2','3','4','5','A','C'], dir: 'Street Exit|↗' }
  ];

  const routeMap = Object.fromEntries(routes.map(r => [r.id, r]));
  let selectedRoutes = new Set(['4', '5', '6', 'N', 'Q', 'R', 'L']);
  let activeFilter = 'all';

  const overheadSign = document.getElementById('overheadSign');
  const signStation = document.getElementById('signStation');
  const signArrow = document.getElementById('signArrow');
  const signDirection = document.getElementById('signDirection');
  const signBullets = document.getElementById('signBullets');
  const stationInput = document.getElementById('stationInput');
  const directionSelect = document.getElementById('directionSelect');
  const bulletPicker = document.getElementById('bulletPicker');
  const stationList = document.getElementById('stationList');

  function renderSign() {
    signStation.textContent = stationInput.value.trim() || 'Station Name';
    const [dirText, arrow] = directionSelect.value.split('|');
    signDirection.textContent = dirText;
    signArrow.textContent = arrow;

    signBullets.innerHTML = '';
    routes.forEach(r => {
      if (selectedRoutes.has(r.id)) {
        const span = document.createElement('span');
        span.className = `bullet lg ${r.cls}`;
        span.textContent = r.id;
        signBullets.appendChild(span);
      }
    });
  }

  function renderPicker() {
    bulletPicker.innerHTML = '';
    routes.forEach(r => {
      const btn = document.createElement('button');
      btn.type = 'button';
      btn.className = 'bullet-pick-btn';
      btn.setAttribute('aria-pressed', String(selectedRoutes.has(r.id)));
      btn.setAttribute('aria-label', `Toggle route ${r.id}`);
      btn.innerHTML = `<span class="bullet ${r.cls}">${r.id}</span>`;
      btn.addEventListener('click', () => {
        if (selectedRoutes.has(r.id) && selectedRoutes.size > 1) {
          selectedRoutes.delete(r.id);
        } else {
          selectedRoutes.add(r.id);
        }
        renderPicker();
        renderSign();
      });
      bulletPicker.appendChild(btn);
    });
  }

  function renderDirectory() {
    stationList.innerHTML = '';
    const filtered = stations.filter(st => {
      if (activeFilter === 'all') return true;
      return st.lines.some(id => routeMap[id] && routeMap[id].trunk === activeFilter);
    });

    filtered.forEach(st => {
      const btn = document.createElement('button');
      btn.type = 'button';
      btn.className = 'station-row';
      const bulletsHtml = st.lines.map(id => `<span class="bullet sm ${routeMap[id].cls}">${id}</span>`).join('');
      btn.innerHTML = `
        <div>
          <span class="station-name">${st.name}</span>
          <span class="station-borough">${st.borough}</span>
        </div>
        <div class="station-lines">${bulletsHtml}</div>
      `;
      btn.addEventListener('click', () => {
        stationInput.value = st.name;
        directionSelect.value = st.dir;
        selectedRoutes = new Set(st.lines);
        renderPicker();
        renderSign();
        document.getElementById('builder').scrollIntoView({ behavior: 'smooth', block: 'start' });
      });
      stationList.appendChild(btn);
    });
  }

  stationInput.addEventListener('input', renderSign);
  directionSelect.addEventListener('change', renderSign);

  const modeBlack = document.getElementById('modeBlack');
  const modeWhite = document.getElementById('modeWhite');
  modeBlack.addEventListener('click', () => {
    overheadSign.classList.remove('classic-white');
    modeBlack.classList.add('active');
    modeWhite.classList.remove('active');
  });
  modeWhite.addEventListener('click', () => {
    overheadSign.classList.add('classic-white');
    modeWhite.classList.add('active');
    modeBlack.classList.remove('active');
  });

  document.querySelectorAll('.filter-btn').forEach(btn => {
    btn.addEventListener('click', () => {
      activeFilter = btn.dataset.filter;
      document.querySelectorAll('.filter-btn').forEach(b => b.classList.toggle('active', b === btn));
      renderDirectory();
    });
  });

  renderPicker();
  renderSign();
  renderDirectory();
})();
</script>
</body>
</html>
```
