/* Sectors · styles.css · v=20260621-6
   Editorial + paper register (house design router), light "City Beautiful"
   Corbusier palette: warm paper, carbon ink, one brick-red accent. Map greens
   and the lake blue are ILLUSTRATION only (canvas), never a second UI accent,
   so the one-accent rule (H1) holds. Type: Fraunces (serif) + IBM Plex Mono.
   No dark mode. Soft paper shadows + gentle radii (paper skill), not the
   hard-corner print grammar of fanpark. */

/* ---------- tokens ---------- */
:root {
  --paper:    #F4F0E7;  /* canvas · warm concrete-in-morning-light */
  --paper-2:  #ECE5D7;  /* recessed paper */
  --panel:    #FBF9F3;  /* card surface */
  --ink:      #1B1713;  /* carbon, warm near-black */
  --ink-2:    #4A4239;
  --ink-3:    #6E655A;
  --ink-4:    #B8AF9F;
  --brick:    #B14A2F;  /* the one accent · fired brick / terracotta */
  --brick-deep:#8E3A24;
  --brick-tint: color-mix(in srgb, var(--brick) 10%, var(--paper));
  --brick-line: color-mix(in srgb, var(--brick) 38%, transparent);

  --line:   color-mix(in srgb, var(--ink) 14%, transparent);
  --line-2: color-mix(in srgb, var(--ink) 26%, transparent);

  /* map illustration palette (canvas only) */
  --map-tile:   #E4DDCD;
  --map-tile-hi:#EFEADC;
  --map-green:  #6E7A45;
  --map-water:  #7C97A8;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-1: 0 1px 2px rgba(27,23,19,.06);
  --shadow-2: 0 2px 8px rgba(27,23,19,.07), 0 12px 32px rgba(27,23,19,.07);
  --shadow-3: 0 8px 24px rgba(27,23,19,.12), 0 40px 80px rgba(27,23,19,.14);

  --r-sm: 6px;
  --r:    12px;
  --r-lg: 18px;

  --maxw: 720px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --header-h: 60px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 380;
  font-size: clamp(16px, 1rem + .15vw, 18px);
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 560; line-height: 1.1; letter-spacing: -.01em; margin: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brick-deep); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--brick); color: var(--paper); }

:focus-visible {
  outline: 2.5px solid var(--brick);
  outline-offset: 2px;
  border-radius: 3px;
}

.mono { font-family: var(--mono); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: var(--r-sm); z-index: 100;
  font-family: var(--mono); font-size: .8rem;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 8px; color: var(--paper); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 4vw, 32px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -.02em;
  line-height: 1;
  display: inline-flex; align-items: baseline; gap: .1em;
  text-decoration: none;
}
.wordmark .dot { color: var(--brick); }
.tagline {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .04em;
  color: var(--ink-3);
  border-left: 1px solid var(--line-2);
  padding-left: 14px; margin-left: 2px;
}
.site-header .spacer { flex: 1; }
.ghost-btn {
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .04em;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.ghost-btn:hover { border-color: var(--brick); color: var(--brick-deep); background: var(--brick-tint); }
@media (max-width: 560px) { .tagline { display: none; } }

/* ---------- hero / map ---------- */
.hero {
  position: relative;
  height: calc(100svh - var(--header-h));
  min-height: 460px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 62% 30%, var(--panel) 0%, var(--paper) 46%, var(--paper-2) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 140px 12px rgba(27, 23, 19, .045);
}
.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.map-canvas:active { cursor: grabbing; }

.map-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  color: var(--ink-3); background: transparent; border: none; padding: 0;
  pointer-events: none; white-space: nowrap;
  transition: opacity .4s var(--ease);
}
.map-legend {
  position: absolute; right: 16px; top: 16px;
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--mono); font-size: .68rem; color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; pointer-events: none;
}
.map-legend .key { display: flex; align-items: center; gap: 8px; }
.map-legend .swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.map-legend .swatch.furnished { background: var(--brick); }
.map-legend .swatch.waiting { background: var(--map-tile); border: 1px solid var(--line-2); }
.map-legend .swatch.green { background: var(--map-green); }
.map-legend .swatch.water { background: var(--map-water); }
.map-legend .count { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; color: var(--ink-3); }
@media (max-width: 560px) { .map-legend { display: none; } }

