/* Neighborhoods street (components/street.html, street.js).
   One line drawing of a block between a corner shop and the campus gate, with four themes below.
   Ink lines only; gold is used for light (windows, porch lights, lamps), never for line work.
   The drawing is written in its finished state; street.js adds the "before" state and the sequence. */
.street {
  --k: 1;                      /* stroke weight, raised as the drawing scales down */
  --st-light: var(--gold);
  --st-glass: .4;              /* lit window fill, at the sill */
  --st-glow: .5;               /* centre of a lamp's glow */
  margin-top: clamp(40px, 5vw, 64px);
}
@media (prefers-color-scheme: dark) {
  .street { --st-light: var(--on-band-accent); --st-glass: .78; --st-glow: .62; }
}
.st-fig { margin: 0; }
.st-canvas { position: relative; }
.st-svg { display: block; width: 100%; height: auto; color: var(--ink); overflow: visible; }

/* Line weights (user units; --k compensates at small sizes) */
.st-svg .o { stroke-width: calc(1.3px * var(--k)); }
.st-svg .d { stroke-width: calc(.9px * var(--k)); }
.st-svg .f { stroke-width: calc(.6px * var(--k)); }
.st-svg .cap { stroke-width: calc(1.5px * var(--k)); }
.st-svg .bg { fill: var(--surface); stroke: none; }
.st-svg .bgk, .st-svg .kf { fill: var(--surface); }
.st-svg .kf { stroke-width: calc(.9px * var(--k)); }
.st-svg .pk { fill: var(--surface); stroke-width: calc(.9px * var(--k)); }
.st-svg .gl { fill: url(#st-pane); stroke: none; }
.st-svg .lt { fill: var(--st-light); stroke: none; }
.st-svg .glow { stroke: none; }
.st-svg .far { color: var(--muted); opacity: .5; }
.st-p0 { stop-color: var(--st-light); stop-opacity: calc(var(--st-glass) * .62); }
.st-p1 { stop-color: var(--st-light); stop-opacity: var(--st-glass); }
.st-g0 { stop-color: var(--st-light); stop-opacity: var(--st-glow); }
.st-g1 { stop-color: var(--st-light); stop-opacity: calc(var(--st-glow) * .32); }
.st-g2 { stop-color: var(--st-light); stop-opacity: 0; }

/* Markers under the street, one per theme */
.st-key { list-style: none; margin: 0; padding: 0; position: relative; height: 30px; }
.st-key li { position: absolute; top: 0; transform: translateX(-50%); padding-top: 12px; font-family: var(--sans); font-size: 12.5px; font-weight: 600; line-height: 1; letter-spacing: .06em; color: var(--gold-text); font-variant-numeric: tabular-nums; transition: color .4s ease; }
.st-key li::before { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 7px; background: var(--muted); opacity: .5; }
.st-k1 { left: 8.5%; }
.st-k2 { left: 23.67%; }
.st-k3 { left: 51.25%; }
.st-k4 { left: 75.75%; }

/* Themes */
.st-themes { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
.st-themes li { display: grid; gap: 8px; align-content: start; padding-top: 18px; border-top: 1px solid var(--rule); cursor: default; transition: opacity .4s ease, border-color .4s ease; }
.st-themes h3 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 2.2vw, 28px); line-height: 1.1; }
.st-themes p { font-size: 16px; line-height: 1.6; color: var(--muted); }

/* Theme focus: hovering a theme brings its part of the street forward */
.st-art > [data-th] { transition: opacity .5s ease; }
.street[data-focus] .st-art > [data-th] { opacity: .16; }
.street[data-focus="econ"] .st-art > [data-th~="econ"],
.street[data-focus="revive"] .st-art > [data-th~="revive"],
.street[data-focus="relate"] .st-art > [data-th~="relate"],
.street[data-focus="conduct"] .st-art > [data-th~="conduct"] { opacity: 1; }
.street[data-focus] .st-themes li { opacity: .45; }
.street[data-focus] .st-themes li.on { opacity: 1; border-top-color: var(--gold); }
.street[data-focus] .st-key li { color: var(--muted); }
.street[data-focus] .st-key li.on { color: var(--ink); }

/* Motion: windows fade gently once the sequence has played */
.street.st-done .gl { transition: opacity 1.6s ease; }
@media (prefers-reduced-motion: no-preference) {
  .st-themes li.st-pre { opacity: 0; transform: translateY(16px); }
  .st-themes li.st-in { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1), border-color .4s ease; }
  .st-themes li.st-in:nth-child(2) { transition-delay: 70ms, 70ms, 0ms; }
  .st-themes li.st-in:nth-child(3) { transition-delay: 140ms, 140ms, 0ms; }
  .st-themes li.st-in:nth-child(4) { transition-delay: 210ms, 210ms, 0ms; }
}
@media (prefers-reduced-motion: reduce) {
  .st-art > [data-th], .st-themes li, .st-key li { transition: none; }
}

/* Sizes: thicker lines as the drawing gets smaller; on phones the street scrolls in its own frame */
@media (max-width: 1240px) { .street { --k: 1.1; } }
@media (max-width: 1000px) {
  .street { --k: 1.3; }
  .st-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; }
}
@media (max-width: 760px) {
  .street { --k: 1.2; }
  .st-scroll {
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 40px), transparent);
  }
  .st-scroll::-webkit-scrollbar { display: none; }
  .st-canvas { width: 820px; }
  .st-svg { max-width: none; }
}
@media (max-width: 600px) {
  .st-themes { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 28px; }
}
