/* ============================================================
   08 — Creator / Fan · "Darkroom"
   Warm dark room, amber safelight, film grain over everything.
   Fonts: Source Serif 4 (body) + JetBrains Mono (labels).
   ============================================================ */

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/SourceSerif4-Variable.woff") format("woff");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #14100D;
  --surface: #1E1814;
  --surface-2: #271F1A;
  --hairline: rgba(255, 228, 196, 0.11);
  --ink: #F0E7DC;
  --muted: #A2907E;
  --safelight: #E8873C;
  --safelight-dim: #6B3E1C;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

/* The UA's `[hidden] { display: none }` loses to any author `display` rule
   below, and every demo here toggles `element.hidden` to show and hide
   panels. Without this, hiding silently stops working. */
[hidden] { display: none !important; }

/* A long unbroken token -- a pasted URL, a 200-character "word" -- must wrap
   rather than push its container past its grid track and break the row.
   `anywhere` rather than `break-word` on purpose: only `anywhere` reduces the
   element's min-content width, and a grid or flex item defaults to
   `min-width: auto`, which refuses to shrink below its longest word. With
   `break-word` alone, demo-06 and demo-10 still blew 1.4k px past the viewport.
   The `min-width: 0` below is the other half of the same fix. */
h1, h2, h3, h4, p, li, a, span, strong, em, code, label, time,
button, input, textarea { overflow-wrap: anywhere; }
.card, .post, .listing, .idea, .topic, .question, .profile-card, .submission,
.lesson, .resource, .nominee, .archive-item, .member-card, .comment, .reply,
.answer, .idea-body-wrap { min-width: 0; }


body {
  margin: 0;
  padding-block-end: 80px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
}

/* Film grain. Fixed overlay, pointer-transparent, sits above the page but
   below nothing interactive because it never receives events. */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

.wrap { max-width: 720px; margin-inline: auto; padding: 0 20px; }

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
a { color: var(--safelight); }
code { font-family: var(--mono); font-size: 0.85em; color: var(--safelight); }

:focus-visible { outline: 2px solid var(--safelight); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { padding-block: clamp(44px, 8vw, 88px) 26px; }
.topbar h1 {
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.topbar > div > p { color: var(--muted); max-width: 46ch; margin-top: 14px; font-size: 16px; }

.notice {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--safelight);
  border-radius: 3px;
  padding: 16px 20px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 34px;
}
.notice strong { color: var(--safelight); font-weight: 600; }

/* ---------- Posts ---------- */

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 34px; }

.post {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 28px 30px;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}
.post-title { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25; margin-bottom: 12px; }
.post-meta {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-top: 18px;
}

/* The gated note: lit from inside, like a print under the safelight. */
.member-note {
  position: relative;
  margin: 20px 0 0;
  padding: 18px 20px;
  border-radius: 3px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232,135,60,0.13), transparent 62%),
    var(--surface-2);
  border: 1px solid var(--safelight-dim);
}
.member-note-label {
  display: block;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--safelight);
  margin-bottom: 8px;
}
.member-note p { margin: 0; font-size: 16px; }

/* ---------- Comments ---------- */

.comments { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.comments:empty { margin: 0; }
.comment {
  border-left: 1px solid var(--hairline);
  padding-left: 16px;
  font-size: 15.5px;
}
.comment-meta {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
.comment-meta strong { color: var(--ink); font-weight: 700; }
.comment-body { margin: 0; }

.new-comment { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: flex-end; }
.new-comment textarea {
  flex: 1 1 16rem;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--hairline);
  border-radius: 3px; padding: 11px 13px; min-height: 44px; resize: vertical;
}
.new-comment textarea:focus { border-color: var(--safelight-dim); }

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--mono); font-size: 12px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.12em; text-transform: uppercase;
  min-height: 44px; padding: 12px 22px;
  background: var(--safelight); color: #1A0F06;
  border: 0; border-radius: 3px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -14px var(--safelight); }

/* ---------- Fan art ---------- */

.fan-art-section {
  margin-top: 52px;
  padding-top: 34px;
  border-top: 1px solid var(--hairline);
}
.fan-art-section > h2 { font-size: clamp(23px, 3vw, 31px); margin-bottom: 8px; }
.fan-art-section > p { color: var(--muted); margin-bottom: 22px; }

.fan-list {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.fan-item {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 18px;
}
.fan-thumb {
  font-size: 34px; line-height: 1;
  display: grid; place-items: center;
  height: 5.5rem; margin-bottom: 14px;
  background: var(--surface-2);
  border-radius: 3px;
}
.fan-caption { font-size: 15px; margin-bottom: 10px; }
.fan-meta {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.fan-meta strong { color: var(--ink); font-weight: 700; }

#pl-fan-form { display: grid; gap: 14px; max-width: 27rem; }
.field { display: block; }
.field label {
  font-family: var(--mono); display: block;
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.field input, .field select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 3px; padding: 11px 13px; min-height: 44px;
}
.field input:focus, .field select:focus { border-color: var(--safelight-dim); }
#pl-fan-form .btn { justify-self: start; }

/* ---------- Toasts ---------- */

.toast-stack { position: fixed; right: 16px; bottom: 88px; display: grid; gap: 8px; z-index: 110; }
.toast {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.06em;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--safelight-dim);
  border-radius: 3px; padding: 12px 16px;
  box-shadow: 0 18px 38px -20px rgba(0,0,0,0.95);
}
.toast.error { border-color: #8E3B2E; color: #F0A99B; }

/* ---------- Motion ---------- */

.motion .post, .motion .fan-item { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .motion .post, .motion .fan-item { opacity: 1 !important; transform: none !important; }
  .btn { transition: none !important; }
  body::after { opacity: 0.03; }
}


/* ---------- Contact sheet strip ---------- */
/* The palette was carrying the whole demo. Give it the object a darkroom
   actually produces: a strip of frames, sprocket holes and all. */

.contact-strip {
  display: grid; grid-auto-flow: column; gap: 6px;
  padding: 12px 8px;
  margin-bottom: 30px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(240,231,220,0.11) 10px 14px) top / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(240,231,220,0.11) 10px 14px) bottom / 100% 7px no-repeat,
    #0C0907;
  border-radius: 3px;
  overflow-x: auto;
}
.contact-strip i {
  display: block; width: 112px; aspect-ratio: 3/2; border-radius: 1px;
  position: relative;
  background:
    radial-gradient(120% 120% at 30% 25%, rgba(232,135,60,0.30), transparent 62%),
    linear-gradient(150deg, var(--surface-2), #100C09);
}
.contact-strip i::after {
  content: attr(data-n);
  position: absolute; bottom: 3px; right: 5px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  color: var(--safelight); opacity: 0.8;
}

@media (max-width: 560px) {
  /* Three frames instead of a scroller nobody will drag. The strip is
     decorative and aria-hidden, so at this width it should just fit. */
  .contact-strip { overflow-x: hidden; }
  .contact-strip i { width: 100px; }
  .contact-strip i:nth-child(n + 4) { display: none; }
}
