/* The AI Security Learning Center's own pages: one per incident, news story, risk, weakness, CVE,
   practice and glossary term, a page listing each kind, and the not-found page. The same colors,
   type and shapes as the one-page site (src/ai_security_curator/web/styles.css), kept small. */
:root {
  --navy-900: #06201a; --navy-line: #1f4a3c; --on-navy: #ecfdf5; --on-navy-muted: #a7c7b9; --cyan: #34d399;
  --glow-text: linear-gradient(90deg, #6ee7b7 0%, #34d399 45%, #a3e635 100%);
  --bg: #f4f8f6; --surface: #ffffff; --surface-2: #edf4f0; --border: #dbe7e0; --text: #0b1f18; --muted: #52665d;
  --accent: #047857; --accent-soft: #e1f5ec; --on-accent: #ffffff;
  --good: #15803d; --good-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #dc2626; --bad-soft: #fee2e2;
  --crit: #991b1b; --info: #1e40af; --info-soft: #e0e7ff;
  --shadow: 0 1px 2px rgba(8, 30, 22, 0.05), 0 8px 24px -12px rgba(8, 30, 22, 0.16);
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #04120d; --surface: #0a2019; --surface-2: #0f2a21; --border: #1e3f33; --text: #e6f2ec; --muted: #9bb5a9;
    --accent: #6ee7b7; --accent-soft: #123a2d; --on-accent: #02160f;
    --good: #4ade80; --good-soft: #0f2a1c; --warn: #fbbf24; --warn-soft: #33260c; --bad: #f87171; --bad-soft: #3a1518;
    --crit: #fca5a5; --info: #93c5fd; --info-soft: #152548;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #04120d; --surface: #0a2019; --surface-2: #0f2a21; --border: #1e3f33; --text: #e6f2ec; --muted: #9bb5a9;
  --accent: #6ee7b7; --accent-soft: #123a2d; --on-accent: #02160f;
  --good: #4ade80; --good-soft: #0f2a1c; --warn: #fbbf24; --warn-soft: #33260c; --bad: #f87171; --bad-soft: #3a1518;
  --crit: #fca5a5; --info: #93c5fd; --info-soft: #152548;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.62 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }
.muted { color: var(--muted); }
.pg-skip { position: absolute; left: -999px; top: 0.5rem; z-index: 20; padding: 0.5rem 0.8rem; background: var(--surface); border-radius: 8px; }
.pg-skip:focus { left: 0.75rem; }

/* the header: the brand, the theme switch and the way into the center */
.pg-top { position: sticky; top: 0; z-index: 10; background: var(--navy-900); color: var(--on-navy); border-bottom: 1px solid var(--navy-line); }
.pg-top-in { max-width: 74rem; margin: 0 auto; padding: 0.55rem 1.25rem; display: flex; align-items: center; gap: 0.6rem 1.1rem; flex-wrap: wrap; }
.pg-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--on-navy); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }
.pg-brand svg { width: 28px; height: 28px; color: var(--cyan); flex: none; }
.pg-brand b { font-weight: 700; white-space: nowrap; background: var(--glow-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pg-top :focus-visible { outline-color: var(--cyan); }
.pg-spacer { flex: 1; }
.pg-theme { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--navy-line); background: transparent; color: var(--on-navy); cursor: pointer; }
.pg-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pg-theme .moon, :root[data-theme="dark"] .pg-theme .sun { display: none; }
:root[data-theme="dark"] .pg-theme .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pg-theme .sun { display: none; } :root:not([data-theme="light"]) .pg-theme .moon { display: block; } }
.pg-open { display: inline-flex; align-items: center; padding: 0.42rem 0.85rem; border-radius: 10px; background: linear-gradient(135deg, #34d399 0%, #059669 100%); color: #022c1e; font-weight: 700; font-size: 0.88rem; text-decoration: none; white-space: nowrap; }
.pg-open:hover { filter: brightness(1.06); }
.pg-sister { color: var(--on-navy-muted); font-size: 0.88rem; font-weight: 600; text-decoration: none; padding: 0.38rem 0.7rem; border: 1px solid var(--navy-line); border-radius: 10px; white-space: nowrap; }
.pg-sister:hover { color: var(--on-navy); }
.pg-mcp { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--border); scroll-margin-top: 4.5rem; }
.pg-mcp h2 { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.pg-mcp-id { font-family: var(--font-mono); font-size: 0.85rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pg-mcp-row { margin: 0.45rem 0; }
.pg-mcp ul { margin: 0.2rem 0 0.6rem; }
.pg-mcp-toc { margin: 1.2rem 0 0.5rem; }
@media (max-width: 760px) {
  .pg-top { position: static; }
  .pg-top-in { padding: 0.5rem 1rem; }
}
@media (max-width: 560px) { .pg-open { display: none; } }

/* the page */
.pg-main { max-width: 74rem; margin: 0 auto; padding: 1.4rem 1.25rem 3.5rem; }
@media (max-width: 760px) { .pg-main { padding: 1rem 1rem 3rem; } }
.pg-crumbs ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.pg-crumbs li + li::before { content: "/"; margin-right: 0.25rem; color: var(--border); }
.pg-crumbs a { color: var(--muted); text-decoration: none; }
.pg-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.pg-crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.pg-kicker { margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.pg-kicker .sep { color: var(--muted); margin: 0 0.35rem; }
.pg-head h1 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 0.7rem; max-width: 52rem; }
.pg-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0 0 1.2rem; }
.pg-badge { display: inline-flex; align-items: center; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pg-badge.sev-critical { background: var(--bad-soft); color: var(--crit); border-color: var(--bad); }
.pg-badge.sev-high { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pg-badge.sev-medium { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pg-badge.sev-low, .pg-badge.sev-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pg-badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pg-badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pg-badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 1.5rem 2.25rem; align-items: start; }
@media (max-width: 960px) { .pg-grid { grid-template-columns: 1fr; } }
.pg-body { max-width: 46rem; }
.pg-lede { font-size: 1.12rem; line-height: 1.6; margin: 0 0 1.4rem; }
.pg-body section { margin: 0 0 1.5rem; }
.pg-body h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.pg-body p { margin: 0 0 0.75rem; }
.pg-body ol, .pg-body ul { margin: 0; padding-left: 1.3rem; }
.pg-body li { margin: 0.3rem 0; }
.pg-body li::marker { color: var(--accent); font-weight: 700; }
.pg-note { padding: 0.75rem 0.95rem; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--border); }
/* Is my AI tool safe? the incidents and CVEs as a list of small cards, the index wider */
.pg-body ul.pg-tool-list { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.pg-tool-list li { margin: 0; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pg-tool-list .pg-meta { font-size: 0.85rem; color: var(--muted); margin-right: 0.35rem; }
.pg-tool-list .muted { font-size: 0.93rem; }
.pg-body.pg-wide { max-width: none; }
.pg-body ul.pg-cards { padding: 0; }
.pg-tools section { margin: 0 0 1.6rem; }
.pg-sources { font-size: 0.93rem; }
.pg-sources a::after { content: " \2197"; font-size: 0.75em; opacity: 0.75; }
.pg-facts { position: sticky; top: 4.6rem; display: grid; gap: 1rem; }
@media (max-width: 960px) { .pg-facts { position: static; } }
.pg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.pg-card h2 { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.55rem; }
.pg-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.92rem; }
.pg-card li a { font-weight: 600; }
.pg-facts dl { margin: 0; display: grid; gap: 0.55rem; font-size: 0.92rem; }
.pg-facts dt { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pg-facts dd { margin: 0.05rem 0 0; overflow-wrap: anywhere; }
.pg-open-here { font-weight: 700; font-size: 0.92rem; }
.pg-open-here::after { content: "\2192"; margin-left: 0.35rem; }
/* a button that reads as a link, as in the Learning Center (the AR page's "Turn them off") */
.linkish { border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; padding: 0; cursor: pointer; }

/* where next: the three doors of the first screen, at the foot of every page */
.pg-next { margin: 2.2rem 0 0; padding: 1.25rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.pg-next > h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.pg-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 0.8rem; }
.pg-door { position: relative; display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pg-door:hover, .pg-door:focus-within { border-color: var(--accent); }
.pg-door a { font-family: var(--font-display); font-weight: 700; color: var(--text); text-decoration: none; }
.pg-door a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pg-door span { font-size: 0.88rem; color: var(--muted); }

/* related entries */
.pg-related { margin: 2rem 0 0; }
.pg-related > h2 { font-size: 1.15rem; margin: 0 0 0.8rem; }
.pg-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 0.8rem; }
.pg-cards li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 1rem; box-shadow: var(--shadow); }
.pg-cards li:hover { border-color: var(--accent); }
.pg-cards a { font-weight: 700; color: var(--text); text-decoration: none; }
.pg-cards a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pg-cards .pg-meta { display: block; margin-top: 0.3rem; font-size: 0.82rem; color: var(--muted); }

/* the footer */
.pg-foot { border-top: 1px solid var(--border); background: var(--surface); }
.pg-foot-in { max-width: 74rem; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; font-size: 0.88rem; color: var(--muted); display: grid; gap: 0.5rem; }
.pg-foot p { margin: 0; }
.pg-foot strong { color: var(--text); }

@media print {
  .pg-top, .pg-next, .pg-related, .pg-theme { display: none !important; }
  .pg-grid { grid-template-columns: 1fr; }
  .pg-facts { position: static; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Share as a picture: the button beside the open link, and the overlay assets/share.js opens */
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.pg-actions .pg-open-here { display: inline; }
.pg-actions .pg-open-here::after { margin-left: 0.35rem; }
.pg-share { display: inline-flex; align-items: center; margin: 0; padding: 0.42rem 0.85rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer; vertical-align: middle; }
.pg-share:hover { border-color: var(--accent); color: var(--accent); }
.sc-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(2, 10, 16, 0.66); }
.sc-box { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 0.7rem; padding: 1rem; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.sc-box.brief { width: min(560px, 100%); }
.sc-img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 10px; border: 1px solid var(--border); background: #04121b; }
.sc-img.brief { aspect-ratio: 1080 / 1350; max-height: calc(100vh - 220px); width: auto; max-width: 100%; justify-self: center; background: #f6faf8; }
.sc-box .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.sc-box .spacer { flex: 1; }
.sc-box .small { font-size: 0.86rem; }
.sc-box .btn { display: inline-flex; align-items: center; padding: 0.45rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.sc-box .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sc-box .btn.small { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.sc-box .btn:disabled { opacity: 0.55; cursor: default; }
#toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 8px); z-index: 1100; padding: 0.55rem 0.9rem; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 0.86rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media print { .sc-overlay, .pg-share { display: none; } }

/* AI attacks on your desk: one big button for the phone in hand, the picture and the QR code on a
   computer; without the script (no data-ar) everything shows */
.pg-ar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem 1.4rem; margin: 0.4rem 0 1.4rem; }
.pg-ar-go { display: grid; justify-items: center; gap: 0.75rem; padding: 1rem 1.2rem 1.15rem; border-radius: 22px; background: radial-gradient(circle at 50% 38%, #10264a 0%, #04070f 75%); color: #fff; text-decoration: none; box-shadow: var(--shadow-lg, var(--shadow)); }
.pg-ar-go img { display: block; width: min(300px, 72vw); height: auto; border-radius: 50%; }
.pg-ar-go span { display: inline-flex; padding: 0.6rem 1.2rem; border-radius: 999px; background: linear-gradient(135deg, #34d399 0%, #059669 100%); color: #022c1e; font-weight: 800; font-size: 1.02rem; }
.pg-ar-qr { display: flex; align-items: center; gap: 1rem; max-width: 30rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.pg-ar-qr p { margin: 0; }
.pg-ar-code { flex: none; padding: 6px; border-radius: 8px; background: #fff; }
.pg-ar-code svg { display: block; width: 128px; height: 128px; shape-rendering: crispEdges; }
html[data-ar="ios"] .pg-ar-android, html[data-ar="ios"] .pg-ar-qr { display: none; }
html[data-ar="android"] .pg-ar-ios, html[data-ar="android"] .pg-ar-qr { display: none; }
html[data-ar="desktop"] .pg-ar-android { display: none; }
html[data-ar="desktop"] .pg-ar-ios { pointer-events: none; }
html[data-ar="desktop"] .pg-ar-ios span { display: none; }
