/* Origin Intelligence Blog — shared stylesheet.
 *
 * Editorial aesthetic from the v3-meta draft: serif body, warm cream
 * paper, dark ink, amber accent tag, purple highlight, single-column
 * long-form layout. Kept intentionally simple so every post is a
 * fully self-contained HTML file that can be authored by hand or
 * generated from markdown without needing a build step.
 *
 * Usage: every post links this file with a relative path and then
 * adds its own <head> (title, meta, OG, JSON-LD BlogPosting). See
 * template.html for the minimum boilerplate to copy for new posts.
 */

:root {
  --ink: #121118;
  --paper: #f9f7f1;
  --muted: #6a6572;
  --accent: #7a3aa8;
  --line: #e7e2d9;
  --amber: #c08a2f;
  --warm: #c47a2c;
  --code-bg: #faf8f2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.62 ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 28px 120px;
}

/* Blog masthead — shows on every post */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  font-family: -apple-system, ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial;
  font-size: .88rem;
}
.masthead a { color: var(--muted); text-decoration: none; }
.masthead .brand {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.masthead .brand:hover { color: var(--accent); }
.masthead nav { display: flex; gap: 18px; }
.masthead nav a:hover { color: var(--ink); }

/* Typography */
h1 {
  font-size: 2.1rem;
  line-height: 1.18;
  margin: .2em 0 .35em;
  letter-spacing: -.015em;
  font-weight: 500;
}
h2 {
  font-size: 1.32rem;
  margin: 2.3em 0 .5em;
  font-weight: 600;
  font-family: -apple-system, ui-sans-serif, system-ui;
  letter-spacing: -.005em;
}
h3 {
  font-size: 1.05rem;
  margin: 1.8em 0 .4em;
  font-weight: 600;
  font-family: -apple-system, ui-sans-serif, system-ui;
}
p { margin: .7em 0; }
.muted { color: var(--muted); font-style: italic; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* Tag pills (amber or purple) */
.tag {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-family: -apple-system, ui-sans-serif, system-ui;
  font-style: normal;
}
.tag.accent { color: var(--accent); border-color: var(--accent); }

/* Post metadata — date, author, reading time */
.post-meta {
  font-family: -apple-system, ui-sans-serif, system-ui;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.post-meta time, .post-meta .author, .post-meta .read-time { font-style: normal; }

/* Hero image block */
.hero {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 22px 0 28px;
}
.hero img { display: block; width: 100%; height: auto; }
.hero figcaption {
  padding: 10px 16px;
  font-family: -apple-system, ui-sans-serif, system-ui;
  font-size: .78rem;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--line);
}

/* Pull-quote */
.pull-quote {
  font-size: 1.2rem;
  line-height: 1.45;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 1.8em 0;
  color: var(--ink);
  font-style: italic;
}
.pull-quote cite {
  display: block;
  margin-top: 8px;
  font-size: .85rem;
  color: var(--muted);
  font-style: normal;
  font-family: -apple-system, ui-sans-serif, system-ui;
}

/* 4-frame animated infographic (adapted from v3-meta zoom frames) */
.infographic {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 28px;
  margin: 22px 0 28px;
  min-height: 260px;
  overflow: hidden;
  font-family: -apple-system, ui-sans-serif, system-ui;
}
.infographic-title {
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 18px;
  font-style: normal;
}
.frames { position: relative; height: 180px; }
.frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: cycle 16s infinite;
  transform-origin: center;
}
.frame:nth-child(1) { animation-delay: 0s; }
.frame:nth-child(2) { animation-delay: 4s; }
.frame:nth-child(3) { animation-delay: 8s; }
.frame:nth-child(4) { animation-delay: 12s; }
@keyframes cycle {
  0%, 3%     { opacity: 0; transform: scale(.97); }
  7%, 22%    { opacity: 1; transform: scale(1); }
  28%, 100%  { opacity: 0; transform: scale(1.02); }
}
.frame .big {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.08;
  margin-bottom: 10px;
  color: var(--ink);
}
.frame .big .accent { color: var(--accent); }
.frame .subline {
  color: var(--muted);
  font-size: .95rem;
  max-width: 560px;
}
.dots {
  display: flex;
  gap: 6px;
  position: absolute;
  bottom: 18px;
  left: 28px;
}
.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  animation: dot 16s infinite;
}
.dots span:nth-child(2) { animation-delay: 4s; }
.dots span:nth-child(3) { animation-delay: 8s; }
.dots span:nth-child(4) { animation-delay: 12s; }
@keyframes dot {
  0%, 3%, 28%, 100% { background: var(--line); }
  7%, 22%           { background: var(--ink); }
}

/* Plain-English stack table */
.stack {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0 24px;
  font-family: -apple-system, ui-sans-serif, system-ui;
}
.stack > div {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.stack > div:nth-last-child(-n+2) { border-bottom: none; }
.stack .k {
  background: #f5f3ea;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* Monospace code block */
pre, code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.55;
}
p code, li code {
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* Footer */
.post-footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: -apple-system, ui-sans-serif, system-ui;
  font-size: .88rem;
  color: var(--muted);
}
.post-footer a { color: var(--accent); }
.post-footer p { margin: .4em 0; }

/* Blog index — list of posts */
.post-list { list-style: none; padding: 0; margin: 30px 0; }
.post-list li {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.post-list li:last-child { border-bottom: none; }
.post-list h2 {
  margin: 0 0 4px;
  font-family: ui-serif, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -.01em;
}
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); }
.post-list .excerpt { margin: 6px 0 4px; color: var(--ink); }
.post-list .post-meta { margin: 6px 0 0; }

@media (max-width: 560px) {
  main { padding: 28px 20px 80px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.2rem; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stack { grid-template-columns: 1fr; }
  .stack > div { border-bottom: 1px solid var(--line); }
  .stack .k { background: transparent; padding-bottom: 2px; }
}
