/* Writ blog — shared styles for blog.writ.build */

/* ---- base ---- */
html, body { margin: 0; padding: 0; background: #f4f5f7; color: #14181f; }
body {
  font-family: 'Instrument Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }

a { color: #3557c7; text-decoration: none; border-bottom: 1px solid #b9c6ea; }
a:hover { color: #22398c; border-bottom-color: #22398c; }
::selection { background: #dbe4fb; }

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---- keyframes (explainer) ---- */
@keyframes orbitDot { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }
@keyframes pulseGate { 0%, 100% { box-shadow: 0 0 0 0 rgba(53,87,199,0.35); } 50% { box-shadow: 0 0 0 10px rgba(53,87,199,0); } }
@keyframes slideAction { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 45% { transform: translateX(150px); } 55% { transform: translateX(150px); } 90% { transform: translateX(300px); opacity: 1; } 100% { transform: translateX(300px); opacity: 0; } }
@keyframes slideDenied { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 45% { transform: translateX(150px); } 60% { transform: translateX(150px) translateY(0); opacity: 1; } 100% { transform: translateX(150px) translateY(46px); opacity: 0; } }
@keyframes checkFlash { 0%, 40% { background: #1c2230; color: #8b96ab; } 48%, 62% { background: #234a2e; color: #7fd99a; } 70%, 100% { background: #1c2230; color: #8b96ab; } }
@keyframes denyFlash { 0%, 40% { background: #1c2230; color: #8b96ab; } 48%, 70% { background: #4a2323; color: #e08c8c; } 78%, 100% { background: #1c2230; color: #8b96ab; } }
@keyframes budgetDrip { 0%, 20% { width: 100%; } 80%, 100% { width: 38%; } }
@keyframes fadeCycle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes rowAppear { 0% { opacity: 0; transform: translateY(4px); } 8% { opacity: 1; transform: translateY(0); } 100% { opacity: 1; transform: translateY(0); } }

/* ---- keyframes (design paper) ---- */
@keyframes reconcileLoop { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fpFill { 0%, 15% { width: 20%; } 40% { width: 55%; } 65% { width: 80%; } 88%, 100% { width: 100%; } }
@keyframes fpTick { 0%, 84% { opacity: 0.3; transform: scale(0.9); } 90%, 100% { opacity: 1; transform: scale(1); } }
@keyframes attFade { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ---- page frame ---- */
.page { min-height: 100vh; background: #f4f5f7; }

.masthead {
  border-bottom: 1px solid #e2e5ea;
  background: #f4f5f7f2;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.masthead__inner {
  max-width: 1040px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 14px;
}
.brand__name { font-weight: 600; letter-spacing: 0.02em; }
.brand__sep { color: #9aa2ae; }
.brand__url { color: #5b6472; }
.topnav { display: flex; gap: 22px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; }
.topnav a { border-bottom: none; color: #5b6472; }

/* ---- hero ---- */
.hero { max-width: 720px; margin: 0 auto; padding: 72px 28px 8px; }
.hero__meta {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: #3557c7;
  display: flex; gap: 14px; align-items: center;
}
.tag { background: #e5ebfa; padding: 3px 10px; border-radius: 3px; }
.hero__time { color: #9aa2ae; }
.hero h1 {
  font-size: 52px; line-height: 1.06; letter-spacing: -0.025em; font-weight: 700;
  margin: 22px 0 18px; text-wrap: balance;
}
.hero__lede { font-size: 20px; line-height: 1.55; color: #4a5260; margin: 0; text-wrap: pretty; }

/* ---- thesis pull quote (under hero) ---- */
.thesis { max-width: 720px; margin: 44px auto 0; padding: 0 28px; }

/* ---- article prose ---- */
.article {
  max-width: 720px; margin: 0 auto; padding: 0 28px 40px;
  font-size: 17.5px; line-height: 1.7; color: #262c36;
}
.article h2 { font-size: 28px; letter-spacing: -0.015em; margin: 48px 0 14px; color: #14181f; }
.article h3 {
  font-size: 20px; margin: 30px 0 12px; color: #14181f;
  font-family: 'IBM Plex Mono', monospace; font-weight: 600;
}
.article p { margin: 0 0 16px; text-wrap: pretty; }

/* inline code chip */
.article code {
  font-family: 'IBM Plex Mono', monospace; font-size: 15px;
  background: #e8eaef; padding: 1px 6px; border-radius: 4px;
}

/* ---- dark code block ---- */
.code {
  background: #10141c; border-radius: 10px; padding: 20px 24px; margin: 28px 0;
  font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; line-height: 1.8;
  color: #c6cddb; overflow-x: auto;
}
.code .gap { height: 12px; }
/* yaml token colors */
.tk-d { color: #7a86a0; }   /* declaration key: writ:/holder: */
.tk-k { color: #f0c674; }   /* clause key: mandate:/grants: … */
.tk-s { color: #9fd0a2; }   /* string */
.tk-p { color: #e0a3f5; }   /* purple: assent / judgment */
.tk-b { color: #8fb8f6; }   /* blue: letter */
.tk-c { color: #55617a; }   /* dim / comment */

/* ---- cards & grids ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.card { background: #fff; border: 1px solid #e2e5ea; border-radius: 8px; padding: 18px; }
.card__label {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; color: #3557c7;
}
.card__body { font-size: 14.5px; line-height: 1.55; color: #4a5260; margin-top: 8px; }

/* ---- callout ---- */
.callout {
  background: #eef2fb; border: 1px solid #d3ddf3; border-radius: 8px;
  padding: 16px 20px; margin: 20px 0; font-size: 15.5px; line-height: 1.55; color: #2a3140;
}

/* ---- pull quote ---- */
.pullquote {
  border-left: 3px solid #3557c7; padding: 6px 0 6px 24px;
  font-family: 'Newsreader', Georgia, serif; line-height: 1.4; color: #1c2230; font-style: italic;
}
.pullquote--lg { font-size: 25px; }
.pullquote--md { font-size: 22px; line-height: 1.45; margin: 24px 0; }

/* ---- figures ---- */
.fig { margin: 28px 0; }
.figcap {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #7a828f;
  margin-top: 12px; text-align: center;
}

/* ---- CTA ---- */
.cta {
  background: #fff; border: 1px solid #e2e5ea; border-radius: 10px; padding: 28px 30px;
  margin: 52px 0 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.cta__title { font-weight: 600; font-size: 18px; }
.cta__sub { font-size: 15px; color: #5b6472; margin-top: 4px; }
.cta--dark { background: #10141c; border-radius: 12px; padding: 30px 32px; margin: 44px 0 22px; color: #f4f5f7; }

.btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 14px; padding: 12px 22px;
  border-radius: 6px; border-bottom: none; white-space: nowrap;
}
.btn--solid { background: #14181f; color: #f4f5f7; }

/* ---- footer ---- */
.footer { border-top: 1px solid #e2e5ea; margin-top: 24px; }
.footer__inner {
  max-width: 720px; margin: 0 auto; padding: 26px 28px;
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #9aa2ae;
}

/* ---- responsive ---- */
@media (max-width: 760px) {
  .masthead__inner { padding: 12px 20px; }
  .brand__sep, .brand__url { display: none; }
  .topnav { gap: 14px; font-size: 12px; }

  .hero { padding: 48px 20px 8px; }
  .hero__meta { flex-wrap: wrap; gap: 10px; }
  .hero h1 { font-size: 40px; line-height: 1.08; }
  .hero__lede { font-size: 18px; line-height: 1.55; }

  .thesis { margin-top: 34px; padding: 0 20px; }
  .article { padding: 0 20px 32px; font-size: 16.5px; line-height: 1.68; }
  .article h2 { font-size: 25px; margin-top: 40px; }
  .article h3 { font-size: 18px; }
  .article code { font-size: 0.84em; overflow-wrap: anywhere; }

  .explainer-hero-figure {
    margin: 38px auto !important;
    padding: 0 20px !important;
  }
  .comparison-grid { grid-template-columns: minmax(0, 1fr) !important; }

  .writ-anatomy { grid-template-columns: minmax(0, 1fr) !important; }
  .writ-anatomy__code { border-radius: 10px !important; }
  .writ-anatomy__notes { display: none !important; }

  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .grid2 > *, .grid3 > * { min-width: 0; }
  .clause-row { grid-template-columns: minmax(0, 1fr) !important; gap: 4px !important; }
  .fixpoint-layout { flex-direction: column; gap: 24px !important; }
  .fixpoint-layout > :last-child { width: 100%; }
  .attenuation-grid { grid-template-columns: minmax(0, 1fr) !important; }

  .authority-node { width: min(300px, 100%) !important; }

  .code { max-width: 100%; padding: 18px; font-size: 12px; }
  .record-sample { line-height: 1.55 !important; }
  .record-row {
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 2px 8px;
    padding: 7px 0;
  }
  .record-row > :last-child { grid-column: 2; }
  .record-row--header > :last-child { display: none; }

  .pullquote { padding-left: 18px; }
  .pullquote--lg { font-size: 22px; }
  .pullquote--md { font-size: 20px; }

  .cta, .cta--dark { padding: 24px 20px; }
  .cta { align-items: flex-start; margin-top: 42px; }
  .cta .btn { width: 100%; text-align: center; }
  .cta-actions { display: grid !important; grid-template-columns: minmax(0, 1fr); }
  .cta-actions .btn { white-space: normal; text-align: center; }

  .footer__inner {
    padding: 22px 20px;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 36px; }
  .topnav { gap: 12px; font-size: 11.5px; }
  .explainer-hero-figure { padding: 0 16px !important; }
  .comparison-grid > div { padding: 22px 18px !important; }
  .figcap { font-size: 11px; }
}
