/* FUDforum — Web Hosting Community, redesign concept.
   Self-contained, no build step, no external requests.
   Color authored in OKLCH; neutrals tinted toward the brand hue (255). */

@font-face {
  font-family: "Jakarta";
  src: url("../fonts/plus-jakarta-sans-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  font-style: normal;
}

/* ---------- Tokens ---------- */
:root {
  --brand: oklch(55% 0.19 258);
  --brand-strong: oklch(48% 0.2 258);
  --brand-press: oklch(43% 0.2 258);
  --brand-tint: oklch(96% 0.03 250);
  --brand-tint-2: oklch(93% 0.05 246);
  --ring: oklch(62% 0.17 255 / 0.45);

  --ink: oklch(27% 0.03 262);
  --text: oklch(41% 0.02 262);
  --muted: oklch(56% 0.016 262);
  --faint: oklch(66% 0.012 262);
  --line: oklch(92% 0.008 262);
  --line-soft: oklch(95% 0.006 262);
  --bg: oklch(98.5% 0.006 255);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(97.5% 0.006 255);

  --success: oklch(58% 0.13 158);
  --success-tint: oklch(95% 0.05 158);
  --warn: oklch(64% 0.13 66);
  --warn-tint: oklch(95% 0.06 78);

  --c-host: oklch(58% 0.16 255);   --c-host-t: oklch(95% 0.04 255);
  --c-virt: oklch(56% 0.18 300);   --c-virt-t: oklch(95% 0.045 300);
  --c-lnx:  oklch(60% 0.15 145);   --c-lnx-t: oklch(95% 0.05 150);
  --c-hw:   oklch(64% 0.16 55);    --c-hw-t:  oklch(95% 0.06 65);
  --c-net:  oklch(62% 0.15 200);   --c-net-t: oklch(95% 0.05 205);
  --c-sec:  oklch(58% 0.17 25);    --c-sec-t: oklch(95% 0.05 30);
  --c-cloud:oklch(64% 0.13 230);   --c-cloud-t: oklch(95% 0.045 230);
  --c-beg:  oklch(66% 0.14 85);    --c-beg-t: oklch(95% 0.06 90);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px;

  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-pill: 999px;

  --sh-1: 0 1px 2px oklch(50% 0.03 262 / 0.06), 0 1px 3px oklch(50% 0.03 262 / 0.05);
  --sh-2: 0 2px 6px oklch(50% 0.03 262 / 0.07), 0 8px 20px oklch(50% 0.03 262 / 0.06);

  --font-display: "Jakarta", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 1440px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg);
  line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s6); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 42px; padding: 0 var(--s5); border-radius: var(--r);
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  border: 1px solid transparent; background: transparent; white-space: nowrap;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: white; box-shadow: 0 1px 0 oklch(40% 0.18 258 / 0.4), var(--sh-1); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: 0 4px 14px oklch(55% 0.18 258 / 0.35); }
.btn-primary:active { background: var(--brand-press); }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { height: 38px; padding: 0 var(--s4); font-size: 0.86rem; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: oklch(100% 0 0 / 0.86); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: var(--s5); height: 68px; }
.brand { display: flex; align-items: center; gap: var(--s3); margin-right: var(--s2); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--brand); letter-spacing: -0.02em; line-height: 1; }
.brand-name b { color: var(--ink); font-weight: 800; }
.brand-ver { font-size: 0.72rem; color: var(--faint); font-weight: 600; margin-left: 5px; vertical-align: 2px; }
.brand-tag { font-size: 0.68rem; color: var(--muted); font-weight: 600; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: var(--s2); margin-inline: auto; }
.nav-links a {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s3); border-radius: var(--r); font-weight: 600; font-size: 0.92rem; color: var(--text);
  transition: background-color .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a .icon { width: 18px; height: 18px; color: var(--faint); }
.nav-links a:hover .icon { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: var(--s3); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); color: var(--muted); border: 1px solid transparent; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-toggle { display: none; }
.nav-links a.menu-only { display: none; }
.nav-links.open a.menu-only { display: flex; }

