/* ==========================================================================
   Get Posting Board — redesign concept: "The window's lit"
   --------------------------------------------------------------------------
   One night, one warm window. The dark street is the product's restraint;
   the lit pane is the welcome. Amber is the only accent, used like a lamp:
   sparingly, and it always means "this is alive".
   All assets are same-origin. No inline scripts. Reduced-motion respected.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --night: #070910;            /* the street at night */
  --night-2: #0b0e18;          /* raised surfaces */
  --night-3: #0e1322;
  --paper: #f7f0e1;            /* the lit pane */
  --paper-2: #efe4cd;
  --ink: #1a150f;              /* text inside the pane */
  --ink-soft: #5d5340;
  --ink-link: #7a4a0c;
  --cream: #ece2cd;            /* text on the night */
  --cream-dim: #a89d84;
  --lamp: #e79c3c;             /* the light itself */
  --lamp-soft: #f3c37e;
  --line-dark: rgba(236, 226, 205, 0.24);
  --line-warm: rgba(231, 156, 60, 0.45);
  --measure: 46rem;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* --- Self-hosted display face (SIL OFL, see fonts/OFL-Fraunces.txt) ------ */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* --- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(56rem 26rem at 50% -14rem, rgba(231, 156, 60, 0.07), rgba(231, 156, 60, 0) 70%),
    radial-gradient(70rem 44rem at 50% -12rem, #0d1326 0%, var(--night) 58%),
    var(--night);
  color: var(--cream);
  font: 17px/1.65 var(--font-body);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--lamp-soft); text-underline-offset: 4px; }
a:visited { color: #d3b184; }
a:hover { color: #ffdca4; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

/* --- Type --------------------------------------------------------------- */
.display,
.h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 480;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}

.display { font-size: clamp(2.4rem, 8.5vw, 4.35rem); }
.display .soft { font-weight: 340; color: var(--ink-soft); display: block; }
.h2 { font-size: clamp(1.55rem, 4.2vw, 2.15rem); margin-bottom: 0.6em; }

.eyebrow,
.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin: 0;
}
.window .eyebrow,
.window .label { color: var(--ink-soft); }

.prose { max-width: 40rem; color: #d9cfb8; }
.prose + .prose { margin-top: 1.1em; }

.meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #bcb197;
}
.display .low { font-weight: 340; color: #b9ae94; }

/* --- Site header -------------------------------------------------------- */
.site { padding: 1rem 0 0.9rem; border-bottom: 1px solid var(--line-dark); }
.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream);
}
.counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--lamp-soft);
  text-decoration: underline dotted;
  text-underline-offset: 5px;
  padding: 11px 2px; /* touch target */
  white-space: nowrap;
}
.counter .counter-num { font-variant-numeric: tabular-nums; }

/* --- The lit window (hero pane) ----------------------------------------- */
.hero {
  display: grid;
  align-content: center;
  min-height: min(calc(100svh - 6rem), 43rem);
  margin-bottom: clamp(2rem, 6vh, 2.8rem);
}

.hero-rail {
  display: flex;
  justify-content: center;
  margin-top: clamp(1.4rem, 4vh, 2.2rem);
}
.hero-rail span {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, rgba(236, 226, 205, 0.45), rgba(236, 226, 205, 0));
}

.window {
  position: relative;
  margin: 0;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
    var(--paper);
  color: var(--ink);
  border: 1px solid rgba(60, 44, 16, 0.28);
  border-radius: clamp(18px, 3vw, 30px);
  padding: clamp(1.6rem, 6vw, 3.4rem);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 0 70px -22px rgba(231, 156, 60, 0.34),
    0 42px 120px -42px rgba(0, 0, 0, 0.9);
}

/* the light spilling onto the street behind the pane */
.window::before {
  content: "";
  position: absolute;
  inset: -45% -18%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(231, 156, 60, 0.18), rgba(231, 156, 60, 0) 72%);
  animation: breathe 9s ease-in-out infinite;
}

.window .deck {
  margin: 1.2em 0 0;
  max-width: 34rem;
  font-size: clamp(1rem, 2.5vw, 1.12rem);
  color: #33291c;
}
.window .display { margin: 0.5em 0 0; }
.window .deck strong { color: var(--ink-link); }

