/* ==========================================================================
   Backrooms: Code Yellow Guide — "hazard tape" theme
   Industrial caution yellow on near-black, thick ink borders, hard shadows.
   ========================================================================== */

:root {
  --ink: #0d0c08;
  --ink-2: #17150d;
  --panel: #1a1710;
  --panel-2: #211d12;
  --yellow: #ffcf3f;
  --yellow-2: #ffe08a;
  --amber: #e8a92f;
  --red: #e5473c;
  --green: #7ed08a;
  --cream: #fff6dc;
  --body: #ece5cc;
  --muted: #b3a988;
  --faint: #8d8467;
  --line: #0d0c08;
  --edge: #3b3520;
  --shadow: 5px 6px 0 rgba(0, 0, 0, .72);
  --shadow-sm: 3px 3px 0 rgba(0, 0, 0, .72);
  --font-display: 'Archivo Black', Impact, 'Arial Black', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-family: var(--font-body);
  color: var(--body);
  background: var(--panel);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background-color: #12100a;
  background-image:
    linear-gradient(rgba(255, 207, 63, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 207, 63, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
p { line-height: 1.78; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }

.skip {
  position: absolute; top: -120px; left: 10px; padding: 10px;
  background: var(--yellow); border: 2px solid var(--line); z-index: 999;
  color: var(--ink); font-weight: 800;
}
.skip:focus { top: 10px; }

/* ------------------------------------------------------------------ type */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
  line-height: 1.08;
  letter-spacing: .2px;
  text-transform: uppercase;
  color: var(--cream);
}
h1 { font-size: clamp(32px, 5vw, 62px); }
h2 { font-size: clamp(22px, 3.1vw, 37px); }
h3 { font-size: clamp(17px, 2vw, 23px); }
strong { font-weight: 800; color: var(--cream); }
em { font-style: normal; }
::selection { background: var(--yellow); color: var(--ink); }

/* --------------------------------------------------------------- ribbon */
.top-ribbon {
  position: relative;
  background: var(--ink);
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}
.top-ribbon::after {
  content: ""; display: block; height: 6px;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
}
.ribbon-in {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 9px 0; flex-wrap: wrap;
}
.ping {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-right: 8px;
  box-shadow: 0 0 0 3px rgba(229, 71, 60, .25);
  animation: blip 2.2s infinite;
}
@keyframes blip { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* --------------------------------------------------------------- header */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13, 12, 8, .94);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 2px 0 rgba(255, 207, 63, .18);
}
.bar {
  min-height: 76px;
  display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 12px; line-height: 1; min-width: 0; }
.brand img {
  width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid var(--yellow);
  box-shadow: var(--shadow-sm);
  transform: rotate(-3deg);
  background: var(--panel-2);
}
.brand span {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.5vw, 18px);
  text-transform: uppercase;
  line-height: 1.16;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--cream);
}
.brand em { color: var(--yellow); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav li > a {
  display: inline-block;
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  padding: 8px 0; white-space: nowrap; color: var(--body);
}
.nav li > a:hover { color: var(--yellow); }
.nav li > a .caret {
  display: inline-block; margin-left: 7px;
  font-size: 10px; line-height: 1; font-style: normal;
  color: var(--yellow);
  transition: transform .16s;
}
.nav .has-kids:hover > a .caret,
.nav .has-kids:focus-within > a .caret { transform: rotate(180deg); }
.nav li.active > a { color: var(--cream); box-shadow: inset 0 -3px 0 var(--yellow); }
.nav .kids {
  position: absolute; top: calc(100% + 4px); left: -12px;
  min-width: 240px; display: none;
  list-style: none; margin: 0; padding: 8px;
  background: #17150d; border: 2px solid var(--yellow); border-radius: 12px;
  box-shadow: var(--shadow); z-index: 60;
}
.nav .has-kids:hover .kids,
.nav .has-kids:focus-within .kids { display: block; }
.nav .kids li a {
  display: block; padding: 9px 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px; text-transform: none; color: var(--body);
}
.nav .kids li a:hover { background: var(--yellow); color: var(--ink); }
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--yellow); border: 2px solid var(--line); border-radius: 100px;
  box-shadow: var(--shadow-sm); color: var(--ink);
  padding: 11px 16px;
  font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  transition: transform .16s, box-shadow .16s;
}
.cta:hover { transform: translate(-1px, -2px); box-shadow: 5px 5px 0 rgba(0, 0, 0, .85); }

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative;
  background: var(--hero) center 30% / cover no-repeat var(--ink);
  border-bottom: 2px solid var(--line);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(9, 8, 4, .78) 0%,
    rgba(9, 8, 4, .52) 38%,
    rgba(9, 8, 4, .18) 66%,
    rgba(9, 8, 4, .02) 100%);
}
.hero-in {
  position: relative; z-index: 2;
  padding: 76px 0 66px;
  max-width: 1160px;
}
.hero-copy { max-width: 640px; color: var(--cream); }
.hero h1 { color: var(--cream); text-shadow: 0 2px 0 rgba(0, 0, 0, .55); }
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--yellow); margin: 0 0 18px;
}
.asterisk {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 30px;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--line); border-radius: 50%;
  font-size: 15px; font-style: normal;
  transform: rotate(-8deg);
}
.hero h1 { margin: 0 0 20px; text-wrap: balance; }
.lead {
  font-size: clamp(15px, 1.6vw, 17.5px);
  line-height: 1.7; color: #f4ecd3; margin: 0 0 8px; font-weight: 600;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-proof {
  margin-top: 30px; font-size: 11px; letter-spacing: 1.2px;
  color: #cfc5a5; font-weight: 700;
}
.hero-proof strong { color: var(--yellow); letter-spacing: 1.4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 20px; border-radius: 9px;
  border: 2px solid var(--line);
  background: var(--yellow); color: var(--ink);
  font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .8);
  transition: transform .16s, box-shadow .16s;
  cursor: pointer;
}
.btn:hover { transform: translate(-1px, -2px); box-shadow: 6px 6px 0 rgba(0, 0, 0, .8); }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--cream); }
.btn.ghost:hover { background: rgba(255, 246, 220, .08); }

