:root {
  --bg: #f2f3f5;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #4d4d4d;
  --yellow: #ffcc00;
  --yellow-hover: #ffdb4d;
  --yellow-press: #f5c400;
  --line: #e6e6e6;
  --soft: #f7f7f8;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --sans: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --radius: 20px;
  --pill: 999px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { margin: 0 0 0.7rem; font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
h2 { margin: 0 0 0.75rem; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
p { margin: 0; }
p + p { margin-top: 0.75rem; }

a { color: #0057d9; text-underline-offset: 0.18em; }
a:hover { color: #003e9c; }

:focus-visible {
  outline: 3px solid #1a1a1a;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -8rem;
  z-index: 6;
  padding: 0.8rem 1.1rem;
  border-radius: var(--pill);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap, .wrap-narrow { width: min(76rem, calc(100% - 2.5rem)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
}
.header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  align-items: center;
  min-height: 4.6rem;
  padding: 0.7rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--pill);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.35rem;
}
.logo-text { display: flex; flex-direction: column; }
.logo-word { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.logo-hint { color: var(--muted); font-size: 1rem; line-height: 1.3; }
.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--pill);
  background: var(--soft);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-list a:hover { background: #ececec; color: var(--ink); }

.hero { padding: 1.4rem 0 0.2rem; }
.hero .wrap {
  padding: 1.6rem 1.4rem 1.45rem;
  border-radius: 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, #fff4b8 0%, rgba(255, 244, 184, 0) 46%),
    #fff;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex;
  margin: 0 0 0.7rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--pill);
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}
.lede { max-width: 42rem; font-size: 1.0625rem; }
.note {
  max-width: 42rem;
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background: #fff8d6;
  color: var(--ink);
}
.actions { margin-top: 1.15rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.75rem 1.35rem;
  border: 0;
  border-radius: var(--pill);
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.button:hover { background: var(--yellow-hover); color: var(--ink); }
.button:active { background: var(--yellow-press); }
.button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.button-small { min-height: 2.9rem; padding-inline: 1.1rem; font-size: 1.05rem; }

.section { padding: 1.6rem 0 0.4rem; }
.section-paper { background: transparent; }

.filters, .sortline { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.85rem 0 1rem; }
.chip, .sortline a {
  display: inline-flex;
  align-items: center;
  min-height: 2.7rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--pill);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.chip:hover, .sortline a:hover { background: #fff; color: var(--ink); }
.chip.is-on, .sortline a[aria-current="true"] {
  background: var(--ink);
  color: #fff;
}

.cards { display: grid; gap: 1.1rem; }
.card, .comment {
  padding: 1.25rem 1.35rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.comment { padding: 0.85rem 1rem; }
.card-layout { display: flex; gap: 0.75rem; align-items: flex-start; }
.card-layout > div:not(.portrait-slot):not(.person) { min-width: 0; flex: 1; }
.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 4.4rem;
  flex: 0 0 4.4rem;
}
.comment .person { width: 3.4rem; flex-basis: 3.4rem; }
.person-name {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: keep-all;
}
.comment .person-name { font-size: 0.78rem; }
.portrait-slot {
  width: 3.5rem;
  height: 3.5rem;
  min-width: 3.5rem;
  max-width: 3.5rem;
  min-height: 3.5rem;
  max-height: 3.5rem;
  flex: 0 0 3.5rem;
  border-radius: 50%;
  overflow: hidden;
  background: #f3f3f4;
  border: 2px solid #e4e4e6;
}
.comment .meta,
.comment .prose {
  font-size: 1rem;
  line-height: 1.45;
}
.comment .vote {
  min-height: 2.5rem;
  font-size: 1rem;
}
.comment .portrait-slot,
.comment .portrait-slot img {
  width: 2.8rem;
  height: 2.8rem;
  min-width: 2.8rem;
  max-width: 2.8rem;
  min-height: 2.8rem;
  max-height: 2.8rem;
  flex-basis: 2.8rem;
}
.portrait-slot img {
  width: 3.5rem;
  height: 3.5rem;
  max-width: 3.5rem;
  max-height: 3.5rem;
  object-fit: cover;
  display: block;
}
.photo-pick { display: flex; align-items: center; gap: 0.8rem; }
.photo-pick input[type="file"] { min-width: 0; }
.portrait-empty {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 36%, #d5d5d8 0 17%, transparent 18%),
    radial-gradient(ellipse at 50% 92%, #d5d5d8 0 32%, transparent 33%),
    #f3f3f4;
}
.pending {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  margin: 0.35rem 0;
  padding: 0.15rem 0.7rem;
  border-radius: var(--pill);
  background: #fff4b8;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}
.field-hint { color: var(--muted); font-size: 1.05rem; font-weight: 500; }
.check { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.check input { width: 1.3rem; height: 1.3rem; min-height: 0; }
.more-comments { margin-top: 0.7rem; }
.more-comments summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.3rem 1rem;
  border-radius: var(--pill);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.more-comments summary::-webkit-details-marker { display: none; }
.more-comments summary::marker { content: ""; }
.more-comments .comments { margin-top: 0.75rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: #0057d9; }
.meta { margin: 0.75rem 0 0.35rem; color: var(--muted); font-size: 1.05rem; }
.meta a { font-weight: 700; }
.empty {
  padding: 1.2rem 1.2rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.card-kicker {
  display: inline-flex;
  margin: 0 0 0.45rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--pill);
  background: #fff4b8;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.votes { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.7rem; }
.vote {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3.15rem;
  min-width: 8.4rem;
  padding: 0.35rem 0.85rem 0.35rem 1rem;
  border: 0;
  border-radius: var(--pill);
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.vote:hover { background: #ececec; }
.vote.is-on.vote-up { background: var(--yellow); }
.vote.is-on.vote-down { background: var(--ink); color: #fff; }
.vote-count {
  min-width: 1.7rem;
  margin-left: 0.15rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--pill);
  background: #fff;
  color: var(--ink);
  text-align: center;
}
.vote.is-on.vote-down .vote-count { background: #fff; color: var(--ink); }
.thumb { font-size: 1.45rem; line-height: 1; }

.flash, .errors {
  margin: 1rem auto 0;
  padding: 0.95rem 1.1rem;
  border-radius: 18px;
  font-weight: 700;
}
.flash { background: #e8f8e8; }
.errors { background: #fff1f0; }
.errors ul { margin: 0.4rem 0 0; padding-left: 1.2rem; font-weight: 500; }

.stack { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.4rem; }
.stack label { font-weight: 800; margin-top: 0.65rem; }
.stack input, .stack select, .stack textarea {
  width: 100%;
  min-height: 3.4rem;
  padding: 0.7rem 1rem;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
}
.stack input:focus, .stack select:focus, .stack textarea:focus {
  border-color: var(--yellow);
  background: #fff;
  outline: none;
}
.stack textarea { min-height: 9rem; border-radius: 18px; resize: vertical; }
#novyy .wrap, #novyy-kommentariy, .section-paper .wrap-narrow {
  /* form sits on a white rounded sheet via the section */
}
.section > .wrap-narrow,
.section-paper .wrap-narrow {
  padding: 1.3rem 1.25rem 1.4rem;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}
h2, #novyy, #kommentarii { scroll-margin-top: 5.2rem; }
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.prose { font-size: 1.0625rem; overflow-wrap: anywhere; }
.card > .card-layout .prose,
.review-copy .prose {
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
}
.joint-line { margin: 0.45rem 0 0; font-size: 1rem; }
article.section > .wrap,
#kommentarii > .wrap {
  padding: 1.4rem 1.5rem 1.5rem;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}
.comments { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: 0.75rem; }
.vote-heading { margin-top: 1.3rem; }
.pager { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-top: 1rem; }
.pager a {
  min-height: 2.8rem;
  padding: 0.35rem 1rem;
  border-radius: var(--pill);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

main { padding-bottom: 1.75rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; margin: 1rem 0 1.5rem; }
.stat-card { padding: 1rem 1.1rem; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: 0.45rem; }
.stat-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.stat-list a { overflow-wrap: anywhere; }
code { font-family: ui-monospace, "Courier New", monospace; font-size: 0.95em; }

@media (max-width: 560px) {
  .wrap, .wrap-narrow { width: calc(100% - 1.25rem); }
  .hero .wrap, .section-paper .wrap-narrow { border-radius: 22px; }
  .button, .stack button.button { width: 100%; }
  .vote { flex: 1 1 8.2rem; }
  .site-header { position: static; }
  .card-layout { display: block; }
  .person,
  .comment .person {
    width: max-content;
    max-width: 100%;
    min-width: 3.5rem;
    flex: none;
    align-items: center;
    margin: 0 0 0.45rem;
  }
  .comment .person { min-width: 2.8rem; }
  .person-name,
  .comment .person-name {
    width: auto;
    max-width: 100%;
    white-space: nowrap;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .button, .vote, .card, .chip, .note, .flash { border: 1px solid CanvasText; }
}
