/* ==================================================================
   AdWizards v3 — Blog. Same design system as v3.css ("Feed to Film"),
   rebuilt standalone so blog pages load ZERO of the landing's JS/CSS
   weight. Tokens: .claude/skills/adwizards-design/DESIGN.md
   No GSAP — reveals are CSS + one tiny IntersectionObserver.
   ================================================================== */

:root {
  --bg: #060608;
  --bg-elev: #0b0b0f;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #f2f2ef;
  --ink-2: rgba(242, 242, 239, 0.64);
  --ink-3: rgba(242, 242, 239, 0.4);
  --blue: #7c5cff;
  --pink: #c77dff;
  --silver: #c9cbd1;
  --grad: linear-gradient(90deg, var(--blue), var(--pink));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-d: "Poppins", sans-serif;
  --font-b: "Atkinson Hyperlegible", sans-serif;
  --font-m: "IBM Plex Mono", ui-monospace, monospace;
  --pad: clamp(20px, 4vw, 48px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

img, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* film grain (CSS only — no JS) */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-4%, -4%); }
  80% { transform: translate(6%, 6%); }
}

/* ---------- primitives ---------- */

.mono {
  font-family: var(--font-m);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }

h1, h2, h3 { font-family: var(--font-d); font-weight: 600; color: var(--ink); }

.grad {
  background: linear-gradient(110deg, #9d7bff 0%, #cdb8ff 30%, #e2a6ff 50%, #9d7bff 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: grad-sheen 7s ease-in-out infinite;
}

@keyframes grad-sheen {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* buttons — identical register to v3 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.4); }

