/*
Theme Name: HowAIWorks
Theme URI: https://howaiworks.ai
Author: HowAIWorks.ai
Description: A fast, dependency-free theme for AI reference sites. Custom post types for glossary terms, AI tools and models, with an A–Z index, live filtering, FAQ schema and automatic dark mode. No framework, no web fonts, no page builder.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: howaiworks
Tags: education, reference, custom-post-types, accessibility-ready, dark-mode
*/

/* ==========================================================================
   HowAIWorks — stylesheet v2
   One file. No framework, no web fonts, no build step.
   ========================================================================== */

:root {
  /* paper & ink */
  --paper:      #f4f5f8;
  --paper-2:    #eceef3;
  --surface:    #ffffff;
  --ink:        #14223f;
  --ink-2:      #2c3e63;
  --muted:      #5e6b86;
  --faint:      #8c97ad;

  /* rules */
  --rule:       #d8dde7;
  --rule-soft:  #e8ebf1;

  /* signal */
  --signal:     #b01455;
  --signal-2:   #8d1046;
  --signal-bg:  #fdeef4;
  --signal-line:#f2c9db;

  /* secondary */
  --teal:       #0b6e6e;
  --teal-bg:    #e8f3f3;

  /* code surface */
  --code-bg:    #101c34;
  --code-fg:    #dfe6f2;
  --code-bar:   #1b2b4a;

  --badge-from: #2c3e63;
  --badge-to:   #14223f;
  --badge-fg:   #ffffff;

  --shadow-sm: 0 1px 2px rgba(20,34,63,.05);
  --shadow-md: 0 4px 16px -6px rgba(20,34,63,.16), 0 1px 2px rgba(20,34,63,.05);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --wrap: 1140px;
  --r: 5px;
  --r-lg: 8px;
  --ease: cubic-bezier(.2,.6,.3,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0e1526;
    --paper-2:    #0a1120;
    --surface:    #141d33;
    --ink:        #e7ecf6;
    --ink-2:      #c3cde1;
    --muted:      #94a1bd;
    --faint:      #6f7d9b;
    --rule:       #26314c;
    --rule-soft:  #1d2740;
    --signal:     #ff7aac;
    --signal-2:   #ff9dc1;
    --signal-bg:  #2a1428;
    --signal-line:#4a2340;
    --teal:       #5fd4cf;
    --teal-bg:    #0f2b30;
    --code-bg:    #0a1120;
    --code-bar:   #16203a;
    --badge-from: #3a4d75;
    --badge-to:   #26355a;
    --badge-fg:   #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 18px -6px rgba(0,0,0,.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 3px;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--surface);
  padding: 11px 18px; z-index: 100; border-radius: 0 0 var(--r) 0; font-size: 14px;
}
.skip:focus { left: 0; top: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(1px)) { .masthead { background: var(--surface); } }

.masthead .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 18.5px; letter-spacing: -.015em;
  text-decoration: none; color: var(--ink); white-space: nowrap;
}
.wordmark .glyph {
  width: 24px; height: 24px; border-radius: 5px;
  background: linear-gradient(150deg, var(--badge-from), var(--badge-to) 65%);
  color: var(--badge-fg); font-family: var(--sans); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--shadow-sm);
}
.wordmark .dot { color: var(--signal); }
.wordmark:hover .glyph { background: linear-gradient(150deg, var(--signal), var(--signal-2) 70%); }
.wordmark .glyph { transition: background .18s var(--ease); }

.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav a {
  position: relative; font-size: 14.5px; color: var(--ink-2); text-decoration: none;
  padding: 8px 11px; border-radius: var(--r); transition: color .15s var(--ease), background .15s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px;
  background: var(--signal); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .2s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav .btn-sm {
  margin-left: 8px; border: 1px solid var(--rule); border-radius: var(--r);
  padding: 8px 15px; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.nav .btn-sm::after { display: none; }
.nav .btn-sm:hover { border-color: var(--ink); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.burger {
  display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r); width: 40px; height: 36px; cursor: pointer; padding: 0;
}
.burger span, .burger span::before, .burger span::after {
  display: block; width: 17px; height: 1.5px; background: var(--ink); margin-inline: auto;
  position: relative; content: ""; border-radius: 2px; transition: transform .2s var(--ease), opacity .15s;
}
.burger span::before { position: absolute; top: -5.5px; }
.burger span::after { position: absolute; top: 5.5px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 880px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: 10px 22px 18px; box-shadow: var(--shadow-md);
  }
  .nav.open { display: flex; animation: drop .18s var(--ease); }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--rule-soft); border-radius: 0; }
  .nav a::after { display: none; }
  .nav .btn-sm { margin: 12px 0 0; text-align: center; padding: 12px; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ==========================================================================
   Search
   ========================================================================== */

.search { position: relative; }
.search svg {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  color: var(--faint); pointer-events: none; transition: color .15s var(--ease);
}
.search input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 15px 16px 15px 48px; box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-bg); }
.search:focus-within svg { color: var(--signal); }

