/* binches.world newsletter — shared y2k / tumblr / analog styling */

:root {
  --bg: #ffd6ec;
  --bg-image: none;
  --font: 'VT323', monospace;
  --ink: #241b2f;
  --panel: #fffaf3;
  --accent: #ff5fa2;
  --accent-2: #7ee0ff;
  --accent-3: #ffe45c;
  --border: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.35;
  position: relative;
}

/* subtle film-grain overlay so flat colors still feel analog */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: var(--accent); }
a:visited { color: var(--accent); }

h1, h2, h3 { font-family: 'Press Start 2P', var(--font), monospace; line-height: 1.5; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.85rem; }

::selection { background: var(--accent-3); color: var(--ink); }

::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--panel); border-left: var(--border); }
::-webkit-scrollbar-thumb { background: var(--accent); border: 2px solid var(--ink); }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.marquee {
  background: var(--ink);
  color: var(--accent-3);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: var(--border);
}
.marquee-inner {
  display: inline-block;
  animation: marquee 16s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

.panel {
  background: var(--panel);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
}

.panel--dashed { border-style: dashed; }

.badge {
  display: inline-block;
  background: var(--accent-2);
  border: 2px solid var(--ink);
  padding: 2px 10px;
  font-size: 0.75rem;
  transform: rotate(-2deg);
}

.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  background: var(--accent-3);
  color: var(--ink);
  border: var(--border);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn--pink { background: var(--accent); color: #fff; }
.btn--ghost { background: transparent; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=url], textarea, select {
  font-family: var(--font);
  font-size: 1rem;
  background: #fff;
  border: 2px solid var(--ink);
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
label { font-weight: bold; display: block; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.hint { font-size: 0.8rem; opacity: 0.7; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.sparkle {
  position: relative;
}
.sparkle::after {
  content: '✦';
  position: absolute;
  top: -10px;
  right: -6px;
  color: var(--accent);
  animation: twinkle 1.6s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.error-text { color: #c8194f; font-weight: bold; }
.edit-notice {
  background: var(--accent-2);
  border: 2px solid var(--ink);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-top: 12px;
}
.center { text-align: center; }

/* plain-text tagline: preserves intentional line breaks but still wraps
   normally on narrow screens. Ascii/kaomoji art has its own dedicated
   field below (.kaomoji-art) since it needs very different handling. */
.tagline {
  white-space: pre-line;
}
.muted { opacity: 0.65; }

/* dedicated kaomoji/ascii-art block, built by kaomoji.js: every character
   sits in its own explicitly-sized box (1 or 2 cells, by Unicode East
   Asian Width) instead of trusting a font's own glyph widths — so
   alignment holds regardless of which font actually draws each glyph */
.kaomoji-art {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}
/* the public homepage's copy: shrinks to fit (via kaomoji.js) instead of
   ever showing a scrollbar. the admin preview keeps the scrollable
   .kaomoji-art behavior above, since that's an editing tool, not
   something friends see. */
#kaomoji-art {
  overflow: hidden;
}
.kaomoji-row {
  white-space: nowrap;
  line-height: 1.15;
}
.kaomoji-cell {
  display: inline-block;
  width: 0.62em;
  text-align: center;
  font-family: 'DotGothic16', monospace;
  vertical-align: top;
}
.kaomoji-cell--wide { width: 1.24em; }

textarea.kaomoji-input {
  font-family: 'DotGothic16', monospace;
  white-space: pre;
  overflow-x: auto;
}

/* ---- passcode gate ---- */
.gate-screen {
  min-height: 100vh;
  min-height: 100dvh; /* accounts for mobile browser toolbars; ignored where unsupported */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-box {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.gate-box h1 { margin-top: 0; }
.gate-lock { font-size: 2.4rem; }

/* ---- issue archive grid ---- */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.issue-card {
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 14px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  background: var(--panel);
}
.issue-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.issue-card .swatch {
  width: 100%;
  height: 60px;
  border: 2px solid var(--ink);
  margin-bottom: 8px;
  background-size: cover;
  background-position: center;
  object-fit: cover;
  display: block;
}

.spotlight-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: var(--border);
  box-shadow: 7px 7px 0 var(--ink);
  padding: 20px;
  margin-bottom: 28px;
}
.spotlight-card:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--ink); }
.spotlight-card .swatch {
  width: 100%;
  height: 170px;
  border: 2px solid var(--ink);
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
  object-fit: cover;
  display: block;
}
.spotlight-card h2 { font-size: 1.3rem; margin: 6px 0; }

.page-banner {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  border: var(--border);
  margin-bottom: 20px;
}

/* ---- collapsible "suggest a question" bar ---- */
.suggest-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.suggest-tab {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  background: var(--accent);
  color: #fff;
  border: var(--border);
  border-bottom: none;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
}
.suggest-tab:hover { padding-top: 6px; }
.suggest-form {
  width: 100%;
  max-width: 760px;
  box-sizing: border-box;
  background: var(--panel);
  border-top: var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  overflow: hidden;
  max-height: 120px;
  opacity: 1;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
}
.suggest-bar--collapsed .suggest-form {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}
.suggest-form input[type=text] { flex: 1; min-width: 160px; }
.suggest-bar-spacer { height: 52px; }
.suggest-bar-msg { font-size: 0.85rem; white-space: nowrap; }

/* ---- response cards ---- */
.response-card { margin-bottom: 20px; }
.response-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.05rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pfp {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  flex-shrink: 0;
  background: var(--panel);
}
.pfp--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-2);
  font-size: 1.1rem;
}
.pfp--lg { width: 64px; height: 64px; }
.answer-block { margin-bottom: 14px; padding-left: 10px; border-left: 3px dotted var(--ink); }
.answer-block .q-label { font-weight: bold; margin-bottom: 6px; }
.answer-photos { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 12px; }
.answer-photos .polaroid {
  background: #fff;
  border: 4px solid #000;
  padding: 10px 10px 30px;
  box-shadow: 6px 6px 0 #000;
  clip-path: polygon(
    0 8px, 8px 8px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px)
  );
}
.answer-photos .polaroid img {
  display: block;
  width: 260px;
  max-width: 60vw;
  height: 260px;
  object-fit: cover;
}
.polaroid-caption {
  margin-top: 8px;
  font-family: 'Dancing Script', 'Caveat', cursive;
  font-size: 1.3rem;
  text-align: center;
  color: var(--ink);
  word-break: break-word;
}
.answer-photos .polaroid .caption-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-family: 'Dancing Script', 'Caveat', cursive;
  font-size: 1.3rem;
  text-align: center;
  border: none;
  border-bottom: 1px dashed var(--ink);
  background: transparent;
  padding: 2px 0;
}
.answer-photos .polaroid a.hint {
  display: block;
  margin-top: 6px;
  text-align: center;
}
.answer-files a { display: block; margin-top: 4px; }
.answer-embed { margin-top: 8px; }
.answer-embed iframe { border: 0; max-width: 100%; }

nav.topnav {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  flex-wrap: wrap;
}
nav.topnav a { text-decoration: none; }

@media (max-width: 480px) {
  body { font-size: 18px; }
}
