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

:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --muted: #666666;
  --accent: #1a56db;
  --accent-light: #e8f0ff;
  --tag: #333333;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  border-bottom: 2px solid var(--text);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links li a {
  display: block;
  padding: 14px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-right: 1px solid var(--border);
}
.nav-links li:first-child a { border-left: 1px solid var(--border); }
.nav-links li a:hover { background: var(--surface); text-decoration: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.nav-actions a {
  color: var(--muted);
  font-size: 13px;
}

.btn-register {
  background: var(--text);
  color: #fff !important;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-register:hover { text-decoration: none !important; opacity: 0.85; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--border);
  max-height: 60vh;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* BREADCRUMB */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}
.breadcrumb-bar a { color: var(--muted); }
.breadcrumb-bar a:hover { color: var(--accent); }

/* MAIN LAYOUT */
.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* THREAD HEADER */
.thread-header {
  border-bottom: 2px solid var(--text);
  padding-bottom: 16px;
  margin-bottom: 0;
}

.thread-category {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

h1.thread-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  align-items: center;
}

.thread-meta span { display: flex; align-items: center; gap: 5px; }

/* POSTS */
.posts-section { margin-top: 0; }

.post {
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px 1fr;
}

.post:first-child { border-top: none; }

.post-sidebar {
  padding: 24px 16px 24px 0;
  border-right: 1px solid var(--border);
}

.username {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.user-role {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.user-post-count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
}

.user-avatar {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.post-content {
  padding: 24px 0 24px 24px;
}

.post-timestamp {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  margin-bottom: 12px;
}

.post-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

.post-text p + p { margin-top: 10px; }

.post-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}

.post-action {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.post-action:hover { color: var(--accent); }

.post-number {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

/* OP post highlight */
.post.op .post-sidebar {
  background: var(--accent-light);
}
.post.op .user-role {
  color: var(--accent);
}

/* REPLY BOX */
.reply-box {
  margin-top: 32px;
  border: 2px solid var(--border);
  padding: 20px;
  background: var(--surface);
}

.reply-box h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  font-family: var(--mono);
}

.reply-box p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.reply-box .btn-login {
  display: inline-block;
  border: 2px solid var(--text);
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  font-family: var(--mono);
}
.reply-box .btn-login:hover { background: var(--text); color: #fff; text-decoration: none; }

/* FOOTER */
footer {
  border-top: 2px solid var(--text);
  background: var(--bg);
  padding: 28px 16px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-col ul li a {
  font-size: 13px;
  color: var(--muted);
}
.footer-col ul li a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 960px;
  margin: 20px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .nav-links, .nav-actions { display: none; }
  .hamburger { display: flex; }

  .post {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .post-content {
    padding: 16px;
  }

  .user-post-count { display: none; }

  .post-sidebar > div:not(.user-avatar) {
    display: flex;
    flex-direction: column;
  }

  .thread-meta { gap: 10px; }

  .footer-inner { flex-direction: column; gap: 20px; }
}

@media (min-width: 641px) and (max-width: 768px) {
  .post {
    grid-template-columns: 120px 1fr;
  }
  .post-content { padding: 20px 0 20px 16px; }
}