@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* --- Invitation block --------------------------------------------------- */
.invite {
  margin: 2em 0 0;
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--paper-2);
  border: 1px solid rgba(60, 44, 16, 0.22);
  border-radius: 14px;
}
.invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.invitation {
  margin: 0.9em 0 0.5em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #3a2f1e;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.status { margin: 0; font-size: 0.78rem; color: var(--ink-soft); min-height: 1.4em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 0.84rem/1 var(--font-body);
  letter-spacing: 0.02em;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid #4a3a20;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: rgba(231, 156, 60, 0.18); border-color: var(--ink-link); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 1.5em;
}
.hero-links a {
  color: var(--ink-link);
  font-weight: 600;
  padding: 10px 0; /* touch target */
}
.hero-links a:hover { color: #5c3706; }

/* --- Night sections ----------------------------------------------------- */
.section { margin: 0 0 clamp(3rem, 8vh, 4.5rem); border-top: 1px solid var(--line-dark); padding-top: clamp(1.6rem, 4vh, 2.2rem); }

.routes {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}
@media (min-width: 720px) { .routes { grid-template-columns: repeat(3, 1fr); } }

.route {
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1.3rem;
  background: linear-gradient(180deg, var(--night-2), rgba(11, 14, 24, 0.4));
  transition: border-color 0.25s ease, background 0.25s ease;
}
.route:hover { border-color: var(--line-warm); background: var(--night-3); }
.route .label { margin-bottom: 0.65em; }
.route h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 480;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}
.route h3 a { text-decoration: none; color: var(--cream); }
.route h3 a:hover { color: var(--lamp-soft); }
.route p { margin: 0; font-size: 0.92rem; color: #cdc2aa; }

.codeblock {
  margin: 1.2rem 0 1.4rem;
  padding: 1rem 1.15rem;
  background: var(--night-3);
  border: 1px solid var(--line-dark);
  border-left: 3px solid var(--lamp);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #f0d9ae;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.steps { margin: 0 0 1.2rem; padding-left: 1.3rem; color: #d9cfb8; }
.steps li { margin: 0.6em 0; }
.steps strong { color: var(--cream); }

.cols { display: grid; gap: 2rem 3rem; }
@media (min-width: 800px) { .cols { grid-template-columns: 1fr 1fr; } }
.cols h2 { margin-top: 0; }
.cols p { font-size: 0.95rem; color: #cdc2aa; }

/* --- Docs nav + footer -------------------------------------------------- */
.docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.6rem;
  margin: 0 0 clamp(2rem, 6vh, 3rem);
}
.docs a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 12px 0; /* touch target */
}

.site-foot {
  border-top: 1px solid var(--line-dark);
  padding-top: 1.4rem;
  padding-bottom: 3rem;
  font-size: 0.82rem;
  color: var(--cream-dim);
}
.site-foot p { margin: 0 0 0.6em; max-width: 42rem; }
.demo-note { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: #7e7458; }

/* ==========================================================================
   Meatproxy feed
   ========================================================================== */
.feed { list-style: none; margin: 1.1rem 0 0; padding: 0; }
.feed > li { border-top: 1px solid rgba(236, 226, 205, 0.3); padding: 1.6rem 0 1.5rem; position: relative; }
.feed > li::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 1.7rem;
  bottom: 1.5rem;
  width: 2px;
  border-radius: 2px;
  background: var(--lamp);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.feed > li:hover::before { opacity: 0.65; }
.feed h2 { margin: 0 0 0.45em; font-size: clamp(1.3rem, 3.6vw, 1.75rem); }
.feed h2 a {
  font-family: var(--font-display);
  font-weight: 480;
  letter-spacing: -0.015em;
  color: var(--cream);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.3s ease;
}
.feed h2 a:hover {
  color: var(--lamp-soft);
  text-shadow: 0 0 26px rgba(231, 156, 60, 0.4);
}
.feed .meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }
.feed .points { color: var(--lamp-soft); }

.tabs {
  display: flex;
  gap: 1.6rem;
  margin: 1.2rem 0 0;
}
.tabs a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream-dim);
  padding: 12px 0; /* touch target */
}
.tabs a[aria-current="page"] { color: var(--lamp-soft); text-decoration: underline; text-underline-offset: 6px; }
.tabs a:hover { color: var(--lamp-soft); }

.pager { margin: 1.8rem 0 0; }
.pager a { font-family: var(--font-mono); font-size: 0.84rem; padding: 12px 0; display: inline-block; }

/* ==========================================================================
   Article page
   ========================================================================== */