.sticker {
  position: absolute; z-index: 3;
  font-family: var(--font-display);
  border: 3px solid var(--line);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, .7);
}
.sticker-a {
  top: 46px; right: 26px;
  width: 122px; height: 122px; border-radius: 50%;
  background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; text-align: center;
  font-size: 16px; line-height: 1.15; letter-spacing: .4px;
  transform: rotate(10deg);
}

/* ----------------------------------------------------------------- strip */
.strip {
  background: var(--yellow);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}
.strip-in {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 13px 0;
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--ink);
}

/* ------------------------------------------------------------ home body */
.home-body { padding-bottom: 80px; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 18px; margin: 64px 0 24px;
}
.overline {
  font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--yellow); margin: 0 0 8px;
}
.count-pill {
  display: inline-block;
  background: var(--panel); border: 2px solid var(--yellow); border-radius: 100px;
  box-shadow: var(--shadow-sm); color: var(--cream);
  padding: 9px 14px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  transform: rotate(3deg); white-space: nowrap; margin-bottom: 10px;
}

/* ----------------------------------------------------------------- cards */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 2px solid var(--edge); border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: 7px 9px 0 rgba(0, 0, 0, .8); border-color: var(--yellow); }
.thumb {
  position: relative; display: block;
  border-bottom: 2px solid var(--edge);
  background: var(--panel-2);
}
.thumb::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; z-index: 2;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 10px, var(--line) 10px 20px);
}
.thumb img {
  aspect-ratio: 16 / 9; width: 100%; object-fit: cover;
  transition: transform .3s;
}
.card:hover .thumb img { transform: scale(1.04); }
.thumb-pill {
  position: absolute; top: 14px; left: 12px; z-index: 3;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--line); border-radius: 100px;
  padding: 6px 11px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase;
  transform: rotate(-1.5deg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .75);
}
.card:nth-child(3n+2) .thumb-pill { background: var(--cream); }
.card:nth-child(3n+3) .thumb-pill { background: var(--amber); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 16px; }
.card-body h3 { line-height: 1.16; margin-bottom: 9px; }
.card-body h3 a { text-decoration: none; }
.card-body p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.6; color: var(--muted); flex: 1; }
.card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 2px dashed var(--edge); padding-top: 12px;
}
.go { font-size: 11px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--yellow); }
.stamp { font-size: 10px; color: var(--faint); letter-spacing: .4px; }

/* --------------------------------------------------------------- article */
.crumb {
  padding: 22px 0 0;
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--faint);
  display: flex; gap: 9px; align-items: center;
}
.crumb a:hover { color: var(--yellow); }
.crumb strong { color: var(--cream); }

.article-frame {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 46px;
  padding: 26px 0 88px;
}
.article-frame.no-side { grid-template-columns: minmax(0, 1fr); }
.no-side article { max-width: 820px; }

.side { border-right: 2px solid var(--edge); padding-right: 22px; }
.side-in { position: sticky; top: 106px; }
.side-title {
  font-size: 10px; font-weight: 800; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--yellow); margin: 0 0 4px;
}
.side ol {
  list-style: none; margin: 10px 0 18px; padding: 6px 0 16px;
  border-bottom: 2px dashed var(--edge);
}
.side li a {
  display: block; padding: 8px 0;
  font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--muted);
}
.side li a:hover { color: var(--yellow); }
.side-cta {
  display: block; background: var(--yellow); color: var(--ink);
  border: 2px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow-sm); padding: 13px 14px;
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
.side-cta span { float: right; }

