/* ============================================================
   ericgang.com/blog — long-form reading layout.
   Reuses the root tokens + shared components from /styles.css
   (brand, nav-cta, btn, grain, ambient duotone backdrop) and
   adds scrolling-document typography the single-screen home
   page deliberately doesn't have.
   ============================================================ */

/* The home page pins .stage to 100svh; blog pages are documents that scroll. */
body.doc { height: auto; min-height: 100%; }

.doc-shell {
  position: relative; z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1rem, 2.6vh, 1.8rem) clamp(1.2rem, 5vw, 2rem) clamp(3rem, 8vh, 5rem);
}

/* Header reuses .site-header/.brand/.brand-mark/.brand-text/.nav-cta from /styles.css. */
.doc-shell .site-header { margin-bottom: clamp(2rem, 6vh, 3.5rem); }
.doc-nav { display: flex; align-items: center; gap: 0.7rem; }

/* ---------- Article ---------- */
.post-head { margin-bottom: clamp(1.8rem, 5vh, 2.8rem); }
.post-kicker {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--green); margin-bottom: 1.1rem;
}
.post-kicker .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 10px 1px var(--glow-green);
}
.post-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.04; letter-spacing: -0.03em;
  padding-bottom: 0.08em;
  background: linear-gradient(180deg, #ffffff 0%, #c9d1ce 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.post-meta {
  margin-top: 1rem; font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
}

/* ---------- Prose ---------- */
.prose { font-size: 1.06rem; color: #dfe4e2; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem); color: var(--text);
  margin-top: clamp(2.2rem, 6vh, 3rem); padding-top: 0.2rem;
}
.prose h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.16rem; color: var(--text); margin-top: 1.9rem;
}
.prose p, .prose li { color: #d3d9d6; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); font-style: italic; }
.prose a {
  color: var(--green);
  background-image: linear-gradient(var(--green), var(--green));
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.3s var(--ease);
}
.prose a:hover { background-size: 100% 1px; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.5rem; }
.prose code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 0.12em 0.4em; border-radius: 5px; color: var(--cyan);
}
.prose blockquote {
  margin: 1.6rem 0; padding: 0.9rem 1.2rem;
  border-left: 2px solid var(--green); background: rgba(74, 222, 128, 0.05);
  border-radius: 0 8px 8px 0; color: var(--text);
}
.prose blockquote p { color: var(--text); font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: clamp(2rem, 5vh, 2.8rem) 0; }

/* ---------- Figures ----------
   The Tribute screenshots are light-on-cream sitting in a dark document.
   They get a frame and a shadow to seat them on the page — deliberately no
   brightness/opacity filter, because a dimmed screenshot isn't the screenshot. */
.prose figure {
  margin-top: clamp(2rem, 5.5vh, 3rem);
  margin-bottom: clamp(2rem, 5.5vh, 3rem);
}
.prose figure img,
.prose figure video {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2);
  box-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.95);
}
.prose figcaption {
  margin-top: 0.8rem;
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.65;
  color: var(--muted-2);
  max-width: 74ch; /* a breakout figure must not drag its caption to 140+ chars */
}
.prose figcaption b { color: var(--muted); font-weight: 500; }

/* Dense UI shots break past the 760px measure so the small type stays legible. */
.fig-wide {
  width: min(1080px, calc(100vw - 2.4rem));
  margin-left: 50%;
  transform: translateX(-50%);
}
@media (max-width: 820px) {
  .fig-wide { width: 100%; margin-left: 0; transform: none; }
}

/* Pull-through CTA to the live project */
.post-cta {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  margin-top: clamp(2.4rem, 6vh, 3.2rem); padding-top: clamp(1.6rem, 4vh, 2.2rem);
  border-top: 1px solid var(--line);
}

/* ---------- Blog index / listing ---------- */
.list-head { margin-bottom: clamp(2rem, 6vh, 3rem); }
.list-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #c9d1ce 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.1em;
}
.list-sub { color: var(--muted); margin-top: 0.8rem; max-width: 52ch; }

.post-list { list-style: none; display: grid; gap: 1rem; }
.post-card {
  display: block; padding: clamp(1.2rem, 3vw, 1.6rem);
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.015);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}
.post-card:hover { border-color: rgba(74, 222, 128, 0.4); transform: translateY(-2px); background: rgba(74, 222, 128, 0.04); }
.post-card:focus-visible { border-color: var(--green); }
.post-card-date { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.post-card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.28rem; letter-spacing: -0.02em; color: var(--text); margin: 0.5rem 0 0.5rem; }
.post-card-excerpt { color: var(--muted); font-size: 0.98rem; }

/* ---------- Footer ---------- */
.doc-footer {
  margin-top: clamp(2.6rem, 7vh, 4rem); padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted-2);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; justify-content: space-between;
}
.doc-footer a { color: var(--muted); }
.doc-footer a:hover { color: var(--green); }

@media (max-width: 600px) {
  .doc-footer { flex-direction: column; }
}
