/* Auto Forum Market — modern marketplace board */

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --mist: #f1f5f9;
  --cobalt: #2563eb;
  --cobalt-deep: #1d4ed8;
  --lime: #84cc16;
  --lime-ink: #3f6212;
  --ok: #059669;
  --font-display: "Space Grotesk", "Trebuchet MS", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --max: 1160px;
  --header-h: 84px;
  --radius: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.branding { visibility: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 380px at 0% 0%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(700px 320px at 100% 8%, rgba(132, 204, 22, 0.12), transparent 50%),
    linear-gradient(180deg, #eef4ff 0%, var(--mist) 42%, #f8fafc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(#94a3b8 0.6px, transparent 0.6px);
  background-size: 18px 18px;
  z-index: 0;
}

a { color: var(--cobalt); text-decoration: none; }
button, .btn { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link { display: flex; align-items: center; color: inherit; }

.logo-link img,
.logo-link .logo-svg {
  height: 72px;
  width: auto;
  max-width: min(360px, 58vw);
  object-fit: contain;
  background: transparent;
  display: block;
}

.nav { display: flex; align-items: center; gap: 0.25rem; }

.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
}

.nav button:hover { color: var(--ink); background: rgba(15, 23, 42, 0.04); }

.nav .btn-cta {
  background: var(--cobalt);
  color: #fff;
  margin-left: 0.35rem;
  padding: 0.6rem 1rem;
}

.nav .btn-cta:hover { background: var(--cobalt-deep); color: #fff; }

/* Hero — full visual plane, copy sits on the image */
.hero {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 1.25rem auto 0;
  min-height: min(52vh, 420px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-radius: 24px;
  isolation: isolate;
  animation: fade-up 0.7s ease both;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      105deg,
      rgba(15, 23, 42, 0.88) 0%,
      rgba(15, 23, 42, 0.72) 38%,
      rgba(15, 23, 42, 0.28) 62%,
      rgba(15, 23, 42, 0.12) 100%
    ),
    url("assets/hero.jpg") center / cover no-repeat;
  transform: scale(1.04);
  animation: hero-drift 20s ease-in-out alternate infinite;
}

.hero__inner {
  position: relative;
  padding: 2.4rem 2rem 2rem;
  max-width: min(36rem, 92%);
}

.hero__brand {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #f8fafc;
  text-wrap: balance;
}

.hero__lede {
  margin: 0.85rem 0 0;
  color: #e2e8f0;
  font-size: 1.02rem;
  max-width: 32rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--lime); color: var(--lime-ink); }
.btn-primary:hover { background: #a3e635; }

.btn-ghost {
  background: rgba(248, 250, 252, 0.12);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.25);
}

.btn-ghost:hover { background: rgba(248, 250, 252, 0.2); }

.layout {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 1.5rem auto 3rem;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.15rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: fade-up 0.75s 0.05s ease both;
}

.side-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.side-block h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cat-list button {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
}

.cat-list button:hover,
.cat-list button.is-active {
  background: #eff6ff;
  color: var(--cobalt);
}

.cat-list .count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--mist);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.side-note {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.side-note strong { color: var(--ink); }

.feed { min-width: 0; animation: fade-up 0.8s 0.1s ease both; }

.feed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.feed-bar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chips button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

.chips button.is-active,
.chips button:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: #eff6ff;
}

.thread {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.thread:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

.thread.is-open { border-color: var(--cobalt); }

.thread__head {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
  cursor: pointer;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}

.avatar--buyer { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.avatar--company { background: linear-gradient(145deg, #a3e635, #65a30d); color: var(--lime-ink); }
.avatar--mod { background: linear-gradient(145deg, #94a3b8, #475569); }

.thread__meta { min-width: 0; }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.badge--cars { background: #dbeafe; color: #1d4ed8; }
.badge--heavy { background: #ecfccb; color: #3f6212; }
.badge--rvs { background: #ffedd5; color: #c2410c; }
.badge--ads { background: #ede9fe; color: #5b21b6; }
.badge--official { background: #d1fae5; color: #047857; }
.badge--sealed { background: #e2e8f0; color: #334155; }

.thread__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.thread__sub {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.thread__stats {
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.thread__stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

.thread__body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0 1.1rem 1.1rem;
}

.thread.is-open .thread__body {
  display: block;
  animation: fade-up 0.3s ease both;
}

.post { padding-top: 1rem; }
.post + .post { border-top: 1px dashed var(--line); margin-top: 1rem; }

.post__top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.post__who { display: flex; flex-direction: column; min-width: 0; }
.post__name { font-weight: 700; font-size: 0.92rem; }
.post__name.is-company { color: var(--ok); }
.post__role { font-size: 0.75rem; color: var(--muted); }
.post__time { margin-left: auto; font-size: 0.75rem; color: var(--muted); }

.post__content { margin: 0; color: #475569; }
.post__content p { margin: 0 0 0.7rem; }
.post__content p:last-child { margin-bottom: 0; }

.post.is-official {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 0.9rem;
  margin-top: 1rem;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.post-actions .btn {
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  background: var(--mist);
  color: var(--ink);
  border: 1px solid var(--line);
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 1.5rem 0 2rem;
}

.site-footer__inner {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.site-footer p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.site-footer button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cobalt);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}

.to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 50;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--cobalt);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.2%, -0.6%, 0); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .cat-list { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .logo-link img,
  .logo-link .logo-svg { height: 58px; }
  :root { --header-h: 72px; }
  .hero__inner { padding: 1.8rem 1.2rem 1.5rem; }
  .hero { min-height: min(48vh, 360px); }
  .thread__head { grid-template-columns: auto 1fr; }
  .thread__stats {
    grid-column: 2;
    text-align: left;
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
  }
  .thread__stats strong { display: inline; font-size: 0.95rem; }
  .cat-list { grid-template-columns: 1fr; }
}
