/* ============================================================
   TWO DAYS — Issue No.01
   Risograph zine direction: paper / ink / fluoro pink / process blue
   ============================================================ */

/* ---------- Fonts (local pool) ---------- */
@font-face {
  font-family: 'Oswald';
  src: url('assets/oswald.ttf') format('truetype');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('assets/dm-sans.ttf') format('truetype');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 100 700;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F7F3EA;
  --paper-2: #EFEADD;
  --ink: #1F1A17;
  --ink-soft: #56504A;
  --pink: #FF48B0;
  --pink-deep: #E9339B;
  --blue: #2B44FF;
  --rule: 2px solid var(--ink);
  --rule-thin: 1px solid var(--ink);
  --ease-step: steps(2, end);
  --shadow: 5px 5px 0 var(--ink);
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; }

.container {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Focus system (per-context) ---------- */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.entry :focus-visible,
.map-band :focus-visible {
  outline-color: var(--paper);
}
.btn:focus-visible {
  outline-offset: 3px;
}

.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}
.topnav a:focus-visible,
.colophon-nav a:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 4px;
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  transition: top 120ms ease-out;
}
.skip:focus { top: 12px; }

/* ---------- Topbar ---------- */
.topbar { border-bottom: var(--rule); }
.topbar-in {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding-block: 14px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding-block: 10px;
  white-space: nowrap;
}
.brand-mark { color: var(--pink); margin-left: 4px; display: inline-block; transition: transform 200ms ease-out; }
@media (hover: hover) and (pointer: fine) {
  .brand:hover .brand-mark { transform: rotate(90deg); }
}
.issue { color: var(--ink-soft); white-space: nowrap; }
.topnav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.topnav a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 14px;
  border: 2px solid transparent;
}
.topnav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.topnav a:active { transform: translateY(1px); }

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden;
  background: var(--pink);
  border-bottom: var(--rule);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-slide 26s linear infinite;
}
.ticker-group {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 10px 0 10px 24px;
  white-space: nowrap;
}
@keyframes ticker-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Front page ---------- */
.front {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 4vw, 64px);
  padding-block: clamp(56px, 7vw, 96px) clamp(48px, 5vw, 72px);
}
.kicker { color: var(--ink-soft); margin-bottom: 20px; }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.2rem, 11.5vw, 10.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  position: relative;
}
.misreg { min-height: 2.1em; }
.mis-layer {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.mis-pink { color: var(--pink-deep); transform: translate(-6px, -4px); animation: ink-drift 7s ease-in-out infinite alternate; }
.mis-blue { color: var(--blue); transform: translate(6px, 4px); }
.mis-ink { position: relative; color: var(--ink); }
@keyframes ink-drift {
  from { transform: translate(-6px, -4px); }
  to { transform: translate(-3px, -2px); }
}
@media (hover: hover) and (pointer: fine) {
  .front-copy:hover .mis-pink,
  .front-copy:focus-within .mis-pink { transform: translate(0, 0); transition: transform 80ms var(--ease-step); }
  .front-copy:hover .mis-blue,
  .front-copy:focus-within .mis-blue { transform: translate(0, 0); transition: transform 80ms var(--ease-step); }
}

.lede {
  max-width: 52ch;
  margin-top: 28px;
  font-size: 18px;
  line-height: 1.6;
}
.front-cta {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-note { color: var(--ink-soft); }

/* Buttons — one primary style */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 22px;
  border: 2px solid var(--ink);
  text-decoration: none;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
}
.btn-primary {
  background: var(--pink);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
  .btn-ghost:hover { background: var(--ink); color: var(--paper); }
}
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn-toggle[aria-pressed="true"] {
  background: var(--pink);
  box-shadow: var(--shadow);
}

/* Front side column */
.front-side { display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.index-box { border: var(--rule); background: var(--paper); }
.index-head {
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
}
.index-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-top: var(--rule-thin);
  color: var(--ink);
}
.index-row span:first-child { color: var(--blue); font-weight: 600; }

.stamp {
  align-self: flex-end;
  background: var(--pink);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 10px 18px;
  transform: rotate(-6deg);
}

/* ---------- Photo plates (riso duotone) ---------- */
.plate {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  border: var(--rule);
}
.plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  filter: grayscale(1) contrast(1.12) brightness(1.05);
  transition: transform 200ms ease-out;
}
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--pink) 1px, transparent 1.4px);
  background-size: 6px 6px;
  mix-blend-mode: multiply;
  opacity: 0.35;
  pointer-events: none;
}
.front-fig { position: relative; }
.front-fig .plate { aspect-ratio: 16 / 10; }
.front-fig .plate img { position: absolute; inset: 0; height: 100%; }
figcaption.mono { color: var(--ink-soft); padding-top: 8px; font-size: 12px; }
.tape {
  position: absolute;
  top: -12px;
  left: 24px;
  width: 96px;
  height: 24px;
  background: rgba(255, 72, 176, 0.45);
  transform: rotate(-4deg);
  z-index: 2;
}

