/* ============================================================
   SEEN AFTER SEVEN — a city journal for the evening shift
   Cream broadsheet · timetable rules · warm lamp light
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/artifacts/city-journal--v1--s4-whacky--glm-5.3-flash--vanilla--2026-09-18T04-44-40-321Z/assets/space-grotesk.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/artifacts/city-journal--v1--s4-whacky--glm-5.3-flash--vanilla--2026-09-18T04-44-40-321Z/assets/literata.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/artifacts/city-journal--v1--s4-whacky--glm-5.3-flash--vanilla--2026-09-18T04-44-40-321Z/assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f6efe0;
  --paper-2: #efe6cf;
  --ink: #232c30;
  --ink-2: #4c565b;
  --ink-3: #7d878c;
  --ink-4: #b9b3a3;
  --line: #d9cfb6;
  --line-2: #c9bfa6;
  --accent: #c25f28;
  --accent-2: #a34c1d;
  --moss: #4d5b3f;
  --teal: #2e5f63;
  --plum: #6b3a4d;
  --gold: #b58730;
  --serif: 'Literata', Georgia, serif;
  --grot: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shadow: 0 2px 0 var(--line-2), 0 10px 24px rgba(60, 46, 20, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #23241e;
    --paper-2: #2b2c24;
    --ink: #ece4cf;
    --ink-2: #c5bda6;
    --ink-3: #9b9481;
    --ink-4: #5f594a;
    --line: #45412f;
    --line-2: #55503b;
    --accent: #e08a4a;
    --accent-2: #f0a868;
    --moss: #a3b48d;
    --teal: #7fb5b8;
    --plum: #d197ab;
    --gold: #d3ab5e;
    --shadow: 0 2px 0 var(--line-2), 0 10px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
img { max-width: 100%; display: block; }
figure { margin: 0; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--paper); }

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

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 60;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.skip:focus { left: 12px; }

/* ---------- masthead ---------- */
.masthead {
  position: relative;
  padding: 1.4rem clamp(1rem, 4vw, 3.5rem) 2.2rem;
  background:
    radial-gradient(ellipse 90% 120% at 78% -10%, rgba(194, 95, 40, 0.13), transparent 55%),
    linear-gradient(var(--paper-2), var(--paper));
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .masthead {
    background:
      radial-gradient(ellipse 90% 120% at 78% -10%, rgba(224, 138, 74, 0.10), transparent 55%),
      linear-gradient(var(--paper-2), var(--paper));
  }
}
.mast-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
}
.mast-title {
  margin: 1.2rem 0 0.9rem;
  font-family: var(--grot);
  font-weight: 700;
  font-size: clamp(3.2rem, 10.5vw, 8.2rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  max-width: 11em;
}
.mast-sub {
  max-width: 42rem;
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  font-style: italic;
  color: var(--ink-2);
}
.mast-clock {
  position: absolute;
  right: clamp(1rem, 5vw, 4rem);
  bottom: 1.2rem;
  color: var(--accent);
  opacity: 0.9;
}
@media (max-width: 760px) {
  .mast-clock { position: static; margin-top: 1.4rem; }
  .mast-clock svg { width: 150px; height: 72px; }
}

/* ---------- toolbar ---------- */
.toolbar-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto;
  align-items: end;
  gap: clamp(0.8rem, 2.4vw, 2rem);
  padding: 0.9rem clamp(1rem, 4vw, 3.5rem);
  max-width: 1500px;
  margin: 0 auto;
}
.tool-search label, .tool-filter label {
  display: block;
  color: var(--ink-2);
  margin-bottom: 0.35rem;
}
#search, #filter {
  width: 100%;
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 0.55rem 0.7rem;
}
#search::placeholder { color: var(--ink-3); font-style: italic; }
.tool-filter { max-width: 260px; }
.saved-toggle {
  align-self: end;
  white-space: nowrap;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 0.55rem 0.8rem;
}
.saved-toggle:hover { border-color: var(--accent); color: var(--accent); }
.saved-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.saved-toggle[aria-pressed="true"]:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.count { align-self: end; color: var(--ink-3); text-align: right; }
@media (max-width: 900px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .count { grid-column: 2; }
}
@media (max-width: 560px) {
  .toolbar { grid-template-columns: 1fr; }
  .count { grid-column: 1; text-align: left; }
}

/* ---------- timetable list ---------- */
.list-wrap {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 3.5rem) 4rem;
}
.list-head { color: var(--ink-3); margin-bottom: 1.1rem; }

.item {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 232px;
  gap: clamp(1rem, 2.4vw, 2.2rem);
  align-items: start;
  padding: clamp(1.2rem, 2.4vw, 1.9rem) 0.6rem;
  border-top: 1px solid var(--line);
}
.item:nth-child(odd) { background: linear-gradient(90deg, var(--paper-2), transparent 65%); }
.item::before {
  content: '';
  position: absolute;
  left: 118px; top: 0; bottom: 0;
  border-left: 1px dashed var(--line-2);
}
.kicker { color: var(--ink-2); margin-bottom: 0.4rem; }
.kicker .topic { color: var(--accent-2); font-weight: 700; }
.open-item {
  all: unset;
  cursor: pointer;
  font-family: var(--grot);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.open-item:hover { color: var(--accent); }
.open-item:hover .arrow { opacity: 1; transform: translateX(4px); }
.arrow {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  color: var(--accent);
}
.dek {
  margin-top: 0.45rem;
  font-size: 0.98rem;
  font-style: italic;
  color: var(--ink-2);
  max-width: 46rem;
}
.foot-line {
  margin-top: 0.7rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: baseline;
}
.foot-line .by { color: var(--ink-2); }
.dur {
  display: block;
  position: relative;
  width: 128px;
  height: 4px;
  background: var(--line);
  margin-top: 4px;
}
.dur span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
}
.foot-line .min { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; }
.foot-line .dur-wrap { display: inline-block; }

