/* Stratum — стиль C · Soft */
@import url('https://fonts.googleapis.com/css2?family=Wix+Madefor+Display:wght@600;700;800&family=Wix+Madefor+Text:wght@400;500;600;700&display=swap');

:root {
  --bg: #F4F3EF;
  --card: #FFFFFF;
  --ink: #17181A;
  --ink-2: #2B2D31;
  --muted: #5F6368;
  --muted-2: #9AA0A8;
  --line: #E6E4DE;
  --accent: #FF5C3A;
  --accent-ink: #FFFFFF;
  --good: #1E8A4C;
  --good-bg: #E8F7EE;
  --bad: #C8361B;
  --bad-bg: #FDECE8;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --display: 'Wix Madefor Display', system-ui, sans-serif;
  --text: 'Wix Madefor Text', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--text);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }

/* Layout */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 20px; }
.wrap-text { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
main { flex: 1 0 auto; }

/* Header pill */
.topbar { padding: 20px 0 8px; }
.topbar-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--card); border-radius: 999px; padding: 10px 10px 10px 22px;
}
.logo { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.topbar-nav { display: flex; align-items: center; gap: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 600; white-space: nowrap; transition: background .15s, transform .15s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn-lg { height: 56px; padding: 0 28px; font-size: 16px; font-weight: 700; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(.95); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn:disabled { background: var(--line); color: var(--muted-2); cursor: not-allowed; filter: none; }
.btn.loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-under { font-weight: 600; border-bottom: 2px solid currentColor; padding-bottom: 1px; }
.link-accent { color: var(--accent); font-weight: 600; }
.link-accent:hover { text-decoration: underline; }

/* Cards */
.card { background: var(--card); border-radius: var(--r-xl); padding: 32px; }
.card-sm { background: var(--card); border-radius: var(--r-lg); padding: 20px; }
.card-dark { background: var(--ink); color: #fff; border-radius: var(--r-xl); padding: 32px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.card-dark .eyebrow { color: var(--muted-2); }

.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.badge-good {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: 999px; background: var(--good-bg); color: var(--good); font-size: 13px; font-weight: 700;
}

/* Type */
.h-display { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
.h1 { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.h2 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.h3 { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.lead { font-size: 17px; color: var(--muted); line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Icon tile */
.icon-tile {
  width: 44px; height: 44px; border-radius: 14px; background: var(--bg); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-tile.accent { background: var(--accent); color: #fff; }
.icon-tile.dark { background: var(--ink-2); color: #fff; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 14px; font-weight: 600; }
.label .opt { color: var(--muted-2); font-weight: 500; }
.input, .textarea {
  width: 100%; height: 52px; padding: 0 18px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 110px; padding: 14px 18px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus { border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 4px rgba(23,24,26,.06); }
.input.error, .textarea.error { border-color: var(--bad); }
.input-code { text-align: center; letter-spacing: .22em; font-weight: 700; text-transform: uppercase; font-size: 18px; }
.hint { font-size: 13px; color: var(--muted); }
.error-msg { font-size: 13px; color: var(--bad); display: none; }
.error-msg.show { display: block; }
.error-box { font-size: 14px; color: var(--bad); background: var(--bad-bg); border-radius: var(--r-sm); padding: 12px 14px; display: none; }
.error-box.show { display: block; }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.prefix .input { padding-left: 36px; }
.pw { position: relative; }
.pw .input { padding-right: 56px; }
.pw button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pw button:hover { background: var(--line); color: var(--ink); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ink); flex-shrink: 0; cursor: pointer; }
.check a { color: var(--ink); font-weight: 600; border-bottom: 1.5px solid var(--line); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.divider { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.note { background: var(--bg); border-radius: var(--r-md); padding: 16px 18px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.note strong { color: var(--ink); }

/* Auth layout */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 0 56px; }
.auth-card { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 24px; }
.auth-head { display: flex; flex-direction: column; gap: 10px; }

/* Footer */
.footer { padding: 16px 0 28px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a:hover { color: var(--ink); }

/* Avatars */
.ava {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.ava.dark { background: var(--ink); color: #fff; }
.ava.sm { width: 32px; height: 32px; font-size: 11px; }
.ava.xl { width: 112px; height: 112px; font-size: 38px; font-family: var(--display); }

/* Posts */
.post { background: var(--card); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.post-name { font-size: 15px; font-weight: 700; }
.post-sub { font-size: 13px; color: var(--muted); }
.post-body { font-size: 16px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.post-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vote {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.vote:hover { border-color: var(--ink); color: var(--ink); }
.vote.up.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote.down.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.vote .lbl { font-weight: 600; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--bg); font-size: 14px; font-weight: 700; border: 0; cursor: pointer;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.ml-auto { margin-left: auto; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab.on { background: var(--ink); color: #fff; }

/* App layout */
.app { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 16px; padding-bottom: 120px; }
.app-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.app-side { flex: 1 1 300px; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }

.rep-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--bg); font-size: 14px; font-weight: 700;
}

/* Bottom nav (phone) */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 50;
  width: calc(100% - 32px); max-width: 420px; height: 64px; border-radius: 999px; background: var(--ink);
  display: none; align-items: center; justify-content: space-around; padding: 0 8px;
  box-shadow: 0 10px 30px rgba(23,24,26,.18);
}
.bottom-nav a { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; color: #8B919C; border-radius: 50%; }
.bottom-nav a.on { color: #fff; }
.bottom-nav a.plus { background: var(--accent); color: #fff; }

.compose { background: var(--card); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.compose-row { display: flex; gap: 12px; align-items: flex-start; }
.compose textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent; font-size: 16px; line-height: 1.5;
  min-height: 40px; padding-top: 8px; overflow: hidden;
}
.compose textarea::placeholder { color: var(--muted-2); }
.compose-foot { display: none; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.compose.active .compose-foot { display: flex; }

.rep-big { font-family: var(--display); font-size: 72px; line-height: .9; font-weight: 800; letter-spacing: -0.04em; }
.meter { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 3px; }
.meter > div { background: var(--line); }
.meter > .fill { background: var(--accent); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-rank { width: 20px; font-weight: 700; color: var(--muted-2); font-size: 14px; }

.banner-warn { background: #FFF4E5; color: #8A4B00; border-radius: var(--r-lg); padding: 16px 20px; font-size: 14px; display: none; }
.banner-warn.show { display: block; }

/* Quote */
.quote { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.quote img { width: 56px; height: 56px; border-radius: 18px; object-fit: cover; }
.quote .initials { width: 56px; height: 56px; border-radius: 18px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.quote-text { font-family: var(--display); font-size: 19px; line-height: 1.35; font-weight: 600; letter-spacing: -0.015em; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }

/* Choice cards */
.choice {
  display: flex; flex-direction: column; gap: 16px; background: var(--card); border-radius: var(--r-xl); padding: 28px;
  border: 2px solid transparent; transition: border-color .15s, transform .15s;
}
.choice:hover { border-color: var(--ink); transform: translateY(-2px); }
.choice ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.choice li { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.choice li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex-shrink: 0; }
.choice .go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }

/* Prose */
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose p { font-size: 16px; color: var(--muted); line-height: 1.7; }
.rules { list-style: none; counter-reset: r; display: flex; flex-direction: column; }
.rules li { counter-increment: r; position: relative; padding: 16px 0 16px 48px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); line-height: 1.6; }
.rules li:first-child { border-top: 0; }
.rules li::before {
  content: counter(r); position: absolute; left: 0; top: 16px; width: 30px; height: 30px; border-radius: 10px;
  background: var(--bg); color: var(--ink); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.rules li strong { color: var(--ink); }
.ktable { width: 100%; border-collapse: collapse; font-size: 15px; }
.ktable td { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.ktable tr:first-child td { border-top: 0; }
.ktable td:first-child { width: 130px; color: var(--ink); font-weight: 700; }

/* Responsive */
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .app-side { max-width: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .card, .card-dark { padding: 24px; border-radius: var(--r-lg); }
  .h1 { font-size: 32px; }
  .topbar-pill { padding-left: 18px; }
  .topbar-nav .hide-sm { display: none; }
  .bottom-nav { display: flex; }
  .app-side { display: none; }
  .post { padding: 18px; }
  .vote .lbl { display: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
