/* ============================================================
   daily-bugle.css: /daily-bugle/, the Spider-Man terminal.
   Sister page to /citadel/, /compass/ and the rest, and the only
   one printed on paper: a broadsheet front page in ink and one
   red, with today's date in the dateline, every room on the site
   run as a story, and a web (daily-bugle.js) that finds whichever
   one you point at.
   ============================================================ */

/* these pages load no shared stylesheet, so they carry their own reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img, svg { display: block; max-width: 100%; }
html.smooth { scroll-behavior: smooth; }   /* added after load, so back/forward restoration is not animated */

.db {
  --iw-a: #b3121c;   /* the shared world button, interface-world.css */
  --iw-bg: #efe7d4;
  --head:  "Oswald", "Arial Narrow", sans-serif;
  --mast:  "Playfair Display", Georgia, serif;
  --body:  "Source Serif 4", Georgia, serif;
  --paper: #f2ecdc;
  --paper-2:#e8e0ca;
  --ink:   #171412;
  --ink-2: #3a342e;
  --mute:  #5c544a;     /* 6.4:1 on the paper */
  --red:   #b3121c;     /* 6.1:1 on the paper */
  --rule:  rgba(23, 20, 18, .78);
  --hair:  rgba(23, 20, 18, .22);
  --ease:  cubic-bezier(.16, 1, .3, 1);

  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.04rem;
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

/* ───────────── newsprint ───────────── */
.db-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.db-field > span { position: absolute; inset: 0; }
/* fibers: two fine crossing hatches, too faint to read as a pattern */
.db-grain {
  opacity: .55;
  background:
    repeating-linear-gradient(17deg, rgba(90, 70, 40, .035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-71deg, rgba(90, 70, 40, .03) 0 1px, transparent 1px 7px);
}
/* the yellowing a page picks up at its edges, darker in the corners */
.db-edge {
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(150, 115, 60, .22)),
    linear-gradient(90deg, rgba(150, 115, 60, .1), transparent 6%, transparent 94%, rgba(150, 115, 60, .1));
}

/* the web canvas: above the paper, below the extra edition */
.db-web { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

/* ───────────── header: a strip of solid ink ───────────── */
.db-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap;
  padding: calc(0.85rem + env(safe-area-inset-top, 0px)) clamp(1rem, 4vw, 2.6rem) 0.85rem;
  background: var(--ink); color: #e9e1cc;
  font-family: var(--head); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.db-exit { display: inline-flex; align-items: center; gap: 0.45rem; color: #fff; }
.db-exit:hover { color: #ffb3b6; }
.db-exit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.db-edition { color: #ff9ea3; font-variant-numeric: tabular-nums; }
.db-exit:focus-visible, .db-story:focus-visible, .db-dispatch:focus-visible, .db-stop:focus-visible, .db-done a:focus-visible {
  outline: 3px solid var(--red); outline-offset: 3px;
}
.db-top .db-exit:focus-visible { outline-color: #ff9ea3; }

.db-main { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.6rem); }

/* ───────────── the masthead ───────────── */
.db-mast { padding-top: clamp(1.2rem, 3.5vw, 2.2rem); }
.db-ears {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem 1.6rem;
}
.db-ear {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.6rem 0.75rem; border: 1px solid var(--rule);
  font-size: 0.86rem; line-height: 1.35; color: var(--ink-2);
  max-width: 220px;
}
.db-ear b { font-family: var(--head); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
.db-ear--r { justify-self: end; text-align: right; }
.db-title {
  font-family: var(--mast); font-weight: 900; line-height: .95; text-align: center; letter-spacing: -0.01em;
  font-size: clamp(2.7rem, 9.4vw, 7.4rem);
  color: var(--ink);
  /* ink spread: a hair of the letter bleeding into the paper */
  text-shadow: 0 0 1px rgba(23, 20, 18, .5);
  animation: db-ink 1.1s var(--ease) both;
}
.db-title span { font-style: italic; font-weight: 700; font-size: .42em; vertical-align: .9em; margin-right: .1em; }
@keyframes db-ink { from { opacity: 0; filter: blur(6px); letter-spacing: .06em; } to { opacity: 1; filter: blur(0); letter-spacing: -0.01em; } }

/* the dateline, between a heavy rule and a hairline, as on every broadsheet */
.db-dateline {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 1.4rem;
  margin-top: 0.9rem; padding: 0.45rem 0;
  border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink);
  box-shadow: 0 3px 0 -2px var(--ink);
  font-family: var(--head); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.db-dateline span:nth-child(2) { color: var(--red); }

/* ───────────── headings ───────────── */
.db-h {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.2rem 0.7rem;
  font-family: var(--head); font-weight: 700; font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
  margin-bottom: 0.9rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--ink);
}
.db-h span {
  font-family: var(--body); font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none;
  font-size: 1rem; color: var(--mute);
}
.db-h--sm { font-size: 1.1rem; }
.db-think { width: 22px; height: 22px; }

.db-front { margin-top: clamp(1.4rem, 3.5vw, 2.2rem); }
.db-hint { margin: -0.4rem 0 1rem; font-style: italic; font-size: 0.95rem; color: var(--mute); }

/* ───────────── the stories ─────────────
   A four-column broadsheet: the lead across the top, wide stories over
   two columns, briefs in one. Every story is ruled off from its
   neighbor by a hairline, the way columns are on newsprint. */
.db-stories {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense;
  column-gap: 0; border-top: 1px solid var(--rule);
}
.db-st {
  position: relative; border-bottom: 1px solid var(--hair);
  animation: db-press .8s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms + 250ms);
}
.db-st + .db-st:not(.db-st--lead) { box-shadow: inset 1px 0 0 var(--hair); }
.db-st--lead { grid-column: 1 / -1; border-bottom: 3px double var(--ink); }
.db-st--wide { grid-column: span 2; }
/* Help Wanted closes the page across every column, as the classifieds do */
.db-st--foot { grid-column: 1 / -1; border-top: 3px double var(--ink); }
.db-st--foot .db-deck { max-width: 70ch; }
@keyframes db-press { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.db-story {
  display: flex; flex-direction: column; gap: 0.45rem; height: 100%;
  padding: 1rem 1rem 1.15rem;
  transition: background .3s;
}
.db-story:hover, .db-story:focus-visible { background: rgba(179, 18, 28, .055); }

.db-kick {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.55rem;
  font-family: var(--head); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red);
}
.db-kick i {
  font-family: var(--body); font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none;
  font-size: 0.9rem; color: var(--mute);
}
.db-kick i::before { content: "· "; color: var(--hair); }
.db-hl {
  font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em;
  font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.12; color: var(--ink);
}
.db-st--wide .db-hl { font-size: clamp(1.3rem, 2.3vw, 1.75rem); }
.db-story:hover .db-hl, .db-story:focus-visible .db-hl { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--red); }
.db-deck { font-size: 1rem; line-height: 1.5; color: var(--ink-2); }

/* the special report sits in a red box, as the paper does with a story it
   wants you to notice and claims it does not care about */
.db-st--special .db-story { margin: 0.6rem; padding: 0.9rem; border: 2px solid var(--red); height: calc(100% - 1.2rem); }

/* the lead: the headline the whole page is about, beside its photo */
.db-st--lead .db-story {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.2rem 2rem; align-items: start;
  padding: 1.3rem 0.2rem 1.6rem;
}
.db-lead-text { display: flex; flex-direction: column; gap: 0.6rem; }
.db-st--lead .db-hl {
  font-family: var(--mast); font-weight: 900; text-transform: none; letter-spacing: -0.01em;
  font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.02;
}
.db-by { font-family: var(--head); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
/* the lead's headline is too big for a hard underline: it reddens instead */
.db-st--lead .db-story:hover .db-hl, .db-st--lead .db-story:focus-visible .db-hl { text-decoration: none; color: var(--red); }
.db-st--lead .db-hl { transition: color .3s; }
.db-st--lead .db-deck { font-size: 1.12rem; line-height: 1.6; }
.db-st--lead .db-deck::first-letter {
  float: left; margin: 0.06em 0.1em 0 0;
  font-family: var(--mast); font-weight: 900; font-size: 3.4em; line-height: .8; color: var(--red);
}

/* the photo: halftone, the way a press prints a photograph, laid over the
   drawing as a screen of ink dots, and multiplied into the paper */
.db-photo { display: flex; flex-direction: column; gap: 0.45rem; }
.db-photo svg {
  width: 100%; height: auto; border: 1px solid var(--ink);
  filter: grayscale(1) contrast(1.15);
}
.db-photo { position: relative; }
.db-photo::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0;
  aspect-ratio: 600 / 380; pointer-events: none;
  background: radial-gradient(circle, rgba(23, 20, 18, .28) 0.9px, transparent 1.4px) 0 0 / 4px 4px;
  mix-blend-mode: multiply;
}
.db-ph-far path { fill: #6f695e; }
.db-ph-near path { fill: #2b2724; }
.db-ph-line { stroke: #f4f0e4; stroke-width: 2.4; }
.db-ph-speed path { stroke: rgba(244, 240, 228, .7); stroke-width: 3; stroke-linecap: round; }
.db-ph-guy circle { fill: #141210; }
.db-ph-limb { stroke: #141210; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.db-ph-guy { animation: db-swing 5s ease-in-out infinite; transform-box: view-box; }
@keyframes db-swing {
  0%, 100% { transform: translate(338px, 190px) rotate(-18deg); }
  50%      { transform: translate(346px, 186px) rotate(-12deg); }
}
.db-caption { font-size: 0.9rem; font-style: italic; line-height: 1.4; color: var(--mute); }

/* ───────────── staff panels ───────────── */
.db-cols { display: grid; gap: clamp(1rem, 2.4vw, 2rem); grid-template-columns: 1fr; margin-top: clamp(1.8rem, 4vw, 2.8rem); }
@media (min-width: 900px) { .db-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }
.db-panel { min-width: 0; }

/* the press card: a laminated pass, slightly glossy, on a lanyard */
.db-panel--card { perspective: 900px; }
.db-card {
  position: relative; max-width: 440px; margin: 0.4rem auto 0;
  background: linear-gradient(160deg, #fbf8ef, #ede6d3);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 40px -18px rgba(40, 25, 10, .55), 0 2px 6px rgba(40, 25, 10, .2);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotate(-1.5deg);
  transition: transform .5s var(--ease);
}
.db-card::after {   /* the laminate's sheen, which slides as the card turns */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) calc(45% + var(--sx, 0%)), transparent 60%);
  mix-blend-mode: soft-light;
}
.db-card-hole {
  position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 2;
  width: 46px; height: 9px; border-radius: 5px; background: var(--paper); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
.db-card-band {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 0.6rem;
  padding: 1.7rem 1.1rem 0.6rem; background: var(--red); color: #fff;
}
.db-card-band b { font-family: var(--head); font-weight: 700; font-size: 2rem; letter-spacing: 0.22em; line-height: 1; }
.db-card-band span { font-family: var(--mast); font-weight: 900; font-size: 1.05rem; }
.db-card-body { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 1rem; padding: 1rem 1.1rem 0.6rem; }
.db-card-photo { display: block; align-self: start; border: 1px solid var(--ink); background: #d9d1bc; }
.db-card-photo svg { width: 100%; height: auto; }
.db-card-photo rect, .db-card-photo path { fill: #2b2724; }
.db-card-lens { fill: #5c544a; stroke: #171412; stroke-width: 3; }
.db-card-glass { fill: #c9c1ab; }
.db-card-dl { display: flex; flex-direction: column; gap: 0.45rem; }
.db-card-dl dt { font-family: var(--head); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.db-card-dl dd { font-size: 0.98rem; line-height: 1.3; color: var(--ink); }
.db-card-dl div:first-child dd { font-family: var(--mast); font-weight: 900; font-size: 1.3rem; }
.db-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 1.1rem 0.9rem;
  font-family: var(--head); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red);
}
/* a barcode: bars of irregular width from three overlaid stripes */
.db-barcode {
  flex: 0 0 auto; width: 130px; height: 30px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 9px),
    repeating-linear-gradient(90deg, transparent 0 11px, var(--ink) 11px 14px, transparent 14px 17px);
}

/* the clippings: briefs, two columns of them, each cut out with a ragged
   top edge and pasted slightly crooked */
.db-clips { list-style: none; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.db-clips li {
  position: relative; padding: 0.75rem 0.85rem 0.8rem;
  background: #f8f4e9; border: 1px solid var(--hair);
  box-shadow: 0 6px 14px -10px rgba(40, 25, 10, .5);
  rotate: var(--r, -0.6deg);
}
.db-clips li:nth-child(3n+2) { --r: 0.7deg; }
.db-clips li:nth-child(3n) { --r: -0.2deg; }
.db-clips li::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -5px; height: 6px;
  background: linear-gradient(135deg, transparent 50%, #f8f4e9 50%) 0 0 / 8px 6px repeat-x,
              linear-gradient(-135deg, transparent 50%, #f8f4e9 50%) 4px 0 / 8px 6px repeat-x;
}
.db-clips b { display: block; font-family: var(--head); font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15; }
.db-clips p { margin-top: 0.3rem; font-size: 0.97rem; line-height: 1.45; color: var(--ink-2); }

/* ───────────── the wire ───────────── */
.db-wire { margin-top: clamp(1.8rem, 4vw, 2.8rem); }
.db-wires { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border-top: 1px solid var(--hair); }
.db-wires li { border-bottom: 1px solid var(--hair); }
.db-dispatch {
  display: block; padding: 0.7rem 0.6rem 0.75rem;
  font-family: var(--body); transition: background .3s;
}
.db-dispatch:hover, .db-dispatch:focus-visible { background: rgba(179, 18, 28, .055); }
.db-dispatch span {
  font-family: var(--head); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red);
}
.db-dispatch span::after { content: " (AP) "; color: var(--mute); }
.db-dispatch b { display: block; margin-top: 0.1rem; font-family: var(--mast); font-weight: 700; font-size: 1.1rem; }
.db-dispatch i { font-size: 0.94rem; color: var(--mute); }

/* ───────────── stop the presses ───────────── */
.db-stop {
  display: block; margin: clamp(2.2rem, 5vw, 3.2rem) auto 0;
  padding: 0.9rem 2rem; border: 3px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink); cursor: pointer;
  font-family: var(--head); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.14em; text-transform: uppercase;
  box-shadow: 5px 5px 0 var(--red);
  transition: background .25s, color .25s, translate .2s var(--ease), box-shadow .2s var(--ease);
}
.db-stop:hover, .db-stop:focus-visible { background: var(--ink); color: var(--paper); }
.db-stop:active { translate: 3px 3px; box-shadow: 2px 2px 0 var(--red); }
.db-colophon { max-width: 56ch; margin: 1.4rem auto 0; text-align: center; font-style: italic; font-size: 0.9rem; color: var(--mute); }

/* the extra edition */
.db.is-stopped .db-main { opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.db.is-stopped .db-web { opacity: 0; }
.db-done {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 1.2rem; background: rgba(23, 20, 18, .9);
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
.db.is-stopped .db-done { opacity: 1; pointer-events: auto; }
.db-extra {
  width: min(520px, 100%); padding: 1.6rem clamp(1rem, 4vw, 2rem) 1.8rem; text-align: center;
  background: var(--paper); color: var(--ink);
  border-top: 8px solid var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.db.is-stopped .db-extra { animation: db-spin 1.15s cubic-bezier(.2, .7, .25, 1) both; }
/* the montage spin: the paper comes out of the dark at the camera,
   turning twice, and stops square to the reader */
@keyframes db-spin {
  from { transform: scale(.05) rotate(-720deg); opacity: 0; }
  20%  { opacity: 1; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.db-extra-k { font-family: var(--head); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--red); }
.db-extra-t { margin-top: 0.4rem; font-family: var(--mast); font-weight: 900; font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.02; }
.db-extra-d { margin-top: 0.6rem; font-style: italic; color: var(--ink-2); }
.db-extra-photo {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  margin: 1.2rem auto 0; padding: 1rem; border: 1px solid var(--ink); background: var(--paper-2);
  font-size: 0.88rem; font-style: italic; color: var(--mute);
}
.db-done-orb { display: block; width: 96px; height: 96px; }
.db:not(.is-stopped) .db-done-orb { display: none; }
.db-done a {
  display: inline-block; margin-top: 1.3rem;
  font-family: var(--head); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--red); border-bottom: 2px solid currentColor; padding-bottom: 2px;
}
.db-done a:hover { color: var(--ink); }

/* ───────────── narrower pages ─────────────
   The broadsheet folds: two columns on a tablet, one on a phone. The ears
   drop under the nameplate rather than squeezing it, and nothing goes. */
@media (max-width: 1000px) {
  .db-stories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-st--lead .db-story { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .db-ears { grid-template-columns: 1fr 1fr; }
  .db-title { grid-column: 1 / -1; grid-row: 1; }
  .db-ear { max-width: none; }
}
@media (max-width: 600px) {
  .db-stories { grid-template-columns: 1fr; }
  .db-st--wide, .db-st--foot { grid-column: auto; }
  .db-st + .db-st:not(.db-st--lead) { box-shadow: none; }
  .db-story { padding: 0.95rem 0.2rem 1.05rem; }
  .db-st--special .db-story { margin: 0.6rem 0; padding: 0.9rem 0.8rem; }
  .db-ears { grid-template-columns: 1fr; }
  .db-ear, .db-ear--r { justify-self: stretch; text-align: left; }
  .db-dateline { justify-content: center; text-align: center; }
  .db-card-body { grid-template-columns: 72px minmax(0, 1fr); gap: 0.8rem; }
  .db-card-band b { font-size: 1.6rem; }
  .db-barcode { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .db-title, .db-st, .db-ph-guy, .db.is-stopped .db-extra { animation: none; }
  .db-card { transition: none; }
}
