/* Judgment Day design system.
 *
 * Taken from the book cover: pure black, one red, a thin red technical grid,
 * heavy condensed caps at large scale, and the diagonal taped banner with
 * dashed stitching. No gradients, no photography, no soft edges.
 *
 * Everything is namespaced jd- and scoped under .jd, so this can be adopted one
 * page at a time without touching the pages still on the old stylesheet.
 *
 * After editing: bin/publish-asset.sh public/assets/css/judgment.css
 */

:root{
  --jd-black:#000000;
  --jd-surface:#0B0B0B;
  --jd-surface-2:#151515;
  --jd-red:#E01E26;
  --jd-red-deep:#A8141B;
  --jd-red-wash:rgba(224,30,38,.10);
  /* The accent splits by role. #E01E26 as 11 to 17px text is 4.38:1 on black,
   * under the 4.5:1 small text needs, so small red TEXT takes --jd-red-text
   * and the deep accent stays on fills, rules and display type. */
  --jd-red-text:#EF4B52;
  --jd-white:#FFFFFF;
  --jd-bone:#E9E6E2;
  --jd-dim:#8C8C8C;
  --jd-line:#262626;
  --jd-grid:rgba(224,30,38,.15);
  --jd-display:"Anton","Arial Narrow",Impact,sans-serif;
  --jd-body:"Archivo",system-ui,-apple-system,"Segoe UI",sans-serif;
}

.jd{
  background:var(--jd-black);
  color:var(--jd-bone);
  font-family:var(--jd-body);
  font-size:17px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
.jd *{box-sizing:border-box}
.jd ::selection{background:var(--jd-red);color:var(--jd-white)}

/* ---------- the blueprint grid ---------- */
.jd-grid{
  position:relative;
  background-color:var(--jd-black);
  background-image:
    repeating-linear-gradient(to right,  var(--jd-grid) 0 1px, transparent 1px 74px),
    repeating-linear-gradient(to bottom, var(--jd-grid) 0 1px, transparent 1px 74px);
}
/* fade the grid out where type sits, so the lines never fight the words */
.jd-grid::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse 80% 65% at 50% 45%, rgba(0,0,0,.86) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}
.jd-grid > *{position:relative;z-index:1}

/* ---------- type ---------- */
.jd-h1,.jd-h2,.jd-h3,.jd-num{
  font-family:var(--jd-display);
  font-weight:400;
  text-transform:uppercase;
  letter-spacing:-.005em;
  line-height:.92;
  margin:0;
  color:var(--jd-white);
}
.jd-h1{font-size:clamp(2.75rem,10vw,7rem)}
.jd-h2{font-size:clamp(1.875rem,5.5vw,3.5rem);line-height:.95}
.jd-h3{font-size:clamp(1.25rem,2.6vw,1.75rem);line-height:1}
.jd-h1 .r,.jd-h2 .r,.jd-h3 .r{color:var(--jd-red)}

.jd-eyebrow{
  font-family:var(--jd-body);
  font-size:.6875rem;font-weight:600;
  letter-spacing:.24em;text-transform:uppercase;
  color:var(--jd-red-text);margin:0 0 1rem;
}
.jd-lede{font-size:clamp(1.0625rem,1.9vw,1.375rem);line-height:1.5;color:var(--jd-bone);margin:0}
.jd-body{font-size:1.0625rem;line-height:1.65;color:var(--jd-bone);margin:0}
.jd-body-dim{font-size:1rem;line-height:1.65;color:var(--jd-dim);margin:0}
.jd-src{font-style:italic;font-size:.8125rem;color:var(--jd-dim)}

/* ---------- layout ---------- */
.jd-wrap{max-width:1120px;margin:0 auto;padding:0 1.25rem}
.jd-wrap-tight{max-width:820px;margin:0 auto;padding:0 1.25rem}
.jd-sec{padding:5rem 0}
.jd-sec-tight{padding:3.5rem 0}
.jd-hr{height:1px;background:var(--jd-red);border:0;margin:0;opacity:.55}
.jd-hr-dim{height:1px;background:var(--jd-line);border:0;margin:0}

