/* ==========================================================================
   Historical Scranton — Then & Now
   One stylesheet for the whole series, on the Classical tokens: a paper ground,
   ink text, gold applied as stroke. Change a token here and every page follows.
   ========================================================================== */

/* Fonts are vendored locally below */
@font-face{
  font-family:'Cormorant Garamond';
  font-style:normal;
  font-weight:400 600;
  font-display:swap;
  src:url('cormorant-garamond.woff2') format('woff2');
}

@font-face{
  font-family:'Lora';
  font-style:normal;
  font-weight:400 600;
  font-display:swap;
  src:url('lora.woff2') format('woff2');
}


:root{
  --bg:#f3f2f2;
  --surface:#eae9e9;
  --ink:#201f1d;
  --accent:#b68235;
  --accent-100:#fff3e4;
  --accent-700:#7d5411;
  --n-200:#eae7e7;
  --n-400:#bab6b6;
  --n-500:#9b9797;
  --n-600:#7d7979;
  --n-700:#605d5d;
  --rule:color-mix(in srgb, #201f1d 16%, transparent);

  --display:"Cormorant Garamond",Georgia,'Times New Roman',serif;
  --body:"Lora",Georgia,'Times New Roman',serif;

  --space-2:9.2px;
  --space-3:13.8px;
  --space-4:18.4px;
  --space-6:27.6px;
  --space-8:36.8px;
  --radius:4px;

  --frame:1180px;
  --gutter:clamp(20px,5vw,44px);
  --plate:2048/1271;   /* every aligned pair is cut to this ratio */
  --mat:6px;           /* the plate mat; the seam rail is inset by it */

  --pos:50%;           /* seam position, 0-100%. Written by slider.js. */
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--body);
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.page{
  max-width:var(--frame);
  margin:0 auto;
  padding:clamp(32px,5vh,60px) var(--gutter) clamp(44px,7vh,80px);
}

a{color:var(--accent-700)}
a:hover{color:var(--accent)}

:where(a,button,summary):focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
  border-radius:2px;
}

.display{
  margin:0;
  font-family:var(--display);
  font-weight:400;
  line-height:1.02;
  letter-spacing:-.02em;
}

.eyebrow{
  margin:0 0 var(--space-2);
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--accent-700);
}

/* A photograph is matted like a tipped-in plate. */
.plate{
  border:var(--mat) solid var(--surface);
  outline:1px solid var(--rule);
  filter:sepia(.22) saturate(.82) contrast(1.05);
}

.icon{
  flex:none;
  width:13px;
  height:13px;
  stroke:currentColor;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  fill:none;
}
.icon--gold{color:var(--accent)}

/* ==========================================================================
   The mark
   ========================================================================== */

.mark{
  display:inline-flex;
  align-items:center;
  font-family:var(--display);
  font-weight:400;
  letter-spacing:.07em;
  text-transform:uppercase;
  line-height:1;
  color:var(--ink);
  white-space:nowrap;
}
.mark__seam{
  width:1px;
  height:1.5em;
  background:var(--accent);
  flex:none;
}
.mark__then{padding-right:.45em}
.mark__now{padding-left:.45em}

.mark--display{font-size:clamp(1.7rem,5.6vw,2.75rem)}
.mark--bar{font-size:1rem;letter-spacing:.09em}
a.mark{text-decoration:none}
a.mark:hover .mark__seam{background:var(--accent-700)}

.masthead{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px var(--space-8);
  padding-bottom:var(--space-4);
  border-bottom:1px solid var(--ink);
}

.intro{
  margin:var(--space-6) 0 var(--space-8);
  max-width:62ch;
  font-size:15px;
  line-height:1.7;
  text-align:justify;
  hyphens:auto;
}

.ledger{list-style:none;margin:0;padding:0}

