/* ═══════════════════════════════════════════════════════════
   hatchbear — tilde.town  |  home.css
   Requires: global.css
   ═══════════════════════════════════════════════════════════ */

/* ── homepage body ────────────────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
}

/* ── ascii header ─────────────────────────────────────────── */
.ascii-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 28px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ascii-header::-webkit-scrollbar { display: none; }

#ascii-art {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  color: var(--teal);
  white-space: pre;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#ascii-art.loaded { opacity: 1; }
#ascii-art.error  { color: var(--text-muted); font-size: 13px; }

/* ── editor layout ────────────────────────────────────────── */
.editor {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── gutter ───────────────────────────────────────────────── */
.gutter {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 10px 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 40px;
  flex-shrink: 0;
  user-select: none;
}

/* every gutter slot — must match .line height exactly */
.ln {
  font-size: 15px;
  line-height: 2;
  height: 2em;
  color: transparent;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ln.para { color: var(--text-muted); } /* paragraph-start lines */
.ln.cur  { color: var(--teal-dark);  } /* cursor line */

/* ── buffer ───────────────────────────────────────────────── */
.buffer {
  flex: 1;
  padding: 20px 40px 60px 20px;
  overflow-x: auto;
}

/* ── code lines ───────────────────────────────────────────── */
.line {
  font-size: 15px;
  line-height: 2;
  height: 2em;
  white-space: pre;
  display: flex;
  align-items: center;
}
.line.empty::after { content: ' '; }

/* syntax highlighting */
.kw      { color: var(--plum-light); }
.fn      { color: var(--teal); }
.key     { color: var(--text-dim); }
.str     { color: var(--text); }
.str-q   { color: var(--teal-dark); }
.comment { color: var(--text-muted); font-style: italic; }
.punct   { color: var(--text-muted); }
.dim     { color: var(--text-muted); }

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

/* ── tilde fill ───────────────────────────────────────────── */
.tilde-fill {
  color: var(--navy);
  font-size: 15px;
  line-height: 2;
  padding: 20px 0 20px 16px;
  user-select: none;
  flex-shrink: 0;
}

/* ── cursor ───────────────────────────────────────────────── */
.cursor {
  display: inline-block;
  width: 9px;
  height: 1em;
  background: var(--teal);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1.1s step-end infinite;
}

/* ── generic page content (about, etc.) ───────────────────── */
.page-content {
  padding: 20px 40px 60px 20px;
  flex: 1;
  max-width: 680px;
}
.page-content h1 {
  color: var(--teal);
  font-size: 16px;
  font-weight: normal;
  margin-bottom: 20px;
}
.page-content p {
  color: var(--text-dim);
  line-height: 2;
  margin-bottom: 16px;
}
.page-content .placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ── responsive ───────────────────────────────────────────── */
@media (max-width: 560px) {
  .ascii-header { padding: 16px 14px 14px; }
  #ascii-art    { font-size: 10px; }
  .buffer       { padding: 16px 16px 60px 14px; }
  .line         { font-size: 13px; }
  .gutter       { min-width: 36px; }
}
