/* ==========================================================================
   IskamPC - bold playful design system
   Direction: neo-brutalist energy. Chunky Cyrillic display type (Unbounded),
   thick ink borders, hard offset shadows, one electric-yellow accent,
   pill buttons, sticker-like tags, slight card tilts.
   Shape rule: buttons/filters/tags = pill, cards/inputs/tables = 14px.
   One accent locked site-wide; success/danger/category tints are semantic.
   Light + dark theming via tokens. WCAG AA, :focus-visible, 360-1440px.
   ========================================================================== */

/* ---------- 0. Fonts (self-hosted, variable, latin + cyrillic) ----------- */
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/Unbounded-var-cyrillic.3a5ed4d11365.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/Unbounded-var-latin.8616dc355070.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Manrope-var-cyrillic.e58febde317b.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Manrope-var-latin.938c6e8019b6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-var-cyrillic.3576e677eb07.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-var-latin.b636a65da4f0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.82rem);
  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-2: clamp(1.25rem, 1.15rem + 0.5vw, 1.55rem);
  --step-3: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-4: clamp(2.1rem, 1.4rem + 3.6vw, 4rem);

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;
  --bw: 2px;
  --container: 1140px;

  /* neutrals (light) */
  --bg: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #e9e8e2;
  --ink: #1a1913;
  --ink-2: #43413a;
  --muted: #5d5a50;
  --line: #d9d7cf;
  --border: #1a1913;

  /* accent: electric yellow */
  --accent: #ffd21e;
  --accent-strong: #f2c200;
  --accent-tint: #fff3c2;
  --on-accent: #1a1913;

  --success: #1c7a43;
  --success-ink: #14603a;
  --success-tint: #dcf3e5;
  --danger: #cf2f26;
  --danger-ink: #a8241d;
  --danger-tint: #fbe7e5;
  --warn-ink: #8a5a12;
  --warn-tint: #fdf0d8;
  --info-ink: #1d4fb8;
  --info-tint: #e0eaff;

  /* category tag tints (semantic) */
  --tag-question-bg: #dbe7ff;
  --tag-recommendation-bg: #d7f1e0;
  --tag-build_review-bg: #ffdce8;

  --shadow-ink: #1a1913;
  --shadow-pop: 4px 4px 0 var(--shadow-ink);
  --shadow-pop-lg: 7px 7px 0 var(--shadow-ink);
  --shadow-pop-sm: 3px 3px 0 var(--shadow-ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #201f17;
    --surface-2: #2b2a20;
    --ink: #f4f2e8;
    --ink-2: #cdcabd;
    --muted: #a5a193;
    --line: #3a3930;
    --border: #f4f2e8;

    --accent: #ffd21e;
    --accent-strong: #ffdc4d;
    --accent-tint: #3a3208;
    --on-accent: #1a1913;

    --success: #4ec584;
    --success-ink: #7fdca8;
    --success-tint: #12301f;
    --danger: #f07570;
    --danger-ink: #f5a19d;
    --danger-tint: #391412;
    --warn-ink: #eec26e;
    --warn-tint: #322508;
    --info-ink: #93b6f8;
    --info-tint: #14213c;

    --tag-question-bg: #1c2a4c;
    --tag-recommendation-bg: #143122;
    --tag-build_review-bg: #431a2c;

    --shadow-ink: #000000;
  }
}

/* ---------- 2. Base ------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 var(--sp-4);
  overflow-wrap: break-word;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
a:hover { background: var(--accent); color: var(--on-accent); }

img { max-width: 100%; height: auto; display: block; }

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

::selection { background: var(--accent); color: var(--on-accent); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
main.container { padding-block: var(--sp-6) var(--sp-8); }

@media (min-width: 760px) {
  .container { padding-inline: var(--sp-6); }
}

/* ---------- 3. Header + nav ---------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: var(--bw) solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: 68px;
  flex-wrap: wrap;
  padding-block: var(--sp-2);
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
}
.logo:hover { background: none; color: var(--ink); }
.logo span {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 0.22em;
  margin-left: 0.08em;
  border-radius: 6px;
  transform: rotate(-2deg);
  display: inline-block;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  font-size: 1.3rem;
  line-height: 1;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-pop-sm);
}
.nav-toggle:active { transform: translate(2px, 2px); box-shadow: none; }

.site-nav {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.site-nav a {
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  border: var(--bw) solid transparent;
}
.site-nav a:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--border);
}

.auth-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.auth-links > a:not(.btn) {
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
}
.auth-links > a:not(.btn):hover { background: var(--accent); color: var(--on-accent); }

.logout-form { margin: 0; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
.link-button:hover { background: var(--accent); color: var(--on-accent); }

/* mobile: collapse nav behind hamburger */
@media (max-width: 759px) {
  .nav-toggle { display: block; order: 2; }
  .auth-links { order: 3; margin-left: 0; width: auto; }
  .logo { order: 1; margin-right: auto; }
  .site-nav {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-3) 0 var(--sp-2);
    border-top: var(--bw) solid var(--border);
    margin-top: var(--sp-2);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { border: var(--bw) solid var(--border); text-align: center; }
}