article { max-width: 800px; min-width: 0; }
article h1 { margin: 6px 0 22px; }
article h2 { margin: 44px 0 14px; scroll-margin-top: 118px; }
article h3 { margin: 30px 0 10px; }
article p { font-size: 15.5px; line-height: 1.85; color: var(--body); margin: 0 0 17px; }
article a {
  color: var(--yellow); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
article a:hover { color: var(--yellow-2); }
article ul, article ol { padding-left: 24px; margin: 0 0 18px; }
article li { margin: 8px 0; line-height: 1.75; color: var(--body); }
article li::marker { color: var(--yellow); }
article blockquote {
  margin: 22px 0; padding: 6px 18px;
  border-left: 8px solid var(--yellow);
  background: var(--panel); border-radius: 0 10px 10px 0;
  color: var(--muted);
}
article img {
  border: 2px solid var(--edge); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin: 24px auto; cursor: zoom-in;
  background: var(--panel-2);
}

.answer-box {
  background: var(--panel);
  border: 2px solid var(--line); border-radius: 12px;
  box-shadow: 6px 6px 0 var(--yellow);
  padding: 18px 21px 16px;
  margin: 4px 0 30px;
}
.answer-kicker {
  font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  color: var(--yellow); margin: 0 0 8px;
}
.answer-box p { margin: 0; font-weight: 700; font-size: 15.5px; color: var(--body); }

.article-end { margin-top: 46px; }
.next-btn {
  display: inline-block;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow-sm); padding: 13px 18px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
.next-btn:hover { transform: translate(-1px, -2px); }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; margin: 24px 0 28px; }
.tbl-wrap table {
  width: 100%; min-width: 480px;
  border: 2px solid var(--line); border-radius: 12px;
  border-collapse: separate; border-spacing: 0; overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
}
.tbl-wrap th {
  background: var(--ink); color: var(--yellow);
  text-align: left; padding: 11px 13px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
}
.tbl-wrap td {
  padding: 11px 13px; border-top: 1px solid var(--edge);
  color: var(--body); vertical-align: top; line-height: 1.6;
}
.tbl-wrap tbody tr:nth-child(even) td { background: var(--panel-2); }

/* -------------------------------------------------------------- callouts */
.callout {
  border: 2px solid var(--line);
  border-left: 10px solid var(--yellow);
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .72);
  padding: 16px 19px; margin: 24px 0;
}
.callout p { margin: 0; font-size: 14.5px; }
.callout p + p { margin-top: 10px; }

/* ---------------------------------------------------------------- footer */
.foot {
  background: var(--ink); color: var(--body);
  padding: 48px 0 22px;
  margin-top: 20px;
  border-top: 2px solid var(--line);
}
.foot::before {
  content: ""; display: block; height: 6px; margin: -48px 0 42px;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 30px);
  text-transform: uppercase;
  margin: 0 0 14px; color: var(--cream);
}
.footer-brand em { color: var(--yellow); }
.disclaimer { max-width: 760px; font-size: 12px; line-height: 1.7; color: var(--faint); margin: 0 0 20px; }
.foot-links {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  border-top: 1px solid var(--edge); padding-top: 18px; margin: 26px 0 14px;
}
.foot-links a:hover { color: var(--yellow); }
.muted { font-size: 11px; color: var(--faint); margin: 0; }

/* ---------------------------------------------------------------- zoom */
main img.open { width: min(1100px, 92vw); max-width: none !important; position: relative; z-index: 5; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-frame { grid-template-columns: 200px minmax(0, 1fr); gap: 30px; }
  .sticker-a { right: 10px; width: 106px; height: 106px; font-size: 14px; }
}
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; padding: 10px 0; gap: 8px 18px; }
  .nav { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 6px 16px; }
  .nav ul { flex-wrap: wrap; gap: 4px 16px; }
  .nav .kids { left: 0; }
  .cta { padding: 9px 13px; }
  .hero-in { padding: 54px 0 48px; }
  .hero::before {
    background: linear-gradient(180deg,
      rgba(9, 8, 4, .72) 0%,
      rgba(9, 8, 4, .5) 55%,
      rgba(9, 8, 4, .42) 100%);
  }
  .sticker-a { top: 20px; right: 14px; width: 90px; height: 90px; font-size: 12px; }
  .article-frame { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 2px dashed var(--edge); padding: 0 0 18px; }
  .side-in { position: static; }
  .side ol { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ribbon-in { justify-content: center; text-align: center; }
  .ribbon-alt { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { transition: none !important; animation: none !important; }
}