/* static fallback grid (reduced-motion / no-canvas) */
.map-fallback {
  position: absolute; inset: 0;
  overflow: auto; padding: 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px; align-content: start;
}
.sector-cell {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2);
  font-family: var(--mono); font-size: 1rem; transition: transform .12s var(--ease);
}
.sector-cell .cell-label { font-size: .54rem; color: var(--ink-3); letter-spacing: .02em; }
.sector-cell.furnished { border-color: var(--brick-line); color: var(--brick-deep); background: var(--brick-tint); }
.sector-cell:hover { transform: translateY(-2px); border-color: var(--brick); }

/* ---------- place-a-day card ---------- */
.today-card {
  position: absolute; left: 16px; bottom: 16px; z-index: 5;
  width: min(330px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brick);
  border-radius: var(--r);
  padding: 14px 16px 15px;
  box-shadow: var(--shadow-2);
  animation: rise .6s var(--ease) both;
}
.today-card .today-name {
  font-family: var(--serif); font-weight: 560; font-size: 1.32rem;
  letter-spacing: -.01em; margin: 4px 0 2px; line-height: 1.08;
}
.today-card .today-line { color: var(--ink-2); font-size: .92rem; line-height: 1.4; margin: 0 0 12px; }
.today-card .today-open {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .04em;
  background: var(--ink); color: var(--paper); border: none;
  padding: 9px 16px; border-radius: 999px;
  transition: background .15s var(--ease), transform .12s var(--ease);
}
.today-card .today-open:hover { background: var(--brick-deep); transform: translateY(-1px); }
@media (max-width: 480px) { .today-card { left: 12px; right: 12px; bottom: 12px; width: auto; } }

/* ---------- room overlay ---------- */
.room-overlay { position: fixed; inset: 0; z-index: 60; }
.room-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade .3s var(--ease) both;
}
.room {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--paper);
  box-shadow: var(--shadow-3);
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 22px clamp(20px, 4vw, 40px) 64px;
  animation: slide-in .5s var(--ease) both; will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .room, .room-scrim, .today-card { animation: none; }
}
.room-close {
  position: sticky; top: 0; float: right;
  margin: -4px -8px 0 0;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 1.1rem; line-height: 1; color: var(--ink-2);
  display: grid; place-items: center; z-index: 2;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.room-close:hover { background: var(--brick-tint); border-color: var(--brick); color: var(--brick-deep); }

.room-sector {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brick-deep);
}
.room-kind { color: var(--ink-3); }
.room-name {
  font-family: var(--serif); font-weight: 580;
  font-size: clamp(2rem, 1.4rem + 3vw, 2.9rem);
  letter-spacing: -.02em; line-height: 1.02;
  margin: 8px 0 10px; max-width: 16ch;
}
.room-oneliner { font-size: 1.12rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 22px; max-width: 40ch; }

/* the locator IS the room hero: a real map fragment */
.room-locator { margin: 0 0 26px; }
.room-locator .locator {
  width: 100%; height: auto; display: block;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
}
.room-locator figcaption {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .04em;
  color: var(--ink-3); margin-top: 8px;
}
/* keyboard reveal for the otherwise-sr-only sector list */
.map-fallback.sr-only a:focus {
  position: fixed; left: 12px; top: 70px; width: auto; height: auto;
  clip: auto; clip-path: none; z-index: 50; overflow: visible;
  background: var(--panel); border: 1px solid var(--brick); border-radius: var(--r-sm);
  padding: 8px 12px; color: var(--brick-deep); white-space: nowrap;
}
/* legacy hero placeholder (unused) */
.room-hero {
  position: relative; aspect-ratio: 16/10; border-radius: var(--r);
  overflow: hidden; margin: 0 0 26px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.room-hero .locator { width: 100%; height: 100%; display: block; }
.room-hero .hero-note {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .04em;
  color: var(--ink-3);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}

.room-block { margin: 0 0 24px; }
.room-block h2, .room-next h2 {
  font-family: var(--mono); font-weight: 500;
  font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 8px;
  display: flex; align-items: center; gap: 10px;
}
.room-block h2::before {
  content: ""; width: 18px; height: 1.5px; background: var(--line-2); flex: none;
}
.room-block p { margin: 0 0 8px; }
.thennow { display: grid; gap: 10px; }
.thennow .tn { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: baseline; }
.thennow .tn dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }
.thennow .tn dd { margin: 0; color: var(--ink-2); }