/* ---------- Hero (compact) ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--brand-tint) 0%, var(--brand-tint-2) 60%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.hero-inner { position: relative; z-index: 2; text-align: center; padding: clamp(32px, 4vw, 52px) 0 clamp(28px, 3.5vw, 44px); max-width: 940px; margin-inline: auto; }
.hero h1 { font-size: clamp(1.45rem, 0.9rem + 1.5vw, 1.75rem); font-weight: 800; color: var(--ink); text-wrap: balance; }
.hero-search, .topics { max-width: 760px; margin-inline: auto; }
.hero p.sub { margin: var(--s3) auto 0; max-width: 40em; font-size: clamp(0.98rem, 0.95rem + 0.25vw, 1.1rem); color: var(--text); }
.hero-search { margin-top: var(--s5); display: flex; gap: var(--s2); background: var(--surface); padding: 6px; border-radius: var(--r-lg); box-shadow: var(--sh-2); border: 1px solid var(--line); }
.hero-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring), var(--sh-2); }
.hero-search .field { display: flex; align-items: center; gap: var(--s3); flex: 1; padding-left: var(--s4); color: var(--faint); }
.hero-search input { flex: 1; border: 0; background: transparent; font-size: 0.98rem; color: var(--ink); padding: var(--s3) 0; outline: none; min-width: 0; }
.hero-search input::placeholder { color: var(--faint); }
.topics { margin-top: var(--s4); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2); }
.topics .label { font-size: 0.84rem; font-weight: 700; color: var(--muted); margin-right: var(--s1); }
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 var(--s3);
  background: oklch(100% 0 0 / 0.7); border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 0.82rem; font-weight: 600; color: var(--brand-strong);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.chip:hover { background: var(--surface); border-color: var(--brand); transform: translateY(-1px); }
.hero-art { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-art img { position: absolute; height: auto; display: block; }
.hero-art .art-left { left: clamp(0px, 2vw, 48px); top: 50%; transform: translateY(-50%); width: clamp(130px, 12vw, 172px); }
.hero-art .art-right { right: clamp(0px, 2vw, 44px); top: 50%; transform: translateY(-50%); width: clamp(190px, 16vw, 240px); }
.hero-dots { position: absolute; right: 30%; top: 14px; color: oklch(72% 0.06 255 / 0.5); }
@media (max-width: 1180px) { .hero-art, .hero-dots { display: none; } }

/* ---------- Categories: single compact row ---------- */
.cats { padding-top: var(--s5); }
.cat-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--s3); }
.cat-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s3) 14px; box-shadow: var(--sh-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: oklch(88% 0.02 255); }
.cat-top { display: flex; align-items: center; gap: var(--s2); }
.cat-tile { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.cat-tile .icon { width: 19px; height: 19px; stroke-width: 1.9; }
.cat-card h3 { font-size: 0.86rem; font-weight: 700; line-height: 1.15; }
.cat-card .count { display: block; margin-top: 1px; font-size: 0.68rem; font-weight: 700; color: var(--brand); }
.cat-card .desc { margin-top: var(--s3); font-size: 0.77rem; color: var(--muted); line-height: 1.4; }
.cat-view-all { text-align: center; margin-top: var(--s4); }

.t-host { background: var(--c-host-t); color: var(--c-host); }
.t-virt { background: var(--c-virt-t); color: var(--c-virt); }
.t-lnx  { background: var(--c-lnx-t);  color: var(--c-lnx); }
.t-hw   { background: var(--c-hw-t);   color: var(--c-hw); }
.t-net  { background: var(--c-net-t);  color: var(--c-net); }
.t-sec  { background: var(--c-sec-t);  color: var(--c-sec); }
.t-cloud{ background: var(--c-cloud-t);color: var(--c-cloud); }
.t-beg  { background: var(--c-beg-t);  color: var(--c-beg); }

.link-more { color: var(--brand); font-weight: 700; font-size: 0.88rem; display: inline-flex; align-items: center; gap: var(--s1); }
.link-more:hover { color: var(--brand-strong); }
.link-more .icon { width: 16px; height: 16px; }

/* ---------- Main two-column layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--s5); align-items: start; padding-block: var(--s6) var(--s8); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--s5) var(--s4); }
.panel-head h2 { font-size: 1.2rem; font-weight: 700; }

/* Segmented tabs — active = filled blue */
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.tab { border: 0; background: transparent; padding: 7px var(--s4); border-radius: var(--r-pill); font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--muted); transition: color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--brand); color: white; box-shadow: 0 1px 4px oklch(55% 0.18 258 / 0.4); }

/* Discussion rows */
.threads { border-top: 1px solid var(--line-soft); }
.thread { display: grid; grid-template-columns: 44px minmax(0,1fr) auto auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-soft); transition: background-color .14s ease; }
.thread:last-child { border-bottom: 0; }
.thread:first-child { background: var(--brand-tint); }
.thread:hover { background: var(--surface-2); }
.thread:first-child:hover { background: var(--brand-tint-2); }
.thread-main { min-width: 0; }
.thread-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink); letter-spacing: -0.01em; }
.thread:first-child .thread-title { color: var(--brand-strong); }
.thread:hover .thread-title { color: var(--brand-strong); }
.thread-snippet { margin-top: 3px; font-size: 0.86rem; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thread-meta { margin-top: var(--s2); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 9px; border-radius: var(--r-pill); }
.counts { display: flex; flex-direction: column; gap: 3px; text-align: left; min-width: 74px; }
.counts span { font-size: 0.8rem; color: var(--faint); white-space: nowrap; }
.counts b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.status { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s2); min-width: 132px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 0.76rem; font-weight: 700; }
.badge .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.badge-solved { color: var(--success); background: var(--success-tint); }
.badge-open { color: oklch(48% 0.12 66); background: var(--warn-tint); }
.byline { display: flex; align-items: center; gap: var(--s2); font-size: 0.8rem; color: var(--muted); }
.byline b { color: var(--text); font-weight: 600; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: white; font-family: var(--font-display); font-weight: 700; font-size: 0.86rem; letter-spacing: 0.01em; background: linear-gradient(135deg, oklch(62% 0.16 var(--h, 255)), oklch(52% 0.17 calc(var(--h, 255) + 24))); box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.25); flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 0.68rem; }