/* ---------- Halftone rule under hero ---------- */
.halftone-rule {
  height: 40px;
  background-image: radial-gradient(var(--blue) 1.2px, transparent 1.6px);
  background-size: 8px 8px;
}

/* ---------- Anchored sections under the sticky desk ---------- */
.programme, .map-band, .colophon { scroll-margin-top: 96px; }

/* ---------- Programme desk (sticky controls) ---------- */
.desk {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--rule);
}
.desk-in {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding-block: 14px;
  flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-search { flex: 1 1 260px; }
.field label { color: var(--ink-soft); }
.field input,
.field select {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: var(--rule);
  padding: 10px 14px;
  min-height: 44px;
}
.field select { cursor: pointer; }
.count { margin-left: auto; color: var(--ink-soft); padding-block: 12px; white-space: nowrap; }
.btn-toggle { min-height: 48px; }

/* ---------- Programme ---------- */
.programme { padding-block: clamp(64px, 7vw, 96px) clamp(64px, 7vw, 96px); }
.prog-head { margin-bottom: 40px; }
.sec-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.sec-kicker { color: var(--ink-soft); margin-top: 10px; }

.day { margin-bottom: 56px; }
.day:last-child { margin-bottom: 0; }
.day-band {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 24px 12px;
  color: var(--paper);
}
.day-sat .day-band { background: var(--blue); }
.day-sun .day-band { background: var(--pink); color: var(--ink); }
.day-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.day-count { margin-left: auto; }

/* torn top edge */
.torn {
  clip-path: polygon(0 10px, 3% 3px, 6% 12px, 10% 4px, 14% 11px, 18% 3px, 22% 10px, 26% 4px, 30% 12px, 34% 5px, 38% 11px, 42% 3px, 46% 10px, 50% 4px, 54% 12px, 58% 5px, 62% 11px, 66% 3px, 70% 10px, 74% 4px, 78% 12px, 82% 5px, 86% 11px, 90% 3px, 94% 10px, 97% 4px, 100% 9px, 100% 100%, 0 100%);
}

/* ---------- Entry rows ---------- */
.list-root { padding-inline: clamp(20px, 4vw, 48px); max-width: 1240px; margin-inline: auto; }
.entry {
  display: grid;
  grid-template-columns: 88px 180px minmax(0, 1fr) 200px 110px;
  grid-template-areas: "num plate main meta side";
  gap: 24px;
  align-items: center;
  padding-block: 24px;
  border-bottom: var(--rule);
  transition: background-color 90ms linear, color 90ms linear;
}
.entry:first-of-type { border-top: var(--rule); }

.e-num {
  grid-area: num;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 64px;
  line-height: 1;
  color: var(--ink);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.e-plate { grid-area: plate; height: 128px; }
.e-main { grid-area: main; min-width: 0; }
.e-kicker { color: var(--ink-soft); margin-bottom: 8px; font-size: 12px; }
.e-title {
  font-size: inherit;
  font-weight: inherit;
}
.e-title button {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink);
  padding-block: 10px;
  min-height: 44px;
}
.e-title button::after { content: " →"; }
@media (hover: hover) and (pointer: fine) {
  .e-title button:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
  .entry:hover .e-plate img { transform: scale(1.04); }
  .front-fig:hover img { transform: scale(1.03); }
}
.e-title button:active { transform: translateY(1px); }
.e-sum { max-width: 58ch; color: var(--ink-soft); }
.e-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
}
.e-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.e-price { font-size: 15px; font-weight: 600; }
.e-saved {
  background: var(--pink);
  color: var(--ink);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* row invert — hover (fine pointers) and keyboard focus */
@media (hover: hover) and (pointer: fine) {
  .entry:hover { background: var(--blue); color: var(--paper); }
  .entry:hover .e-num { -webkit-text-stroke-color: var(--paper); }
  .entry:hover .e-kicker, .entry:hover .e-sum, .entry:hover .e-meta, .entry:hover .e-title button,
  .entry:hover .e-price, .entry:hover figcaption { color: var(--paper); }
  .entry:hover .e-plate { border-color: var(--paper); }
  .entry:hover .e-title button:hover { text-decoration-color: var(--pink); }
}
.entry:focus-within { background: var(--blue); color: var(--paper); }
.entry:focus-within .e-num { -webkit-text-stroke-color: var(--paper); }
.entry:focus-within .e-kicker, .entry:focus-within .e-sum, .entry:focus-within .e-meta,
.entry:focus-within .e-title button, .entry:focus-within .e-price { color: var(--paper); }
.entry:focus-within .e-plate { border-color: var(--paper); }

/* ---------- Empty state ---------- */
.empty {
  margin-top: 40px;
  border: 2px dashed var(--ink);
  padding: clamp(32px, 5vw, 56px);
  text-align: center;
}
.empty-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
.empty p { max-width: 46ch; margin: 0 auto 24px; color: var(--ink-soft); }
.noscript-note { padding-block: 40px; color: var(--ink-soft); }

/* ---------- Field map band (color-flipped interlude) ---------- */
.map-band {
  background-color: var(--blue);
  background-image: radial-gradient(rgba(247, 243, 234, 0.16) 1.2px, transparent 1.6px);
  background-size: 11px 11px;
  color: var(--paper);
  padding-block: clamp(72px, 9vw, 128px);
}
.map-band .sec-kicker { color: rgba(247, 243, 234, 0.9); }
.map-in {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.map-lede { max-width: 46ch; margin-top: 20px; color: rgba(247, 243, 234, 0.92); }
.map-notes {
  list-style: none;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
}
.map-notes li {
  display: flex;
  gap: 16px;
  padding-block: 14px;
  border-top: 1px solid rgba(247, 243, 234, 0.35);
  max-width: 52ch;
}
.map-note-n {
  background: var(--pink);
  color: var(--ink);
  padding: 1px 7px;
  font-weight: 600;
  flex: none;
  height: fit-content;
}
.map-board {
  background: var(--paper);
  border: var(--rule);
  box-shadow: 10px 10px 0 var(--pink);
  color: var(--ink);
  overflow-x: auto;
}
.map-board svg { display: block; width: 100%; min-width: 560px; height: auto; }
.map-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--blue);
}
.map-river { font-size: 10px; }

