/* Men Falling Off Things dev log. Sits on top of /assets/site.css (fonts, colors, header, footer).
   Look: a dark soundstage under one warm tungsten key; every post is a take with its own clapperboard. */

.devlog {
  --tungsten: #ffb46b;
  --chalk: #e9e4d8;
  --card: #1b1822;
  --card-2: #221e2b;
  --red-light: #ff3b30;
  --reel-w: 780px;
}

.no-scroll { overflow: hidden; }

/* ---------- Hero ---------- */
.dl-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(32px, 5vw, 56px);
  text-align: center;
  isolation: isolate;
}
.dl-hero::before {
  /* the key light: a soft cone from a Fresnel above the frame */
  content: "";
  position: absolute; inset: -20% -10% 0;
  background:
    radial-gradient(ellipse 38% 55% at 50% 0%, rgba(255, 180, 107, 0.30), transparent 70%),
    radial-gradient(ellipse 70% 60% at 50% 10%, rgba(255, 106, 61, 0.10), transparent 75%);
  z-index: -1;
}
.dl-hero::after {
  /* stage floor seam */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.dl-hero-inner { max-width: 860px; margin: 0 auto; }
.on-air {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin: 0 0 22px; padding: 6px 14px;
  font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(20, 18, 26, 0.6);
}
.on-air em { color: var(--gold); font-style: normal; }
.on-air-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--red-light);
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6);
  animation: tally 1.6s ease-in-out infinite;
}
@keyframes tally {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 0 7px rgba(255, 59, 48, 0); opacity: 0.75; }
}
.dl-hero h1 { margin: 0 auto; max-width: 640px; }
.dl-logo { width: 100%; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6)); }
.dl-sub {
  margin: 4px 0 18px;
  font-family: var(--display); font-size: clamp(0.9rem, 2vw, 1.05rem); letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--gold); padding-left: 0.5em;
}
.dl-hero .lede { max-width: 640px; margin: 0 auto; color: var(--chalk); font-size: clamp(1rem, 2vw, 1.12rem); text-wrap: pretty; }
.dl-stats { justify-content: center; margin: 28px auto 0; }
.updated { margin: 18px 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Toolbar ---------- */
.dl-bar {
  position: sticky; top: 57px; z-index: 4;
  background: rgba(20, 18, 26, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.dl-bar-inner {
  max-width: calc(var(--reel-w) + 120px); margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip, .sort {
  flex: none;
  font: 700 0.8rem/1 var(--text);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.chip:hover, .sort:hover { color: var(--paper); border-color: rgba(246, 240, 228, 0.3); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.sort .sort-old { display: none; }
.sort[aria-pressed="true"] .sort-old { display: inline; }
.sort[aria-pressed="true"] .sort-new { display: none; }

/* ---------- The reel (timeline) ---------- */
.reel {
  position: relative;
  max-width: calc(var(--reel-w) + 120px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--gutter) 24px calc(var(--gutter) + 46px);
  display: flex; flex-direction: column; gap: clamp(28px, 4vw, 44px);
}
.reel::before {
  /* a strip of film running down the left: sprocket holes on a dark base */
  content: "";
  position: absolute; top: 0; bottom: 0; left: var(--gutter); width: 26px;
  background:
    repeating-linear-gradient(180deg, transparent 0 7px, rgba(246, 240, 228, 0.16) 7px 17px, transparent 17px 24px) left 5px top 0 / 6px 24px repeat-y,
    repeating-linear-gradient(180deg, transparent 0 7px, rgba(246, 240, 228, 0.16) 7px 17px, transparent 17px 24px) right 5px top 0 / 6px 24px repeat-y,
    #0d0c11;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  border-radius: 3px;
}
.reel-empty { color: var(--muted); text-align: center; }

.post { position: relative; scroll-margin-top: 130px; }
.post[hidden] { display: none; }
.post::before {
  /* frame marker on the strip */
  content: "";
  position: absolute; left: -38px; top: 22px;
  width: 12px; height: 12px; border-radius: 2px;
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255, 106, 61, 0.18), 0 0 18px rgba(255, 106, 61, 0.5);
}

/* Clapperboard header */
.slate {
  background: #101014;
  border: 1px solid rgba(246, 240, 228, 0.18);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}
.slate-stripes {
  height: 16px;
  background: repeating-linear-gradient(-55deg, var(--chalk) 0 18px, #101014 18px 36px);
  border-bottom: 1px solid rgba(246, 240, 228, 0.18);
}
.slate-grid {
  margin: 0;
  display: grid; grid-template-columns: 64px 70px 1fr;
}
.slate-grid > div { padding: 7px 12px 8px; border-right: 1px solid rgba(246, 240, 228, 0.18); min-width: 0; }
.slate-grid > div:last-child { border-right: 0; }
.slate-grid dt { font: 800 0.6rem/1 var(--text); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.slate-grid dd { margin: 0; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", var(--text); color: var(--chalk); font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slate-when dd { font-size: 0.92rem; }

.post-body {
  background: linear-gradient(180deg, var(--card-2), var(--card) 180px);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  padding: clamp(18px, 3vw, 28px);
  display: flex; flex-direction: column; gap: 14px;
}
.post-body > * { margin: 0; min-width: 0; }
.post h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); text-wrap: balance; }
.post h2 a { color: var(--paper); text-decoration: none; }
.post h2 a:hover { color: var(--gold); }
.post p { color: var(--chalk); text-wrap: pretty; }
.post code { font: 0.88em/1 ui-monospace, "Cascadia Code", Consolas, monospace; background: rgba(246, 240, 228, 0.08); padding: 2px 6px; border-radius: 4px; color: var(--paper); }
.post strong { color: var(--paper); }

.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font: 800 0.66rem/1 var(--text); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 4px;
  color: var(--ink); background: var(--muted);
}
.tag-code { background: #8ec5ff; }
.tag-art { background: var(--coral); }
.tag-audio { background: #b9a2ff; }
.tag-ai { background: var(--gold); }
.tag-design { background: #9be3b0; }
.tag-playtest { background: var(--ember); }
.tag-unused { background: transparent; color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); }

/* Media */
.shot { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.zoom {
  position: relative; display: block; width: 100%;
  padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: #0c0b10; cursor: zoom-in;
}
.zoom img { width: 100%; transition: transform 0.35s ease; }
.zoom:hover img { transform: scale(1.015); }
.shot figcaption { font-size: 0.86rem; color: var(--muted); line-height: 1.45; }
.is-unused .zoom img { filter: saturate(0.85); }

.badge {
  position: absolute; top: 10px; left: 10px;
  font: 800 0.62rem/1 var(--text); letter-spacing: 0.16em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 4px;
}
.badge + .badge { left: auto; right: 10px; }
.badge-unused { background: rgba(16, 16, 20, 0.85); color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); }
.badge-picked { background: var(--gold); color: var(--ink); }
.badge-clip { background: rgba(16, 16, 20, 0.85); color: var(--paper); }
.badge-clip::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red-light); margin-right: 6px; vertical-align: 1px; }
.audio .badge, .options .badge { position: static; }

.gallery { display: grid; gap: 10px; }
.gallery.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery .shot figcaption { font-size: 0.8rem; }

.audio {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border-radius: 8px;
  background: rgba(246, 240, 228, 0.04); border: 1px solid var(--line);
}
.audio.is-picked { border-color: rgba(255, 197, 74, 0.55); background: rgba(255, 197, 74, 0.06); }
.audio-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.audio-label { font-weight: 800; color: var(--paper); }
.audio-note { font-size: 0.86rem; color: var(--muted); }
.audio audio { width: 100%; height: 36px; }

.pull { margin: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--ember); }
.pull p { font-size: 1.12rem; font-style: italic; color: var(--paper); }
.pull cite { display: block; margin-top: 6px; font-style: normal; font-size: 0.82rem; color: var(--muted); }

.options { list-style: none; padding: 0; display: grid; gap: 6px; }
.options li {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px;
  padding: 9px 12px; border-radius: 6px; background: rgba(246, 240, 228, 0.04); border: 1px solid transparent;
}
.options li.is-picked { border-color: rgba(255, 197, 74, 0.55); background: rgba(255, 197, 74, 0.07); }
.opt-name { font-weight: 800; color: var(--paper); }
.options li:not(.is-picked) .opt-name { text-decoration: line-through; text-decoration-color: rgba(255, 106, 61, 0.7); text-decoration-thickness: 2px; }
.opt-note { grid-column: 1 / -1; font-size: 0.86rem; color: var(--muted); }

.code { margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 8px; background: #0c0b10; border: 1px solid var(--line); font: 0.84rem/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--chalk); }

.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: flow; }
.flow li {
  counter-increment: flow;
  display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; align-items: start;
  padding: 10px 12px; border-radius: 8px; background: rgba(246, 240, 228, 0.04);
}
.flow li::before {
  content: counter(flow);
  grid-row: span 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); color: var(--ink); background: var(--gold);
}
.flow b { color: var(--paper); }
.flow span { color: var(--muted); font-size: 0.92rem; }

.mini-stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.mini-stats li { padding: 12px; border-radius: 8px; background: rgba(246, 240, 228, 0.04); border: 1px solid var(--line); }
.mini-stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--gold); }
.mini-stats span { font-size: 0.84rem; color: var(--muted); }

.tip {
  padding: 12px 14px 12px 16px;
  border-radius: 0 8px 8px 0;
  border-left: 3px solid var(--gold);
  background: rgba(255, 197, 74, 0.07);
}
.tip-label { display: block; font: 800 0.66rem/1 var(--text); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.tip p { font-size: 0.95rem; }

.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--muted); }
.tools > span { font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.66rem; margin-right: 4px; }
.tools em { font-style: normal; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--chalk); }

.dl-end { max-width: var(--reel-w); margin: 0 auto; padding: 24px var(--gutter) 64px; text-align: center; color: var(--chalk); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(8, 7, 10, 0.94);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox-close {
  position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--ink-2); color: var(--paper);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}

/* Small screens */
@media (max-width: 640px) {
  .reel { padding-left: calc(var(--gutter) + 30px); }
  .reel::before { width: 18px; }
  .reel::before { background-size: 4px 24px, 4px 24px, auto; }
  .post::before { left: -27px; width: 10px; height: 10px; }
  .slate-grid { grid-template-columns: 52px 58px 1fr; }
  .slate-grid > div { padding: 6px 9px 7px; }
  .gallery.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .on-air { font-size: 0.58rem; letter-spacing: 0.1em; gap: 6px; padding: 6px 12px; border-radius: 14px; }
  .on-air-theme { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .on-air-dot { animation: none; }
  .zoom img { transition: none; }
}