/* ---------- 4. Buttons ---------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.6em 1.5em;
  border-radius: var(--r-pill);
  border: var(--bw) solid var(--border);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow-ink);
}
.btn:active { transform: translate(2px, 2px); box-shadow: none; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }

.btn-secondary { background: var(--surface); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- 5. Hero ------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--sp-6) 0 var(--sp-8);
  max-width: 100%;
}
.hero h1 {
  font-weight: 900;
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-5);
  max-width: 16ch;
}
.hero .marker {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.02em 0.18em;
  border-radius: 10px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hero > p {
  font-size: var(--step-1);
  font-weight: 500;
  color: var(--ink-2);
  max-width: 46ch;
  margin-bottom: var(--sp-6);
}
.hero-actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.hero-sticker {
  position: absolute;
  top: var(--sp-5);
  right: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.55em 1.1em;
  transform: rotate(5deg);
  box-shadow: var(--shadow-pop-sm);
}
@media (max-width: 899px) {
  .hero-sticker { display: none; }
}

/* ---------- 6. Home sections + section head ------------------------------- */
.home-section { margin-bottom: var(--sp-8); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.section-head h2 { margin: 0; }
.section-head a {
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.35em 1em;
  background: var(--surface);
  box-shadow: var(--shadow-pop-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.section-head a:hover {
  background: var(--accent);
  color: var(--on-accent);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow-ink);
}
.section-head a:active { transform: translate(2px, 2px); box-shadow: none; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.page-head h1 { margin: 0; }

/* ---------- 7. Card grid + cards ------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
@media (min-width: 560px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  --tx: -3px;
  --ty: -3px;
  --rot: 0deg;
  box-shadow: var(--shadow-pop-lg);
}
/* playful tilt on home page card grids */
.home-section .card:nth-child(odd) { --rot: -0.8deg; }
.home-section .card:nth-child(even) { --rot: 0.8deg; }

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: var(--bw) solid var(--border);
}

.card-body { padding: var(--sp-4) var(--sp-4) var(--sp-5); }

.card-body h2,
.card-body h3 { margin: 0 0 var(--sp-2); font-size: var(--step-1); }
.card-body h2 a,
.card-body h3 a { text-decoration: none; }
.card-body h2 a:hover,
.card-body h3 a:hover { background: var(--accent); color: var(--on-accent); }

.brand {
  font-size: var(--step--1);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--sp-1);
}

.verdict,
.use-case { color: var(--ink-2); margin: 0 0 var(--sp-3); }

.price {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.15em 0.8em;
  margin: 0;
}

/* ---------- 8. Filter bar (pills) ------------------------------------------ */
.filter-bar {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.filter {
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.35em 1.1em;
  transition: transform 0.15s ease;
}
.filter:hover {
  background: var(--accent-tint);
  color: var(--ink);
  transform: translate(-1px, -1px);
}
.filter.is-active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-pop-sm);
}
@media (max-width: 559px) {
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--sp-2);
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter { flex: 0 0 auto; }
}

/* ---------- 9. Tables (spec + component) ----------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  margin-bottom: var(--sp-6);
}

.spec-table,
.component-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.component-table { min-width: 560px; }

.spec-table th,
.spec-table td,
.component-table th,
.component-table td {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: none; }

.spec-table th {
  font-weight: 800;
  color: var(--muted);
  width: 38%;
}
.spec-table td { color: var(--ink); font-family: var(--font-mono); }

.component-table thead th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--surface-2);
  border-bottom: var(--bw) solid var(--border);
}
.component-table tbody tr:hover { background: var(--accent-tint); }
.component-table td:nth-child(3) { font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.component-table .note {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 500;
}
.component-table tfoot th {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  border-top: var(--bw) solid var(--border);
  border-bottom: none;
  background: var(--accent);
  color: var(--on-accent);
}
.component-table tfoot th:first-child { font-family: var(--font-display); font-size: 0.85rem; }

/* ---------- 10. Product / build detail -------------------------------------- */
.build-detail,
.question-detail { max-width: 780px; }
.product-detail { max-width: 960px; }