.search-big input { font-size: 18px; padding: 20px 20px 20px 56px; }
.search-big svg { left: 21px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative; overflow: hidden;
  padding: 80px 0 44px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
/* faint plotter grid — the only decoration on the page */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 74px 74px;
  -webkit-mask-image: radial-gradient(75% 130% at 100% -10%, #000 0%, rgba(0,0,0,.45) 38%, transparent 78%);
          mask-image: radial-gradient(75% 130% at 100% -10%, #000 0%, rgba(0,0,0,.45) 38%, transparent 78%);
}
.hero > .wrap { position: relative; }
@media (max-width: 620px) { .hero { padding: 42px 0 34px; } }

.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.06; letter-spacing: -.025em;
  margin: 0 0 16px; max-width: 12ch; text-wrap: balance;
}
.hero p.lede {
  font-size: 18.5px; color: var(--muted); margin: 0 0 32px; max-width: 52ch; line-height: 1.55;
}
.hero .search-big { max-width: 660px; }

.suggests {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 16px; font-size: 14px; color: var(--muted);
}
.suggests a {
  text-decoration: none; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 13px;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.suggests a:hover { border-color: var(--signal); color: var(--signal); background: var(--signal-bg); }

.counts { display: flex; flex-wrap: wrap; margin-top: 48px; border-top: 1px solid var(--rule); }
.counts div {
  padding: 20px 30px 6px 0; margin-right: 30px; border-right: 1px solid var(--rule-soft);
}
.counts div:last-child { border-right: 0; }
.counts b {
  font-family: var(--serif); font-size: 30px; font-weight: 400;
  display: block; line-height: 1.15; letter-spacing: -.02em;
}
.counts span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 620px) {
  .counts { display: grid; grid-template-columns: 1fr 1fr; margin-top: 36px; }
  .counts div { padding: 15px 0; margin: 0; border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .counts div:nth-child(odd) { padding-right: 18px; border-right: 1px solid var(--rule-soft); }
  .counts div:nth-child(even) { padding-left: 18px; }
  .counts b { font-size: 25px; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 62px 0; }
.section + .section { border-top: 1px solid var(--rule); }

.section-head { margin-bottom: 30px; }
.section-head h2 {
  font-family: var(--serif); font-weight: 400; font-size: 29px;
  letter-spacing: -.018em; margin: 0 0 8px;
}
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }

.page-head {
  background: var(--surface); border-bottom: 1px solid var(--rule);
  padding: 52px 0 38px; position: relative;
}
.page-head h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.2vw, 46px);
  letter-spacing: -.025em; margin: 0 0 14px; line-height: 1.1; text-wrap: balance;
}
.page-head p { color: var(--muted); margin: 0; max-width: 62ch; font-size: 17.5px; line-height: 1.55; }

.crumbs { font-size: 13.5px; color: var(--faint); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); }
.crumbs a:hover { color: var(--signal); border-color: var(--signal); }
.crumbs span { padding: 0 7px; color: var(--rule); }

/* ==========================================================================
   Pillars
   ========================================================================== */

.pillars {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
}
.pillars a {
  position: relative; padding: 26px 24px 28px;
  border-right: 1px solid var(--rule-soft);
  text-decoration: none; transition: background .16s var(--ease);
}
.pillars a:last-child { border-right: 0; }
.pillars a::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--signal); transform: scaleX(0); transform-origin: left;
  transition: transform .22s var(--ease);
}
.pillars a:hover { background: var(--signal-bg); }
.pillars a:hover::before { transform: scaleX(1); }
.pillars h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 8px; letter-spacing: -.01em; }
.pillars p { font-size: 14px; color: var(--muted); margin: 0 0 14px; line-height: 1.52; }
.pillars em { font-style: normal; font-size: 13.5px; color: var(--signal); font-weight: 500; }