.row{
  display:grid;
  grid-template-columns:272px minmax(0,1fr) 104px 18px;
  gap:var(--space-6) 22px;
  align-items:start;
  padding:var(--space-4) 0;
  border-bottom:1px solid var(--rule);
  text-decoration:none;
  color:inherit;
}
.row:focus-visible{outline:none}
.row:focus-visible .row__frame{outline:2px solid var(--accent);outline-offset:3px}

.row__frame{
  position:relative;
  display:block;
  aspect-ratio:var(--plate);
  overflow:hidden;
  background:var(--n-200);
}
.row__frame img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
/* The historical plate shows by default; hovering reveals "now", rehearsing
   the drag gesture the pair pages are built on. */
.row__then{opacity:1;transition:opacity .5s cubic-bezier(.4,0,.2,1)}
@media (hover:hover){.row:hover .row__then{opacity:0}}
.row:focus-visible .row__then{opacity:0}

.row__title{
  margin:0;
  font-family:var(--display);
  font-weight:600;
  font-size:25px;
  line-height:1.15;
  letter-spacing:-.015em;
}
.row__where{
  display:flex;
  align-items:center;
  gap:6px;
  margin:4px 0 0;
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--accent-700);
}
.row__blurb{
  margin:10px 0 0;
  max-width:52ch;
  font-size:14px;
  line-height:1.6;
  color:var(--n-700);
}
.row__years{
  margin:0;
  text-align:right;
  font-size:13px;
  line-height:1.5;
  color:var(--n-700);
  font-feature-settings:'tnum';
}
.row__to{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  margin-top:2px;
  color:var(--n-700);
}
.row__mark{
  display:flex;
  justify-content:flex-end;
  padding-top:5px;
  color:var(--accent);
  opacity:0;
  transform:translateX(-5px);
  transition:opacity .25s ease,transform .25s ease;
}
@media (hover:hover){.row:hover .row__mark{opacity:1;transform:none}}
.row:focus-visible .row__mark{opacity:1;transform:none}


.sitefoot{
  margin-top:var(--space-8);
  padding-top:var(--space-4);
  border-top:1px solid var(--rule);
  font-size:12px;
  color:var(--n-700);
}

/* ==========================================================================
   Pair page — plate at three fifths, text in a sidecar
   ========================================================================== */

.topbar{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  margin-bottom:var(--space-6);
  padding-bottom:var(--space-3);
  border-bottom:1px solid var(--rule);
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.topbar a{text-decoration:none}

/* Grid, not flex: a flex line's width depends on what else shares the line,
   so the instant the sidecar wraps off it, the stage's flex-grow share
   jumps to fill the space freed up — a real discontinuity, not just an
   easing issue. Grid tracks don't have that problem: column 1's width comes
   only from grid-template-columns, never from what is or isn't sitting in
   column 2, so it can be *any* fraction, at *any* moment, independent of
   where the sidecar currently is. Two rows exist from the start; the
   sidecar simply relocates between (row 1, col 2) and (row 2, col 1) — a
   discrete jump, but one made while it's already invisible (see
   .pair--transit below), so nothing about the move itself is ever seen. */
.pair{
  display:grid;
  grid-template-columns:3fr 2fr;
  grid-template-rows:auto auto;
  column-gap:var(--space-8);
  row-gap:var(--space-6);
  align-items:start;
  transition:grid-template-columns .45s cubic-bezier(.4,0,.2,1),
             column-gap .45s cubic-bezier(.4,0,.2,1);
}

.stage{
  position:relative;
  aspect-ratio:var(--plate);
  overflow:hidden;
  background:var(--n-200);
  cursor:ew-resize;
  user-select:none;
  -webkit-user-select:none;
  touch-action:pan-y;
}
.stage img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  pointer-events:none;
  -webkit-user-drag:none;
}
/* <picture> exists only to offer format alternatives; it must not become a
   box, or the absolutely-positioned plate inside it would resolve against the
   wrapper instead of the stage. */
