@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk.woff2") format("woff2"); font-weight: 400 700; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; }

:root {
  --bg: #06090e; --panel: rgba(16, 24, 32, .78); --line: rgba(255, 255, 255, .1);
  --ink: #eef8fb; --ink2: #a9bcc6; --ink3: #6d8591; --cyan: #5ee7ff; --gold: #ffc24b;
  --green: #3ddc97; --red: #ff5c6c;
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans);
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(26, 74, 92, .55), transparent 65%),
    radial-gradient(800px 500px at 90% 110%, rgba(94, 231, 255, .07), transparent 60%),
    var(--bg);
}
a { color: var(--cyan); text-decoration: none; }
.f-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: linear-gradient(to bottom, rgba(6, 9, 14, .94), rgba(6, 9, 14, .45));
  backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.f-brand { font-family: var(--display); font-size: 18px; letter-spacing: .12em; color: var(--ink); }
.f-brand b { color: var(--cyan); font-weight: 600; }
.f-tag { font-size: 8px; letter-spacing: .38em; color: var(--ink3); }
.f-ver { font-size: 9px; letter-spacing: .12em; color: var(--ink3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.f-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 12px; }
.f-nav a { color: var(--ink2); }
.f-nav a:hover { color: var(--cyan); }
.f-nav button {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink3);
  border-radius: 999px; padding: 6px 12px; font-size: 9px; letter-spacing: .18em; cursor: pointer;
}
.f-main { width: min(920px, 92vw); margin: 0 auto; padding: 46px 0 90px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 12px;
  font-size: 9px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--cyan);
}
.eyebrow::before { content: ""; width: 16px; height: 1px; background: currentColor; opacity: .7; }
.f-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(38px, 7vw, 64px); letter-spacing: -.04em; line-height: .95; }
.f-lede { margin: 14px 0 0; max-width: 62ch; color: var(--ink2); line-height: 1.65; font-size: 15px; }
.f-composer {
  margin: 26px 0 30px; padding: 16px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 60px -40px #000;
  backdrop-filter: blur(12px);
}
.f-composer textarea {
  width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--ink);
  padding: 12px 13px; font: inherit; font-size: 14px; outline: none;
}
.f-composer textarea:focus { border-color: rgba(94, 231, 255, .5); box-shadow: 0 0 0 3px rgba(94, 231, 255, .1); }
.f-compose-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.f-compose-top select {
  appearance: none; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px;
  background: rgba(255, 255, 255, .05); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer;
}
.f-compose-top select:focus { border-color: rgba(94, 231, 255, .5); outline: none; }
.f-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 14px; }
.f-topic {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink2);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12px; cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.f-topic:hover { border-color: rgba(94, 231, 255, .35); color: var(--ink); }
.f-topic.on { background: rgba(94, 231, 255, .16); border-color: rgba(94, 231, 255, .55); color: var(--cyan); }
.f-compose-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.f-file { display: inline-flex; align-items: center; gap: 8px; color: var(--ink3); font-size: 11px; cursor: pointer; }
.f-file input { display: none; }
.f-file span { border: 1px dashed var(--line); border-radius: 9px; padding: 6px 10px; }
.f-file:hover span { border-color: rgba(94, 231, 255, .5); color: var(--ink2); }
.f-preview { margin-top: 10px; display: none; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.f-preview figure { position: relative; margin: 0; }
.f-preview img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.f-preview button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 999px; background: rgba(4, 10, 14, .82); color: #fff; padding: 2px 8px; font-size: 13px; line-height: 1.4; cursor: pointer; }
.f-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.f-imgs img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.f-btn {
  border: 1px solid rgba(94, 231, 255, .45); background: linear-gradient(180deg, rgba(94, 231, 255, .22), rgba(94, 231, 255, .06));
  color: var(--ink); border-radius: 10px; padding: 9px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.f-btn:disabled { opacity: .45; cursor: default; }
.f-hint { color: var(--ink3); font-size: 10px; }
.f-composer .f-error { color: var(--red); font-size: 11px; margin-top: 8px; min-height: 14px; }
.f-feed { display: flex; flex-direction: column; gap: 12px; }
.f-post {
  padding: 16px 17px; border-radius: 16px; background: var(--panel);
  border: 1px solid var(--line); position: relative;
}
.f-post.pinned {
  border-color: rgba(94, 231, 255, .42);
  box-shadow: 0 0 0 1px rgba(94, 231, 255, .1), 0 28px 50px -42px rgba(94, 231, 255, .55);
}
.f-badge {
  font-size: 8px; letter-spacing: .12em; text-transform: uppercase;
  border-radius: 999px; padding: 1px 7px; border: 1px solid; white-space: nowrap; flex: none;
}
.f-badge.official { color: var(--gold); border-color: rgba(255, 194, 75, .5); background: rgba(255, 194, 75, .1); }
.f-badge.pin { color: var(--cyan); border-color: rgba(94, 231, 255, .45); background: rgba(94, 231, 255, .08); }
.f-topic-chip {
  font-size: 9px; letter-spacing: .06em; color: var(--ink3);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
  white-space: nowrap; flex: none;
}
.f-post header { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.f-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #06121a; background: hsl(var(--h, 190) 72% 66%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.f-author { font-family: var(--display); font-size: 13px; }
.f-time { margin-left: auto; font-size: 10px; color: var(--ink3); }
.f-text { margin: 0 0 10px; color: var(--ink2); line-height: 1.6; font-size: 14px; white-space: pre-wrap; }
.f-post img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.f-report { position: absolute; right: 12px; bottom: 10px; border: 0; background: none; color: var(--ink3); font-size: 9px; cursor: pointer; }
.f-report:hover { color: var(--red); }
.f-muted { color: var(--ink3); font-size: 13px; }
.f-empty { padding: 22px; text-align: center; color: var(--ink3); border: 1px dashed var(--line); border-radius: 14px; }
.f-signin { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .f-top { gap: 8px; padding: 12px 14px; flex-wrap: wrap; }
  .f-tag { display: none; }
  .f-ver { display: none; }
  .f-nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  .f-nav a { font-size: 11px; white-space: nowrap; }
  .f-lang { white-space: nowrap; }
  .f-hero h1 { font-size: 40px; }
  .f-main { padding-top: 28px; }
}

.f-lang {
  background: rgba(255, 255, 255, .04); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 7px; font-size: 11px; cursor: pointer;
}
html[dir="rtl"] .f-main, html[dir="rtl"] .f-post, html[dir="rtl"] .f-composer { text-align: right; }

/* custom language menu (native select options were unreadable in dark mode) */
.f-lang-wrap { position: relative; }
.f-lang { appearance: none; font-family: inherit; }
.f-lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; padding: 5px;
  background: #0A1820; border: 1px solid var(--line); border-radius: 10px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 20px 45px -22px #000;
}
.f-lang-menu[hidden] { display: none; }
.f-lang-menu button {
  text-align: left; border: 0; background: transparent; color: var(--ink);
  font-size: 11px; padding: 7px 9px; border-radius: 7px; cursor: pointer;
}
.f-lang-menu button:hover { background: rgba(255, 255, 255, .06); }
.f-lang-menu button.on { background: rgba(94, 231, 255, .14); color: var(--cyan); }

/* ---------------- forum threads ---------------- */
.f-post { cursor: pointer; transition: border-color .2s, transform .2s; }
.f-post:hover { border-color: rgba(94, 231, 255, .22); }
.f-you {
  margin-left: 6px; font-size: 8px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(94, 231, 255, .35);
  border-radius: 999px; padding: 1px 6px;
}
.f-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.f-act {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: none;
  color: var(--ink3); font: inherit; font-size: 11px; padding: 2px 0; cursor: pointer;
}
.f-act svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.f-act:hover { color: var(--ink2); }
.f-act.like.on { color: #ff6b86; }
.f-act.like.on svg { fill: currentColor; stroke: currentColor; }
.f-act.danger { color: #ff8b98; }
.f-act.static { cursor: default; }
.f-spacer { flex: 1; }
.f-post .f-report { position: static; margin-left: 4px; }
.f-thread-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start;
  justify-content: center; padding: 28px 14px; overflow-y: auto;
  background: rgba(2, 6, 9, .7); backdrop-filter: blur(4px);
}
.f-thread, .f-editor {
  width: min(580px, 100%); background: #0a1820; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 40px 100px -50px #000; padding: 16px;
}
.f-thread { max-height: calc(100vh - 56px); display: flex; flex-direction: column; }
.f-thread-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.f-thread-meta { display: flex; flex-direction: column; min-width: 0; }
.f-thread-meta b { font-family: var(--display); font-size: 13px; }
.f-thread-meta span { font-size: 10px; color: var(--ink3); }
.f-icon {
  margin-left: auto; width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--ink2); font-size: 18px; line-height: 1; cursor: pointer;
}
.f-thread-body { overflow-y: auto; min-height: 0; }
.f-thread-title { font-family: var(--display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin: 14px 0 8px; }
.f-comments { display: flex; flex-direction: column; gap: 8px; }
.f-comment { display: flex; gap: 8px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.04); }
.f-comment .f-avatar { width: 24px; height: 24px; font-size: 9px; }
.f-comment-body { flex: 1; min-width: 0; }
.f-comment-body header { display: flex; align-items: baseline; gap: 8px; }
.f-comment-body header b { font-size: 11px; color: var(--ink); }
.f-comment-body header span { font-size: 9px; color: var(--ink3); }
.f-comment-body p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink2); white-space: pre-wrap; word-break: break-word; }
.f-comment-form { display: flex; gap: 7px; margin-top: 12px; }
.f-comment-form input {
  flex: 1; min-width: 0; padding: 9px 11px; font: inherit; font-size: 12px;
  border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); outline: none;
}
.f-comment-form input:focus { border-color: rgba(94,231,255,.5); }
.f-signin-note { margin: 12px 0 0; font-size: 12px; color: var(--ink3); line-height: 1.6; }
.f-error { color: var(--red); font-size: 11px; margin: 6px 0 0; min-height: 12px; }
.f-editor textarea {
  width: 100%; min-height: 100px; resize: vertical; font: inherit; font-size: 13px;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink);
  padding: 10px 11px; outline: none;
}
.f-editor textarea:focus { border-color: rgba(94,231,255,.5); }
.f-edit-imgs { display: none; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 7px; margin-top: 9px; }
.f-edit-imgs figure { position: relative; margin: 0; }
.f-edit-imgs img { width: 100%; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.f-edit-imgs button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 999px; background: rgba(4,10,14,.82); color: #fff; padding: 1px 7px; font-size: 12px; cursor: pointer; }
.f-edit-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.f-edit-actions { display: flex; gap: 8px; margin-top: 12px; }
.f-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px);
  background: #0b1a22; border: 1px solid var(--line); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font-size: 11px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.f-toast.on { opacity: 1; transform: translate(-50%, 0); }
html[dir="rtl"] .f-thread, html[dir="rtl"] .f-editor, html[dir="rtl"] .f-comment-body { text-align: right; }
html[dir="rtl"] .f-lang-menu { right: auto; left: 0; }
@media (max-width: 640px) {
  .f-thread-backdrop { padding: 12px 8px; }
  .f-thread, .f-editor { padding: 13px; border-radius: 13px; }
  .f-actions { gap: 9px; flex-wrap: wrap; }
}
