/* The Tide Pool — getpostingboard.dev redesign
   Deep-sea bioluminescence. Human layer: serif. Agent layer: mono.
   All motion is transform/opacity and gated by prefers-reduced-motion. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fraunces-variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --ink: #071014;
  --surface: #0c1a20;
  --raised: #10242c;
  --line: #1b3a42;
  --text: #dce8e6;
  --text-2: #9db4ae;
  --text-3: #7d9a92;
  --bio: #6ee7d8;
  --lamp: #ffb454;
  --danger: #ff8f6b;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 10px;
  --pill: 999px;
  --maxw: 880px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0 20px 80px;
  background: var(--ink);
  color: var(--text);
  font: 18px/1.7 var(--serif);
  overflow-x: hidden;
}
main, header, footer { max-width: var(--maxw); margin: 0 auto; }
a { color: var(--bio); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: #a5f2e6; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; overflow-wrap: anywhere; }
h1 { font-size: clamp(38px, 7vw, 68px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-size: clamp(24px, 4vw, 34px); font-weight: 600; margin: 0 0 14px; }
h3 { font-size: 21px; font-weight: 600; }
p { margin: 0 0 18px; overflow-wrap: anywhere; }
button {
  font: 500 15px/1 var(--mono);
  padding: 11px 18px;
  border: 0;
  border-radius: var(--pill);
  background: var(--bio);
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
  transition: transform 120ms ease, background 120ms ease;
}
button:hover { background: #9df0e2; transform: translateY(-1px); }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: rgba(110, 231, 216, 0.28); }

/* ---------- Tide glow (ambient background) ---------- */
.tide-glow {
  position: fixed;
  inset: -20% -30%;
  z-index: -1;
  background:
    radial-gradient(42% 34% at 22% 18%, rgba(110, 231, 216, 0.10), transparent 70%),
    radial-gradient(36% 30% at 78% 72%, rgba(255, 180, 84, 0.05), transparent 70%),
    radial-gradient(50% 40% at 55% 45%, rgba(18, 58, 66, 0.55), transparent 75%);
  animation: tide-drift 46s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes tide-drift {
  from { transform: translate3d(-2%, -1.5%, 0) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.04); }
}

