/* AI Prompt Guide — design tokens */
:root {
  --bg: #F4F3FA;
  --surface: #FFFFFF;
  --ink: #18163A;
  --muted: #5C5A7A;
  --line: #DEDCEC;
  --brand: #4B3FE0;
  --brand-hover: #3A2FC4;
  --on-brand: #FFFFFF;
  --mark: #FFE45C;
  --mark-ink: #18163A;
  --soft: #E9E7F8;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1180px;
  --r-lg: 18px;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121027; --surface: #1C1A36; --ink: #ECEAFB; --muted: #A7A4C8;
    --line: #302D52; --brand: #8D84FF; --brand-hover: #A49DFF; --on-brand: #121027;
    --soft: #26234A;
  }
}
:root[data-theme="dark"] {
  --bg: #121027; --surface: #1C1A36; --ink: #ECEAFB; --muted: #A7A4C8;
  --line: #302D52; --brand: #8D84FF; --brand-hover: #A49DFF; --on-brand: #121027;
  --soft: #26234A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
mark.var {
  background: linear-gradient(transparent 8%, var(--mark) 8%, var(--mark) 92%, transparent 92%);
  color: var(--mark-ink); padding: 0 .15em; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Header */
.site-head { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; gap: 24px; min-height: 66px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.logo .br { color: var(--brand); font-weight: 500; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .97rem; }
.nav a[aria-current="page"], .nav a:hover { color: var(--brand); }
.head-search { margin-left: auto; }
.head-search input {
  font: inherit; font-size: .95rem; width: 220px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
@media (max-width: 760px) {
  .head-row { gap: 10px 18px; padding-top: 10px; padding-bottom: 10px; }
  .head-search { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
  .nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; }
  .head-search input { width: 100%; max-width: 170px; }
}

/* Buttons */
.btn, .btn-copy {
  display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem var(--body);
  background: var(--brand); color: var(--on-brand); border: 0; border-radius: 10px;
  padding: 10px 16px; cursor: pointer; text-decoration: none;
}
.btn:hover, .btn-copy:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-copy.done { background: #1E9E63; color: #fff; }
.btn-ghost {
  display: inline-flex; align-items: center; font: 500 .9rem var(--body); color: var(--muted);
  padding: 10px 12px; border-radius: 10px; text-decoration: none;
}
.btn-ghost:hover { color: var(--ink); background: var(--soft); }

/* Hero */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; align-items: center; }
.hero-grid > * { min-width: 0; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; } }
.hero h1 { max-width: 13ch; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.big-search { display: flex; gap: 8px; margin: 28px 0 14px; max-width: 520px; }
.big-search input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: 14px 18px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.big-search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.big-search .btn { padding: 14px 20px; border-radius: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; font-size: .92rem; color: var(--muted); align-items: center; }
.quick a { color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; text-decoration: none; }
.quick a:hover { border-color: var(--brand); color: var(--brand); }

/* The anatomy card — the signature element */
.anatomy { position: relative; }
.anatomy-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 26px 20px; box-shadow: 0 30px 60px -36px rgba(40, 30, 120, .35);
}
.anatomy-card .label { font-size: .85rem; color: var(--muted); margin-bottom: 12px; display: flex; justify-content: space-between; gap: 12px; }
.anatomy-card .prompt-text { font-size: 1rem; }
.anatomy-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; counter-reset: s; }
.anatomy-steps li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; color: var(--muted); font-size: .95rem; }
.anatomy-steps li::before {
  content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--soft); color: var(--brand); font: 700 .8rem/24px var(--display); text-align: center;
}
.anatomy-steps strong { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .anatomy mark.var { animation: sweep .9s cubic-bezier(.2,.7,.2,1) both; background-size: 0% 100%; background-repeat: no-repeat;
    background-image: linear-gradient(var(--mark), var(--mark)); background-color: transparent; }
  .anatomy mark.var:nth-of-type(1) { animation-delay: .35s; }
  .anatomy mark.var:nth-of-type(2) { animation-delay: .6s; }
  .anatomy mark.var:nth-of-type(3) { animation-delay: .85s; }
  .anatomy mark.var:nth-of-type(4) { animation-delay: 1.1s; }
  .anatomy mark.var:nth-of-type(5) { animation-delay: 1.35s; }
  @keyframes sweep { to { background-size: 100% 100%; } }
}