.stage picture,
.row__frame picture{display:contents}
/* The historical plate sits on top, clipped to the seam. Then lives left of
   the seam, now lives right of it, matching the yr labels either side of the
   scale — so dragging right toward "Today" reveals more of "now". */
.plate--then{z-index:2;clip-path:inset(0 0 0 var(--pos))}

.seam{
  position:absolute;
  top:0;
  bottom:0;
  left:var(--pos);
  width:1px;
  background:var(--accent-100);
  box-shadow:0 0 0 1px color-mix(in srgb, #201f1d 28%, transparent);
  transform:translateX(-.5px);
  z-index:3;
  pointer-events:none;
}

/* A real range input drives the seam: native pointer drag, native keyboard,
   native screen-reader semantics — stretched over the plate so the seam lands
   exactly under the cursor. */
.range{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
  appearance:none;
  -webkit-appearance:none;
  accent-color:transparent;
  cursor:ew-resize;
  z-index:5;
}
.range:focus{outline:none}
.range::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:2px;height:100%;
  background:transparent;border:0;box-shadow:none;
}
.range::-webkit-slider-runnable-track{background:transparent;border:0}
.range::-moz-range-thumb{width:2px;height:100%;background:transparent;border:0;border-radius:0}
.range::-moz-range-track{background:transparent;border:0}
.range:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

/* Full-width toggle, a small chip pinned to the plate's corner. */
.expand{
  position:absolute;
  top:calc(var(--mat) + 10px);
  right:calc(var(--mat) + 10px);
  z-index:6;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  padding:0;
  appearance:none;
  border:1px solid color-mix(in srgb, var(--accent-100) 35%, transparent);
  border-radius:var(--radius);
  background:color-mix(in srgb, var(--ink) 55%, transparent);
  color:var(--accent-100);
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease;
}
.expand:hover{background:color-mix(in srgb, var(--ink) 72%, transparent);border-color:var(--accent-100)}
.expand:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* The two icons share one cell and swap with a quarter-turn crossfade,
   rather than a hard show/hide switch (the `hidden` attribute doesn't
   reliably hide inline SVG across browsers, so state is driven by
   aria-pressed instead). */
.expand .icon{
  position:absolute;
  inset:9px;
  width:16px;
  height:16px;
  opacity:1;
  transform:rotate(0deg) scale(1);
  transition:opacity .22s ease, transform .22s ease;
}
.expand[aria-pressed="true"] .expand__in{opacity:0;transform:rotate(45deg) scale(.6)}
.expand[aria-pressed="false"] .expand__out{opacity:0;transform:rotate(-45deg) scale(.6)}

.comparison{grid-column:1;grid-row:1;min-width:0}

.sidecar{
  grid-column:2;
  grid-row:1;
  min-width:0;
  overflow:hidden;
  transition:opacity .2s ease;
}
/* Widening: column 1 grows to fill the row (column 2 shrinks to nothing but
   stays a real track, which is what keeps the width transition smooth — see
   the .pair comment above), and the sidecar relocates to a second row under
   column 1, at full width, no longer squeezed into a vanishing column. It's
   hidden only for the moment that relocation happens, so the jump in its
   position is never actually seen; slider.js times .pair--transit to
   bracket the width transition, then clears it so the sidecar fades back in
   wherever it just landed. */
.pair--wide{grid-template-columns:1fr 0fr;column-gap:0}
.pair--wide .sidecar{grid-column:1;grid-row:2}
.pair--transit .sidecar{opacity:0;pointer-events:none}

/* Years and the tick rail, inset by the mat so the tick sits under the seam. */
.scale{padding:0 var(--mat)}
.scale__labels{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
  margin-top:10px;
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-feature-settings:'tnum';
}
.yr{transition:opacity .18s ease}
.yr--then{opacity:var(--then-weight,1)}
.yr--now{opacity:var(--now-weight,1)}
.readout{color:var(--n-700)}

