/* ===================================================================
   4nt - site styles
   One stylesheet shared by every page.
   Look: "field notes" — warm paper, ink type, fire-ant rust accent,
   hairline rules, mono specimen labels. No webfonts, no frameworks.
   Re-theme the whole site by editing the tokens in :root below.
   =================================================================== */

:root {
  --paper:     #f2ecdd;   /* page background (warm paper) */
  --paper-2:   #e8e0ca;   /* recessed: code blocks, pre */
  --card:      #f9f5ea;   /* raised: cards, inputs */
  --ink:       #241d11;   /* main text */
  --ink-2:     #6a5e45;   /* muted text */
  --line:      #d8cdb2;   /* hairline rules */
  --line-2:    #b3a685;   /* stronger rules, control borders */
  --rust:      #a03f16;   /* accent (fire-ant rust) */
  --rust-2:    #7e300e;   /* accent hover */
  --rust-tint: rgba(160,63,22,.08);
  --moss:      #5f6b33;   /* secondary accent (leaf) */
  --danger:    #a03f16;
  --radius:    3px;
  --maxw:      1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono:  ui-monospace, "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(160,63,22,.18); }

a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}
.nav .wrap {
  display: flex; align-items: center; gap: 8px;
  height: 58px;
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem;
  letter-spacing: -.02em; color: var(--ink);
  display: inline-flex; align-items: baseline;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--rust); }
.nav-links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  font-family: var(--mono); font-size: .8rem; text-transform: lowercase;
  letter-spacing: .02em; color: var(--ink-2); padding: 6px 10px;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active {
  color: var(--rust);
  text-decoration: underline; text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: .85rem; font-weight: 600;
  letter-spacing: .02em;
  background: var(--rust); color: var(--paper);
  padding: 11px 20px; border-radius: var(--radius); border: 1px solid var(--rust);
  cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--rust-2); border-color: var(--rust-2); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { border-color: var(--ink); background: transparent; }
.btn.ghost { background: var(--paper-2); color: var(--ink); border-color: var(--paper-2); }
.btn.ghost:hover { background: var(--line); border-color: var(--line); }
.btn.big { padding: 14px 26px; font-size: .95rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* mono text link with a trailing arrow, pairs with .btn in action rows */
.arrow-link {
  font-family: var(--mono); font-size: .85rem; letter-spacing: .02em;
  color: var(--rust);
}
.arrow-link:hover { color: var(--rust-2); }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero > .wrap { padding-top: 78px; padding-bottom: 8px; }
.hero .tag { margin-bottom: 18px; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .72rem;
  font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--rust); margin: 0 0 10px;
}
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 620px; }
.hero-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-top: 28px; }
.hero-meta {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .08em;
  color: var(--ink-2); margin: 30px 0 0;
}

/* pheromone trail strip at the foot of the hero */
.trail { margin-top: 6px; }
.trail svg { display: block; width: 100%; height: 90px; }
.trail-path {
  fill: none; stroke: var(--ink); stroke-opacity: .3;
  stroke-width: 2; stroke-dasharray: .5 8; stroke-linecap: round;
}
/* fill sits on the GROUP so it inherits into the <use>-cloned ant glyph */
.ant-dots, .trail-ant { fill: var(--ink); }
.ant-dots { opacity: .5; }
.trail-ant {
  offset-path: path("M-40,62 C160,18 330,84 520,52 C710,20 850,78 1040,44 C1110,32 1170,40 1240,30");
  animation: march 75s linear infinite;
}
@keyframes march {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .trail-ant { animation: none; offset-distance: 12%; }
  html { scroll-behavior: auto; }
}