/* Sections */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Library index — a list, not a card grid */
.lib { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .lib { grid-template-columns: 1fr 1fr; column-gap: 48px; } }
.lib li { border-bottom: 1px solid var(--line); }
.lib a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 18px 4px; text-decoration: none; color: var(--ink); }
.lib a:hover .lib-name { color: var(--brand); }
.lib-name { font: 700 1.15rem/1.3 var(--display); }
.lib-count { font: 500 .9rem var(--body); color: var(--muted); align-self: center; grid-row: span 2; white-space: nowrap; }
.lib-desc { color: var(--muted); font-size: .95rem; }

/* Prompt cards */
.prompt-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 860px) { .prompt-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.prompt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 20px 12px; display: flex; flex-direction: column; scroll-margin-top: 90px;
}
.prompt:target { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.prompt[hidden] { display: none; }
.prompt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.prompt-title { font-size: 1.12rem; margin: 0; }
.pill { flex: none; font-size: .8rem; font-weight: 500; color: var(--muted); background: var(--soft); padding: 3px 10px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
a.pill:hover { color: var(--brand); }
.prompt-text {
  font: 400 .93rem/1.7 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
  margin: 0 0 14px; flex: 1;
}
.prompt-actions { display: flex; flex-wrap: wrap; gap: 4px 6px; border-top: 1px dashed var(--line); padding-top: 12px; }

/* Category page */
.cat-hero { padding: 40px 0 28px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.cat-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); max-width: 22ch; }
.cat-hero .lede { max-width: 64ch; }
.cat-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .92rem; margin-top: 8px; }
.how { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin: 22px 0 0; max-width: 820px; font-size: .97rem; }
.how strong { font-family: var(--display); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; position: sticky; top: 66px; background: var(--bg); padding: 10px 0; z-index: 2; }
.filters button {
  font: 500 .9rem var(--body); padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 760px) { .filters { top: 0; position: static; } }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1020px) { .layout-2 { grid-template-columns: minmax(0, 1fr) 280px; } }
.aside-box { position: sticky; top: 90px; }
.aside-box h2 { font-size: 1.05rem; }
.aside-box ul { list-style: none; padding: 0; margin: 0 0 24px; }
.aside-box li a { display: block; padding: 7px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .95rem; }
.aside-box li a:hover { color: var(--brand); }

/* Prose (guides + category explainer) */
.prose { max-width: 720px; font-size: 1.06rem; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose li { margin-bottom: .4em; }
.prose code { font: .9em var(--mono); background: var(--soft); padding: 1px 6px; border-radius: 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; overflow-x: auto; font: .92rem/1.7 var(--mono); white-space: pre-wrap; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1em 0 1.5em; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { font-family: var(--display); }
.prose blockquote { margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--mark); color: var(--muted); }

/* FAQ */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font: 600 1.08rem var(--display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 0 18px; color: var(--muted); }

/* Guides list */
.guides { display: grid; gap: 0; border-top: 1px solid var(--line); }
.guide-row { display: grid; gap: 6px; padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
@media (min-width: 760px) { .guide-row { grid-template-columns: 140px 1fr; gap: 24px; } }
.guide-row time { color: var(--muted); font-size: .9rem; padding-top: 4px; }
.guide-row h3 { font-size: 1.35rem; margin: 0 0 6px; }
.guide-row p { color: var(--muted); margin: 0; }
.guide-row:hover h3 { color: var(--brand); }

.post-head { padding: 44px 0 20px; }
.post-head h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); max-width: 20ch; }
.post-meta { color: var(--muted); font-size: .95rem; }
.cta-box { background: var(--soft); border-radius: var(--r-lg); padding: 26px 28px; margin: 48px 0; max-width: 720px; }
.cta-box h2 { font-size: 1.4rem; margin-top: 0; }