@media (max-width: 880px) {
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillars a:nth-child(2n) { border-right: 0; }
  .pillars a:nth-child(-n+2) { border-bottom: 1px solid var(--rule-soft); }
}
@media (max-width: 520px) {
  .pillars { grid-template-columns: 1fr; }
  .pillars a { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .pillars a:last-child { border-bottom: 0; }
}

/* ==========================================================================
   Glossary entries
   ========================================================================== */

.entries { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
@media (max-width: 820px) { .entries { grid-template-columns: 1fr; gap: 0; } }

.entry {
  position: relative; display: block; text-decoration: none;
  padding: 17px 16px 18px; border-bottom: 1px solid var(--rule-soft);
  border-radius: var(--r);
  transition: background .16s var(--ease), box-shadow .16s var(--ease);
}
.entry::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px;
  background: var(--signal); border-radius: 2px;
  transform: scaleY(0); transform-origin: top;
  transition: transform .2s var(--ease);
}
.entry:hover {
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border-bottom-color: transparent;
}
.entry:hover::before { transform: scaleY(1); }

.entry .term, .entry dt {
  font-family: var(--serif); font-size: 18px; color: var(--ink);
  margin: 0 0 5px; letter-spacing: -.008em; line-height: 1.3;
  transition: color .15s var(--ease);
}
.entry:hover .term { color: var(--signal); }
.entry .def, .entry dd { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.52; }

.entry .tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px; color: var(--muted); background: var(--paper);
  border: 1px solid var(--rule-soft); border-radius: 3px; padding: 2.5px 8px; white-space: nowrap;
  transition: border-color .15s var(--ease);
}
.entry:hover .tag { border-color: var(--rule); }

/* letter rail */
.rail {
  position: sticky; top: 60px; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(1px)) { .rail { background: var(--surface); } }
.rail .wrap { display: flex; flex-wrap: wrap; gap: 2px; padding-block: 10px; }
.rail a {
  font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  min-width: 28px; text-align: center; padding: 5px 2px; border-radius: var(--r);
  transition: background .14s var(--ease), color .14s var(--ease);
}
.rail a:hover { background: var(--ink); color: var(--surface); }
.rail a.is-active { background: var(--signal-bg); color: var(--signal); }
.rail a.off { color: var(--rule); pointer-events: none; }

