:root {
  --red: #DD2525;
  --red-hover: #B52727;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --soft: #f4f4f4;
  --bg: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 Inter, system-ui, -apple-system, sans-serif; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: Montserrat, system-ui, sans-serif; font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
i { font-style: normal; color: #bdbdbd; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
img { max-width: 100%; height: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 24px; border: 0; border-radius: 5px; background: var(--red); color: #fff; font: 700 16px Montserrat, sans-serif; cursor: pointer; white-space: nowrap; transition: background .15s ease, transform .15s ease; }
.btn:hover { background: var(--red-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(221, 37, 37, .35); outline-offset: 2px; }
.btn-sm { height: 40px; padding: 0 18px; font-size: 15px; }

/* header */
.top { position: sticky; top: 0; z-index: 50; background: #000; color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 32px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font: 800 24px Montserrat, sans-serif; letter-spacing: .04em; flex: none; }
.logo img { height: 34px; width: auto; display: block; }
.nav { display: flex; gap: 28px; font: 600 16px Montserrat, sans-serif; }
.nav a { color: rgba(255, 255, 255, .72); padding: 8px 0; border-bottom: 2px solid transparent; transition: color .15s ease; }
.nav a:hover, .nav a:focus-visible { color: #fff; outline: none; }
.nav a[aria-current] { color: #fff; border-color: var(--red); }
.hsearch { margin-left: auto; }
.hsearch input { width: 220px; height: 40px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 5px; background: rgba(255, 255, 255, .08); color: #fff; padding: 0 14px; font: 16px Inter, sans-serif; transition: border-color .15s ease; }
.hsearch input::placeholder { color: rgba(255, 255, 255, .55); }
.hsearch input:focus { outline: none; border-color: rgba(255, 255, 255, .6); }
.login { font: 600 16px Montserrat, sans-serif; color: rgba(255, 255, 255, .85); }
.login:hover { color: #fff; }
.burger { display: none; width: 40px; height: 40px; border: 0; background: none; padding: 8px; flex-direction: column; justify-content: space-between; cursor: pointer; }
.burger span { display: block; height: 2px; background: #fff; border-radius: 2px; }
.drawer { display: none; }

/* hero */
.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 1fr 440px; gap: 48px; align-items: center; }
.hero h1 { font-size: 64px; }
.searchbar { display: flex; gap: 12px; margin-top: 28px; max-width: 640px; }
.searchbar input { flex: 1; min-width: 0; height: 52px; border: 2px solid #dfdfdf; border-radius: 5px; padding: 0 18px; font: 17px Inter, sans-serif; color: var(--ink); transition: border-color .15s ease; }
.searchbar input:focus { outline: none; border-color: var(--ink); }
.stats { display: flex; gap: 48px; margin-top: 36px; }
.stat b { display: block; font: 700 30px Montserrat, sans-serif; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 16px; }
.hero-img { width: 100%; max-width: 440px; justify-self: end; }

/* main grid */
.main { padding: 56px 0 96px; }
.main .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: start; }
.cat { margin-bottom: 56px; }
.cat h2 { font-size: 34px; margin-bottom: 20px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 96px 104px 300px; gap: 24px; padding: 0 0 10px; color: var(--muted); font-size: 14px; }
.cols .r { text-align: right; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) 96px 104px 300px; gap: 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); transition: background .15s ease; }
.cat .frow:last-child { border-bottom: 1px solid var(--line); }
.frow:hover { background: #fafafa; box-shadow: -16px 0 0 #fafafa, 16px 0 0 #fafafa; }
.frow:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.fname { font: 700 20px/1.25 Montserrat, sans-serif; letter-spacing: -0.01em; }
.frow:hover .fname { color: var(--red); }
.fdesc { color: var(--muted); font-size: 16px; margin-top: 3px; }
.subs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sub { font-size: 14px; background: var(--soft); border-radius: 999px; padding: 4px 12px; }
.sub em { font-style: normal; color: var(--muted); margin-left: 4px; }
.num { font: 600 17px Montserrat, sans-serif; text-align: right; }
.num small { display: block; font: 400 13px Inter, sans-serif; color: var(--muted); }
.last { display: flex; gap: 12px; align-items: center; min-width: 0; }
.av { width: 40px; height: 40px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font: 700 17px Montserrat, sans-serif; overflow: hidden; }
.av.staff { background: var(--red); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.lmeta { min-width: 0; }
.last .t { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last .m { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* sidebar */
.side { position: sticky; top: 96px; }
.side h3 { font-size: 22px; margin-bottom: 8px; }
.lt { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.lt:last-of-type { border-bottom: 1px solid var(--line); }
.lt .t { font-size: 16px; font-weight: 600; line-height: 1.35; transition: color .15s ease; }
.lt:hover .t { color: var(--red); }
.lt .x { color: var(--muted); font-size: 15px; line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lt .m { color: var(--muted); font-size: 14px; margin-top: 6px; }
.online { margin-top: 40px; }
.online p { color: var(--muted); font-size: 16px; margin: 6px 0 0; }

/* thread */
.thead { padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 15px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.thead h1 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.15; max-width: 960px; margin-top: 18px; }
.tmeta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; color: var(--muted); font-size: 16px; }
.tmeta .btn { margin-left: auto; }
.posts { padding: 8px 0 96px; }
.posts .wrap { max-width: 1120px; }
.post { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding: 40px 0; border-bottom: 1px solid var(--line); }
.post.staff { box-shadow: inset 4px 0 0 var(--red); padding-left: 28px; }
.who .av { width: 64px; height: 64px; border-radius: 12px; font-size: 26px; }
.who .n { font: 700 18px Montserrat, sans-serif; margin-top: 12px; }
.who .r { color: var(--muted); font-size: 14px; margin-top: 2px; }
.badge { display: inline-block; background: var(--red); color: #fff; font: 700 12px Montserrat, sans-serif; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; margin-top: 6px; }
.ptime { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.body { font-size: 17px; line-height: 1.65; max-width: 760px; }
.body p { margin: 0 0 1em; }
.body p:last-child { margin-bottom: 0; }
.pfoot { display: flex; gap: 24px; margin-top: 24px; font: 600 15px Montserrat, sans-serif; color: var(--muted); }
.pfoot a:hover { color: var(--ink); }
.reply { padding-top: 40px; max-width: 980px; }
.reply h2 { font-size: 28px; margin-bottom: 16px; }
.reply textarea { width: 100%; min-height: 160px; border: 2px solid #dfdfdf; border-radius: 5px; padding: 16px; font: 17px/1.6 Inter, sans-serif; resize: vertical; transition: border-color .15s ease; }
.reply textarea:focus { outline: none; border-color: var(--ink); }
.reply-actions { display: flex; align-items: center; gap: 20px; margin-top: 16px; color: var(--muted); font-size: 16px; }

/* footer */
.foot { background: #000; color: #fff; padding: 48px 0; }
.foot .wrap { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.foot nav { display: flex; flex-wrap: wrap; gap: 12px 28px; font: 600 15px Montserrat, sans-serif; }
.foot nav a { color: rgba(255, 255, 255, .72); }
.foot nav a:hover { color: #fff; }
.fine { margin-left: auto; color: rgba(255, 255, 255, .55); font-size: 15px; }

/* tablet */
@media (max-width: 1120px) {
  .main .wrap { grid-template-columns: 1fr; gap: 48px; }
  .side { position: static; }
  .frow, .cols { grid-template-columns: minmax(0, 1fr) 90px 100px 260px; gap: 18px; }
}

/* phone */
@media (max-width: 820px) {
  .wrap { padding: 0 16px; }
  .top .wrap { height: 60px; gap: 14px; }
  .burger { display: flex; }
  .nav, .hsearch, .login { display: none; }
  .logo { font-size: 20px; }
  .logo img { height: 28px; }
  .top .btn-sm { margin-left: auto; }
  body.menu-open .drawer { display: flex; flex-direction: column; gap: 4px; padding: 8px 16px 20px; border-top: 1px solid rgba(255, 255, 255, .15); }
  .drawer a { padding: 12px 0; font: 600 18px Montserrat, sans-serif; }
  .drawer .btn { margin-top: 8px; }
  .hero { padding: 40px 0 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 44px; }
  .hero-img { max-width: 220px; justify-self: center; order: -1; }
  .searchbar { flex-direction: column; }
  .stats { gap: 24px; flex-wrap: wrap; margin-top: 28px; }
  .stat b { font-size: 24px; }
  .main { padding: 40px 0 64px; }
  .cat h2 { font-size: 28px; }
  .cols { display: none; }
  .frow { display: flex; flex-wrap: wrap; gap: 0 18px; padding: 18px 0; }
  .frow:hover { box-shadow: none; }
  .finfo { flex: 0 0 100%; margin-bottom: 10px; }
  .num { flex: none; text-align: left; font-size: 15px; }
  .num small { display: inline; margin-left: 4px; }
  .last { flex: 0 0 100%; margin-top: 12px; }
  .last .t, .last .m { white-space: normal; }
  .post { grid-template-columns: 1fr; gap: 20px; padding: 28px 0; }
  .post.staff { padding-left: 16px; }
  .who { display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; align-items: center; }
  .who .av { width: 56px; height: 56px; grid-row: 1 / 4; }
  .who .n { margin-top: 0; }
  .who .badge { justify-self: start; }
  .tmeta { font-size: 15px; gap: 8px; }
  .tmeta .btn { margin-left: 0; width: 100%; margin-top: 8px; }
  .foot .wrap { gap: 20px; }
  .fine { margin-left: 0; }
}