.room-memory {
  margin: 28px 0; padding: 20px 22px;
  background: var(--brick-tint);
  border: 1px solid var(--brick-line);
  border-radius: var(--r);
  font-style: italic; font-size: 1.16rem; line-height: 1.5; color: var(--ink);
}
.room-memory .who {
  display: block; margin-top: 12px; font-style: normal;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brick-deep);
}
.room-memory.pending { background: var(--paper-2); border-color: var(--line); color: var(--ink-3); font-style: normal; }

.room-next { margin: 24px 0; }
.room-next .nbrs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.room-next .nbr {
  font-family: var(--mono); font-size: .76rem;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px;
  text-decoration: none; color: var(--ink-2);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.room-next .nbr:hover { border-color: var(--brick); color: var(--brick-deep); }
.room-next .nbr[data-furnished] { border-color: var(--brick-line); color: var(--brick-deep); }

.room-sources { margin: 26px 0 0; border-top: 1px solid var(--line); padding-top: 14px; }
.room-sources summary {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); cursor: pointer; list-style: none;
}
.room-sources summary::-webkit-details-marker { display: none; }
.room-sources summary::before { content: "+ "; color: var(--brick); }
.room-sources[open] summary::before { content: "- "; }
.room-sources ol { margin: 14px 0 0; padding-left: 18px; }
.room-sources li { font-family: var(--mono); font-size: .76rem; line-height: 1.5; color: var(--ink-3); margin-bottom: 10px; overflow-wrap: anywhere; }
.room-sources li b { color: var(--ink-2); font-weight: 500; }

.room-actions { margin-top: 30px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  border-radius: 999px; padding: 11px 18px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink-2);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--brick); color: var(--brick-deep); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--brick-deep); border-color: var(--brick-deep); color: var(--paper); }

/* ---------- share modal ---------- */
.share-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.share-modal .share-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 46%, transparent); }
.share-card-wrap {
  position: relative; background: var(--panel); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); padding: 18px; max-width: 420px; width: 100%;
  max-height: 92svh; overflow: auto;
}
.share-card-wrap h3 { font-family: var(--serif); font-size: 1.3rem; margin: 2px 4px 12px; }
.share-preview { width: 100%; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); }
.share-sizes { display: flex; gap: 8px; margin: 14px 0; }
.share-sizes .seg {
  flex: 1; font-family: var(--mono); font-size: .74rem; text-align: center;
  padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); transition: all .15s var(--ease);
}
.share-sizes .seg[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px clamp(16px,4vw,32px) 56px; background: var(--paper-2); }
.cross-link { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 26px; }
.cross-link a {
  font-family: var(--mono); font-size: .74rem; color: var(--ink-3);
  text-decoration: none; transition: color .15s var(--ease);
}
.cross-link a:hover { color: var(--brick-deep); }
.colophon { max-width: var(--maxw); }
.colophon p { font-family: var(--mono); font-size: .72rem; line-height: 1.65; color: var(--ink-3); margin: 0 0 8px; }
.colophon a { color: var(--ink-2); }
.colophon .thanks { color: var(--brick-deep); }

/* ---------- animations ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* ---------- print ---------- */
@media print {
  .site-header, .hero, .today-card, .room-actions, .room-close, .site-footer .cross-link { display: none; }
  .room { position: static; width: auto; box-shadow: none; }
  body { background: #fff; }
}
