@font-face {
  font-family: 'Roboto Flex';
  src: url('./assets/fonts/roboto-flex-cyrillic.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
  unicode-range: U+0400-052F, U+2116;
}
@font-face {
  font-family: 'Roboto Flex';
  src: url('./assets/fonts/roboto-flex-latin.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
  unicode-range: U+0000-03FF, U+2000-20FF, U+2122, U+2212;
}
@font-face {
  font-family: Unbounded;
  src: url('./assets/fonts/wide.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f4f1eb;
  --ink: #241e21;
  --muted: #625957;
  --rule: #d9d1c6;
  --accent: #292092;
  --lime: #d2ff58;
  --like: #20461b;
  --like-bg: #e4f4bf;
  --ok: #5c4308;
  --ok-bg: #faecc4;
  --dislike: #73270f;
  --dislike-bg: #ffe3d6;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.45 'Roboto Flex', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .25em; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
:focus-visible { outline: 3px solid #5141b5; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 3; inset: .5rem auto auto .5rem; padding: .7rem 1rem; background: white; border-radius: .6rem; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.page-width { width: min(100% - clamp(2rem, 7vw, 7.5rem), 86rem); margin-inline: auto; }

.masthead { padding-top: clamp(1.2rem, 4vw, 3.1rem); }
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: .36rem .78rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 900 .89rem/1 Unbounded, 'Roboto Flex', sans-serif;
  letter-spacing: -.05em;
}
.masthead-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(10rem, 21vw, 15rem);
  gap: 1.25rem;
  align-items: end;
  padding: clamp(1.2rem, 4.6vw, 3.25rem) 0 clamp(1.3rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
}
.masthead-title h1 {
  margin: 0;
  font-size: clamp(3.35rem, 8.2vw, 8rem);
  font-weight: 1000;
  line-height: .88;
  letter-spacing: -.079em;
}
.masthead-title p { margin: .8rem 0 0; color: var(--muted); }
.overview { display: grid; gap: .45rem; align-content: end; }
.overview p { margin: 0; color: var(--muted); font-size: .94rem; }
.overview strong { color: var(--ink); font-size: 1.42rem; font-weight: 950; font-variant-numeric: tabular-nums; }
.overview-actions { display: flex; flex-wrap: wrap; gap: .15rem .95rem; align-items: center; }
progress { width: 100%; height: .56rem; appearance: none; border: 0; border-radius: 999px; background: #e7e0d5; overflow: hidden; }
progress::-webkit-progress-bar { background: #e7e0d5; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.text-button { width: fit-content; padding: .48rem 0; min-height: 44px; background: none; border: 0; color: var(--accent); font-weight: 710; text-decoration: underline; text-underline-offset: .24em; }
.text-button:not(:disabled):hover, .footer a:hover { color: #5141b5; }

.workspace { display: grid; grid-template-columns: clamp(10.8rem, 16vw, 13rem) minmax(0, 1fr); column-gap: clamp(1.2rem, 4vw, 3.5rem); padding-top: clamp(1.45rem, 4vw, 3rem); }
.sidebar { border-inline-end: 1px solid var(--rule); padding-inline-end: clamp(.75rem, 2vw, 1.45rem); }
.sidebar-inner { position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); padding: .18rem .25rem .3rem; margin: 0 -.25rem; overflow: auto; scrollbar-width: thin; }
.sidebar h2 { margin: 0 0 .55rem .55rem; color: var(--muted); font-size: .88rem; font-weight: 740; }
.category-menu { display: grid; gap: .1rem; }
.category-menu a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .3rem;
  min-height: 2.5rem;
  padding: .37rem .55rem;
  border: 1px solid transparent;
  border-radius: .72rem;
  font-weight: 690;
  text-decoration: none;
}
.category-menu a:hover { background: #e9e2d7; }
.category-menu a[aria-current='page'] { background: var(--lime); border-color: #c1e763; }
.category-menu a.is-showcase { margin-bottom: .55rem; padding-bottom: .5rem; position: relative; }
.category-menu a.is-showcase::after { content: ''; position: absolute; left: .4rem; right: .4rem; bottom: -.32rem; height: 1px; background: var(--rule); }
.category-menu .category-total { color: #534b3e; font-size: .81rem; font-variant-numeric: tabular-nums; }
.category-mobile { display: none; }
.review { min-width: 0; overflow-x: clip; }
.review-header { display: flex; justify-content: space-between; align-items: end; gap: .8rem; flex-wrap: wrap; }
.review-header h2 { margin: 0; font-size: clamp(2.35rem, 5.7vw, 5rem); font-weight: 1000; line-height: .94; letter-spacing: -.07em; }
.category-status { margin: .42rem 0 0; color: var(--muted); font-size: .94rem; }
.segmented { display: flex; padding: .2rem; gap: .12rem; border: 1px solid var(--rule); border-radius: 999px; }
.segmented button, .filters button, .outline-button {
  min-height: 44px;
  padding: .48rem .82rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: .91rem;
  font-weight: 720;
}
.segmented button { min-height: 40px; }
.segmented button:hover, .filters button:hover, .outline-button:not(:disabled):hover { background: #e9e2d7; }
.segmented button[aria-pressed='true'] { background: var(--ink); color: white; }
.filters button[aria-pressed='true'] { background: #e5dffc; color: #292092; border-color: #d1c6f1; }
.review-tools { display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; margin: 1.25rem 0 .9rem; padding-block: .46rem; border-block: 1px solid var(--rule); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; }
.review-tools > button { font-size: .91rem; }
.outline-button { border-color: var(--rule); background: #fcf9f2; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem .85rem; }
.gallery-item { min-width: 0; margin: 0; padding-bottom: .45rem; border-bottom: 1px solid var(--rule); }
.budget-card { container-type: inline-size; min-width: 0; width: 100%; }
.card-stage {
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: clamp(17rem, 25vw, 23rem);
  padding: 1.25rem .95rem;
  overflow: visible;
}
.card-toolbar { display: grid; gap: .45rem; margin-top: .75rem; }
.archetype-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .32rem .5rem; }
.archetype-badge {
  display: inline-flex;
  align-items: center;
  padding: .16rem .52rem;
  border-radius: 999px;
  background: #e5dffc;
  color: #292092;
  font-size: .74rem;
  font-weight: 780;
  letter-spacing: -.01em;
}
.archetype-cat { color: var(--muted); font-size: .78rem; font-weight: 680; }
.card-toolbar h3 { margin: 0; font-size: .92rem; font-weight: 800; line-height: 1.2; }
.vote-actions { display: flex; flex-wrap: wrap; justify-content: start; align-items: center; gap: .32rem; }
.vote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 44px;
  min-height: 44px;
  padding: .3rem .54rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #faf7f0;
  color: var(--ink);
  font-size: .89rem;
  font-weight: 750;
}
.vote:hover { background: #e9e2d7; }
.vote[data-vote='like'][aria-pressed='true'] { background: var(--like-bg); color: var(--like); border-color: #b0c478; }
.vote[data-vote='ok'][aria-pressed='true'] { background: var(--ok-bg); color: var(--ok); border-color: #dec075; }
.vote[data-vote='dislike'][aria-pressed='true'] { background: var(--dislike-bg); color: var(--dislike); border-color: #e1a18a; }
.comment-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-width: 44px;
  min-height: 44px;
  padding: .3rem .62rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #faf7f0;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 730;
}
.comment-toggle:hover { background: #e9e2d7; }
.comment-toggle[data-has-comment='true'] { background: #e5dffc; color: #292092; border-color: #c5b6f0; }
.comment-toggle[aria-expanded='true'] { border-color: #5141b5; }
.comment-box { margin-top: .48rem; }
.comment-box textarea {
  width: 100%;
  min-height: 3.4rem;
  padding: .55rem .72rem;
  border: 1px solid var(--rule);
  border-radius: .85rem;
  background: #fcf9f2;
  color: var(--ink);
  font: 500 16px/1.38 'Roboto Flex', system-ui, sans-serif;
  resize: vertical;
}
.comment-box textarea:focus-visible { outline: 2px solid #5141b5; outline-offset: 2px; border-color: #5141b5; }
.single-review { width: min(100%, 30rem); margin: 0 auto; }
.single-card .card-stage { min-height: 25rem; padding: 1rem; touch-action: pan-y; }
.single-card .card-toolbar { flex-wrap: wrap; }
.single-card .vote { padding-inline: .76rem; }
.single-nav { display: flex; gap: .45rem; align-items: center; justify-content: space-between; padding: .75rem 0 0; }
.single-nav p, .keyboard-hint { margin: 0; color: var(--muted); font-size: .92rem; }
.keyboard-hint { margin-top: .55rem; text-align: center; }
.empty-state { margin: 0; padding: 3rem 1rem; border: 1px dashed var(--rule); border-radius: 1.55rem; text-align: center; color: var(--muted); }
.storage-message { border: 1px solid #e1a18a; border-radius: .8rem; color: var(--dislike); background: var(--dislike-bg); padding: .65rem .8rem; }
.next-category { display: block; width: fit-content; margin: 1.65rem 0 0 auto; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 2rem; padding-block: .95rem; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--muted); }
.footer p { margin: 0; }

@media (min-width: 1200px) {
  .card-stage { padding: .93rem; }
}
@media (max-width: 1120px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-stage { min-height: clamp(17.5rem, 32vw, 23.5rem); }
}
@media (max-width: 760px) {
  .workspace { display: block; }
  .sidebar { display: none; }
  .category-mobile { display: grid; gap: .24rem; max-width: 20rem; margin-bottom: 1.25rem; }
  .category-mobile label { color: var(--muted); font-size: .9rem; font-weight: 750; }
  .category-mobile select { width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--rule); border-radius: .8rem; background: #fcf9f2; font-weight: 750; }
}
@media (max-width: 560px) {
  .masthead-body { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .overview { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 1.05rem; }
  .card-stage { min-height: 20.5rem; }
  .single-card .card-stage { min-height: 21rem; padding: 1.15rem .95rem; }
  .review-tools { margin-top: .9rem; }
  .filters { gap: .1rem; }
  .filters button { padding-inline: .6rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .category-menu a { transition: background-color .14s ease-out, border-color .14s ease-out, color .14s ease-out; }
}
