/* ai-adver.com — shared styles v0.1 */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --fg: #1c1c1a;
  --muted: #6b6a64;
  --line: #e2e0d8;
  --accent: #e8562a;
  --accent-ink: #ffffff;
  --official: #1f8a4c;
  --platform_doc: #0e7c86;
  --public_case: #2f5fd0;
  --community_claim: #b7791f;
  --hypothesis: #7a7a75;
  --radius: 10px;
  --max: 1360px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121311; --surface: #1b1c1a; --surface-2: #242522; --fg: #ecebe6; --muted: #a4a39c; --line: #30312d;
    --accent: #ff7a4d; --accent-ink: #1b1c1a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121311; --surface: #1b1c1a; --surface-2: #242522; --fg: #ecebe6; --muted: #a4a39c; --line: #30312d;
  --accent: #ff7a4d; --accent-ink: #1b1c1a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 1rem; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--line); }
code:not(pre code) { background: var(--surface-2); padding: .1em .4em; border-radius: 5px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; letter-spacing: .02em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap table { min-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; }
.section-head p { margin: 0; color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: .85rem; font-weight: 900; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--fg); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface-2); font-weight: 700; }
.theme-btn { border: 1px solid var(--line); background: var(--surface); color: var(--fg); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.theme-btn:hover { background: var(--surface-2); }
@media (max-width: 760px) {
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 60; }
  .nav a { flex: 1 1 18%; }
  .nav a { text-align: center; font-size: .78rem; padding: 8px 2px; }
  body { padding-bottom: 64px; }
  .theme-btn { margin-left: auto; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 9px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; font-size: .95rem; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(.95); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* hero */
.hero { padding: 72px 0 48px; }
.hero h1 { max-width: 20ch; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; margin-bottom: 28px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 40px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; }
.stat b { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .875rem; }

/* pillar cards */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; color: var(--fg); }
.pillar:hover { border-color: var(--accent); text-decoration: none; }
.pillar .num { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: .85rem; }
.pillar h3 { margin: 0; }
.pillar p { margin: 0; color: var(--muted); }
.pillar .more { margin-top: auto; font-weight: 700; color: var(--accent); }

/* tactic cards */
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1500px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.cards.two { grid-template-columns: 1fr; }
@media (min-width: 900px) { .cards.two { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; color: var(--fg); font: inherit; min-height: 200px; }
.card:hover { border-color: var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--muted); }
.card h3 { font-size: 1.02rem; margin: 0; line-height: 1.4; }
.card .claim { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--fg); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.tag.ev { color: #fff; }
.tag.ev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ev-official { background: var(--official); } .ev-platform_doc { background: var(--platform_doc); } .ev-public_case { background: var(--public_case); } .ev-community_claim { background: var(--community_claim); } .ev-hypothesis { background: var(--hypothesis); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

/* library layout */
.library { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 32px 0 64px; }
@media (min-width: 960px) { .library { grid-template-columns: 260px 1fr; align-items: start; } .filters { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.filters details { border-top: 1px solid var(--line); padding: 8px 0; }
.filters details:first-of-type { border-top: 0; }
.filters summary { cursor: pointer; font-weight: 700; font-size: .9rem; padding: 6px 0; list-style: none; display: flex; justify-content: space-between; }
.filters summary::after { content: "+"; color: var(--muted); }
.filters details[open] summary::after { content: "−"; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: .9rem; padding: 4px 0; cursor: pointer; }
.filters label .n { margin-left: auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.filters input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.filters .reset { width: 100%; margin-top: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; height: 42px; }
.search input { flex: 1; border: 0; background: transparent; color: var(--fg); font: inherit; outline: none; min-width: 0; }
.toolbar select { height: 42px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; padding: 0 10px; }
.count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.active-filters button { border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
@media (max-width: 959px) { .filters-toggle { display: inline-flex; } .filters { display: none; } .filters.open { display: block; } }
@media (min-width: 960px) { .filters-toggle { display: none; } }

/* detail drawer */
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.drawer .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; padding: 24px 24px 48px; }
.drawer .close { position: sticky; top: 0; float: right; margin: -8px -8px 0 0; }
.drawer h2 { font-size: 1.35rem; margin-top: 8px; }
.drawer .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.drawer dl { margin: 0; }
.drawer dt { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 18px; }
.drawer dd { margin: 6px 0 0; }
.drawer ol { padding-left: 1.3em; margin: 6px 0 0; }
.drawer ol li { margin-bottom: 6px; }
.callout { border-left: 3px solid var(--accent); background: var(--surface-2); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin: 12px 0; }
.callout.warn { border-color: var(--community_claim); }
.source { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; }
.source a { word-break: break-all; }

/* bars */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: .85rem; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* content pages */
.prose { max-width: 920px; }
/* report viewer (markdown) */
.report { max-width: 1100px; }
.report table { font-size: .9rem; display: block; overflow-x: auto; }
.report h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.report h2 { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.report blockquote { margin: 0; padding: 8px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.report-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .report-list { grid-template-columns: repeat(2, 1fr); } }
.copybar { display: flex; justify-content: flex-end; margin: -6px 0 6px; }
.copybar .btn { padding: 4px 10px; font-size: .78rem; }
.prose h2 { margin-top: 48px; padding-top: 8px; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: .9rem; margin: 24px 0 40px; }
.toc ol { margin: 6px 0 0; padding-left: 1.2em; columns: 2; }
.toc a { color: var(--fg); }
.step-list { counter-reset: s; display: grid; gap: 10px; }
.step { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.step::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.step h4 { margin: 2px 0 4px; font-size: 1rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.diagram svg text { font-family: var(--font); fill: var(--fg); }
.diagram svg .box { fill: var(--surface-2); stroke: var(--line); }
.diagram svg .acc { fill: var(--accent); }
.diagram svg .line { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.diagram svg .sub { fill: var(--muted); font-size: 11px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: .875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