/* Search */
.search-page .big-search { max-width: 640px; }
.empty { color: var(--muted); padding: 24px 0; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 44px 0 28px; font-size: .95rem; }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-foot p { color: var(--muted); max-width: 40ch; margin-top: 10px; }
.site-foot h2 { font-size: 1rem; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 6px 0; }
.site-foot li a { color: var(--ink); text-decoration: none; }
.site-foot li a:hover { color: var(--brand); }
.foot-base { color: var(--muted); margin-top: 32px; font-size: .88rem; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 500;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Example output panel */
.example { margin: 10px -20px -12px; border-top: 1px solid var(--line); }
.example summary {
  list-style: none; cursor: pointer; padding: 12px 20px; font: 600 .92rem var(--body); color: var(--brand);
  display: flex; align-items: center; gap: 8px;
}
.example summary::-webkit-details-marker { display: none; }
.example summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s; margin-right: 2px;
}
.example[open] summary::before { transform: rotate(45deg); }
.example summary:hover { background: var(--soft); }
.ex-wrap { padding: 4px 20px 18px; }
.ex-in { font-size: .9rem; color: var(--muted); margin: 0 0 10px; }
.ex-in span { display: inline-block; font-weight: 600; color: var(--ink); background: var(--mark); padding: 0 6px; border-radius: 4px; margin-right: 6px; font-size: .8rem; }
.ex-out {
  background: var(--soft); border-radius: 10px; padding: 16px 18px; font-size: .95rem; line-height: 1.6;
  border-left: 3px solid var(--brand); overflow-x: auto;
}
.ex-out > :first-child { margin-top: 0; }
.ex-out > :last-child { margin-bottom: 0; }
.ex-out p { margin: 0 0 .7em; }
.ex-out ul, .ex-out ol { margin: 0 0 .7em; padding-left: 1.3em; }
.ex-out li { margin-bottom: .25em; }
.ex-out table { border-collapse: collapse; width: 100%; font-size: .87rem; margin: .4em 0 .8em; }
.ex-out th, .ex-out td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.ex-out th { font-family: var(--display); font-weight: 700; }
.ex-out pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font: .84rem/1.6 var(--mono); margin: 0 0 .8em; }
.ex-out code { font: .86em var(--mono); }
.ex-out pre code { font-size: inherit; }
.ex-out blockquote { margin: .4em 0 .8em; padding: 2px 14px; border-left: 3px solid var(--mark); color: var(--muted); }
.ex-out hr { border: 0; border-top: 1px dashed var(--line); margin: 1em 0; }
.ex-note { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

/* Example images on image-prompt cards */
.prompt-img { margin: -20px -20px 16px; position: relative; }
.prompt-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 25%; border-radius: var(--r) var(--r) 0 0; background: var(--soft); }
.prompt-img figcaption {
  position: absolute; left: 12px; bottom: 12px; font-size: .78rem; font-weight: 600;
  background: rgba(24, 22, 58, .78); color: #fff; padding: 3px 10px; border-radius: 999px;
}

/* Seasonal band (Diwali) */
.festive { background: #2A1B5C; color: #FFF6E0; padding: 40px 0; position: relative; overflow: hidden; }
.festive::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 8% 30%, rgba(255,196,64,.35) 0 2px, transparent 3px),
    radial-gradient(circle at 22% 80%, rgba(255,196,64,.3) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, rgba(255,196,64,.35) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 70%, rgba(255,196,64,.3) 0 2px, transparent 3px),
    radial-gradient(ellipse at 85% 110%, rgba(255,170,40,.35), transparent 55%);
}
.festive .wrap { position: relative; }
.festive-head h2 { color: #FFE45C; margin-bottom: 6px; }
.festive-head p { color: #E9E2FF; margin: 0 0 22px; }
.festive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.festive-list a {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 12px; text-decoration: none;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,228,92,.28); color: #FFF6E0;
}
.festive-list a:hover { background: rgba(255,255,255,.13); border-color: #FFE45C; color: #FFF6E0; }
.fl-kind { font-size: .82rem; color: #CFC4F5; }
.fl-name { font: 700 1.15rem/1.25 var(--display); }

/* Author */
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--brand); color: #fff; font: 700 .95rem var(--display); text-decoration: none; letter-spacing: .02em;
}
.avatar:hover { color: #fff; }
.avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
img.avatar { display: block; border-radius: 50%; object-fit: cover; }
.avatar { overflow: hidden; }
.byline .avatar { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.1rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 1.7rem; }
.byline { display: flex; align-items: center; gap: 12px; }
.byline .post-meta { margin: 0; line-height: 1.5; }
.author-box {
  display: flex; gap: 18px; align-items: flex-start; max-width: 720px; margin: 48px 0 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px;
}
.author-box p { margin: 0 0 6px; color: var(--muted); font-size: .97rem; }
.author-box .ab-name { font: 700 1.15rem var(--display); color: var(--ink); margin: 0; }
.author-box .ab-name a { color: var(--ink); text-decoration: none; }
.author-box .ab-role { font-size: .9rem; margin-bottom: 8px; }
.ab-links { display: flex; gap: 18px; margin-top: 8px !important; }
.profile-head { display: flex; align-items: center; gap: 22px; }
.profile-head h1 { margin: 0 0 4px; }
.cat-meta a { color: var(--muted); }
.festive-head p a { color: #FFE45C; }
.season-note { margin: 16px 0 0; font-size: .95rem; color: var(--muted); }
