@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700.woff2") format("woff2"); }
/* Display faces for the landing headline (SIL Open Font License). */
@font-face { font-family: "Anton"; font-weight: 400; font-display: swap; src: url("../fonts/anton-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Pacifico"; font-weight: 400; font-display: swap; src: url("../fonts/pacifico-latin-400.woff2") format("woff2"); }

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #161a26;
  --muted: #5d6478;
  --border: #e2e5ee;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --logo: #a91151;
  --brand-text: #ffffff;
  --ok: #0f7b4a;
  --ok-bg: #e6f6ee;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 6%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --surface: #151a24;
    --surface-2: #1c2230;
    --text: #e8eaf2;
    --muted: #9aa2b8;
    --border: #262d3d;
    --brand: #818cf8;
    --brand-2: #a78bfa;
    --logo: #e0457f;
    --brand-text: #0d1017;
    --ok: #4ade80;
    --ok-bg: #12301f;
    --err: #f87171;
    --err-bg: #3a1414;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 16px; }
main.narrow { max-width: 460px; }
main.feed { max-width: 680px; }

.nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.nav-links { display: flex; gap: 18px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 600; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
/* Buttons in the nav keep their own colours (the muted link colour above is more specific than .btn). */
.nav-links a.btn, .nav-links a.btn:hover { color: var(--brand-text); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 12px; text-align: center; margin-left: 4px; }

.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 24px 16px; display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.footer-inner a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit;
}
input[type=file] { padding: 6px; color: var(--muted); cursor: pointer; }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-text); font: inherit; font-weight: 600;
}
input[type=file]::file-selector-button:hover { filter: brightness(1.08); }
select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { resize: vertical; min-height: 80px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--brand); color: var(--brand-text); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--err); color: #fff; }
.btn.link { background: none; color: var(--muted); padding: 4px 6px; }
.btn.block { width: 100%; margin-top: 20px; }
form.inline { display: inline; }

.flash { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

.captcha { display: flex; gap: 12px; align-items: center; }
.captcha img { border-radius: 8px; border: 1px solid var(--border); height: 60px; }

.hero { text-align: center; padding: 72px 0 48px; }
.hero h1 { font-family: "Anton", Impact, "Arial Narrow", sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(24px, 7vw, 72px); line-height: 1.02; letter-spacing: 0.04em; margin: 0 0 28px; }
.hero h1 span { display: block; font-family: "Pacifico", "Brush Script MT", cursive; text-transform: none;
  font-size: clamp(30px, 6vw, 62px); letter-spacing: 0; line-height: 1.35; margin-top: 4px;
  /* Room for the script's descenders (g tails): the gradient fill only paints inside the padding box. */
  padding: 0.05em 0.2em 0.4em; margin-bottom: -0.3em;
  background: linear-gradient(100deg, var(--logo), var(--brand-2)); -webkit-background-clip: text; background-clip: text;
  color: transparent; transform: rotate(-3deg); }
.hero p { font-size: 19px; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.hero-logo { display: block; height: 360px; width: auto; margin: 0 auto 24px; animation: fade-in 2.5s ease-in both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }

.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.comments { margin-top: 10px; }
.comment { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.prose h2 { margin-top: 1.4em; }
code.detail { font-size: 12px; color: var(--muted); }

/* Uploaded images keep their own aspect ratio and square corners: never cropped or rounded. */
img.avatar { width: auto; max-width: 80px; height: 40px; object-fit: contain; border-radius: 0; background: none; }
img.cover { width: 100%; height: auto; margin-bottom: 16px; display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.grid figure { margin: 0; position: relative; }
.grid img { width: 100%; height: auto; display: block; }
.grid figure .btn { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.convo { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.convo:hover { text-decoration: none; background: var(--surface-2); }
.convo .preview { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }
.thread { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: var(--brand-text); }
.bubble .meta { font-size: 11px; opacity: .7; display: flex; gap: 8px; justify-content: space-between; }
.bubble .btn.link { color: inherit; padding: 0; font-size: 11px; }
.typing { color: var(--muted); font-size: 13px; font-style: italic; min-height: 20px; }

.nav-search { flex: 1; max-width: 320px; }
.nav-search input { padding: 7px 12px; }
.composer textarea { margin-bottom: 8px; }
.composer > input[type=text] { margin-top: 8px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-picker .btn.link { font-size: 18px; padding: 2px 4px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.swatches input { position: absolute; opacity: 0; }
.swatch { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.swatch.none { background: var(--surface-2); border-color: var(--border); }
.swatches input:checked + .swatch { border-color: var(--text); }
.swatches input:focus-visible + .swatch { outline: 2px solid var(--brand); }
.post-bg { color: #fff; font-size: 22px; font-weight: 700; text-align: center; padding: 48px 20px; border-radius: 12px; text-shadow: 0 1px 2px rgb(0 0 0 / 30%); }
.post-gif { max-width: 100%; height: auto; margin-top: 10px; display: block; }
.embed { position: relative; aspect-ratio: 16 / 9; margin-top: 10px; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; }
.gif-picker { margin-top: 8px; }
.gif-picker summary { list-style: none; display: inline-flex; }
.gif-picker input { margin-top: 8px; }
.gif-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.gif { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.gif img { width: 100%; height: auto; display: block; }
.gif:focus-visible, .gif:hover { border-color: var(--brand); }
[data-gif-preview] img { max-width: 200px; height: auto; margin-top: 8px; }
.ad { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.ad:hover { text-decoration: none; border-color: var(--brand); }
.ad img { width: 100%; height: auto; }

.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(13, 16, 23, 0.72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.overlay-card { max-width: 620px; width: 100%; margin: 0; }
.rules { padding-left: 22px; line-height: 1.55; }
.rules li { margin-bottom: 10px; }

.report summary { list-style: none; display: inline-flex; font-size: 13px; }
.post-actions { flex-wrap: wrap; }
.report[open] { flex-basis: 100%; }
.report[open] form { display: grid; gap: 8px; margin-top: 8px; }
.post-actions .report-result { flex-basis: 100%; }
.report-result:empty { display: none; }
.report-row { border-top: 1px solid var(--border); padding: 14px 0; }
.report-row.urgent { border-left: 4px solid var(--err); padding-left: 12px; }
.snapshot { margin: 8px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.qr { display: flex; justify-content: center; margin: 16px 0; }
.qr svg { background: #fff; padding: 8px; }
code.secret { word-break: break-all; }
.backup-codes { columns: 2; list-style: none; padding: 0; font-size: 16px; line-height: 2; }
.evidence summary { list-style: none; display: inline-flex; }
.evidence img { display: block; max-width: 100%; height: auto; margin-top: 8px; }
.grid figure .report { margin-top: 4px; }
