/* Prompt Library: index and article pages. Palette A: black, champagne gold lead, tech blue accents */
:root {
  --bg: #07080a;
  --surface: #0f1115;
  --line: #24272b;
  --text: #f3f5f8;
  --soft: #c9ced6;
  --muted: #8f96a1;
  --champ: #f0cf98;
  --mint: #8bf3e6;
  --sky: #38bdf8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* Header: same layout and controls as the main website header */
.site-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 24px; height: 88px; padding-inline: clamp(24px, 2.6vw, 64px); background: rgba(0, 0, 0, .86); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255, 255, 255, .05); }
.site-header .brand-logo { display: block; width: 150px; height: 50px; object-fit: contain; }
.site-header nav { display: flex; justify-content: center; gap: clamp(14px, 1.6vw, 28px); white-space: nowrap; }
.site-header nav a { position: relative; font-family: Inter, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; padding-block: 14px; color: #c2c5c5; text-decoration: none; transition: color .25s, text-shadow .25s; }
.site-header nav a::after { content: ""; position: absolute; inset: auto 0 5px; height: 1px; background: linear-gradient(90deg, #f2c462, #42c6d8); transform: scaleX(0); transform-origin: left center; transition: transform .3s; }
.site-header nav a:hover { color: var(--mint); text-shadow: 0 0 12px rgba(139, 243, 230, .45); }
.site-header nav a:hover::after, .site-header nav a:focus-visible::after, .site-header nav a[aria-current]::after { transform: scaleX(1); }
.site-header nav a[aria-current] { color: var(--champ); }
.language-toggle { position: relative; display: flex; align-items: center; width: 112px; height: 40px; padding: 4px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 13px; background: linear-gradient(160deg, rgba(255, 255, 255, .082), rgba(255, 255, 255, .016)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .133), 0 4px 14px rgba(0, 0, 0, .333); isolation: isolate; }
.language-toggle button { position: relative; z-index: 1; width: 50%; height: 100%; border: 0; background: transparent; color: #969d9d; font: inherit; font-size: 12px; font-weight: 700; padding: 0; cursor: pointer; transition: color .3s; }
.language-toggle button[aria-pressed="true"] { color: #101918; text-shadow: 0 0 10px rgba(139, 243, 230, .35); }
.language-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: linear-gradient(110deg, #f6d482, #e7e5ae 40%, #75cdd0); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .667), 0 2px 7px rgba(0, 0, 0, .333); transition: transform .45s cubic-bezier(.22, 1, .36, 1); pointer-events: none; }
html[data-language="zh"] .language-thumb { transform: translateX(100%); }
.header-contact { color: #f0d38b; font-size: 12px; text-decoration: none; white-space: nowrap; }
.header-contact:hover { color: var(--mint); }
.menu-toggle { display: none; }
@media (min-width: 761px) and (max-width: 1100px) {
  .site-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; padding-inline: 24px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 9px; letter-spacing: .8px; }
  .site-header .brand-logo { width: 112px; }
  .header-contact { display: none; }
}
@media (max-width: 760px) {
  .site-header { display: flex; height: 72px; padding-inline: 16px; gap: 10px; background: #000; backdrop-filter: none; }
  .site-header .brand { margin-right: auto; }
  .site-header .brand-logo { width: 96px; height: 34px; }
  .language-toggle { width: 102px; height: 36px; }
  .language-toggle button { font-size: 11px; }
  .header-contact { display: none; }
  .menu-toggle { display: block; font: inherit; font-size: 11px; padding: 7px 10px; border: 1px solid #3b4046; border-radius: 10px; background: rgba(255, 255, 255, .035); color: #ddd; cursor: pointer; }
  .site-header nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 6px; padding: 18px 24px; background: #080909; border-bottom: 1px solid var(--line); }
  .site-header nav.open { display: flex; }
  .site-header nav a { padding: 12px 0; letter-spacing: 1.4px; }
}

/* Back to the library from an article */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--champ); text-decoration: none; padding: 8px 16px 8px 12px; border: 1px solid rgba(240, 207, 152, .35); border-radius: 999px; transition: color .2s, border-color .2s, box-shadow .2s; }
.back-link:hover { color: var(--mint); border-color: rgba(139, 243, 230, .5); box-shadow: 0 0 18px rgba(56, 189, 248, .18); }

/* Small glowing pill, scrolltide style */
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 999px; color: var(--mint); background: rgba(56, 189, 248, .10); border: 1px solid rgba(56, 189, 248, .40); letter-spacing: .02em; }

/* Index hero */
.pl-hero { padding: 72px 0 36px; }
.pl-hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.15; font-weight: 700; margin-top: 16px; }
.pl-hero h1 em { font-style: normal; color: var(--champ); }
.pl-hero p { color: var(--soft); font-size: 17px; max-width: 620px; margin-top: 16px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 28px; }
.filters button { font: inherit; font-size: 14px; color: var(--soft); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; cursor: pointer; transition: color .2s, border-color .2s; }
.filters button:hover { color: var(--text); border-color: #3a3f46; }
.filters button[aria-pressed="true"] { color: var(--mint); border-color: rgba(56, 189, 248, .5); background: rgba(56, 189, 248, .08); }

/* Cards */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 80px; }
.pl-card { display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pl-card[hidden] { display: none; }
.pl-card .thumb { aspect-ratio: 1 / 1; overflow: hidden; background: #15181d; }
.pl-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
.pl-card:hover .thumb img { transform: scale(1.04); }
.pl-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pl-card .body .pill { align-self: flex-start; }
.pl-card h2 { font-size: 20px; line-height: 1.35; font-weight: 700; }
.pl-card p { font-size: 14px; color: var(--muted); }
.pl-card .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; font-size: 13px; color: var(--champ); }
.pl-card.soon { opacity: .55; pointer-events: none; }

/* Article */
.article { padding: 56px 0 90px; }
.article .crumbs { font-size: 13px; color: var(--muted); }
.article .crumbs a { text-decoration: none; }
.article .crumbs a:hover { color: var(--champ); }
.article header { margin-top: 18px; max-width: 760px; }
.article h1 { font-size: clamp(32px, 5.5vw, 50px); line-height: 1.2; margin-top: 14px; }
.article h1 em { font-style: normal; color: var(--champ); }
.article .lead { color: var(--soft); font-size: 18px; margin-top: 14px; }
.article .facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.article .hero-img { margin: 34px 0 10px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); max-width: 760px; }
.content { max-width: 760px; }
.content h2 { font-size: 26px; margin: 48px 0 12px; line-height: 1.3; }
.content h2 .num { color: var(--champ); margin-right: 10px; }
.content p, .content li { color: var(--soft); font-size: 16px; }
.content ul { padding-left: 20px; margin-top: 8px; }
.content figure { margin: 22px 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #f5f1ea; }
.content figcaption { background: var(--surface); color: var(--muted); font-size: 13px; padding: 10px 16px; }

/* Prompt box with copy button */
.prompt { position: relative; margin: 16px 0; background: #0b0d10; border: 1px solid rgba(56, 189, 248, .28); border-radius: 16px; padding: 20px 20px 18px; box-shadow: 0 0 0 1px rgba(139, 243, 230, .04), 0 12px 40px -24px rgba(56, 189, 248, .45); }
.prompt .label { font-size: 12px; color: var(--mint); letter-spacing: .06em; }
.prompt pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.65; color: #e6ebf1; margin-top: 10px; }
.copy { position: absolute; top: 14px; right: 14px; font: inherit; font-size: 13px; font-weight: 600; color: #1a1406; background: var(--champ); border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.copy.done { background: var(--mint); }

.tip { margin: 22px 0; padding: 18px 20px; border-radius: 16px; border: 1px solid rgba(240, 207, 152, .35); background: rgba(240, 207, 152, .06); }
.tip b { color: var(--champ); }

/* CTA */
.cta-box { margin-top: 56px; padding: 32px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(240, 207, 152, .35); text-align: center; }
.cta-box h2 { margin: 0; font-size: 26px; }
.cta-box p { color: var(--soft); margin-top: 8px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px; padding: 12px 24px; border-radius: 999px; }
.btn.primary { background: var(--champ); color: #1a1406; }
.btn.secondary { color: var(--mint); border: 1px solid rgba(56, 189, 248, .5); background: rgba(56, 189, 248, .08); }

/* Isaac's mascot opens and closes the pages; the demo uses a fictional AI person */
.pl-hero { position: relative; }
.hero-mascot { position: absolute; right: 0; bottom: 0; width: 210px; filter: drop-shadow(0 18px 40px rgba(56, 189, 248, .22)); }
.mascot-intro { display: flex; align-items: flex-end; gap: 18px; margin-top: 30px; max-width: 760px; }
.mascot-intro img { width: 120px; flex: none; filter: drop-shadow(0 12px 30px rgba(56, 189, 248, .25)); }
.mascot-intro .bubble { position: relative; background: var(--surface); border: 1px solid rgba(56, 189, 248, .35); border-radius: 18px 18px 18px 4px; padding: 16px 18px; color: var(--soft); font-size: 15px; box-shadow: 0 12px 40px -24px rgba(56, 189, 248, .6); }
.hero-img { position: relative; }
.demo-tag { position: absolute; left: 14px; bottom: 14px; font-size: 12px; font-weight: 600; color: var(--mint); background: rgba(7, 8, 10, .78); border: 1px solid rgba(56, 189, 248, .45); border-radius: 999px; padding: 5px 12px; }
.content figure.light { background: #f5f3ef; }
.cta-mascot { width: 130px; margin: -86px auto 6px; filter: drop-shadow(0 16px 30px rgba(240, 207, 152, .25)); }
.cta-box { margin-top: 96px; }

@media (max-width: 760px) {
  .hero-mascot { position: relative; display: block; width: 130px; margin-bottom: 12px; }
}
@media (max-width: 640px) {
  .mascot-intro img { width: 84px; }
  .mascot-intro .bubble { font-size: 14px; }
}

.pl-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.pl-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .pl-header nav { gap: 14px; font-size: 13px; }
  .pl-header nav .hide-sm { display: none; }
  .pl-hero { padding: 48px 0 24px; }
  .copy { position: static; margin-top: 12px; }
  .prompt { padding: 18px 16px; }
  .cta-box { padding: 24px 18px; }
}

/* Mascot that turns its head towards the cursor (prompt-library.js drives the transforms) */
.mascot-follow { aspect-ratio: 349 / 517; perspective: 700px; }
.mascot-follow img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mascot-follow .m-head { transform-origin: 50% 47%; will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .mascot-follow.idle .m-head { animation: mascot-look 6s ease-in-out infinite; }
}
@keyframes mascot-look { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg) translateX(-1%); } 65% { transform: rotate(3deg) translateX(1%); } }

/* Article column centred in the page */
.article header, .article .hero-img, .content { margin-inline: auto; }

/* Result picture paired with each prompt */
.content figure.result { margin: 18px 0 14px; }
.content figure.result img { width: 100%; }

/* Back to the library: fixed at the top right so it is always reachable */
.back-link { position: fixed; top: 104px; right: 24px; z-index: 25; background: rgba(7, 8, 10, .88); backdrop-filter: blur(10px); }
@media (max-width: 760px) { .back-link { top: 84px; right: 12px; font-size: 13px; padding: 6px 12px 6px 10px; } }

/* Back-to-top arrow, shown after scrolling */
.to-top { position: fixed; right: 24px; bottom: 28px; z-index: 25; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(240, 207, 152, .55); background: rgba(15, 17, 21, .92); color: var(--champ); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 0 20px rgba(56, 189, 248, .2), 0 8px 24px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s, color .2s, border-color .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--mint); border-color: rgba(139, 243, 230, .6); }
@media (max-width: 760px) { .to-top { right: 14px; bottom: 18px; width: 46px; height: 46px; } }