/* ---------- Sections / cards ---------- */
.section { padding: 72px 0; }
.section.tight { padding: 44px 0; }
.section.ruled { border-top: 1px solid var(--line); }
.grid { display: grid; gap: 24px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* numbered feature columns (index) */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.feature { border-top: 2px solid var(--ink); padding-top: 18px; }
.feature .num {
  display: block; font-family: var(--mono); font-size: .78rem;
  font-weight: 600; letter-spacing: .1em; color: var(--rust); margin-bottom: 12px;
}
.feature h3 { margin-bottom: .4em; }
.feature p { font-size: .95rem; }

/* config file shown as a labelled specimen (index) */
.specimen { margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); }
.specimen-head {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .05em;
  color: var(--ink-2); padding: 8px 14px;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.specimen pre {
  margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: .8rem;
  color: var(--ink); overflow: auto;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.card h3 { margin-bottom: .5em; }

/* small field-guide ant illustration */
.ant-fig { display: block; width: 88px; height: auto; margin: 4px auto 12px; color: var(--ink); }

.page-head { padding: 60px 0 26px; border-bottom: 1px solid var(--line); }
.page-head p { color: var(--ink-2); max-width: 680px; }

/* ---------- Forms / inputs ---------- */
label {
  display: block; font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  margin: 0 0 6px;
}
input[type=text], input[type=search], input[type=email], input[type=password], textarea, select {
  width: 100%; background: #fdfbf4; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; font-size: 1rem; font-family: var(--serif);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px var(--rust-tint);
}
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

/* file drop zone */
.drop {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 30px; text-align: center; color: var(--ink-2);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--rust); background: var(--rust-tint); color: var(--ink); }

/* ---------- Notices ---------- */
.notice {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--rust); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 20px; color: var(--ink-2); font-size: .92rem;
}
.notice strong { color: var(--ink); }
.notice.demo { border-left-color: var(--moss); }

.badge {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px;
  color: var(--moss); border: 1px solid var(--line-2);
}

/* ---------- Forum ---------- */
.thread {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; cursor: pointer;
  transition: border-color .15s;
}
.thread:hover { border-color: var(--line-2); }
.thread h3 { margin-bottom: 4px; font-size: 1.15rem; }
.meta { font-family: var(--mono); font-size: .75rem; color: var(--ink-2); }
.reply {
  border-left: 2px solid var(--line-2);
  padding: 6px 0 6px 16px; margin-bottom: 14px;
}
.reply .meta { margin-bottom: 6px; }

/* board cards + filter pills (forum page) */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 30px; }
.cat-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
  transition: border-color .15s, background .15s; text-align: left; font: inherit; color: inherit; }
.cat-card:hover { border-color: var(--line-2); }
.cat-card.active { border-left-color: var(--rust); }
.cat-card.active h3 { color: var(--rust); }
.cat-card h3 { margin: 0 0 2px; font-size: 1.05rem; }
.cat-card .cat-count { margin-left: auto; font-family: var(--mono); color: var(--ink-2);
  font-size: .72rem; white-space: nowrap; padding-top: 4px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar button { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  padding: 6px 13px; border-radius: var(--radius); cursor: pointer; font-family: var(--mono); font-size: .75rem; }
.filter-bar button:hover { color: var(--ink); border-color: var(--ink); }
.filter-bar button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
/* category tag on thread cards/modal — a .badge with breathing room */
.cat-tag { margin-bottom: 6px; }

/* User-generated text can contain long unbroken tokens (URLs, pasted logs);
   let them wrap instead of overflowing cards, the modal, or the phone layout. */
.thread, .reply, .config, .modal, .tagline { overflow-wrap: anywhere; }

/* ---------- Auth tabs + edited stamp ---------- */
.auth-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.auth-hint { font-size: .85rem; }
.auth-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth-form input { flex: 1; min-width: 150px; }
.auth-form .btn { white-space: nowrap; }
/* Segmented controls: the auth tabs and sort toggles share one look. */
.auth-tabs, .sort-bar { display: inline-flex; border: 1px solid var(--line-2);
  border-radius: var(--radius); overflow: hidden; }
.auth-tabs button, .sort-bar button { background: var(--card); border: 0; color: var(--ink-2);
  padding: 8px 16px; cursor: pointer; font-family: var(--mono); font-size: .8rem; }
.sort-bar button { padding: 6px 14px; font-size: .75rem; }
.auth-tabs button:hover, .sort-bar button:hover { color: var(--ink); }
.auth-tabs button.active, .sort-bar button.active { background: var(--ink); color: var(--paper); font-weight: 600; }
.edited { font-family: var(--mono); color: var(--ink-2); font-size: .68rem; margin-top: 6px; }

/* ---------- Moderation links ---------- */
.mod-row { display: flex; gap: 14px; margin-top: 8px; }
.modlink {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .03em;
  text-transform: lowercase; color: var(--ink-2);
}
.modlink:hover { color: var(--ink); text-decoration: underline; }
.modlink.danger { color: var(--danger); }
.modlink.danger:hover { color: var(--rust-2); }

/* ---------- Tip buttons ---------- */
.tip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 10px; }
.tip-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tip-btn:hover { border-color: var(--rust); color: var(--rust); background: var(--rust-tint); text-decoration: none; }
.tip-btn .amt { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; line-height: 1.1; }
.tip-btn .lbl { font-family: var(--mono); font-size: .7rem; letter-spacing: .05em; color: var(--ink-2); }
.tip-btn:hover .lbl { color: inherit; }
.tip-other { display: flex; width: 100%; }   /* full-width but still a flex button, so .btn's centering applies */
/* Disabled = not clickable, but still shown at full strength so the buttons
   look like real, available buttons (they activate once Stripe links are set). */