.build-detail > .use-case {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink-2);
}

/* product hero: info left, photo right (stacks on mobile) */
.product-hero {
  display: grid;
  gap: var(--sp-6);
  align-items: center;
  margin-bottom: var(--sp-7);
}
@media (min-width: 760px) {
  .product-hero { grid-template-columns: 1.1fr 1fr; }
}
.product-hero-info .brand { margin-bottom: var(--sp-2); }
.product-hero-info h1 { margin-bottom: var(--sp-3); }
.product-hero-info .verdict {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--sp-4);
}
.product-hero-info .price {
  font-size: 1.3rem;
  padding: 0.2em 1em;
}
.product-hero-img {
  width: 100%;
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  transform: rotate(1deg);
}

/* pros / cons verdict cards */
.pros-cons {
  display: grid;
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}
@media (min-width: 760px) {
  .pros-cons { grid-template-columns: 1fr 1fr; align-items: start; }
}
.verdict-card {
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
}
.verdict-card h2 {
  font-size: 0.95rem;
  margin-bottom: var(--sp-3);
}
.verdict-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}
.verdict-card li {
  position: relative;
  padding-left: 1.9em;
  color: var(--ink-2);
  font-weight: 500;
}
.verdict-card li::before {
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.3em;
  height: 1.3em;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85em;
  border: var(--bw) solid var(--border);
  border-radius: 50%;
}
.verdict-card-pros { box-shadow: 4px 4px 0 var(--success); }
.verdict-card-pros li::before { content: "+"; background: var(--success-tint); color: var(--success-ink); }
.verdict-card-cons { box-shadow: 4px 4px 0 var(--danger); }
.verdict-card-cons li::before { content: "-"; background: var(--danger-tint); color: var(--danger-ink); }

.review { max-width: 780px; margin-bottom: var(--sp-7); }

.description,
.intro,
.body { color: var(--ink-2); }
.description :is(p, ul, ol):last-child,
.intro :is(p, ul, ol):last-child { margin-bottom: 0; }

/* offers: one row per shop, cheapest flagged */
.offer-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-6);
  display: grid;
  gap: var(--sp-4);
}
.offer {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-pop-sm);
}
.offer.is-best {
  background: var(--accent-tint);
  box-shadow: var(--shadow-pop);
}
.offer-flag {
  position: absolute;
  top: -0.85em;
  right: var(--sp-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.68rem;
  background: var(--accent);
  color: var(--on-accent);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.3em 0.9em;
  transform: rotate(2deg);
}
.offer-info { min-width: 0; margin-right: auto; }
.offer-shop {
  display: block;
  font-weight: 800;
  font-size: var(--step-1);
}
.offer-note {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--muted);
}
.offer-price {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.2rem;
  white-space: nowrap;
}
@media (max-width: 559px) {
  .offer { align-items: flex-start; flex-direction: column; }
  .offer .btn { align-self: stretch; text-align: center; }
}

/* ---------- 11. Question list rows ------------------------------------------ */
.question-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--sp-4);
}
.question-row {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-pop-sm);
  transform: translate(var(--tx, 0), var(--ty, 0));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.question-row:hover {
  --tx: -2px;
  --ty: -2px;
  box-shadow: var(--shadow-pop);
}

.question-stats {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 0 0 auto;
}
.question-stats .stat {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.15em 0.7em;
  white-space: nowrap;
  text-align: center;
}
.question-stats .stat:first-child {
  background: var(--accent-tint);
  border-color: var(--border);
}

.question-main { min-width: 0; }
.question-main h2,
.question-main h3 {
  font-size: var(--step-1);
  margin: var(--sp-2) 0 var(--sp-1);
}
.question-main h2 a,
.question-main h3 a { text-decoration: none; }
.question-main h2 a:hover,
.question-main h3 a:hover { background: var(--accent); color: var(--on-accent); }

.meta {
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}

@media (max-width: 559px) {
  .question-row { flex-direction: column-reverse; gap: var(--sp-3); }
  .question-stats { flex-direction: row; }
}

/* ---------- 12. Tags --------------------------------------------------------- */
.tag {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 800;
  color: var(--ink);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.1em 0.8em;
  transform: rotate(-1deg);
}
.tag-question { background: var(--tag-question-bg); }
.tag-recommendation { background: var(--tag-recommendation-bg); }
.tag-build_review { background: var(--tag-build_review-bg); }

