/* VAGUEPOST — styling.
   One rule: everything must look like it was drawn with a mouse in a minute.
   No rounded corners, no blurred shadows, no gradients. */

:root {
  --ink: #000;
  --pink: #ff69c4;
  --yellow: #ffee00;
  --blue: #1e8ad6;
  --red: #ed1c24;
  --paper: #fff;
  --grey: #c3c3c3;
  --dust: #f2f2f2;
}

* { box-sizing: border-box; }

html { background: var(--dust); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Sans MS", "Comic Neue", "Chalkboard SE", "Segoe Print", cursive;
  color: var(--ink);
  background: var(--paper);
  background-image:
    linear-gradient(var(--dust) 1px, transparent 1px),
    linear-gradient(90deg, var(--dust) 1px, transparent 1px);
  background-size: 22px 22px;
  /* cursor: the same shaky hand */
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M3 2 L4 19 L8 14 L11 21 L14 20 L11 13 L18 12 Z" fill="black" stroke="white" stroke-width="1"/></svg>') 3 2, auto;
}

.defs { position: absolute; width: 0; height: 0; }

/* ── the shared hand-drawn border ─────────────────────────────────────────── */
/* The border lives in its own ::before layer, which carries the wobble filter.
   Text sits above it and stays sharp — through the filter it would turn to mush. */
.panel { position: relative; background: var(--paper); }
.panel::before {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid var(--ink);
  filter: url(#wob);
  pointer-events: none;
  z-index: 0;
}
.panel > * { position: relative; z-index: 1; }

img { image-rendering: pixelated; }

/* ── header ───────────────────────────────────────────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(14px, 4vw, 40px);
  border-bottom: 4px solid var(--ink);
  background: var(--yellow);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-crown { width: 46px; height: 46px; object-fit: cover; mix-blend-mode: multiply; }
.top h1 {
  margin: 0; font-size: clamp(26px, 5vw, 42px); letter-spacing: 2px;
  text-shadow: 3px 3px 0 var(--paper), 5px 5px 0 var(--ink);
}
.stage-chip {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 14px; background: var(--paper);
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  transition: background .15s steps(2);
}
.stage-chip.bump { background: var(--pink); }
.stage-n { font-size: 14px; opacity: .6; }
.stage-name { font-size: 20px; font-weight: bold; letter-spacing: 1px; }

/* ── layout ───────────────────────────────────────────────────────────────── */
.wrap {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: clamp(18px, 3vw, 40px);
  padding: clamp(20px, 3vw, 40px);
  align-items: start;
  max-width: 1280px; margin: 0 auto;
}
@media (max-width: 820px) { .wrap { grid-template-columns: 1fr; } }

.king-col { display: grid; gap: 26px; position: sticky; top: 20px; }
@media (max-width: 820px) { .king-col { position: static; } }

/* ── the King ─────────────────────────────────────────────────────────────── */
.king-box { padding: 12px; text-align: center; }
.king-box img {
  width: 100%; display: block; border: 3px solid var(--ink);
  transition: filter .2s steps(3);
}
.king-box.thinking img { animation: jitter .18s steps(2) infinite; }
@keyframes jitter {
  0% { transform: translate(0, 0) }
  50% { transform: translate(-2px, 1px) }
  100% { transform: translate(1px, -1px) }
}
.king-name { margin-top: 8px; font-size: 17px; font-weight: bold; }
.king-sub { font-size: 13px; opacity: .7; margin-top: 3px; line-height: 1.35; }

/* ── the FED meter ────────────────────────────────────────────────────────── */
.meter { padding: 10px 12px 12px; }
.meter-label { font-size: 12px; letter-spacing: 1px; margin-bottom: 7px; }
.meter-label span { opacity: .55; letter-spacing: 0; text-transform: none; }
.meter-bar {
  height: 20px; border: 3px solid var(--ink); background: var(--paper);
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 26px);
  position: relative; overflow: hidden;
}
.meter-bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0;
  width: var(--fill, 0%); background: var(--pink);
  transition: width .35s steps(6);
}

