:root {
  --bg: #0e1726;
  --bg-2: #15213a;
  --panel: #1a2845;
  --line: #2c3d63;
  --ink: #f2f5fb;
  --ink-2: #b9c4dc;
  --focus: #ffe14d;
  --c-Culture: #ff6fb5;
  --c-Food: #ffa94d;
  --c-Movement: #38d9f5;
  --c-People: #b8f05a;
  --c-Places: #b79cff;
  --sans: "Helvetica Neue", "Segoe UI", Roboto, "Arial Nova", Arial, system-ui, sans-serif;
  --cond: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", "Segoe UI Semibold", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html.lock { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }

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

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--focus); color: #000; padding: 10px 14px; font-weight: 700;
}
.skip:focus { top: 8px; }

.shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  padding: 36px 28px 28px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 30px;
}
.brand { display: flex; gap: 16px; align-items: center; }
.brand-mark { display: grid; gap: 5px; width: 54px; flex: none; }
.brand-mark i { display: block; height: 11px; border-radius: 6px; }
.brand-mark i:nth-child(1) { background: var(--c-Movement); width: 100%; }
.brand-mark i:nth-child(2) { background: var(--c-Culture); width: 78%; margin-left: 22%; }
.brand-mark i:nth-child(3) { background: var(--c-People); width: 56%; }
.brand-name {
  font-family: var(--cond); font-weight: 800; font-size: 46px; line-height: 0.95;
  letter-spacing: -0.02em; text-transform: uppercase;
}
.brand-tag { margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 1.3; }

