/* Forma — dark "run sheet" direction: charcoal, bone text, one acid-lime signal colour. */
:root {
  --bg: #131313;
  --surface: #1c1c1b;
  --surface-2: #262625;
  --line: #3a3a38;
  --text: #f2f0ea;
  --muted: #b9b6ac;
  --accent: #d9f85a;
  --accent-ink: #131313;
  --focus: #ffffff;

  --display: "Avenir Next Condensed", "Helvetica Neue Condensed", "Arial Narrow", "Roboto Condensed", "Nimbus Sans Narrow", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --side: 380px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lock { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, figure, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; font-weight: 700;
}
.skip:focus { top: 12px; }
.main:focus { outline: none; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); }
.side-inner {
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 26px;
}
.main { padding: 28px 48px 40px; min-width: 0; }

/* ---------- sidebar ---------- */
.wordmark {
  font: 800 30px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
  color: var(--text); text-decoration: none; align-self: flex-start;
}
.wordmark span { color: var(--accent); margin-left: 2px; }
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1 {
  font: 800 56px/.94 var(--display); text-transform: uppercase; letter-spacing: -.005em;
  margin: 10px 0 14px; text-wrap: balance;
}
.lede { color: var(--muted); max-width: 32ch; }

.controls { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .shortlist h2 {
  font: 500 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
input[type="search"], select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0;
  color: var(--text); appearance: none; -webkit-appearance: none;
}
input[type="search"]::placeholder { color: #8f8c83; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(1); }
input[type="search"]:hover, select:hover { border-color: #6a6a66; }
input[type="search"]:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--accent); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
select { padding-right: 40px; cursor: pointer; }
select option { background: var(--surface); color: var(--text); }

.saved-toggle {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px;
  background: transparent; border: 1px solid var(--line); text-align: left;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.saved-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.saved-toggle span:nth-of-type(1) { flex: 1; font-weight: 600; }
.saved-toggle .count {
  min-width: 28px; padding: 1px 8px; text-align: center; font: 600 13px/22px var(--mono);
  border: 1px solid currentColor;
}
.saved-toggle:hover { border-color: var(--accent); }
.saved-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.saved-toggle[aria-pressed="true"] svg { fill: currentColor; }

.shortlist { display: grid; gap: 10px; }
.shortlist ol { list-style: none; display: grid; }
.shortlist li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.shortlist li button {
  flex: 1; min-height: 44px; padding: 8px 0; background: none; border: 0; text-align: left;
  font-weight: 600; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
}
.shortlist li button:hover { text-decoration-color: var(--accent); }
.shortlist li .p { font: 500 13px var(--mono); color: var(--muted); }
.shortlist .total {
  display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--text);
  font: 600 14px var(--mono);
}
.shortlist .none { color: var(--muted); font-size: 15px; }

.side-photo { position: relative; margin-top: auto; }
.side-photo img { width: 100%; height: 170px; object-fit: cover; }
.side-photo figcaption { font: 400 12px/1.4 var(--mono); color: var(--muted); padding-top: 8px; }

/* ---------- list ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--text); }
.list-head h2 { font: 800 28px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.status { font: 500 13px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.list { display: block; }
.row {
  position: relative; display: grid;
  grid-template-columns: 92px 176px minmax(0, 1fr) 112px 52px;
  grid-template-areas: "when img main price save";
  align-items: center; column-gap: 28px; padding: 22px 12px;
  border-bottom: 1px solid var(--line);
  transition: background-color .2s var(--ease);
}
.intro .row { animation: rise .5s var(--ease) backwards; }
.intro .row:nth-child(2) { animation-delay: 60ms; }
.intro .row:nth-child(3) { animation-delay: 120ms; }
.intro .row:nth-child(4) { animation-delay: 180ms; }
.intro .row:nth-child(n+5) { animation-delay: 240ms; }
.row:hover { background: var(--surface); }
.row:has(.open:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }
.row .open:focus-visible { outline-offset: 2px; }

.when { grid-area: when; display: grid; justify-items: start; line-height: 1; }
.when .dow, .when .mon { font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.when .day { font: 800 64px/.95 var(--display); color: var(--accent); letter-spacing: -.01em; }
.row-img { grid-area: img; width: 176px; height: 124px; object-fit: cover; background: var(--surface-2); }
.row-main { grid-area: main; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.tag {
  display: inline-block; padding: 1px 8px; font: 500 11px/20px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted);
}
.row h3 { font: 800 34px/1 var(--display); text-transform: uppercase; letter-spacing: .005em; }
.row .desc {
  color: var(--muted); font-size: 15px; max-width: 58ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { font: 400 13px/1.5 var(--mono); color: var(--text); }
.meta i { font-style: normal; color: var(--muted); padding: 0 6px; }
.open {
  margin-top: 4px; min-height: 44px; padding: 0; background: none; border: 0;
  font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px;
  display: inline-flex; align-items: center; gap: 8px;
}
.open::before { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole row opens the detail */
.open .arrow { transition: transform .2s var(--ease); text-decoration: none; display: inline-block; }
.row:hover .open .arrow { transform: translateX(5px); }

.price { grid-area: price; display: grid; justify-items: end; text-align: right; }
.price strong { font: 800 40px/1 var(--display); }
.price span { font: 400 12px/1.5 var(--mono); color: var(--muted); }

.quick {
  grid-area: save; position: relative; z-index: 2; width: 48px; height: 48px;
  display: grid; place-items: center; background: transparent; border: 1px solid var(--line); color: var(--text);
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.quick svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.quick:hover { border-color: var(--accent); }
.quick:active { transform: scale(.94); }
.quick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.quick[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- empty ---------- */
.empty { padding: 56px 0; display: grid; gap: 10px; justify-items: start; border-bottom: 1px solid var(--line); }
.empty-title { font: 800 40px/1 var(--display); text-transform: uppercase; }
.empty-text { color: var(--muted); max-width: 44ch; }
.btn {
  margin-top: 8px; min-height: 48px; padding: 10px 20px; background: var(--accent); color: var(--accent-ink);
  border: 0; font-weight: 700;
}
.btn:hover { background: #e8ff7d; }

.foot { padding-top: 32px; color: var(--muted); font: 400 12px/1.6 var(--mono); max-width: 70ch; }

/* ---------- detail dialog ---------- */
dialog.detail {
  margin: 0 0 0 auto; padding: 0; border: 0; width: min(620px, 100%); height: 100vh; height: 100dvh;
  max-width: 100%; max-height: none; background: var(--surface); color: var(--text); overflow: hidden;
  border-left: 1px solid var(--line);
}
dialog.detail[open] { display: flex; flex-direction: column; animation: slide-in .32s var(--ease); }
dialog.detail::backdrop { background: rgba(5, 5, 5, .72); animation: fade .25s ease; }

.d-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 24px; border-bottom: 1px solid var(--line); flex: none;
}
.d-body .tag { justify-self: start; }
.close b { font-weight: 600; }
.d-bar > span { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.close {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px;
  background: transparent; border: 1px solid var(--line); font-weight: 600;
}
.close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: square; }
.close:hover { border-color: var(--accent); }
.d-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.d-img { width: 100%; height: 300px; object-fit: cover; }
.d-body { padding: 24px 24px 28px; display: grid; gap: 16px; }
.d-body h2 { font: 800 56px/.94 var(--display); text-transform: uppercase; text-wrap: balance; }
.d-text { font-size: 18px; line-height: 1.6; max-width: 52ch; }
.facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin-top: 8px; }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 16px; }
.facts dt { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-weight: 600; font-size: 17px; }
.d-foot { flex: none; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.save-btn {
  width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); font-weight: 800; font-size: 17px;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.save-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.save-btn:hover { background: #e8ff7d; }
.save-btn[aria-pressed="true"] { background: transparent; color: var(--accent); }
.save-btn[aria-pressed="true"] svg { fill: currentColor; }
.save-btn:focus-visible { outline-offset: 3px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  :root { --side: 320px; }
  .side-inner { padding: 24px; }
  h1 { font-size: 46px; }
  .main { padding: 24px 28px 36px; }
  .row { grid-template-columns: 72px 128px minmax(0, 1fr) 84px 48px; column-gap: 18px; }
  .row-img { width: 128px; height: 108px; }
  .when .day { font-size: 52px; }
  .row h3 { font-size: 28px; }
  .price strong { font-size: 32px; }
}

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { border: 0; border-bottom: 1px solid var(--line); }
  .side-inner { position: static; max-height: none; overflow: visible; padding: 18px 16px 20px; gap: 18px; }
  .side-photo { display: none; }
  h1 { font-size: 44px; margin: 6px 0 10px; }
  .lede { max-width: 40ch; font-size: 15px; }
  .controls { grid-template-columns: 1fr 1fr; align-items: end; }
  .controls .field:first-child { grid-column: 1 / -1; }
  .saved-toggle { align-self: end; }
  .saved-toggle span:nth-of-type(1) { font-size: 15px; }
  .main { padding: 18px 16px 32px; }
  .list-head h2 { font-size: 24px; }

  .row {
    grid-template-columns: minmax(0, 1fr) 48px;
    grid-template-areas: "img img" "main save" "price save";
    row-gap: 10px; column-gap: 12px; padding: 18px 0; align-items: start;
  }
  .row-img { width: 100%; height: 188px; }
  .when {
    position: absolute; left: 0; top: 18px; z-index: 1; justify-items: center; padding: 8px 12px 6px;
    background: var(--accent); min-width: 64px;
  }
  .when .dow, .when .mon { color: var(--accent-ink); font-weight: 600; }
  .when .day { color: var(--accent-ink); font-size: 40px; }
  .row h3 { font-size: 32px; }
  .price { justify-items: start; text-align: left; grid-auto-flow: column; gap: 10px; align-items: baseline; justify-content: start; }
  .price strong { font-size: 30px; }
  .quick { align-self: start; }

  dialog.detail { width: 100%; border-left: 0; }
  dialog.detail[open] { animation-name: slide-up; }
  .d-bar { padding-left: 16px; }
  .d-img { height: 210px; }
  .d-body { padding: 18px 16px 24px; }
  .d-body h2 { font-size: 46px; }
  .d-text { font-size: 17px; }
  .d-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