.btn-primary {
  background: linear-gradient(180deg, #8467ff 0%, #6a48f2 55%, #5d3ce8 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 26px rgba(104, 72, 242, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 32px rgba(104, 72, 242, 0.52);
}

.btn-ghost { background: rgba(255,255,255,0.02); backdrop-filter: blur(6px); }
.btn-lg { padding: 18px 34px; font-size: 17px; }

/* reveals — IO adds .in; content is visible without JS too (default in
   articles is opacity 1; only [data-reveal] starts hidden, and a
   <noscript> fallback plus reduced-motion rules force it visible) */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .grain { animation: none; }
  .grad { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==================================================================
   NAV (same as landing)
   ================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  background: linear-gradient(rgba(6, 6, 8, 0.82), rgba(6, 6, 8, 0.55) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-brand { display: flex; align-items: baseline; gap: 12px; }

.nav-wordmark {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.nav-tag {
  font-size: 10px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

.nav-links { display: flex; gap: 34px; }

.nav-links a {
  font-family: var(--font-d);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav-links a:hover::after, .nav-links a[aria-current]::after { transform: scaleX(1); }

.nav-cta-wrap { display: flex; align-items: center; gap: 14px; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-burger span { width: 24px; height: 2px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s; }

.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(6, 6, 8, 0.97);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.nav-mobile.open { display: flex; }

.nav-mobile a:not(.btn) {
  font-family: var(--font-d);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta-wrap .btn { display: none; }
  .nav-burger { display: flex; }
}

/* ==================================================================
   BLOG INDEX
   ================================================================== */

.blog-hero { padding: clamp(150px, 20vw, 210px) 0 clamp(48px, 6vw, 72px); position: relative; }

.blog-hero-glow {
  position: absolute;
  left: 50%;
  top: -30%;
  transform: translateX(-50%);
  width: min(1100px, 100vw);
  height: 640px;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(124, 58, 237, 0.22) 0%,
      rgba(92, 124, 255, 0.08) 50%,
      transparent 75%);
}

.blog-hero .eyebrow { display: block; margin-bottom: 22px; }

.blog-hero h1 {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.blog-hero .sub {
  margin-top: 22px;
  max-width: 560px;
  color: var(--ink-2);
}

.post-list { padding: clamp(24px, 4vw, 48px) 0 clamp(90px, 10vw, 140px); }

.post-card {
  display: block;
  border-top: 1px solid var(--line);
  padding: clamp(30px, 4vw, 44px) clamp(14px, 2vw, 24px);
  margin: 0 clamp(-24px, -2vw, -14px);
  border-radius: 4px;
  position: relative;
  transition: background 0.25s ease;
}

.post-card:hover { background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 70%); }

.post-card:last-child { border-bottom: 1px solid var(--line); }

.post-card-inner { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: clamp(18px, 4vw, 60px); align-items: baseline; }

@media (max-width: 720px) { .post-card-inner { grid-template-columns: 1fr; gap: 12px; } }

.post-card h2 {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}

.post-card h2 .arrow {
  display: inline-block;
  margin-left: 10px;
  transform: translateX(-6px);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
  background: linear-gradient(110deg, #9d7bff, #cdb8ff, #e2a6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.post-card:hover h2 .arrow { transform: translateX(0); opacity: 1; }

.post-card .dek { margin-top: 12px; color: var(--ink-2); max-width: 56ch; }

.post-meta { text-align: right; white-space: nowrap; }

@media (max-width: 720px) { .post-meta { text-align: left; } }

.post-meta .tag { color: var(--silver); }

/* ==================================================================
   ARTICLE
   ================================================================== */

.article-head { padding: clamp(150px, 20vw, 200px) 0 clamp(40px, 5vw, 64px); position: relative; }

.article-head .blog-hero-glow { top: -40%; height: 560px; }

.crumbs { margin-bottom: 26px; }
.crumbs a { color: var(--ink-3); transition: color 0.2s; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin: 0 8px; color: var(--ink-3); }

.article-head h1 {
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 20ch;
  text-wrap: balance;
}

.article-head .standfirst {
  margin-top: 24px;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 19px;
}

.byline { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* article body — measure-first reading column */
.article-body { padding-bottom: clamp(60px, 8vw, 100px); }

.article-body .prose { max-width: 720px; }

.prose h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: clamp(48px, 6vw, 72px) 0 18px;
}

.prose h3 {
  font-size: clamp(19px, 2.2vw, 23px);
  margin: 40px 0 14px;
}

.prose p { margin-bottom: 20px; color: var(--ink-2); }

.prose p strong, .prose li strong { color: var(--ink); font-weight: 700; }

.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(157, 123, 255, 0.55); transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: #9d7bff; }

.prose ul, .prose ol { margin: 0 0 20px 22px; color: var(--ink-2); }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--ink-3); }

.prose .lead { font-size: 19px; color: var(--ink-2); }

/* mono section label inside articles */
.prose .kicker { display: block; margin: clamp(48px, 6vw, 72px) 0 -6px; }
.prose .kicker + h2 { margin-top: 14px; }

/* callout — glass card */
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 26px;
  margin: 28px 0;
}

.callout .mono { display: block; margin-bottom: 10px; }
.callout p { margin-bottom: 0; }

/* tables — edit-suite register: mono heads, hairlines */
.table-wrap { overflow-x: auto; margin: 28px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }

table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 15px; }

thead th {
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }

tbody td:first-child { color: var(--ink); font-weight: 700; white-space: nowrap; }

tbody tr.row-hl td { background: rgba(124, 92, 255, 0.07); }
tbody tr.row-hl td:first-child { color: var(--ink); }

.table-note { font-size: 13px; color: var(--ink-3); margin-top: -18px; margin-bottom: 28px; }

/* FAQ — same details/summary pattern as the landing */
.faq-block { margin-top: clamp(56px, 7vw, 84px); }

.faq-block > .mono { display: block; margin-bottom: 8px; }

.faq-block h2 { margin: 0 0 10px; }

.faq-block details { border-top: 1px solid var(--line); }
.faq-block details:last-of-type { border-bottom: 1px solid var(--line); }

.faq-block summary {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.2s;
}

.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary:hover { color: #fff; }
.faq-block summary .mono { flex-shrink: 0; }

.faq-block summary i {
  margin-left: auto;
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  align-self: center;
}

.faq-block summary i::before, .faq-block summary i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ink-3);
  transition: transform 0.3s var(--ease);
}

.faq-block summary i::before { width: 12px; height: 1.5px; }
.faq-block summary i::after { width: 1.5px; height: 12px; }

.faq-block details[open] summary i::after { transform: translate(-50%, -50%) rotate(90deg); }

.faq-block details p { padding: 0 0 22px; color: var(--ink-2); max-width: 64ch; }
.faq-block details p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* further reading */
.further { margin-top: clamp(56px, 7vw, 84px); }
.further .mono { display: block; margin-bottom: 18px; }

.further-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }

.further-links a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.further-links a:hover { border-color: var(--line-2); color: var(--ink); transform: translateY(-2px); }

.further-links a span { display: block; margin-top: 6px; }

/* CTA band */
.cta-band {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  padding: clamp(80px, 10vw, 120px) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -55%;
  transform: translateX(-50%);
  width: 800px;
  height: 480px;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(124, 58, 237, 0.18) 0%, transparent 70%);
}

.cta-band .eyebrow { display: block; margin-bottom: 20px; }

.cta-band h2 {
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 34px;
  text-wrap: balance;
}

.cta-band > .container { position: relative; }

/* ==================================================================
   FOOTER (same as landing)
   ================================================================== */

.footer { border-top: 1px solid var(--line); padding: 76px 0 44px; background: var(--bg-elev); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 76px;
}

@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.footer-brand p { margin-top: 12px; line-height: 1.8; }

.footer-col { display: flex; flex-direction: column; gap: 12px; }

.footer-h { margin-bottom: 6px; }

.footer-col a { color: var(--ink-2); font-size: 14.5px; transition: color 0.2s; }

.footer-col a:hover { color: var(--ink); }

.footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.footer-legal .mono { font-size: 10.5px; line-height: 1.8; }