/* time rail */
.rail { padding-top: 0.45rem; }
.rail .time {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
}
.ticks {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--ink-4);
}
.ticks i { font-style: normal; font-family: var(--mono); font-size: 0.66rem; }
.item-clipped {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--moss);
  margin-top: 0.8rem;
  text-align: right;
}

/* thumb */
.thumb-wrap { padding-top: 0.3rem; }
.thumb {
  border: 1px solid var(--line-2);
  padding: 6px;
  background: var(--paper);
  transform: rotate(1.4deg);
  box-shadow: var(--shadow);
}
.thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
}
.thumb figcaption {
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.item:nth-child(even) .thumb { transform: rotate(-1.2deg); }

/* ---------- empty state ---------- */
.empty {
  border: 1px dashed var(--line-2);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  max-width: 620px;
  margin: 3rem auto;
}
.empty-kicker { color: var(--accent-2); margin-bottom: 0.8rem; }
.empty-title {
  font-family: var(--grot);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.7rem;
}
.empty p + p { margin-top: 0.6rem; color: var(--ink-2); }
#clear-all {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 3px;
  padding: 0.7rem 1.2rem;
}
#clear-all:hover { background: var(--accent); }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.2rem clamp(1rem, 4vw, 3.5rem);
  border-top: 2px solid var(--ink);
  background: linear-gradient(var(--paper), var(--paper-2));
  color: var(--ink-3);
}

/* ---------- detail stub ---------- */
.detail {
  border: none;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(880px, calc(100% - 2rem));
}
.detail::backdrop {
  background: rgba(28, 24, 14, 0.62);
}
.stub {
  padding: clamp(1.1rem, 3vw, 2.2rem) clamp(1.1rem, 4vw, 2.6rem) clamp(1.4rem, 3vw, 2rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.stub-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.9rem;
  margin-bottom: 1.1rem;
}
.stub-actions { display: flex; gap: 0.6rem; }
.save-btn, .close-btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 0.5rem 0.8rem;
  white-space: nowrap;
}
.save-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.save-btn:hover { border-color: var(--accent); color: var(--accent); }
.save-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.save-btn[aria-pressed="true"]:hover { background: var(--accent-2); color: #fff; }
.close-btn { background: var(--ink); color: var(--paper); border: none; }
.close-btn:hover { background: var(--accent); color: #fff; }

.stub-fig {
  border: 1px solid var(--line-2);
  padding: 7px;
  background: var(--paper-2);
  transform: rotate(-0.6deg);
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
}
.stub-fig img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.03);
}
#d-kicker { color: var(--ink-2); }
#d-kicker .topic { color: var(--accent-2); font-weight: 700; }
#d-title {
  font-family: var(--grot);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
}
#d-dek {
  margin-top: 0.6rem;
  font-style: italic;
  color: var(--ink-2);
  font-size: 1.06rem;
}
#d-byline { color: var(--ink-3); margin-top: 0.9rem; }

.perf {
  margin: 1.3rem 0 1.5rem;
  height: 0;
  border-top: 2px dashed var(--line-2);
  position: relative;
}
.perf::before, .perf::after {
  content: '';
  position: absolute;
  top: -8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-2);
}
.perf::before { left: -10px; }
.perf::after { right: -10px; }

#d-body p {
  font-size: 1.04rem;
  line-height: 1.72;
  max-width: 62ch;
}
#d-body p + p { margin-top: 1.15rem; }
#d-body p:first-of-type::first-letter {
  font-family: var(--grot);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.82;
  float: left;
  padding-right: 0.09em;
  padding-top: 0.06em;
  color: var(--accent);
}
.stub-foot {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-3);
}

/* ---------- list on mobile ---------- */
@media (max-width: 900px) {
  .item { grid-template-columns: 84px minmax(0, 1fr); }
  .item .thumb-wrap { grid-column: 2; margin-top: 0.9rem; }
  .item::before { left: 82px; }
  .ticks i:nth-child(n+5) { display: none; }
  .rail .time { font-size: 0.66rem; }
}
@media (max-width: 560px) {
  .item { grid-template-columns: 1fr; gap: 0.6rem; }
  .rail { display: flex; flex-direction: row; align-items: center; gap: 0.8rem; padding-top: 0; }
  .ticks { flex-direction: row; margin-top: 0; gap: 10px; }
  .item-clipped { text-align: left; }
  .item::before { display: none; }
  .detail { width: 100%; }
  .stub { max-height: 100vh; padding: 1rem 1.1rem 1.3rem; }
  .stub-fig { margin-bottom: 1.1rem; }
  .stub-fig img { aspect-ratio: 16 / 9; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .arrow, .open-item:hover .arrow { transition: none; transform: none; }
  .item:nth-child(odd) .thumb, .item:nth-child(even) .thumb, .stub-fig { transform: none; }
}