/* ---------- Colophon ---------- */
.colophon {
  border-top: var(--rule);
  padding-block: clamp(48px, 6vw, 72px);
}
.colophon-in {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
}
.colophon-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.colophon-note { max-width: 52ch; color: var(--ink-soft); }
.colophon-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.colophon-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 0;
}
.colophon-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.colophon-nav a:active { transform: translateY(1px); }
.tiny { grid-column: 1 / -1; color: var(--ink-soft); font-size: 12px; letter-spacing: 0.06em; text-transform: none; }

/* ---------- Detail dialog (entry sheet) ---------- */
.entry-dialog {
  border: var(--rule);
  padding: 0;
  width: min(92vw, 720px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 10px 10px 0 rgba(31, 26, 23, 0.35);
}
.entry-dialog::backdrop { background: rgba(31, 26, 23, 0.55); }
.sheet {
  max-height: min(86dvh, 900px);
  overflow-y: auto;
  padding: clamp(20px, 3.5vw, 36px);
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.sheet-kicker { color: var(--blue); }
.sheet-close { flex: none; }
.sheet-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.sheet-plate { aspect-ratio: 16 / 7; margin-bottom: 24px; }
.sheet-plate img { position: absolute; inset: 0; height: 100%; }
.sheet-body p { margin-bottom: 14px; max-width: 62ch; }
.sheet-subhead {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: var(--rule);
  color: var(--ink-soft);
  font-size: 12px;
}
.sheet-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.sheet-table th, .sheet-table td {
  text-align: left;
  padding: 10px 0;
  border-top: var(--rule-thin);
  font-size: 15px;
}
.sheet-table th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  width: 34%;
  vertical-align: top;
}
.sheet-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: var(--rule);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.btn-save[aria-pressed="true"] {
  background: var(--ink);
  color: var(--pink);
  box-shadow: 5px 5px 0 var(--pink);
}
.sheet-note { color: var(--ink-soft); margin-left: auto; }

/* ---------- Entrance (CSS only, runs once) ---------- */
@keyframes stamp-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.front-copy > *, .front-side > * {
  animation: stamp-in 120ms var(--ease-step) both;
}
.front-copy > :nth-child(1) { animation-delay: 40ms; }
.front-copy > :nth-child(2) { animation-delay: 110ms; }
.front-copy > :nth-child(3) { animation-delay: 180ms; }
.front-copy > :nth-child(4) { animation-delay: 250ms; }
.front-side > :nth-child(1) { animation-delay: 200ms; }
.front-side > :nth-child(2) { animation-delay: 280ms; }
.front-side > :nth-child(3) { animation-delay: 360ms; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .entry {
    grid-template-columns: 64px 150px minmax(0, 1fr) 96px;
    grid-template-areas: "num plate main side";
    gap: 18px;
  }
  .e-meta {
    grid-area: auto;
    grid-column: 3;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 10px;
  }
  .e-main { display: flex; flex-direction: column; }
}
@media (max-width: 980px) {
  .front { grid-template-columns: 1fr; }
  .front-side { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .front-side .index-box { flex: 1 1 260px; }
  .front-side .front-fig { flex: 1 1 260px; }
  .map-in { grid-template-columns: 1fr; }
  .issue { display: none; }
}
@media (max-width: 820px) {
  .entry {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "num main side"
      "plate plate plate"
      "meta meta meta";
    gap: 14px;
    align-items: start;
  }
  .e-num { font-size: 44px; }
  .e-plate { height: 150px; }
  .e-side { align-items: flex-end; padding-top: 6px; }
}
@media (max-width: 700px) {
  .topbar-in { flex-wrap: wrap; row-gap: 0; }
  .topnav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-right: 24px;
    -webkit-mask-image: linear-gradient(to right, #000 92%, transparent);
            mask-image: linear-gradient(to right, #000 92%, transparent);
  }
  .topnav a { flex: none; }
  .desk-in { align-items: stretch; }
  .field-search { flex: 1 1 100%; }
  .count { margin-left: 0; }
  .sheet-actions { flex-direction: column; align-items: stretch; }
  .btn-save { width: 100%; text-align: center; }
  .sheet-note { margin-left: 0; }
  .front-cta { align-items: flex-start; flex-direction: column; gap: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .mis-pink { transform: translate(-3px, -2px); }
  .mis-blue { transform: translate(3px, 2px); }
}