/* ---------- the taped banner ---------- */
.jd-tape{
  display:block;
  background:var(--jd-red);
  border-top:5px dashed var(--jd-black);
  border-bottom:5px dashed var(--jd-black);
  transform:rotate(-2.6deg);
  padding:.875rem 1.5rem;
  margin:0;
  box-shadow:0 0 0 1px rgba(0,0,0,.5);
}
.jd-tape-in{
  font-family:var(--jd-display);
  text-transform:uppercase;
  color:var(--jd-black);
  font-size:clamp(1rem,3.2vw,1.875rem);
  line-height:1.05;
  letter-spacing:.005em;
  display:flex;align-items:center;gap:.875rem;
  justify-content:center;
  text-align:center;
}
.jd-tape-wide{ transform:rotate(-2.6deg) scale(1.03); }

/* crosshair, the cover's reticle */
.jd-reticle{flex:none;width:1.75em;height:1.75em;display:block}

/* ---------- stats, the back-cover pattern ---------- */
.jd-stats{
  display:grid;grid-template-columns:repeat(3,1fr);
  gap:0;border-top:1px solid var(--jd-line);border-bottom:1px solid var(--jd-line);
}
.jd-stat{padding:2.25rem 1.75rem;border-left:1px solid var(--jd-line)}
.jd-stat:first-child{border-left:0}
.jd-num{font-size:clamp(3rem,7vw,5rem);color:var(--jd-red);line-height:.85;margin:0 0 .75rem}
.jd-stat-cap{font-size:.9375rem;line-height:1.45;color:var(--jd-bone);margin:0 0 .875rem}
.jd-stat-src{display:block;font-style:italic;font-size:.8125rem;color:var(--jd-dim)}
.jd-stat-src::before{content:"";display:block;width:26px;height:1px;background:var(--jd-line);margin:0 0 .5rem}
@media (max-width:860px){
  .jd-stats{grid-template-columns:1fr}
  .jd-stat{border-left:0;border-top:1px solid var(--jd-line)}
  .jd-stat:first-child{border-top:0}
}

/* ---------- buttons: square, caps, no pills ---------- */
.jd-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  font-family:var(--jd-body);font-weight:700;
  font-size:.875rem;letter-spacing:.12em;text-transform:uppercase;
  padding:1.0625rem 1.75rem;border:2px solid var(--jd-red);
  background:var(--jd-red);color:var(--jd-white);
  text-decoration:none;cursor:pointer;
  transition:background .12s,color .12s,border-color .12s;
}
.jd-btn:hover{background:var(--jd-red-deep);border-color:var(--jd-red-deep);color:var(--jd-white)}
.jd-btn-ghost{background:transparent;color:var(--jd-white);border-color:var(--jd-white)}
.jd-btn-ghost:hover{background:var(--jd-white);color:var(--jd-black);border-color:var(--jd-white)}
.jd-btn-quiet{background:transparent;color:var(--jd-red-text);border-color:var(--jd-line)}
.jd-btn-quiet:hover{background:transparent;color:var(--jd-white);border-color:var(--jd-red)}
.jd-btn:focus-visible,.jd a:focus-visible{outline:3px solid var(--jd-red);outline-offset:3px}
.jd-btnrow{display:flex;flex-wrap:wrap;gap:.875rem}

/* ---------- panels and cards, hard edges only ---------- */
.jd-panel{background:var(--jd-surface);border:1px solid var(--jd-line);padding:2rem}
.jd-panel-red{background:var(--jd-red-wash);border-left:4px solid var(--jd-red);padding:1.75rem}
.jd-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1px;background:var(--jd-line)}
.jd-card{background:var(--jd-surface);padding:2rem;text-decoration:none;display:block;transition:background .12s}
a.jd-card:hover{background:var(--jd-surface-2)}
a.jd-card:hover .jd-h3{color:var(--jd-red)}

