/* RetroModLab blog concept: sethlukin.com structure (black hero, giant uppercase, pixel sprites,
   rounded panels, scroll reveals) dressed in the guides site palette (cream grid, hard shadows, Press Start 2P) */

:root {
  --cream: #fdf6e9;
  --ink: #17130e;
  --muted: #6d6357;
  --ghost: #d9cfbf; /* unlit scroll-reveal words */
  --red: #ff5b5b;
  --pink: #ffd3d3;
  --yellow: #ffc93c;
  --green: #58c274;
  --blue: #57a4ff;
  --purple: #a06bf5;
  --px-font: 'Press Start 2P', monospace;
  --bar: 48px; /* height of the black top bar */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink); /* black shows behind the rounded cream panel */
  color: var(--ink);
  font: 500 18px/1.6 'Manrope', -apple-system, sans-serif;
  overflow-x: hidden;
}
::selection { background: var(--yellow); color: var(--ink); }
a { color: inherit; }
svg.px { display: block; width: 100%; height: auto; }

/* ---------- top bar (black, sticky, like Seth's) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 24px;
  background: var(--ink); color: #fff;
  font-weight: 800; font-size: 15px; letter-spacing: -.01em; text-transform: uppercase;
}
.topbar a { text-decoration: underline; text-underline-offset: 3px; }
.topbar .mid { justify-self: center; }
.topbar .end { justify-self: end; }

/* ---------- hero (black, stays put while the cream panel slides over it) ---------- */
.hero {
  position: sticky; top: var(--bar); z-index: 0;
  height: calc(100svh - var(--bar));
  min-height: 520px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff;
  overflow: hidden;
}
.name {
  display: flex; align-items: center; justify-content: center; gap: 1.6vw;
  width: 100%; margin: 0; padding: 0 1.5vw;
  font-weight: 800; text-transform: uppercase; letter-spacing: -.055em; line-height: .8;
  font-size: 11.4vw;
}
.name span { display: block; }
.mascot { position: relative; width: 12vw; flex: none; }
.mascot .ds { animation: idle 1.2s steps(2) infinite; }
.mascot .ds svg { /* white sticker outline so the ink edge reads on black, like Seth's sprite */
  filter: drop-shadow(4px 0 0 #fff) drop-shadow(-4px 0 0 #fff) drop-shadow(0 4px 0 #fff) drop-shadow(0 -4px 0 #fff);
}
@keyframes idle { 50% { transform: translateY(-.35vw); } }

/* pixel speech bubble: notched corners from four flat box-shadows */
.bubble {
  position: absolute; left: 50%; bottom: calc(100% + 2.4vw);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: .9vw 1.6vw .8vw;
  background: var(--ink); color: #fff;
  font-weight: 800; font-size: 2.4vw; letter-spacing: -.03em; line-height: 1;
  box-shadow: 0 -4px 0 #fff, 0 4px 0 #fff, -4px 0 0 #fff, 4px 0 0 #fff;
  animation: pop .5s steps(3) both .3s;
}
.bubble::after { /* pixel tail */
  content: ''; position: absolute; left: 50%; top: calc(100% + 4px); width: 8px; height: 8px;
  background: #fff; transform: translateX(-50%);
  box-shadow: 0 8px 0 -0px #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
@keyframes pop { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }

/* four corner labels around the hero, like Seth's */
.corner {
  position: absolute; z-index: 2;
  font-weight: 800; font-size: 15px; line-height: 1.25; text-transform: uppercase; letter-spacing: -.01em;
}
.corner.bl { left: 24px; bottom: 24px; }
.corner.br { right: 24px; bottom: 24px; text-align: right; }
.corner.bc { left: 50%; bottom: 26px; transform: translateX(-50%); width: 22px; animation: nudge 1.4s steps(2) infinite; }
@keyframes nudge { 50% { transform: translate(-50%, 4px); } }

/* ---------- cream panel that slides over the hero ---------- */
.panel {
  position: relative; z-index: 2;
  background-color: var(--cream);
  background-image:
    linear-gradient(rgba(23, 19, 14, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 19, 14, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  border-radius: 36px;
  overflow: hidden; /* clips clouds and keeps the rounded bottom clean */
  margin-bottom: 0;
}

/* drifting pixel clouds */
.sky { position: relative; height: 340px; }
.cloud { position: absolute; width: 220px; animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
.hills { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; }

/* scroll-lit manifesto */
.manifesto {
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 160px;
  text-align: center; text-transform: uppercase;
  font-weight: 800; letter-spacing: -.035em; line-height: 1.05;
  font-size: clamp(30px, 4.6vw, 68px);
}
.manifesto .w { color: var(--ghost); transition: color .25s; }
.manifesto .w.lit { color: var(--ink); }
.manifesto mark { /* highlighted words, guides-site style */
  display: inline-block; padding: 0 .18em .04em; margin: .06em 0;
  border: 3px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 var(--ink);
  background: var(--yellow); color: inherit;
  transform: rotate(-1.5deg);
}
.manifesto mark.blue { background: var(--blue); transform: rotate(1.2deg); }
.manifesto mark.green { background: var(--green); transform: rotate(-1deg); }

/* ---------- latest posts ---------- */
.posts { position: relative; padding: 40px 0 120px; }
.scatter { position: absolute; width: 28px; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.giant {
  margin: 0; padding: 0 1.5vw;
  text-align: center; text-transform: uppercase;
  font-weight: 800; letter-spacing: -.055em; line-height: .86;
  font-size: 11.6vw;
}

/* sticky category pills with pixel icons */
.filters {
  position: sticky; top: calc(var(--bar) + 12px); z-index: 20;
  display: flex; gap: 10px; width: max-content; max-width: calc(100% - 32px);
  margin: 28px auto 56px; padding: 8px;
  overflow-x: auto; scrollbar-width: none;
  background: #fff; border: 3px solid var(--ghost); border-radius: 16px;
}
.filters::-webkit-scrollbar { display: none; }
.pill {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 10px 16px 10px 12px;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ghost); border-radius: 12px;
  font: 800 20px/1 'Manrope', sans-serif; letter-spacing: -.02em; text-transform: uppercase;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.pill svg { width: 24px; }
.pill:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.pill[aria-pressed='true'] { background: var(--pink); border-color: var(--red); }
.pill:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }

.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px;
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
}
.card {
  display: flex; flex-direction: column;
  background: #fff; text-decoration: none;
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 7px 7px 0 var(--ink);
  overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--ink); }
.card:focus-visible { outline: 4px dashed var(--ink); outline-offset: 5px; }
.card.featured { grid-column: span 2; flex-direction: row; }
.card .cover {
  position: relative; aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  border-bottom: 3px solid var(--ink);
}
.card.featured .cover { aspect-ratio: auto; flex: 1.1; border-bottom: 0; border-right: 3px solid var(--ink); min-height: 340px; }
.card .cover svg { width: 32%; max-width: 140px; }
.card .tag {
  position: absolute; top: 14px; left: 14px;
  padding: 8px 10px 6px; background: #fff;
  border: 3px solid var(--ink); border-radius: 999px;
  font: 9px/1 var(--px-font); text-transform: uppercase;
}
.card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card.featured .body { justify-content: center; padding: 34px 36px; }
.card time { font: 10px/1.4 var(--px-font); color: var(--muted); }
.card h3 { margin: 0; font-size: 23px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.card.featured h3 { font-size: clamp(26px, 2.4vw, 34px); }
.card p { margin: 0; font-size: 16px; line-height: 1.55; color: #3b342b; }
.card .soon { font: 9px/1 var(--px-font); color: var(--muted); margin-top: auto; padding-top: 8px; }
.card[hidden] { display: none; }

/* ---------- what I tinker with: list scales toward the viewport centre ---------- */
.tinker { position: relative; padding: 120px 24px 140px; text-align: center; }
.tinker .label { font: 12px/1 var(--px-font); text-transform: uppercase; color: var(--muted); }
.tinker ul { list-style: none; margin: 34px 0 0; padding: 0; }
.tinker li {
  font-weight: 800; text-transform: uppercase; letter-spacing: -.035em; line-height: 1.12;
  font-size: 40px; color: var(--muted);
  transition: font-size .15s linear, color .15s linear;
}
.stamp {
  position: absolute; width: 130px; aspect-ratio: 1;
  padding: 9px;
  background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 12px 12px; /* pixel checker frame */
  border: 3px solid var(--ink);
  text-decoration: none;
  transition: transform .2s;
}
.stamp:hover { transform: rotate(0deg) scale(1.06) !important; }
.stamp div {
  height: 100%; display: grid; place-items: center; text-align: center;
  border: 3px solid var(--ink);
  font: 10px/1.5 var(--px-font); text-transform: uppercase; padding: 6px;
}

/* ---------- footer: black, its top tucked under the panel's rounded bottom corners ---------- */
.foot {
  position: relative; z-index: 1; /* above the sticky hero, below the panel */
  min-height: calc(100svh - var(--bar));
  display: flex; flex-direction: column; justify-content: center;
  padding: 80px 24px 120px; margin-top: -36px; /* tuck under the panel's rounded corners */
  background: var(--ink); color: #fff;
}
.foot h2 {
  margin: 0;
  font-weight: 800; text-transform: uppercase; letter-spacing: -.055em; line-height: .86;
  font-size: 10.5vw;
}
.foot h2 span { display: block; }
.foot h2 span + span { padding-left: 26vw; }
.foot .actions { display: flex; gap: 24px; flex-wrap: wrap; justify-content: flex-end; margin-top: 30px; }
.ghostbtn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 30px; border: 4px solid #fff; border-radius: 999px;
  font-weight: 800; font-size: clamp(20px, 2.4vw, 34px); letter-spacing: -.03em; text-transform: uppercase;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.ghostbtn svg { width: 34px; }
.ghostbtn:hover { background: #fff; color: var(--ink); }
.ghostbtn:hover svg rect { fill: var(--ink); }
.foot .meta {
  position: absolute; left: 24px; right: 24px; bottom: 24px;
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
  font-weight: 800; font-size: 15px; line-height: 1.3; text-transform: uppercase; letter-spacing: -.01em;
}
.foot .colon { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.foot .fine { max-width: 420px; font-weight: 500; font-size: 12px; text-transform: none; letter-spacing: 0; color: #a39a8c; }
.foot .fine a { color: #fff; }

/* ---------- post page ---------- */
.post-head { max-width: 980px; margin: 0 auto; padding: 70px 24px 40px; }
.back { font: 10px/1 var(--px-font); text-decoration: none; text-transform: uppercase; }
.back:hover { color: var(--red); }
.post-meta { display: flex; align-items: center; gap: 14px; margin-top: 36px; }
.chip {
  padding: 9px 12px 7px; border: 3px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  font: 10px/1 var(--px-font); text-transform: uppercase;
}
.post-meta time { font: 10px/1 var(--px-font); color: var(--muted); }
.post-head h1 {
  margin: 22px 0 0; max-width: 20ch;
  font-weight: 800; letter-spacing: -.04em; line-height: 1.02;
  font-size: clamp(38px, 6vw, 78px);
}
.post-head .lede { max-width: 640px; margin: 24px 0 0; font-size: 21px; color: #3b342b; }
.post-cover {
  max-width: 980px; margin: 0 auto 60px; height: 320px;
  display: grid; place-items: center;
  border: 3px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink);
}
.post-cover svg { width: 150px; }
.wrapcover { padding: 0 24px; }

.prose { max-width: 700px; margin: 0 auto; padding: 0 24px 120px; font-size: 19px; line-height: 1.72; }
.prose h2 { margin: 2.2em 0 .5em; font-size: 31px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.prose a { text-decoration-color: var(--red); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.prose a:hover { background: var(--yellow); }
.prose strong { font-weight: 800; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul li { position: relative; padding-left: 26px; margin: .35em 0; }
.prose ul li::before { content: ''; position: absolute; left: 0; top: .62em; width: 10px; height: 10px; background: var(--red); } /* pixel bullet */
.prose code {
  padding: .1em .35em; font-size: .86em;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px;
}
.prose pre { padding: 18px 20px; overflow-x: auto; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: 6px 6px 0 var(--yellow); }
.prose pre code { background: none; border: 0; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; background: #fff; border: 3px solid var(--ink); }
.prose th, .prose td { padding: 10px 12px; border: 2px solid var(--ink); text-align: left; vertical-align: top; }
.prose th { background: var(--yellow); }
.prose hr { border: 0; height: 6px; margin: 3em 0; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 12px); }
.more { max-width: 1180px; margin: 0 auto; padding: 0 0 120px; }
.more .label { display: block; text-align: center; margin-bottom: 34px; font: 12px/1 var(--px-font); text-transform: uppercase; color: var(--muted); }
.more .grid { grid-template-columns: repeat(2, 1fr); max-width: 900px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .topbar { font-size: 12px; padding: 0 16px; white-space: nowrap; grid-template-columns: 1fr 1fr; }
  .topbar .hide-m { display: none; } /* guides link is in the footer too */
  .topbar .mid { justify-self: start; }
  .name { flex-direction: column; font-size: 23vw; gap: 4vw; }
  .mascot { width: 30vw; }
  .bubble { /* sits to the right of the DS, wrapped over three lines */
    left: calc(100% + 3vw); bottom: auto; top: -3vw; width: 26vw;
    white-space: normal; text-align: left; font-size: 4.2vw; line-height: 1.05;
    transform: none; animation: none;
  }
  .bubble::after { display: none; }
  .scatter { display: none; }
  .corner { font-size: 11px; }
  .corner.bl { left: 16px; } .corner.br { right: 16px; }
  .sky { height: 220px; }
  .cloud { width: 140px; }
  .grid { grid-template-columns: 1fr; gap: 26px; padding: 0 16px; }
  .card.featured { grid-column: auto; flex-direction: column; }
  .card.featured .cover { min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 3px solid var(--ink); }
  .filters { margin: 22px 16px 40px; width: auto; }
  .pill { font-size: 16px; padding: 8px 12px 8px 10px; }
  .pill svg { width: 20px; }
  .tinker { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 80px 16px 100px; }
  .tinker .label, .tinker ul { flex-basis: 100%; }
  .tinker .label { order: -1; margin: 0 0 10px; }
  .stamp { position: static; width: 74px; } /* a row of stamps above the list instead of floating over it */
  .stamp div { font-size: 6px; padding: 3px; }
  .foot h2 span + span { padding-left: 10vw; }
  .foot .actions { justify-content: flex-start; }
  .foot .meta { flex-wrap: wrap; font-size: 11px; left: 16px; right: 16px; }
  .post-head { padding: 48px 16px 30px; }
  .wrapcover { padding: 0 16px; }
  .post-cover { height: 200px; }
  .prose { padding: 0 16px 90px; font-size: 18px; }
  .more .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