.tools { display: grid; gap: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--bg); border: 2px solid var(--line); border-radius: 12px;
}
.field input::placeholder { color: #7f8cab; }
.field input:hover, .field select:hover { border-color: #4a5f92; }
.field select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px;
}
.field select option { background: var(--bg); color: var(--ink); }

.saved-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 14px;
  background: transparent; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left;
  font-weight: 600;
}
.saved-toggle:hover { border-color: #4a5f92; }
.saved-ico {
  width: 14px; height: 18px; flex: none; border: 2px solid currentColor; border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
  background: transparent;
}
.saved-label { flex: 1; }
.saved-count {
  min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center;
  border-radius: 14px; background: var(--line); font-size: 14px; font-weight: 700;
}
.saved-toggle[aria-pressed="true"] { background: var(--focus); border-color: var(--focus); color: #11151f; }
.saved-toggle[aria-pressed="true"] .saved-ico { background: #11151f; }
.saved-toggle[aria-pressed="true"] .saved-count { background: #11151f; color: var(--focus); }
.saved-toggle[aria-pressed="true"]:focus-visible { outline-color: #fff; }

.lines-head {
  font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 8px;
}
.lines ul { position: relative; }
.lines button {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 44px; padding: 6px 8px 6px 0; background: none; border: 0; cursor: pointer; text-align: left;
  font-weight: 600; border-radius: 8px;
}
.lines .dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--bg-2);
  border: 5px solid var(--lc); position: relative; z-index: 1;
}
.lines li::before {
  content: ""; position: absolute; left: 10px; width: 4px; height: 44px; background: var(--line); transform: translateY(-22px);
}
.lines li { position: relative; }
.lines li:first-child::before { display: none; }
.lines .n { margin-left: auto; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.lines button:hover { background: rgba(255,255,255,0.05); }
.lines button[aria-current="true"] .dot { background: var(--lc); }
.lines button[aria-current="true"] { color: #fff; }

.fine { margin-top: auto; color: #8d9bbd; font-size: 13px; line-height: 1.4; }

/* ---------- main ---------- */
.main { padding: 44px 48px 72px; min-width: 0; outline: none; }
.main-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px;
  padding-bottom: 24px; border-bottom: 4px solid var(--ink);
}
.kicker { font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--focus); margin-bottom: 10px; }
.main-title { font-family: var(--cond); font-weight: 800; font-size: 44px; line-height: 1.02; letter-spacing: -0.01em; max-width: 18ch; text-transform: uppercase; }
.status { color: var(--ink-2); font-size: 15px; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid[hidden] { display: none; }
.card {
  --c: var(--ink);
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 26px 28px 26px 34px; background: var(--panel); border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--c); }
.card:hover { transform: translateY(-3px); border-color: var(--c); }
.card[data-cat="Culture"] { --c: var(--c-Culture); }
.card[data-cat="Food"] { --c: var(--c-Food); }
.card[data-cat="Movement"] { --c: var(--c-Movement); }
.card[data-cat="People"] { --c: var(--c-People); }
.card[data-cat="Places"] { --c: var(--c-Places); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border-radius: 999px;
  background: var(--c); color: #0e1726; font-family: var(--cond); font-weight: 800; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}
.tag::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #0e1726; border: 3px solid var(--c); box-shadow: 0 0 0 2px #0e1726 inset; }
.num { font-family: var(--cond); font-weight: 800; font-size: 40px; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--c); font-variant-numeric: tabular-nums; }
.badge { display: none; font-size: 13px; font-weight: 700; color: var(--focus); }
.card.is-saved .badge { display: inline-flex; align-items: center; gap: 6px; }
.badge::before { content: ""; width: 10px; height: 13px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); }

.card h3 { font-family: var(--sans); font-weight: 800; font-size: 27px; line-height: 1.14; letter-spacing: -0.015em; }
.card.lead h3 { font-size: 40px; max-width: 22ch; }
.open-item {
  all: unset; cursor: pointer; display: inline;
}
.open-item::after { content: ""; position: absolute; inset: 0; }
.open-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.card:has(.open-item:focus-visible) { border-color: var(--focus); }
.card .sum { color: var(--ink-2); }
.card.lead .sum { font-size: 20px; max-width: 54ch; }
.meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); }
.meta b { color: var(--ink); font-weight: 700; }
.card.lead { grid-column: 1 / -1; padding: 38px 44px 34px 52px; background: linear-gradient(120deg, var(--panel) 40%, color-mix(in srgb, var(--c) 28%, var(--panel))); }
.card.lead::before { width: 16px; }

/* empty */
.empty { padding: 56px 32px; border: 3px dashed var(--line); border-radius: 18px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty[hidden] { display: none; }
.empty-big { font-family: var(--cond); font-weight: 800; font-size: 40px; text-transform: uppercase; }
.empty p { color: var(--ink-2); }
.btn {
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--focus); color: #11151f; font-weight: 800;
}
.btn:hover { filter: brightness(1.08); }

/* ---------- detail ---------- */
dialog.detail {
  --c: var(--ink);
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0;
  width: min(820px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh;
  background: var(--bg); color: var(--ink);
  box-shadow: -30px 0 80px rgba(0,0,0,.55);
  overflow: hidden;
  animation: slide .28s ease-out;
}
dialog.detail::backdrop { background: rgba(5, 9, 18, .7); animation: fade .28s ease-out; }
dialog.detail[data-cat="Culture"] { --c: var(--c-Culture); }
dialog.detail[data-cat="Food"] { --c: var(--c-Food); }
dialog.detail[data-cat="Movement"] { --c: var(--c-Movement); }
dialog.detail[data-cat="People"] { --c: var(--c-People); }
dialog.detail[data-cat="Places"] { --c: var(--c-Places); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.d-wrap { height: 100%; display: flex; flex-direction: column; }
.d-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none;
  padding: 14px 28px; background: var(--c); color: #0e1726;
}
.d-bar .tag { background: #0e1726; color: var(--c); }
.d-bar .tag::before { background: var(--c); border-color: #0e1726; box-shadow: none; }
.d-close {
  min-height: 46px; padding: 8px 18px; border-radius: 999px; border: 2px solid #0e1726; background: transparent; color: #0e1726; cursor: pointer; font-weight: 800;
}
.d-close:hover { background: #0e1726; color: var(--c); }
.d-close:focus-visible, .d-bar :focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px #0e1726; }
.d-scroll { flex: 1; overflow-y: auto; padding: 40px 48px 64px; }
.d-title { font-family: var(--sans); font-weight: 800; font-size: 46px; line-height: 1.07; letter-spacing: -0.025em; }
.d-sum { margin-top: 18px; font-size: 21px; line-height: 1.45; color: var(--ink-2); }
.d-meta { margin: 24px 0 22px; padding: 14px 0; border-block: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; color: var(--ink-2); }
.d-meta b { color: var(--ink); }
.save {
  display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 22px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--c); background: transparent; color: var(--ink); font-weight: 800;
}
.save::before { content: ""; width: 13px; height: 17px; border: 2px solid currentColor; border-bottom: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); }
.save:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.save[aria-pressed="true"] { background: var(--c); color: #0e1726; }
.save[aria-pressed="true"]::before { background: #0e1726; }
.d-body { margin-top: 34px; max-width: 62ch; font-size: 20px; line-height: 1.7; }
.d-body p + p { margin-top: 1.1em; }
.d-body p:first-child::first-letter {
  float: left; font-family: var(--cond); font-weight: 800; font-size: 4.3em; line-height: .82; padding: 6px 12px 0 0; color: var(--c);
}
.d-end { margin-top: 40px; display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 14px; }
.d-end::before { content: ""; width: 56px; height: 8px; border-radius: 4px; background: var(--c); }

/* ---------- mobile ---------- */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 300px minmax(0, 1fr); }
  .side { padding: 28px 22px; }
  .main { padding: 36px 28px 64px; }
  .grid { grid-template-columns: 1fr; }
  .main-title { font-size: 36px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { display: block; }
  .side { position: static; height: auto; overflow: visible; padding: 22px 18px 20px; gap: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-name { font-size: 40px; }
  .brand-mark { width: 46px; }
  .tools { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tools .field:first-child { grid-column: 1 / -1; }
  .tools .field { min-width: 0; }
  .saved-toggle { align-self: end; padding: 10px 12px; gap: 8px; }
  .saved-label { font-size: 14px; white-space: nowrap; }
  .lines { display: none; }
  .fine { display: none; }
  .main { padding: 26px 18px 56px; }
  .main-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding-bottom: 18px; }
  .main-title { font-size: 30px; }
  .grid { gap: 16px; }
  .card { padding: 20px 20px 20px 28px; }
  .card.lead { padding: 24px 22px 24px 32px; }
  .card h3 { font-size: 23px; }
  .card.lead h3 { font-size: 29px; }
  .card.lead .sum { font-size: 17px; }
  .num { font-size: 32px; }
  .empty-big { font-size: 32px; }
  .d-bar { padding: 10px 16px; }
  .d-scroll { padding: 28px 20px 56px; }
  .d-title { font-size: 33px; }
  .d-sum { font-size: 18px; }
  .d-body { font-size: 18px; }
  dialog.detail { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
}