/* ---------- links ---------- */
.jd-link{
  color:var(--jd-red-text);text-decoration:none;font-weight:600;
  border-bottom:2px solid rgba(224,30,38,.35);padding-bottom:1px;
}
.jd-link:hover{border-bottom-color:var(--jd-red);color:var(--jd-white)}

/* ---------- fork: the two doors ---------- */
.jd-fork{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--jd-line)}
@media (max-width:760px){.jd-fork{grid-template-columns:1fr}}
.jd-fork-side{background:var(--jd-surface);padding:2.5rem 2rem}
/* a third door, sitting under the two-column pair rather than beside it */
.jd-fork-side.is-wide{grid-column:1 / -1;border-top:1px solid var(--jd-line)}
.jd-fork-side.is-red{background:var(--jd-red)}
.jd-fork-side.is-red .jd-eyebrow{color:var(--jd-white)}
.jd-fork-side.is-red .jd-h3{color:var(--jd-white)}
.jd-fork-side.is-red .jd-body{color:var(--jd-white)}
.jd-fork-side.is-red .jd-btn{background:var(--jd-black);border-color:var(--jd-black)}
.jd-fork-side.is-red .jd-btn:hover{background:var(--jd-white);color:var(--jd-black)}

@media (prefers-reduced-motion:reduce){.jd *{transition:none!important}}

/* ---------- book covers ----------
 * Both covers are real artwork now. Scale with --cw (the cover width); the
 * font-size derives from it so the drop shadow, written in em, stays
 * proportional whether a cover renders at 104px in the footer or 320px on a
 * book page. The CSS facsimile that stood in for Judgment Day before the KDP
 * front cover arrived was deleted with it, parts and all.
 */
.jd-cover-img{
  --cw:280px;
  width:var(--cw);
  height:auto;
  font-size:calc(var(--cw) / 280 * 16px);
  display:block;
  border:1px solid #6A6A6A;
  box-shadow:0 1.5em 3em -1em rgba(0,0,0,.9);
  flex:none;
}
a.jd-cover-img:hover{border-color:var(--jd-red)}

/* ---------- books in the footer, on every surface ---------- */
.jd-footer-books{
  background:#000;
  border-top:1px solid var(--jd-line);
  padding:3rem 1.25rem;
}
.jd-footer-books-in{
  max-width:1120px;margin:0 auto;
  display:flex;flex-wrap:wrap;align-items:center;gap:2.25rem;
}
.jd-footer-books .shots{display:flex;gap:1.25rem;flex:none}
.jd-footer-books .copy{flex:1 1 20rem;min-width:0}
.jd-footer-books .copy p{margin:0 0 .5rem}
@media (max-width:640px){
  .jd-footer-books .shots{gap:.875rem}
  .jd-footer-books-in{gap:1.5rem}
}

/* ---------- page hero for the tool and interior pages ----------
 * Replaces the retired platform banner (a stock webp with gradient-clipped
 * Poppins). Bare class, not scoped under .jd, so a page whose body is a
 * self-contained instrument can wear the hero without adopting the wrapper.
 */
.jd-toolhero{
  background:var(--jd-black);
  background-image:
    repeating-linear-gradient(to right,  var(--jd-grid) 0 1px, transparent 1px 74px),
    repeating-linear-gradient(to bottom, var(--jd-grid) 0 1px, transparent 1px 74px);
  border-bottom:2px solid var(--jd-red);
  padding:7rem 1.125rem 2.75rem;
}
.jd-toolhero-in{max-width:60rem;margin:0 auto}
.jd-toolhero h1{
  font-family:var(--jd-display);
  font-weight:400;
  text-transform:uppercase;
  font-size:clamp(2.125rem,6.5vw,4.25rem);
  line-height:.9;
  letter-spacing:-.005em;
  color:var(--jd-white);
  margin:0;
  text-wrap:balance;
}
.jd-toolhero .jd-toolhero-rule{
  width:88px;height:5px;background:var(--jd-red);margin:1.375rem 0 0;
}
@media(min-width:768px){ .jd-toolhero{padding:8.5rem 1.5rem 3.25rem} }