.letter-head {
  display: flex; align-items: baseline; gap: 16px;
  margin: 44px 0 12px; padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.letter-head h2 {
  font-family: var(--serif); font-weight: 400; font-size: 34px;
  margin: 0; line-height: 1; letter-spacing: -.02em;
}
.letter-head span { font-size: 13px; color: var(--faint); }

.no-results { padding: 60px 0; color: var(--muted); font-size: 16.5px; }
.no-results b { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Article layout
   ========================================================================== */

.layout { display: grid; grid-template-columns: 216px minmax(0,1fr); gap: 56px; padding: 48px 0 80px; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; gap: 0; padding-top: 34px; } }

.toc { position: sticky; top: 92px; align-self: start; font-size: 14px; }
.toc h4 {
  margin: 0 0 12px; font-size: 12.5px; font-weight: 600; color: var(--faint);
  padding-bottom: 10px; border-bottom: 1px solid var(--rule); letter-spacing: .01em;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a {
  display: block; padding: 7px 0 7px 26px; color: var(--ink-2);
  text-decoration: none; position: relative; line-height: 1.35;
  border-left: 2px solid transparent; margin-left: -2px;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.toc a::before {
  content: counter(t); position: absolute; left: 8px;
  color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--signal); }
.toc a.is-active { color: var(--signal); border-left-color: var(--signal); font-weight: 600; }
.toc a.is-active::before { color: var(--signal); }
@media (max-width: 980px) {
  .toc {
    position: static; margin-bottom: 32px; padding: 18px 20px 6px;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  }
  .toc a.is-active { border-left-color: transparent; }
}

/* ==========================================================================
   Prose
   ========================================================================== */

.prose { max-width: var(--measure); font-family: var(--serif); font-size: 18.5px; line-height: 1.7; }

.prose > h1 {
  font-size: clamp(34px, 4.6vw, 48px); font-weight: 400; letter-spacing: -.028em;
  line-height: 1.08; margin: 0 0 14px; text-wrap: balance;
}
.prose .standfirst {
  font-size: 21px; color: var(--ink-2); line-height: 1.48; margin: 0 0 20px; font-style: italic;
}
.prose .byline {
  font-family: var(--sans); font-size: 13.5px; color: var(--muted);
  padding-bottom: 24px; border-bottom: 1px solid var(--rule); margin-bottom: 34px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

.prose h2 {
  font-size: 28px; font-weight: 400; letter-spacing: -.02em;
  margin: 50px 0 14px; padding-top: 22px; border-top: 1px solid var(--rule-soft);
  scroll-margin-top: 96px;
}
.prose .byline + h2 { border-top: 0; padding-top: 0; margin-top: 34px; }
.prose h3 {
  font-family: var(--sans); font-size: 17.5px; font-weight: 650;
  letter-spacing: -.005em; margin: 34px 0 10px; color: var(--ink);
}
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 24px; }
.prose li { margin-bottom: 10px; padding-left: 4px; }
.prose li::marker { color: var(--signal); }

.prose a {
  color: var(--signal); text-decoration: underline;
  text-decoration-color: var(--signal-line); text-decoration-thickness: 1px;
  transition: text-decoration-color .15s var(--ease);
}
.prose a:hover { text-decoration-color: var(--signal); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose em { font-style: italic; }

.prose code {
  font-family: var(--mono); font-size: .8em; background: var(--teal-bg);
  color: var(--teal); padding: 2px 6px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--teal) 18%, transparent);
}
.prose pre {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
  background: var(--code-bg); color: var(--code-fg);
  padding: 20px 22px; border-radius: var(--r-lg); overflow-x: auto; margin: 0 0 24px;
  border: 1px solid var(--code-bar); box-shadow: var(--shadow-md);
  tab-size: 2;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; border: 0; }
.prose pre::-webkit-scrollbar { height: 9px; }
.prose pre::-webkit-scrollbar-thumb { background: var(--code-bar); border-radius: 99px; }

.prose blockquote {
  margin: 0 0 24px; padding: 6px 0 6px 22px;
  border-left: 3px solid var(--signal); color: var(--ink-2); font-style: italic;
}

.callout {
  font-family: var(--sans); font-size: 15.5px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-lg); padding: 18px 20px; margin: 0 0 24px;
  color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.callout strong { color: var(--ink); }
.callout code { font-size: .82em; }

/* FAQ */
.faq { margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--rule); }
.faq h2 { font-family: var(--serif); font-weight: 400; font-size: 27px; margin: 0 0 16px; letter-spacing: -.02em; }
.faq details {
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  margin-bottom: 10px; background: var(--surface); overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.faq details[open] { border-color: var(--signal-line); box-shadow: var(--shadow-sm); }
.faq summary {
  font-family: var(--serif); font-size: 18px; padding: 16px 48px 16px 20px;
  cursor: pointer; position: relative; list-style: none;
  transition: color .15s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 50%;
  width: 11px; height: 11px; margin-top: -6px;
  border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal);
  transform: rotate(45deg); transform-origin: center;
  transition: transform .2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { color: var(--signal); }
.faq .answer {
  font-size: 16px; line-height: 1.62; color: var(--ink-2);
  padding: 0 48px 18px 20px; margin: 0;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  position: relative; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 20px 20px 22px; text-decoration: none; display: block;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.card:hover {
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 11px; }
.mono-badge {
  width: 38px; height: 38px; flex: none; border-radius: var(--r);
  background: linear-gradient(150deg, var(--badge-from), var(--badge-to) 70%);
  color: var(--badge-fg); display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.card h3 {
  font-family: var(--serif); font-weight: 400; font-size: 19px;
  margin: 0; line-height: 1.24; letter-spacing: -.01em;
  transition: color .15s var(--ease);
}
.card:hover h3 { color: var(--signal); }
.card .vendor { font-size: 12.5px; color: var(--faint); margin: 3px 0 0; }
.card p { font-size: 14.5px; color: var(--muted); line-height: 1.52; margin: 0 0 14px; }

.pill {
  display: inline-block; font-size: 11.5px; font-weight: 500; padding: 3px 10px;
  border-radius: 999px; background: var(--signal-bg); color: var(--signal);
  border: 1px solid var(--signal-line); white-space: nowrap;
}
.pill.free { background: var(--teal-bg); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 25%, transparent); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0 6px; }
.filters button {
  font: inherit; font-size: 13.5px; cursor: pointer; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 999px; padding: 7px 15px; color: var(--ink-2);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.filters button:hover { border-color: var(--ink); color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 500;
}

.cat-head {
  font-family: var(--serif); font-size: 23px; font-weight: 400;
  margin: 42px 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule); letter-spacing: -.015em;
}

/* spec table */
.spec { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 0 0 26px; font-family: var(--sans); }
.spec th, .spec td { text-align: left; padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.spec tr:hover td, .spec tr:hover th { background: var(--surface); }
.spec th { width: 32%; font-weight: 600; color: var(--muted); font-size: 14px; padding-left: 12px; }
.spec td { color: var(--ink-2); }

/* ==========================================================================
   Blog
   ========================================================================== */

.post-list { border-top: 1px solid var(--rule); }
.post-item {
  display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 30px;
  padding: 28px 14px 28px 0; border-bottom: 1px solid var(--rule-soft);
  text-decoration: none; align-items: start; border-radius: var(--r);
  transition: background .16s var(--ease), padding-left .16s var(--ease);
}
.post-item:hover { background: var(--surface); padding-left: 14px; }
.post-item:hover h3 { color: var(--signal); }
.post-item .meta { font-size: 13px; color: var(--faint); line-height: 1.65; }
.post-item h3 {
  font-family: var(--serif); font-weight: 400; font-size: 23px;
  margin: 0 0 8px; line-height: 1.22; letter-spacing: -.015em;
  transition: color .15s var(--ease);
}
.post-item p { font-size: 15.5px; color: var(--muted); margin: 0; line-height: 1.55; max-width: 66ch; }
@media (max-width: 720px) { .post-item { grid-template-columns: 1fr; gap: 9px; } }

.featured {
  position: relative; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 32px 34px; margin-bottom: 34px; text-decoration: none; display: block;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.featured::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--signal); border-radius: var(--r-lg) 0 0 var(--r-lg);
  opacity: 0; transition: opacity .2s var(--ease);
}
.featured:hover { border-color: color-mix(in srgb, var(--ink) 35%, transparent); box-shadow: var(--shadow-md); }
.featured:hover::before { opacity: 1; }
.featured:hover h2 { color: var(--signal); }
.featured h2 {
  font-family: var(--serif); font-weight: 400; font-size: 32px;
  margin: 10px 0 12px; line-height: 1.12; letter-spacing: -.022em;
  transition: color .15s var(--ease);
}
.featured p { color: var(--muted); margin: 0; max-width: 64ch; line-height: 1.55; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px;
  box-shadow: var(--shadow-sm); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-bg);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--faint); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  padding: 13px 24px; border-radius: var(--r); text-decoration: none;
  background: var(--ink); color: var(--surface); border: 1px solid var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); box-shadow: none; }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ==========================================================================
   Closing band
   ========================================================================== */

