/* ===================================================================
   Zol's Game World — resource page styles (KAN-627/628).

   THE single source of resource-content styling, referenced by BOTH
   containers: the in-app Resources view (a <link> in the root layout;
   colour tokens come from globals.css per the user's theme) AND the
   public static pages (rendered by backend/resources/public_render.py,
   which inlines the Midnight --zgw-* tokens since it has no theme system).

   Contains ONLY the .zgw-res rules — every colour resolves from --zgw-*
   tokens (no hex), and the type faces from --zgw-font-*. The container
   provides the tokens; this file is theme-agnostic.
   =================================================================== */

.zgw-res {
  --res-display: var(--zgw-font-display, system-ui, sans-serif);
  --res-body:    var(--zgw-font-body, Georgia, serif);
  --res-mono:    var(--zgw-font-mono, ui-monospace, monospace);

  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) 1rem 4rem;
  color: var(--zgw-text);
  font-family: var(--res-body);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.zgw-res p { margin: 0 0 1.25rem; }
.zgw-res p:last-child { margin-bottom: 0; }

/* ---------- Masthead ---------- */

.zgw-res__kicker {
  font-family: var(--res-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--zgw-accent);
  margin: 0 0 1.25rem;
}

.zgw-res__title {
  font-family: var(--res-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
  text-wrap: balance;
}

.zgw-res__brand {
  display: block;
  color: var(--zgw-muted);
  font-weight: 500;
  font-size: 0.42em;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

/* ---------- Lede ---------- */

.zgw-res__lede {
  font-size: 1.15rem;
  line-height: 1.62;
}

.zgw-res__lede::first-letter {
  font-family: var(--res-display);
  font-weight: 800;
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  color: var(--zgw-accent);
}

/* ---------- Sections ---------- */

.zgw-res__section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--zgw-border);
}

.zgw-res__section > h2 {
  font-family: var(--res-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

/* ---------- whoami ---------- */

.zgw-res__cmd {
  font-family: var(--res-mono);
  font-size: 0.9rem;
  background: var(--zgw-surface);
  border: 1px solid var(--zgw-border);
  border-radius: 0.4rem;
  padding: 0.65rem 0.9rem;
  margin: 0 0 1.5rem;
}

.zgw-res__prompt {
  color: var(--zgw-accent);
  margin-right: 0.5rem;
  user-select: none;
}

.zgw-res__caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.15em;
  background: var(--zgw-accent);
  transform: translateY(0.15em);
  animation: zgw-res-blink 1.15s steps(1) infinite;
}

@keyframes zgw-res-blink { 50% { opacity: 0; } }

.zgw-res__handle {
  font-family: var(--res-display);
  font-weight: 700;
  color: var(--zgw-accent);
  letter-spacing: -0.01em;
}

/* ---------- Pull line ---------- */

.zgw-res__pull {
  font-family: var(--res-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 4.4vw, 1.85rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--zgw-accent);
  text-wrap: balance;
  margin: 0 0 1.75rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--zgw-accent);
}

/* ---------- Emphasis ---------- */

.zgw-res__annual {
  border-bottom: 2px solid var(--zgw-accent);
  padding-bottom: 1px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .zgw-res *,
  .zgw-res *::before,
  .zgw-res *::after {
    animation: none !important;
    transition: none !important;
  }
}