/* ---------- 13. Question detail + vote widgets ------------------------------- */
.question-detail {
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: var(--sp-6);
  margin-bottom: var(--sp-7);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--sp-5);
}
.question-detail > .tag,
.question-detail > h1,
.question-detail > .meta { grid-column: 1 / -1; }
.question-detail .tag { justify-self: start; margin-bottom: var(--sp-3); }
.question-detail h1 { margin-bottom: var(--sp-2); }
.question-detail > .meta { margin-bottom: var(--sp-5); }
.question-detail .vote-widget { grid-column: 1; }
.question-detail .body { grid-column: 2; color: var(--ink); margin: 0; }

.vote-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  flex: 0 0 auto;
}
.vote-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  line-height: 1;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-pop-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vote-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-pop);
}
.vote-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.vote-up:hover { background: var(--success-tint); color: var(--success-ink); }
.vote-down:hover { background: var(--danger-tint); color: var(--danger-ink); }

.vote-score {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  padding: var(--sp-1) 0;
}

/* ---------- 14. Answers -------------------------------------------------------- */
.answers { margin-bottom: var(--sp-8); max-width: 780px; }
.answers > h2 { margin-bottom: var(--sp-5); }

.answer {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--sp-5);
  row-gap: var(--sp-3);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop-sm);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.answer .vote-widget { grid-row: 2; }
.answer .body { grid-column: 2; color: var(--ink); }
.answer .body p:last-child { margin-bottom: 0; }
.answer .meta { grid-column: 2; }
.answer .accepted-badge { grid-column: 1 / -1; }
.answer form { grid-column: 2; margin: var(--sp-2) 0 0; }

.answer.is-accepted {
  border-color: var(--success);
  box-shadow: 3px 3px 0 var(--success);
}

.accepted-badge {
  justify-self: start;
  font-weight: 800;
  font-size: var(--step--1);
  color: var(--success-ink);
  background: var(--success-tint);
  border: var(--bw) solid var(--success);
  border-radius: var(--r-pill);
  padding: 0.15em 0.9em;
  margin: 0;
}

.answer-form { max-width: 780px; }

/* ---------- 15. Forms (form.as_p) ----------------------------------------------- */
form p { margin: 0 0 var(--sp-4); }

form label {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: var(--sp-1);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form select,
form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
}
form input:focus-visible,
form select:focus-visible,
form textarea:focus-visible {
  outline: 3px solid var(--border);
  outline-offset: 1px;
}
form textarea { min-height: 9rem; resize: vertical; }

.helptext {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  margin-top: var(--sp-1);
}

.errorlist {
  list-style: none;
  padding: var(--sp-2) var(--sp-3);
  margin: 0 0 var(--sp-2);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--danger-ink);
  background: var(--danger-tint);
  border: var(--bw) solid var(--danger);
  border-radius: var(--r-sm);
}
.errorlist li { margin: 0; }

/* ---------- 16. Auth card ---------------------------------------------------------- */
.auth-card {
  max-width: 460px;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: var(--sp-6);
}
.auth-card h1 { font-size: var(--step-2); }
.auth-alt {
  font-size: var(--step--1);
  color: var(--muted);
  margin-top: var(--sp-4);
}

/* ---------- 17. Profile lists -------------------------------------------------------- */
.profile-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-6);
  display: grid;
  gap: var(--sp-2);
}
.profile-list li { margin: 0; }
.profile-list a {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  transition: transform 0.15s ease;
}
.profile-list a:hover {
  background: var(--accent-tint);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-pop-sm);
}

/* ---------- 18. Messages ---------------------------------------------------------------- */
.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
  display: grid;
  gap: var(--sp-2);
}
.message {
  font-weight: 700;
  padding: var(--sp-3) var(--sp-4);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop-sm);
  background: var(--surface);
}
.message.success { background: var(--success-tint); color: var(--success-ink); border-color: var(--success); }
.message.error { background: var(--danger-tint); color: var(--danger-ink); border-color: var(--danger); }
.message.warning { background: var(--warn-tint); color: var(--warn-ink); }
.message.info,
.message.debug { background: var(--info-tint); color: var(--info-ink); }

/* ---------- 19. Empty state --------------------------------------------------------------- */
.empty {
  border: var(--bw) dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- 20. Footer ---------------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 3px solid var(--border);
  padding: var(--sp-6) 0;
  margin-top: var(--sp-8);
}
.site-footer p { margin: 0 0 var(--sp-1); font-size: 0.9rem; font-weight: 600; }
.site-footer .disclaimer { font-size: var(--step--1); color: var(--muted); font-weight: 500; }

/* ---------- 21. Scroll reveal (JS adds .reveal, then .is-visible) --------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px) rotate(var(--rot, 0deg));
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg));
}

/* ---------- 22. Reduced motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg));
  }
}