.band {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #1b2c4f 0%, var(--ink) 55%, #0f1b33 100%);
  color: #fff; padding: 64px 0;
}
.band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 74px 74px;
  -webkit-mask-image: radial-gradient(70% 130% at 100% -10%, #000 0%, rgba(0,0,0,.4) 40%, transparent 80%);
          mask-image: radial-gradient(70% 130% at 100% -10%, #000 0%, rgba(0,0,0,.4) 40%, transparent 80%);
}
.band > .wrap { position: relative; }
.band h2 {
  font-family: var(--serif); font-weight: 400; font-size: 32px;
  margin: 0 0 12px; letter-spacing: -.022em;
}
.band p { color: #aeb9d4; margin: 0 0 26px; max-width: 54ch; line-height: 1.55; }
.band .btn { background: #fff; color: #14223f; border-color: #fff; }
.band .btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.band .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.28); }
.band .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; border-color: #fff; }

/* ==========================================================================
   Footer
   ========================================================================== */

.foot {
  background: var(--surface); border-top: 1px solid var(--rule);
  padding: 54px 0 32px; font-size: 14.5px;
}
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; gap: 26px; } }
.foot p { color: var(--muted); max-width: 40ch; margin: 14px 0 0; line-height: 1.6; }
.foot h4 { font-size: 12.5px; font-weight: 600; color: var(--faint); margin: 0 0 14px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 10px; }
.foot a {
  color: var(--ink-2); text-decoration: none;
  transition: color .15s var(--ease), padding-left .15s var(--ease);
}
.foot a:hover { color: var(--signal); padding-left: 3px; }
.foot-base {
  margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--rule-soft);
  color: var(--faint); font-size: 13.5px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