.scale__rule{
  position:relative;
  height:1px;
  margin-top:7px;
  background:var(--n-400);
  transition:opacity .2s ease;
}
.scale__tick{
  position:absolute;
  top:-5px;
  left:var(--pos);
  width:1px;
  height:11px;
  background:var(--accent);
  transform:translateX(-.5px);
}

.modes{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-4)}
.mode{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:44px;
  padding:7px 15px;
  appearance:none;
  background:transparent;
  border:1px solid var(--rule);
  border-radius:var(--radius);
  font-family:var(--body);
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--n-700);
  cursor:pointer;
  transition:border-color .16s ease,color .16s ease,background .16s ease;
}
.mode:hover{background:color-mix(in srgb, var(--accent) 8%, transparent);color:var(--accent-700)}
.mode:active{border-color:var(--accent-700);color:var(--accent-700)}
.mode[aria-pressed="true"]{border-color:var(--accent);color:var(--accent-700)}

.hint{
  display:flex;
  align-items:center;
  gap:7px;
  margin:10px 0 0;
  font-size:11px;
  line-height:1.6;
  color:var(--n-700);
}

/* Blink: the slider steps aside and the plate swaps whole views on click. */
.comparison[data-mode="blink"] .range{display:none}
.comparison[data-mode="blink"] .stage{cursor:pointer}
.comparison[data-mode="blink"] .seam,
.comparison[data-mode="blink"] .scale__rule{opacity:0}
.comparison[data-mode="blink"] .plate--then{
  clip-path:inset(0);
  opacity:var(--then-shown,1);
  transition:opacity .28s ease;
}
.comparison[data-mode="fade"] .seam,
.comparison[data-mode="fade"] .scale__tick{opacity:0}
.comparison[data-mode="fade"] .plate--then{
  clip-path:inset(0);
  opacity:var(--fade,1);
}

.sidecar .pair-title{font-size:clamp(1.9rem,3.4vw,2.4rem)}
.sidecar .standfirst{
  margin:var(--space-4) 0 0;
  font-size:14px;
  line-height:1.75;
  text-align:justify;
  hyphens:auto;
}
.where{
  display:flex;
  align-items:center;
  gap:7px;
  margin:8px 0 0;
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--n-700);
}

.credits{
  width:100%;
  border-collapse:collapse;
  margin-top:var(--space-6);
  font-size:12px;
}
.credits th{
  width:86px;
  padding:10px 0;
  border-top:1px solid var(--rule);
  text-align:left;
  vertical-align:top;
  font-family:var(--body);
  font-weight:400;
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--accent-700);
}
.credits th span{display:inline-flex;align-items:center;gap:6px}
.credits td{
  padding:10px 0;
  border-top:1px solid var(--rule);
  line-height:1.6;
  color:var(--n-700);
}
.credits tr:last-child th,.credits tr:last-child td{border-bottom:1px solid var(--rule)}
.credits td a{text-decoration:underline;text-underline-offset:3px}

.walk:empty{display:none}
.walk{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
  margin:var(--space-4) 0 0;
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.walk a{display:inline-flex;align-items:center;gap:8px;text-decoration:none}
.walk__prev .icon{order:-1}

@media (max-width:860px){
  .pair{grid-template-columns:minmax(0,1fr);gap:var(--space-6)}
  .comparison{grid-column:1;grid-row:1}
  .sidecar{grid-column:1;grid-row:2}
  .row{grid-template-columns:minmax(0,1fr);gap:1em}
  .row__years{text-align:left;margin-top:10px}
  .row__to{justify-content:flex-start}
  .row__mark{display:none}
  .modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .mode{padding:7px 8px;font-size:10px;letter-spacing:.1em}
  .expand{display:none}
  .mark--display{flex-direction:column;align-items:flex-start;gap:.2em}
  .mark--display .mark__then,
  .mark--display .mark__now{padding:0}
  .mark--display .mark__seam{width:2.5em;height:1px}
}

@media (prefers-reduced-motion:reduce){
  *{transition-duration:.001ms !important;animation-duration:.001ms !important}
}