.panel-foot { padding: var(--s4) var(--s5); text-align: center; border-top: 1px solid var(--line-soft); }
.empty { display: none; padding: var(--s8) var(--s5); text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto var(--s3); color: var(--faint); }

/* ---------- Sidebar ---------- */
.side { display: flex; flex-direction: column; gap: var(--s5); }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--s5); }
.side-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: var(--s4); display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.side-card h3 .link-more { font-size: 0.8rem; }
.side-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.side-duo .side-card { padding: var(--s4); }
.side-duo .side-card h3 { font-size: 0.95rem; margin-bottom: var(--s3); }

.glist li + li { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
.glist a { display: flex; gap: var(--s3); align-items: flex-start; }
.glist .g-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.glist .g-ic .icon { width: 17px; height: 17px; }
.g-body { min-width: 0; }
.g-title { font-family: var(--font-display); font-weight: 600; font-size: 0.88rem; color: var(--ink); line-height: 1.3; }
.glist a:hover .g-title { color: var(--brand-strong); }
.g-meta { font-size: 0.76rem; color: var(--faint); margin-top: 2px; }
.g-meta b { color: var(--muted); font-weight: 600; }

.mlist li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; }
.mlist li + li { border-top: 1px solid var(--line-soft); }
.rank { width: 16px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 0.84rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.mlist li:nth-child(1) .rank { color: oklch(70% 0.14 85); }
.mlist li:nth-child(2) .rank { color: oklch(70% 0.02 260); }
.mlist li:nth-child(3) .rank { color: oklch(58% 0.1 55); }
.m-name { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.m-pts { font-size: 0.78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-pts span { color: var(--faint); font-weight: 500; }

.stats-card dl { display: grid; grid-template-columns: 1fr auto; gap: var(--s3) var(--s2); margin: 0; }
.stats-card dt { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); min-width: 0; }
.stats-card dt .icon { width: 15px; height: 15px; color: var(--faint); }
.stats-card dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.84rem; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-card dd.accent { color: var(--brand); }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; box-shadow: 0 0 0 3px var(--success-tint); }

.join-card { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-strong) 100%); color: white; border: 0; }
.join-card h3 { color: white; }
.join-card p { font-size: 0.86rem; color: oklch(100% 0 0 / 0.85); margin: 0 0 var(--s4); line-height: 1.5; }
.join-card .btn { width: 100%; background: white; color: var(--brand-strong); }
.join-card .btn:hover { background: oklch(97% 0.02 255); }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: var(--s7) var(--s5); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s6); }
.footer .brand { margin-bottom: var(--s4); }
.footer-blurb { font-size: 0.88rem; color: var(--muted); max-width: 30ch; }
.footer h4 { font-family: var(--font-display); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: var(--s3); }
.footer-col a { display: block; padding: var(--s1) 0; font-size: 0.9rem; color: var(--muted); }
.footer-col a:hover { color: var(--brand); }
.footer-base { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--faint); }
.proto { display: inline-flex; align-items: center; gap: var(--s2); padding: 4px 10px; border-radius: var(--r-pill); background: var(--brand-tint); color: var(--brand-strong); font-size: 0.74rem; font-weight: 700; border: 1px solid oklch(85% 0.05 255); }

/* ---------- Entrance motion (additive, never hides content) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .will-rise { opacity: 0; transform: translateY(16px); }
  .will-rise.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .55s cubic-bezier(.22,.61,.36,1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
  .side-duo { grid-column: 1 / -1; }
  .join-card { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-grid; }
  .nav-links.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--s3) var(--s5); box-shadow: var(--sh-2); }
  .nav-links.open a { padding: var(--s3) var(--s3); }
  .brand-tag { display: none; }
  .thread { grid-template-columns: 40px minmax(0,1fr); }
  .thread-side-wrap { grid-column: 2; }
  .counts { flex-direction: row; gap: var(--s4); grid-column: 2; }
  .status { grid-column: 2; align-items: flex-start; min-width: 0; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .side { grid-template-columns: 1fr; }
  .side-duo { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .container { padding-inline: var(--s4); }
  .nav-inner { gap: var(--s3); }
  .nav-actions { gap: var(--s2); }
  .nav-actions .btn, .nav-actions .icon-btn:not(.nav-toggle) { display: none; }
  .menu-cta { color: var(--brand); font-weight: 700; }
  .panel-head { flex-wrap: wrap; padding: var(--s5) var(--s4) var(--s4); }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 8px 6px; font-size: 0.8rem; }
  .cat-grid { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; }
  .hero-search .btn { width: 100%; }
}