.is-disabled { pointer-events: none; }

/* ---------- Votes + sort ---------- */
.vote {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: var(--radius); padding: 4px 10px; cursor: pointer;
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  line-height: 1.3; transition: all .12s;
}
.vote:hover { border-color: var(--ink); color: var(--ink); }
.vote .arrow { font-size: .8rem; }
.vote.voted { background: var(--rust-tint); border-color: var(--rust); color: var(--rust); }
/* .sort-bar styling lives with .auth-tabs (shared segmented-control rules). */
.head-row { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; }

/* ---------- Config cards ---------- */
.config-list { display: grid; gap: 14px; grid-template-columns: repeat(2,1fr); }
.config {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
}
.config h3 { font-size: 1.1rem; margin: 0; }
/* .file-pre = the same recessed code box, used by the upload preview */
.config pre, .file-pre {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; font-family: var(--mono); font-size: .78rem; color: var(--ink);
  max-height: 120px; overflow: auto; margin: 0; white-space: pre-wrap;
}
.file-pre { max-height: 160px; padding: 12px; }
.config .actions { display: flex; gap: 8px; margin-top: auto; }
.tagline { color: var(--ink-2); font-size: .9rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: .68rem; letter-spacing: .03em;
  border: 1px solid var(--line-2); padding: 2px 8px; border-radius: 2px;
  color: var(--ink-2); text-transform: lowercase; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(36,29,17,.45);
  display: none; align-items: flex-start; justify-content: center; z-index: 100;
  padding: 40px 16px; overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
  position: relative;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 26px; max-width: 640px; width: 100%;
  box-shadow: 0 20px 60px rgba(36,29,17,.25);
}
.modal .close { position: absolute; top: 14px; right: 16px; background: none; border: 0;
  color: var(--ink-2); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal .close:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-2); margin-top: 40px;
  padding: 26px 0; color: var(--ink-2);
  font-family: var(--mono); font-size: .75rem; letter-spacing: .02em;
}
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--ink); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Misc ---------- */
.heart { color: var(--rust); }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); }
.empty { text-align: center; color: var(--ink-2); font-style: italic; padding: 40px; }
.spacer { height: 24px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid.cols-2, .config-list, .features, .cat-grid { grid-template-columns: 1fr; }
  .nav .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav-links { width: 100%; margin-left: 0; }
  .hero > .wrap { padding-top: 56px; }
}