/* ── controls ─────────────────────────────────────────────────────────────── */
.console { padding: 12px; }
.console-label { display: block; font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
textarea {
  width: 100%; padding: 9px; font: inherit; font-size: 15px; resize: vertical;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  outline: none;
}
textarea:focus { background: #fffdf0; }
textarea::placeholder { color: #999; }

.btn-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
.btn {
  font: inherit; font-weight: bold; letter-spacing: 1px; line-height: 1.1;
  padding: 12px 14px; cursor: inherit;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .05s steps(1), box-shadow .05s steps(1), background .1s;
}
.btn:hover { background: var(--yellow); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; box-shadow: 5px 5px 0 var(--grey); border-color: #666; }
.btn-main { font-size: 17px; }
.btn-alt { font-size: 12px; background: var(--pink); }
.btn-alt:hover { background: var(--yellow); }

.src-line { margin-top: 9px; font-size: 11px; min-height: 15px; opacity: .6; }
.src-line.live { color: var(--blue); opacity: 1; }

.reset {
  font: inherit; font-size: 12px; background: none; border: none;
  color: #888; text-decoration: underline; cursor: inherit; padding: 0;
  justify-self: start;
}
.reset:hover { color: var(--red); }

/* ── feed ─────────────────────────────────────────────────────────────────── */
.feed-head {
  font-size: 13px; letter-spacing: 3px; margin-bottom: 14px;
  border-bottom: 3px solid var(--ink); padding-bottom: 5px;
}
.feed { display: grid; gap: 30px; }

.post { padding: 14px 16px 12px; background: var(--paper); }
.post.fresh { animation: pop .28s steps(3); }
@keyframes pop {
  0% { transform: scale(.94) rotate(-1deg); opacity: 0 }
  100% { transform: none; opacity: 1 }
}

.post-head { display: flex; align-items: center; gap: 10px; }
.post-av { width: 42px; height: 42px; border: 3px solid var(--ink); object-fit: cover; flex: none; }
.post-who { font-size: 15px; font-weight: bold; }
.post-when { font-size: 11px; opacity: .5; }

.post-text {
  font-size: clamp(19px, 2.4vw, 25px); line-height: 1.32;
  margin: 14px 2px 14px; white-space: pre-wrap; word-break: break-word;
}
/* Real tweets run to 280 characters. At the headline size a long one eats the
   whole viewport, so step the size down as the post gets longer. */
.post-text.mid { font-size: clamp(17px, 1.9vw, 20px); }
.post-text.long { font-size: clamp(15px, 1.6vw, 17px); line-height: 1.4; }

.post-meta {
  display: flex; gap: 16px; font-size: 12px; opacity: .6;
  border-top: 2px dashed var(--ink); padding-top: 7px;
}

/* the King's micro-reaction, sitting under someone else's real post */
.reaction {
  margin-top: 11px; display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; line-height: 1.35;
  border-left: 4px solid var(--ink); padding: 6px 0 6px 9px;
}
.reaction.live { border-left-color: var(--blue); }
.reaction .rav { width: 26px; height: 26px; flex: none; border: 2px solid var(--ink); }
.reaction b { font-weight: bold; }

/* ── empty state ──────────────────────────────────────────────────────────── */
.empty { padding: 34px 20px; text-align: center; opacity: .8; }
.empty-art {
  width: 90px; height: 90px; margin: 0 auto 14px;
  background: url('img/king-blank.jpg') center/contain no-repeat;
  filter: grayscale(1) contrast(1.3); opacity: .3;
}
.empty p { margin: 0; font-size: 15px; }

/* ── toasts ───────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: grid; gap: 9px; justify-items: end; max-width: min(340px, 80vw);
  pointer-events: none;
}
.toast {
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  padding: 9px 13px; font-size: 13px; animation: slide .25s steps(3);
}
.toast.warn { background: var(--yellow); }
.toast.big { background: var(--pink); font-weight: bold; font-size: 15px; letter-spacing: 1px; }
@keyframes slide { from { transform: translateX(30px); opacity: 0 } }

/* ── ending ───────────────────────────────────────────────────────────────── */
.final {
  position: fixed; inset: 0; z-index: 100; overflow: auto;
  background: rgba(255, 255, 255, .96);
  display: grid; place-items: center; padding: 24px;
}
.final[hidden] { display: none; }
.final-card { max-width: 620px; padding: 26px 28px 30px; text-align: center; }
.final-img { width: 190px; border: 3px solid var(--ink); }
.final-card h2 { font-size: 30px; margin: 16px 0 6px; letter-spacing: 1px; }
.final-card h3 { font-size: 14px; letter-spacing: 2px; margin: 26px 0 10px; }
.final-lead { font-size: 15px; opacity: .75; margin: 0; }
.final-memory {
  list-style: none; margin: 0 0 18px; padding: 0; text-align: left;
  display: grid; gap: 7px; max-height: 260px; overflow: auto;
  border: 3px solid var(--ink); padding: 12px;
}
.final-memory li { font-size: 14px; line-height: 1.35; padding-left: 16px; position: relative; }
.final-memory li::before { content: "—"; position: absolute; left: 0; }
.final-memory .none { opacity: .5; padding-left: 0; }
.final-memory .none::before { content: ""; }
.final-note { font-size: 15px; margin: 0 0 22px; }

/* ── wallet chip in the header ─────────────────────────────────────────────── */
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wallet-chip {
  font: inherit; font-size: 13px; font-weight: bold; letter-spacing: 1px;
  padding: 8px 14px; cursor: inherit;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}
.wallet-chip:hover { background: var(--pink); }
.wallet-chip.on { background: var(--paper); font-family: ui-monospace, Menlo, monospace; letter-spacing: 0; }
.wallet-chip.on::before { content: "◆ "; color: var(--blue); }

/* ── the draft, shown exactly as it will land on X ─────────────────────────── */
.draft { padding: 12px; }
.draft-label { font-size: 12px; letter-spacing: 1px; margin-bottom: 8px; }
.draft-text {
  font-size: 19px; line-height: 1.32; white-space: pre-wrap; word-break: break-word;
  border: 3px dashed var(--ink); padding: 11px; background: #fffdf0;
}
.draft-ping { font-size: 13px; opacity: .6; margin: 6px 2px 11px; }
.btn-x { width: 100%; background: var(--blue); color: var(--paper); font-size: 16px; }
.btn-x:hover { background: var(--ink); color: var(--yellow); }
.draft .reset { margin-top: 9px; display: block; }
.draft-note { font-size: 12px; color: var(--red); margin-top: 8px; min-height: 14px; }

/* ── wall header ───────────────────────────────────────────────────────────── */
.wall-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border-bottom: 3px solid var(--ink); padding-bottom: 5px; margin-bottom: 8px;
}
.tabs { display: flex; gap: 8px; }
.tab {
  font: inherit; font-size: 13px; letter-spacing: 2px; cursor: inherit;
  background: none; border: none; border-bottom: 4px solid transparent;
  padding: 2px 2px 4px; color: #999;
}
.tab.on { color: var(--ink); border-bottom-color: var(--pink); }
.tab:hover { color: var(--ink); }
.refresh {
  font: inherit; font-size: 12px; background: none; border: none;
  color: #888; text-decoration: underline; cursor: inherit; padding: 0;
}
.refresh:hover { color: var(--blue); }
.wall-note { font-size: 11px; opacity: .55; margin-bottom: 16px; min-height: 14px; }

/* ── real tweets on the wall ───────────────────────────────────────────────── */
.post.ours::before { border-color: var(--blue); }
.post-head { align-items: flex-start; }
.post-id { flex: 1; min-width: 0; }
.post-av { image-rendering: auto; }
.post-av.blank { background: var(--grey); }
.mine-tag {
  font-size: 10px; letter-spacing: 2px; font-weight: bold; flex: none;
  background: var(--blue); color: var(--paper); padding: 3px 7px;
  border: 2px solid var(--ink);
}
.post-meta { flex-wrap: wrap; align-items: baseline; }
.post-meta a { color: var(--blue); }

/* ── connect gate ──────────────────────────────────────────────────────────── */
.gate-err { color: var(--red); font-size: 13px; margin: 14px 0 0; min-height: 16px; }
.gate-err a { color: var(--red); }
.gate-fine {
  font-size: 12px; opacity: .6; line-height: 1.45; margin: 18px 0 0;
  border-top: 2px dashed var(--ink); padding-top: 14px;
}
.final-card .btn-main { margin-top: 20px; }

/* ── contract address: the chip in the header and the big block on the landing ─ */
/* Both read data-state="soon|live" so the pre-launch copy is a styling concern,
   not a second markup path. */
.ca-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: var(--paper);
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  max-width: min(46vw, 380px);
}
.ca-chip-label { font-size: 11px; letter-spacing: 2px; flex: none; opacity: .55; }
.ca-chip-value {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ca-chip[data-state="soon"] .ca-chip-value { font-family: inherit; opacity: .5; }
.ca-chip-copy, .ca-copy {
  font: inherit; font-size: 11px; font-weight: bold; letter-spacing: 1px;
  flex: none; cursor: inherit; padding: 4px 9px;
  border: 2px solid var(--ink); background: var(--yellow); color: var(--ink);
}
.ca-chip-copy:hover, .ca-copy:hover:not(:disabled) { background: var(--pink); }
.ca-chip-copy.copied, .ca-copy.copied { background: var(--blue); color: var(--paper); }
.ca-copy:disabled { background: var(--grey); opacity: .6; }

.ca-block { padding: 14px 16px; margin: 26px 0; background: var(--paper); }
.ca-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.ca-title { font-size: 11px; letter-spacing: 3px; opacity: .6; }
.ca-ticker { font-size: 15px; font-weight: bold; color: var(--blue); }
.ca-row { display: flex; align-items: stretch; gap: 10px; }
.ca-value {
  flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace;
  font-size: clamp(11px, 1.5vw, 15px); word-break: break-all; line-height: 1.35;
  border: 3px dashed var(--ink); padding: 9px 11px; background: #fffdf0;
}
.ca-block[data-state="soon"] .ca-value { font-family: inherit; opacity: .55; word-break: normal; }
.ca-copy { padding: 0 16px; font-size: 13px; box-shadow: 4px 4px 0 var(--ink); }
.ca-note { font-size: 11px; opacity: .5; margin-top: 9px; }

/* ── landing ──────────────────────────────────────────────────────────────── */
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.enter {
  font-size: 13px; font-weight: bold; letter-spacing: 1px; text-decoration: none;
  padding: 8px 14px; color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
}
.enter:hover { background: var(--pink); }

.lp { max-width: 1100px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 40px) 60px; }

.hero { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(22px, 4vw, 50px); align-items: start; }
@media (max-width: 780px) { .hero { grid-template-columns: 1fr; } }
.hero-art img { width: 100%; display: block; border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.hero-copy h2 { font-size: clamp(26px, 4.6vw, 46px); line-height: 1.12; margin: 0 0 18px; }
.lede { font-size: clamp(15px, 1.8vw, 18px); line-height: 1.5; opacity: .8; margin: 0; max-width: 56ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cta .btn { text-decoration: none; display: inline-block; }

.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px; margin: clamp(40px, 6vw, 70px) 0 0; background: var(--ink);
  border: 3px solid var(--ink);
}
.strip-item { background: var(--paper); padding: 16px 15px; display: flex; gap: 11px; align-items: flex-start; }
.strip-item b {
  font-size: 22px; line-height: 1; flex: none;
  background: var(--yellow); border: 3px solid var(--ink); padding: 4px 10px;
}
.strip-item span { font-size: 13.5px; line-height: 1.4; padding-top: 4px; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(24px, 3vw, 34px); margin: clamp(42px, 6vw, 70px) 0 0;
}
.card { padding: 18px 20px 20px; }
.card h3 { font-size: 14px; letter-spacing: 2px; margin: 0 0 10px; }
.card p { font-size: 14px; line-height: 1.5; margin: 0; opacity: .8; }

.sample { margin: clamp(40px, 6vw, 64px) 0 0; padding: 22px 24px; text-align: center; }
.sample-label { font-size: 11px; letter-spacing: 3px; opacity: .5; }
.sample-text { font-size: clamp(21px, 3.4vw, 34px); margin: 16px 0 14px; }
.sample-meta { font-size: 12px; opacity: .5; }

.notice { margin-top: 34px; padding: 14px 16px; background: var(--yellow); font-size: 14px; }

.foot {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  border-top: 4px solid var(--ink); padding: 18px clamp(16px, 4vw, 40px);
  font-size: 12px; background: var(--dust);
}
.foot a { color: var(--ink); }
.foot-fine { margin-left: auto; opacity: .45; }

/* ── admin ────────────────────────────────────────────────────────────────── */
.admin { max-width: 720px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 32px) 60px; display: grid; gap: 30px; }
.gate-card { padding: 26px 28px; text-align: center; }
.gate-card h2 { font-size: 26px; letter-spacing: 3px; margin: 0 0 12px; }
.gate-card p { font-size: 14px; line-height: 1.5; opacity: .75; margin: 0 0 20px; max-width: 48ch; margin-inline: auto; }

.admin-you { padding: 11px 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.admin-label { font-size: 11px; letter-spacing: 2px; opacity: .55; }
.admin-you code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }

.admin-form { padding: 20px 22px 22px; }
.admin-form h3 { font-size: 13px; letter-spacing: 3px; margin: 0 0 18px; }
.admin-form label { display: block; font-size: 11px; letter-spacing: 2px; margin: 16px 0 6px; }
.admin-form label .opt { letter-spacing: 0; opacity: .5; text-transform: none; }
.admin-form input, .admin-form select {
  width: 100%; padding: 10px; font: inherit; font-size: 14px;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink); outline: none;
}
.admin-form input:focus, .admin-form select:focus { background: #fffdf0; }
.admin-form input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.field-note { font-size: 11px; opacity: .5; margin-top: 5px; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .two-up { grid-template-columns: 1fr; } }
.admin-actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.run-note { font-size: 12px; opacity: .7; }
.run-note.good { color: var(--blue); opacity: 1; }
.run-note.bad { color: var(--red); opacity: 1; }

.admin-preview { padding: 16px 18px; }
.admin-preview .ca-block { margin: 10px 0 0; border: 3px solid var(--ink); }
.admin-stats { padding: 16px 18px 20px; }
.admin-stats dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; margin: 12px 0 18px; font-size: 13px; }
.admin-stats dt { opacity: .55; }
.admin-stats dd { margin: 0; word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* .btn-x is full-width inside the draft panel; in the hero it sits beside the
   primary call to action and must not stretch. */
.hero-cta { margin-top: 26px; }
.hero-cta .btn-x { width: auto; }

/* our own X account, shown in the header and the footer of every page */
.xlink {
  font-size: 13px; font-weight: bold; letter-spacing: 1px; text-decoration: none;
  padding: 8px 12px; color: var(--paper); background: var(--ink);
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--paper);
}
.xlink:hover { background: var(--blue); }
.foot .xlink { box-shadow: none; padding: 4px 9px; font-size: 12px; }

.section-break { margin-top: 30px !important; border-top: 3px dashed var(--ink); padding-top: 20px; }
.tracking-now {
  margin-top: 16px; padding: 10px 12px; background: var(--dust);
  border: 3px solid var(--ink); display: grid; gap: 5px;
}
.tracking-now code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
