:root {
  color-scheme: dark;
  --bg: #100e12;
  --panel: #19161c;
  --line: #302931;
  --text: #faf5f8;
  --muted: #b9aeb9;
  --accent: #fa5499;
  --hot: #d41066;
  font-family: "Inter", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1216px, calc(100% - 72px)); margin-inline: auto; }
.header { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: #100e12f5; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; }
.brand { font-family: Georgia, serif; font-weight: bold; font-size: 38px; letter-spacing: -.08em; line-height: .95; }
.brand span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 24px; }
nav button { background: transparent; border: 0; padding: 12px 0; color: var(--muted); }
nav button[aria-pressed="true"] { color: var(--text); box-shadow: 0 2px var(--accent); }
.favorite-tab, .gate-actions button, .primary { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px 15px; }
.favorite-tab[aria-pressed="true"] { border-color: var(--accent); }
.favorite-tab span { margin-left: 5px; color: var(--accent); }
.stories { padding: 25px 0 22px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.stories h2 { font-size: 14px; margin: 0 0 13px; }
.story-list { display: flex; gap: 21px; overflow: auto; padding: 5px; }
.story { flex: 0 0 66px; display: grid; gap: 7px; justify-items: center; background: none; border: 0; padding: 0; font-size: 12px; }
.story-photo { width: 61px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--accent); box-shadow: 0 0 0 3px var(--bg) inset; }
#catalog { scroll-margin-top: 85px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 27px 0 18px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .15em; font-weight: 700; font-size: 11px; }
h1, .detail-copy h2, .gate h2 { font-family: Georgia, serif; font-weight: normal; margin: 5px 0 0; font-size: clamp(30px, 4vw, 50px); letter-spacing: -.035em; }
.demo, .count { color: var(--muted); font-size: 12px; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .28fr) minmax(140px, .28fr); gap: 9px; }
.search, select { min-height: 46px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; }
.search { display: flex; align-items: center; gap: 9px; padding: 0 12px; }
.search span { color: var(--accent); font-size: 24px; }
.search input { width: 100%; background: transparent; color: inherit; border: 0; padding-block: 8px; }
.search input::placeholder { color: var(--muted); }
select { padding: 0 11px; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0; }
.categories { display: flex; gap: 7px; flex-wrap: wrap; }
.categories button { padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: 13px; }
.categories [aria-pressed="true"] { background: #38172a; color: #ffd5e8; border-color: #964263; }
.count { flex: 0 0 auto; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.card { position: relative; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--panel); }
.card-main { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; }
.card-main:focus-visible { outline-offset: -4px; }
.card-photo { display: block; aspect-ratio: 1 / 1.06; }
.story-photo, .card-photo, .detail-photo {
  background-color: #38262f;
  background-image: url("portraits.png"), linear-gradient(145deg, #674052, #20161f);
  background-size: 300% 200%, cover;
  background-position: var(--x) var(--y), center;
}
.card-copy { display: block; padding: 11px 13px 13px; }
.card-name { display: block; font-family: Georgia, serif; font-size: 24px; }
.location { color: var(--muted); font-size: 12px; }
.heart, .close { position: absolute; top: 9px; right: 9px; border-radius: 50%; width: 38px; height: 38px; border: 1px solid #ffffff40; background: #100e12d9; font-size: 23px; display: grid; place-content: center; }
.heart[aria-pressed="true"] { color: var(--accent); }
.empty { padding: 32px 0; color: var(--muted); }
footer { margin-top: 42px; min-height: 90px; padding: 20px 0; display: flex; gap: 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
footer .brand { font-size: 26px; }
footer p { color: var(--muted); font-size: 12px; }
dialog { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 13px; max-height: calc(100dvh - 36px); }
dialog::backdrop { background: #08060be6; }
.gate { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; background: #0c090d; }
.gate[open] { display: grid; place-items: center; }
body:has(.gate[open]) { overflow: hidden; }
.gate-inner { text-align: center; max-width: 520px; padding: 20px; }
.gate .brand { font-size: clamp(74px, 15vw, 132px); margin-bottom: 25px; }
.gate h2 { font-size: clamp(26px, 5vw, 34px); }
.gate p, .detail-copy p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.gate-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.gate-actions button { min-width: 114px; }
.primary, .gate-actions .primary { background: var(--hot); border-color: var(--hot); color: white; font-weight: 700; }
.details { padding: 0; width: min(415px, calc(100% - 24px)); }
.detail-photo { aspect-ratio: 1.2; }
.detail-copy { padding: 16px 22px 23px; }
.detail-copy h2 { font-size: 38px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .shell { width: calc(100% - 30px); }
  .topbar { min-height: 60px; gap: 7px; }
  .brand { font-size: 30px; }
  nav { gap: 11px; font-size: 12px; }
  .favorite-tab { padding: 7px; font-size: 12px; }
  .stories { padding-block: 15px; }
  .story-list { gap: 13px; }
  .intro { align-items: start; flex-direction: column; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { grid-column: 1 / -1; }
  .results-bar { align-items: start; flex-direction: column; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-copy { padding-inline: 9px; }
}