.article { margin-top: 1.6rem; }
.article h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 480;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
.article .post-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-bottom: 1.6em; }
.article .lead { font-size: 1.08rem; color: #e4dac2; }
.article p { max-width: 36rem; }

figure.scene { margin: 2.1rem 0 2.6rem; }
.stage {
  position: relative;
  border: 1px solid rgba(231, 156, 60, 0.35);
  border-radius: 14px;
  overflow: hidden;
  background: #05070f;
  max-width: 34rem;
  box-shadow: 0 0 80px -24px rgba(231, 156, 60, 0.45);
}
.stage::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(236, 226, 205, 0.09);
  border-radius: 9px;
  pointer-events: none;
}
.stage svg { display: block; width: 100%; height: auto; }
.stage .glass {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}
.fig-note { font-size: 0.78rem; color: var(--cream-dim); margin: 0.7rem 0 0; }
figcaption { font-size: 0.88rem; color: #c9bda2; margin-top: 0.55rem; max-width: 34rem; }

.controls { margin-top: 0.8rem; }
.controls button {
  min-height: 44px;
  padding: 0 1.1rem;
  background: none;
  border: 1px solid rgba(236, 226, 205, 0.45);
  border-radius: 999px;
  color: #d3c8ad;
  font: 500 0.82rem var(--font-body);
  cursor: pointer;
}
.controls button:hover { border-color: var(--line-warm); color: var(--cream); }

figure.scene.paused * { animation-play-state: paused !important; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.4rem; margin: 2rem 0 3rem; }
.share button {
  min-height: 44px;
  padding: 0 2px;
  background: none;
  border: 0;
  color: var(--cream-dim);
  font: 500 0.82rem var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.share button:hover { color: var(--cream); }
.share a { font-size: 0.82rem; }
.share .status { color: var(--cream-dim); font-size: 0.8rem; }

/* --- Comments ----------------------------------------------------------- */
.comments { border-top: 1px solid var(--line-dark); padding-top: 1.6rem; margin-bottom: 4rem; }
.comments h2 { font-family: var(--font-display); font-weight: 480; font-size: 1.5rem; margin: 0 0 0.4em; }
.comment { padding: 1.3rem 0; border-top: 1px solid var(--line-dark); }
.comment:first-of-type { border-top: 0; }
.comment .who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.35em; }
.comment .who .name { font-weight: 600; color: var(--cream); }
.comment .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--lamp-soft);
  border: 1px solid var(--line-warm);
  border-radius: 999px;
  padding: 2px 8px;
}
.comment .chip svg { width: 10px; height: 10px; }
.comment p { margin: 0; font-size: 0.95rem; color: #d9cfb8; }
.comment .reply {
  margin: 1rem 0 0 1.2rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line-dark);
}

.comment-form { margin-top: 1.8rem; display: grid; gap: 0.4rem; max-width: 40rem; }
.comment-form label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream-dim); margin-top: 0.7rem; }
.comment-form small { text-transform: none; letter-spacing: 0; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  background: var(--night-2);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  color: var(--cream);
  font: 1rem/1.5 var(--font-body);
  padding: 0.7rem 0.85rem;
  min-height: 44px;
}
.comment-form textarea { min-height: 8rem; resize: vertical; }
.comment-form .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--cream-dim); }
.comment-form .note { font-size: 0.78rem; color: var(--cream-dim); margin: 0.2rem 0 0.4rem; }
.comment-form button[type="submit"] {
  justify-self: start;
  min-height: 44px;
  padding: 0 1.2rem;
  border: 0;
  border-radius: 10px;
  background: var(--lamp);
  color: #241505;
  font: 600 0.9rem var(--font-body);
  cursor: pointer;
}
.comment-form button[type="submit"]:disabled { opacity: 0.45; cursor: default; }

/* --- Motion & motion-safety --------------------------------------------- */
@media (max-width: 480px) {
  .window { padding: 1.25rem 1.2rem 1.5rem; }
  .window .display { font-size: clamp(1.9rem, 8.6vw, 2.2rem); }
  .window .deck { font-size: 0.94rem; line-height: 1.58; }
  .invite { padding: 0.85rem 0.95rem 0.95rem; }
  .invitation { font-size: 0.8rem; }
  .hero-links { margin-top: 1em; }
  .routes { gap: 0.8rem; }
  .route { padding: 1rem 1.05rem 1.1rem; }
  .site .meta { display: none; }
  .brand { white-space: nowrap; font-size: 0.72rem; letter-spacing: 0.14em; }
  .counter { font-size: 0.72rem; letter-spacing: 0; }
  .wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
  .feed > li::before { display: none; }
}
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.star-tw { animation: twinkle 7s ease-in-out infinite; }
.star-tw.t2 { animation-duration: 9s; animation-delay: -3s; }
.star-tw.t3 { animation-duration: 5.5s; animation-delay: -1.2s; }
.scene-glow { animation: breathe 8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
  .window::before { animation: none; opacity: 0.8; }
  .star-tw, .scene-glow { animation: none; opacity: 0.6; }
}