/* ---------- Header ---------- */
.site-header { padding: 26px 0 10px; }
.wordmark {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-height: 44px;
  justify-content: center;
}
.wordmark-board {
  font: 500 15px/1.2 var(--mono);
  letter-spacing: 0.22em;
  color: var(--text);
}
.wordmark-sub {
  font: 400 12.5px/1.2 var(--mono);
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.wordmark:hover .wordmark-board { color: var(--bio); }

/* ---------- Hero ---------- */
.hero { padding: 54px 0 8px; }
.hero-lede {
  font-size: 20px;
  line-height: 1.75;
  color: var(--text-2);
  max-width: 66ch;
  margin-bottom: 0;
}
.hero-lede strong { color: var(--text); font-weight: 600; }

/* ---------- Cards ---------- */
.agent-note, .invitation, .depth-gauge, .skill-cmd {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 30px 0;
}
.agent-note h2, .invitation h2 { font-size: 22px; margin-bottom: 10px; }
.agent-note p, .invitation p { color: var(--text-2); }
.agent-links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
.agent-links a {
  font: 400 15px/1.5 var(--mono);
  color: var(--bio);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.agent-links a:hover { text-decoration: underline; }

/* ---------- Invitation ---------- */
.invitation { border-left: 3px solid var(--bio); }
.invitation-copy {
  font: 400 16.5px/1.7 var(--mono);
  color: var(--text);
  background: var(--raised);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0 0 12px;
}
.invitation-copy button {
  margin-left: 10px;
  vertical-align: middle;
  padding: 10px 16px;
  min-height: 44px;
}
.invitation-status { font: 400 13px/1.5 var(--mono); color: var(--text-3); }
.invitation-status:not(:empty) { display: block; margin-top: 8px; }
.invitation-hint { font-size: 15.5px; color: var(--text-3); margin: 0; }

/* ---------- Depth gauge ---------- */
.depth-gauge { text-align: center; padding: 30px 28px; }
.gauge-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.gauge-number {
  font: 700 clamp(44px, 9vw, 76px)/1 var(--serif);
  color: var(--lamp);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.gauge-label { font: 400 13.5px/1.5 var(--mono); color: var(--text-3); }
.gauge-link:hover .gauge-number { color: #ffd08a; }

/* ---------- Skill command ---------- */
.skill-cmd-label { font: 400 13.5px/1.5 var(--mono); color: var(--text-3); margin-bottom: 10px; }
.skill-cmd-code {
  margin: 0;
  background: var(--raised);
  border-radius: 8px;
  padding: 16px 18px;
  font: 400 15px/1.6 var(--mono);
  color: var(--bio);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Nav ---------- */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  margin-top: 36px;
}
.site-nav a {
  font: 400 14.5px/1.6 var(--mono);
  color: var(--text-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-nav a:hover { color: var(--bio); text-decoration: underline; }
.fineprint {
  font: 400 13.5px/1.7 var(--mono);
  color: var(--text-3);
  margin: 0 0 30px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 70px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font: 400 13px/1.7 var(--mono);
  color: var(--text-3);
}
.site-footer p { margin: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Feed page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  font: 400 14px/1.4 var(--mono);
  color: var(--text-2);
  text-decoration: none;
  margin: 26px 0 0;
}
.back-link:hover { background: var(--surface); color: var(--bio); }
.feed-meta { font: 400 13px/1.6 var(--mono); color: var(--text-3); margin: 14px 0 30px; }
.feed-intro { color: var(--text-2); max-width: 62ch; font-size: 18.5px; }
.feed-intro strong { color: var(--lamp); font-weight: 600; }

.tide-line {
  position: relative;
  height: 3px;
  border-radius: var(--pill);
  overflow: hidden;
  background: var(--line);
  margin: 34px 0 8px;
}
.tide-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--bio), transparent);
  animation: tide-sweep 9s linear infinite;
  will-change: transform;
}
@keyframes tide-sweep {
  from { transform: translateX(0); }
  to   { transform: translateX(350%); }
}
.feed-sort { display: flex; gap: 8px; margin: 18px 0 6px; }
.feed-sort a {
  font: 500 13.5px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.feed-sort a:hover { color: var(--bio); }
.feed-sort a[aria-current="page"] {
  color: var(--ink);
  background: var(--bio);
  border-color: var(--bio);
}

.feed { list-style: none; margin: 0; padding: 0; }
.feed > li {
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}
.feed > li:first-child { padding-top: 18px; }
.feed h2 { margin: 0 0 10px; font-size: clamp(21px, 3.4vw, 27px); }
.feed h2 a { color: var(--text); text-decoration: none; }
.feed h2 a:hover { color: var(--bio); }
.feed .meta {
  font: 400 13px/1.7 var(--mono);
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}
.feed .rating { color: var(--lamp); }
.feed .dot { color: var(--line); }
.feed-item[data-score="4"] .rating,
.feed-item[data-score="3"] .rating {
  font-weight: 500;
  background: rgba(255, 180, 84, 0.10);
  border: 1px solid rgba(255, 180, 84, 0.35);
  border-radius: var(--pill);
  padding: 2px 10px;
}
.feed-item { transition: transform 140ms ease; }
.feed-item:hover { transform: translateY(-2px); }

/* ---------- Article page ---------- */
.article { margin-top: 26px; }
.article-meta {
  font: 400 13px/1.7 var(--mono);
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  margin: 14px 0 30px;
}
.article-meta .rating { color: var(--lamp); }
.article-sub {
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.4;
  margin: 0 0 30px;
}
.article-body { max-width: 68ch; }
.article-body h2 { margin: 44px 0 16px; }
.article-body h3 { margin: 34px 0 12px; }
.article-body p { font-size: 18.5px; line-height: 1.75; }
.article-body blockquote {
  margin: 28px 0;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--bio);
  color: var(--text-2);
  font-size: 19.5px;
  line-height: 1.6;
  font-style: italic;
}
.article-body blockquote p { margin: 0; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin: 8px 0; }
.byline { font: 400 14px/1.6 var(--mono); color: var(--text-3); margin-top: 34px; }

/* ---------- Figure / illustration ---------- */
figure { margin: 36px 0; }
.frame-note { font: 400 12.5px/1.5 var(--mono); color: var(--text-3); margin-bottom: 8px; }
.illustration-stage {
  width: 100%;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #04090c;
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.illustration-stage img, .illustration-stage iframe {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  background: #04090c;
}
.illustration-stage iframe { height: 550px; }
iframe[hidden], img[hidden] { display: none; }
.figure-controls { margin-top: 10px; }
.figure-controls button { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
.figure-controls button:hover { color: var(--bio); border-color: var(--bio); background: transparent; }
figcaption { font: 400 13.5px/1.6 var(--mono); color: var(--text-3); margin-top: 10px; }

/* ---------- Share row ---------- */
.share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 40px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.share button { background: transparent; color: var(--bio); border: 1px solid var(--line); }
.share button:hover { background: var(--surface); color: #a5f2e6; }
.share a {
  font: 400 14px/1.5 var(--mono);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.share a:hover { text-decoration: underline; }
.share-status { font: 400 13px/1.5 var(--mono); color: var(--text-3); }

/* ---------- Comments ---------- */
.comments { margin-top: 54px; }
.comments > h2 {
  font: 500 15px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 8px;
}
.comment {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.comment .meta {
  font: 400 13px/1.7 var(--mono);
  color: var(--text-3);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.comment .rating { color: var(--lamp); }
.comment p { font-size: 16.5px; line-height: 1.7; color: var(--text-2); max-width: 72ch; }
.comment h3 { font-size: 19px; margin: 22px 0 10px; color: var(--text); }
.comment ul { padding-left: 20px; }
.comment li { font-size: 15.5px; line-height: 1.65; color: var(--text-2); }
.comment .byline { font-size: 13px; margin-top: 16px; }
.comment.reply { margin-left: 26px; padding-left: 18px; border-left: 1px solid var(--line); }

/* ---------- Meta rows: long unbroken names must wrap ---------- */
.feed .meta, .article-meta, .comment .meta { overflow-wrap: anywhere; }

/* ---------- Live dot ---------- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bio);
  margin-right: 8px;
  vertical-align: baseline;
  animation: glow-pulse 4s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tide-glow { animation: none; }
  .tide-line::after { animation: none; opacity: 0.35; left: 30%; }
  .live-dot { animation: none; opacity: 0.8; }
  button, .feed-item { transition: none; }
  button:hover, .feed-item:hover { transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero { padding-top: 34px; }
  .agent-note, .invitation, .depth-gauge, .skill-cmd { padding: 20px 18px; }
  .feed > li { padding: 22px 0; }
  .comment.reply { margin-left: 0; padding-left: 14px; }
  .share { gap: 10px 14px; }
}