.hidden { display: none !important; }

/* ==========================================================================
   Print — reference pages get read on paper
   ========================================================================== */

@media print {
  .masthead, .rail, .toc, .band, .foot, .filters, .search, .suggests, .btn-row, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .layout { display: block; padding: 0; }
  .prose { max-width: none; font-size: 11pt; }
  .prose a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .prose pre { background: #f4f4f4; color: #000; border: 1px solid #ccc; box-shadow: none; }
  .faq details { border: 1px solid #ccc; }
  .faq details > .answer { display: block !important; }
  .card, .entry { box-shadow: none; break-inside: avoid; }
  .prose h2, .prose h3 { break-after: avoid; }
}

/* ==========================================================================
   WordPress core classes
   ========================================================================== */

.alignleft  { float: left;  margin: 6px 24px 18px 0; }
.alignright { float: right; margin: 6px 0 18px 24px; }
.aligncenter { margin-inline: auto; display: block; }
.alignwide, .alignfull { max-width: none; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption {
  font-family: var(--sans); font-size: 13.5px; color: var(--muted);
  margin-top: 8px; line-height: 1.5;
}
.prose figure { margin: 0 0 24px; }
.prose img { border-radius: var(--r-lg); }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.sticky .card { border-color: var(--signal-line); }
.admin-bar .masthead { top: 32px; }
@media (max-width: 782px) { .admin-bar .masthead { top: 46px; } }
.admin-bar .rail { top: 92px; }
@media (max-width: 782px) { .admin-bar .rail { top: 106px; } }

/* pagination */
.pager { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; }
.pager .page-numbers {
  display: inline-block; padding: 9px 15px; border: 1px solid var(--rule);
  border-radius: var(--r); background: var(--surface); text-decoration: none;
  color: var(--ink-2); font-size: 14.5px;
}
.pager .page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.pager .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pager .dots { border-color: transparent; background: none; }

/* comments kept minimal — reference sites rarely want them */
.comments { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); }
.comments h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 18px; }
.comment-list { list-style: none; margin: 0 0 30px; padding: 0; }
.comment-list li { padding: 18px 0; border-bottom: 1px solid var(--rule-soft); }

/* ==========================================================================
   Imported components (prompt examples, partner CTAs, disclosures)
   ========================================================================== */

.prompt {
  margin: 0 0 26px; border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm);
}
.prompt-head {
  font-family: var(--sans); font-size: 14.5px; padding: 14px 18px;
  border-bottom: 1px solid var(--rule-soft); display: flex; gap: 10px; align-items: baseline;
  flex-wrap: wrap; color: var(--ink);
}
.prompt-kind {
  font-size: 11.5px; color: var(--teal); background: var(--teal-bg);
  border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
  border-radius: 999px; padding: 2px 9px;
}
.prompt-note {
  font-family: var(--sans); font-size: 14.5px; color: var(--muted);
  margin: 0; padding: 14px 18px 0; line-height: 1.55;
}
.prompt-body {
  margin: 14px 18px 0 !important; border-radius: var(--r) !important;
  white-space: pre-wrap; word-break: break-word;
}
.prompt-copy {
  font: inherit; font-family: var(--sans); font-size: 13.5px; cursor: pointer;
  margin: 12px 18px 16px; padding: 7px 14px; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2);
}
.prompt-copy:hover { border-color: var(--ink); color: var(--ink); }
.prompt-copy[data-copied] { border-color: var(--teal); color: var(--teal); }

.partner {
  font-family: var(--sans); margin: 0 0 26px; padding: 22px 24px;
  border: 1px solid var(--rule); border-left: 3px solid var(--signal);
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.partner-title { font-family: var(--serif); font-size: 20px; margin: 0 0 8px; color: var(--ink); }
.partner-body { font-size: 15.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.55; }
.partner-note { font-size: 12.5px; color: var(--faint); margin: 10px 0 0; }

.disclosure {
  font-family: var(--sans); font-size: 13.5px; color: var(--muted);
  background: var(--paper); border: 1px solid var(--rule-soft);
  border-radius: var(--r); padding: 12px 16px; margin: 0 0 24px; line-height: 1.55;
}
.disclosure a { color: var(--signal); }
