/* =========================================================
   AIPickPro — public theme (Nov 2026)
   System fonts, no external requests, light + dark mode.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --surface: #ffffff;
  --text: #0e1525;
  --text-2: #2c3446;
  --muted: #5d6679;
  --line: #e5e8f0;
  --line-2: #d6dae5;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --brand-ink: #3730a3;
  --brand-soft: #eef0ff;
  --grad: linear-gradient(135deg, #6d5dfc 0%, #06b6d4 100%);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .14);
  --shadow-lg: 0 20px 50px -20px rgba(16, 24, 40, .30);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 66px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Charter", "Georgia", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0e17;
  --bg-soft: #0f1522;
  --surface: #121a29;
  --text: #eaf0fb;
  --text-2: #cdd5e4;
  --muted: #95a0b4;
  --line: #1f2939;
  --line-2: #2b374b;
  --brand: #8f87ff;
  --brand-ink: #b9b4ff;
  --brand-soft: #1b1f3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-pad { padding-top: 36px; padding-bottom: 64px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; }
.icon { flex: none; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.lead { font-size: 19px; color: var(--muted); max-width: 680px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .15s ease, opacity .15s; }
.btn:hover { color: var(--bg); opacity: .9; transform: translateY(-1px); }
.btn--brand { background: var(--grad); color: #fff; }
.btn--brand:hover { color: #fff; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn--ghost:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2); transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--bg-soft); border-color: var(--line); color: var(--text); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.main-nav a { padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.main-nav a:hover { background: var(--bg-soft); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.menu-btn { display: none; }
.i-sun, .i-moon { display: inline-flex; }
[data-theme="dark"] .i-sun, .i-moon { display: none; }
[data-theme="dark"] .i-moon { display: inline-flex; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .1s linear; }

/* ---------- search overlay / mobile menu ---------- */
.search-overlay, .mobile-menu { position: fixed; inset: 0; z-index: 80; background: rgba(8, 12, 22, .55); backdrop-filter: blur(4px); }
.search-panel { position: relative; max-width: 720px; margin: 12vh auto 0; padding: 0 20px; }
.search-form { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 10px 18px; box-shadow: var(--shadow-lg); color: var(--muted); }
.search-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 18px; color: var(--text); padding: 8px 0; }
.search-form--inline { box-shadow: none; max-width: 560px; margin: 24px 0; }
.search-close { position: absolute; right: 28px; top: -52px; color: #fff; }
.search-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.mobile-menu-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 88vw); background: var(--bg); padding: 16px 20px 32px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mobile-menu nav { display: grid; }
.mobile-menu nav a { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; }
.mobile-menu nav small { color: var(--muted); font-weight: 500; }

/* ---------- sections ---------- */
.section { margin-top: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 24px; }
.section-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--grad); margin-right: 10px; vertical-align: 3px; }
.section-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.section-link .icon { width: 16px; height: 16px; }
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- cards ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-soft); aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-img { transform: scale(1.04); }
.card-img--empty { display: grid; place-items: center; background: var(--brand-soft); }
.card-img--empty .logo-mark { width: 44px; height: 44px; opacity: .8; }
.card-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kicker { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); }
.kicker:hover { color: var(--brand-ink); }
.card-title { font-size: 19px; font-weight: 750; letter-spacing: -.015em; line-height: 1.3; }
.card-title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s; }
.card-title a:hover { color: var(--text); background-size: 100% 1.5px; }
.card-excerpt { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.card-meta .dot { opacity: .6; }

.card--large .card-media { border-radius: 20px; }
.card--large .card-title { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.03em; }
.card--large .card-excerpt { font-size: 17px; -webkit-line-clamp: 3; }

.card--compact { flex-direction: row; gap: 14px; align-items: flex-start; }
.card--compact .card-media { flex: none; width: 112px; aspect-ratio: 4 / 3; border-radius: 12px; }
.card--compact .card-title { font-size: 16px; line-height: 1.35; }
.card--compact .card-body { gap: 5px; }

.card--row { flex-direction: row; gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.card--row:first-child { padding-top: 0; }
.card--row .card-media { flex: none; width: 300px; }
.card--row .card-title { font-size: 22px; }

/* ---------- home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 40px; padding-top: 32px; }
.hero-side { display: flex; flex-direction: column; }
.hero-side-title { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.hero-side .card--compact { padding: 16px 0; border-top: 1px solid var(--line); }
.hero-side .card--compact:first-of-type { border-top: 0; padding-top: 0; }
.intro-band { margin-top: 48px; padding: 28px 32px; border-radius: 22px; background: var(--bg-soft); border: 1px solid var(--line); display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.intro-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: var(--grad); opacity: .12; filter: blur(10px); }
.intro-band h1 { font-size: clamp(22px, 2.6vw, 30px); }
.intro-band p { margin: 8px 0 0; color: var(--muted); }
.topic-pills { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 650; transition: border-color .15s, color .15s; }
.pill small { color: var(--muted); font-weight: 600; font-size: 12px; }
.pill:hover { border-color: var(--brand); }
.home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 28px; }
.widget { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); }
.widget-title { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.ranked li:first-child { border-top: 0; padding-top: 0; }
.ranked li::before { content: counter(rank, decimal-leading-zero); font-size: 20px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.ranked a { font-weight: 700; font-size: 15px; line-height: 1.35; }
.ranked span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.widget-about p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

/* ---------- archive header ---------- */
.archive-head { padding: 40px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.archive-head h1 { font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -.035em; }
.archive-head p { margin: 12px 0 0; color: var(--muted); font-size: 18px; max-width: 760px; }
.archive-count { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 650; color: var(--muted); }

/* ---------- breadcrumbs ---------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: 14px; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs [aria-current] { color: var(--text-2); display: inline-block; max-width: 46ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* ---------- article ---------- */
.article-head { max-width: 860px; margin: 0 auto; padding: 34px 0 0; text-align: center; }
.article-head .breadcrumbs ol { justify-content: center; }
.article-head .kicker { align-self: center; display: inline-block; margin: 22px 0 14px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); }
.article-title { font-size: clamp(32px, 4.8vw, 52px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.article-dek { margin: 18px auto 0; max-width: 720px; font-size: 20px; line-height: 1.5; color: var(--muted); }
.byline { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 12px; margin-top: 26px; font-size: 14px; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.byline-text { text-align: left; line-height: 1.4; }
.byline-text strong { display: block; color: var(--text); font-size: 15px; }
.byline-text strong a:hover { color: var(--brand); }
.article-hero { max-width: 1040px; margin: 34px auto 0; }
.article-hero img { width: 100%; border-radius: 22px; border: 1px solid var(--line); aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-soft); }
.article-hero figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }

.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 260px; gap: 64px; justify-content: center; margin-top: 44px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
.toc-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc-title .icon { width: 16px; height: 16px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.4; color: var(--muted); }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 650; }
.toc-mobile { display: none; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); }
.toc-mobile summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); }
.toc-mobile[open] summary::after { content: "–"; }
.toc-mobile ol { margin: 0; padding: 0 18px 16px 38px; }
.toc-mobile li { padding: 4px 0; color: var(--muted); }
.toc-mobile a:hover { color: var(--brand); }

/* ---------- prose ---------- */
.prose { font-size: 18.5px; line-height: 1.78; color: var(--text-2); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35em; }
.prose h2 { font-size: 30px; color: var(--text); margin: 2.1em 0 .7em; letter-spacing: -.025em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: 22px; color: var(--text); margin: 1.8em 0 .55em; }
.prose h4 { font-size: 19px; color: var(--text); margin: 1.5em 0 .5em; }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--brand); }
.prose strong { color: var(--text); font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose li::marker { color: var(--brand); }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 4px solid; border-image: var(--grad) 1; font-family: var(--font-serif); font-size: 21px; font-style: italic; color: var(--text); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: .12em .4em; }
.prose pre { overflow-x: auto; background: #0d1220; color: #e5eaf5; border-radius: 14px; padding: 18px; font-size: 15px; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose img { border-radius: 14px; margin: 1.6em auto; }
.prose figure { margin: 1.8em 0; }
.prose figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.table-wrap { margin: 1.8em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; min-width: 520px; }
.prose th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--bg-soft); color: var(--text); font-weight: 750; font-size: 14px; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
.prose td:first-child { font-weight: 650; color: var(--text); }

.article-footer { margin-top: 44px; display: grid; gap: 28px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-list .label { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.tag { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; }
.tag:hover { border-color: var(--brand); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share .label { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 14px; font-weight: 650; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--brand); color: var(--brand); }
.share .icon { width: 16px; height: 16px; }
.author-box { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 24px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); }
.author-box .avatar { width: 64px; height: 64px; font-size: 22px; }
.author-box h2 { font-size: 18px; }
.author-box p { margin: 6px 0 10px; color: var(--muted); font-size: 15px; }
.author-box a.more { font-size: 14px; font-weight: 700; color: var(--brand); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s; }
.post-nav a:hover { border-color: var(--brand); color: var(--text); }
.post-nav small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.post-nav strong { font-size: 15px; line-height: 1.35; display: block; }
.post-nav .next { text-align: right; grid-column: 2; }
.notice { margin-top: 10px; padding: 14px 18px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- static pages ---------- */
.page-head { padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -.035em; max-width: 880px; }
.page-head .lead { margin-top: 14px; }
.page-layout { display: grid; grid-template-columns: minmax(0, 760px) 280px; gap: 64px; margin-top: 44px; }
.page-meta { margin-top: 18px; font-size: 14px; color: var(--muted); }
.topic-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 1.4em 0; }
.topic-cards div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 15.5px; line-height: 1.55; }
.topic-cards strong { display: block; margin-bottom: 4px; }
.principles { display: grid; gap: 14px; margin: 1.4em 0; }
.principles div { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 18px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; }
.principles b { font-size: 22px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.principles strong { display: block; }
.author-card { display: grid; grid-template-columns: 76px 1fr; gap: 20px; padding: 24px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); margin: 1.2em 0 1.6em; }
.author-card .avatar { width: 76px; height: 76px; font-size: 26px; }
.author-card p { margin: 0 0 .8em; font-size: 16.5px; }
.cta-box { margin-top: 2.4em; padding: 28px; border-radius: 18px; background: var(--grad); color: #fff; }
.cta-box h2 { color: #fff; margin: 0 0 8px !important; font-size: 24px; }
.cta-box p { color: rgba(255, 255, 255, .9); margin: 0 0 16px; }
.cta-box .btn { background: #fff; color: #1e1b4b; }
.side-nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.side-nav a { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--text-2); }
.side-nav a:hover { color: var(--brand); }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 180px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 14px 18px; border-radius: 12px; font-size: 15px; margin-bottom: 20px; }
.alert--ok { background: #e8f8ef; color: #11633a; border: 1px solid #b7e6cb; }
.alert--err { background: #fdecec; color: #8a1c1c; border: 1px solid #f5c2c2; }
[data-theme="dark"] .alert--ok { background: #0f2a1d; color: #8ee0b2; border-color: #1d4d34; }
[data-theme="dark"] .alert--err { background: #2c1212; color: #f4a7a7; border-color: #5a2222; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- search / 404 ---------- */
.notfound { padding: 40px 0 10px; max-width: 720px; }
.notfound h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -.035em; }
.empty { padding: 40px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }

/* ---------- pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 48px; }
.page-link { min-width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.page-link:hover { border-color: var(--brand); }
.page-link.is-current { background: var(--text); color: var(--bg); border-color: var(--text); }
.page-gap { align-self: center; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { margin-top: 90px; background: var(--bg-soft); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.footer-about p { margin: 16px 0; color: var(--muted); font-size: 15px; max-width: 360px; }
.footer-rss { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand); }
.footer-rss .icon { width: 16px; height: 16px; }
.footer-title { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* ---------- content boxes (AiTechnoly format) ---------- */
.prose .box-answer, .prose .box-tip, .prose .box-warn, .prose .verdict { margin: 1.6em 0; padding: 18px 22px; border-radius: 14px; border: 1px solid; font-size: 17px; line-height: 1.65; }
.prose .box-answer > :last-child, .prose .box-tip > :last-child, .prose .box-warn > :last-child, .prose .verdict > :last-child { margin-bottom: 0; }
.prose .box-answer > :first-child, .prose .box-tip > :first-child, .prose .box-warn > :first-child, .prose .verdict > :first-child { margin-top: 0; }
.prose .box-answer { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); border-left: 5px solid var(--brand); color: var(--text); }
.prose .box-tip { background: color-mix(in srgb, #10b981 9%, var(--bg)); border-color: color-mix(in srgb, #10b981 35%, transparent); border-left: 5px solid #10b981; }
.prose .box-warn { background: color-mix(in srgb, #f59e0b 10%, var(--bg)); border-color: color-mix(in srgb, #f59e0b 40%, transparent); border-left: 5px solid #f59e0b; }
.prose .verdict { background: var(--bg-soft); border-color: var(--line-2); position: relative; padding-top: 44px; }
.prose .verdict::before { content: "Verdict"; position: absolute; top: 14px; left: 22px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--grad); padding: 3px 10px; border-radius: 999px; }
.prose .box-answer strong:first-child { color: var(--brand); }
.prose .box-tip strong:first-child { color: #059669; }
.prose .box-warn strong:first-child { color: #b45309; }
[data-theme="dark"] .prose .box-tip strong:first-child { color: #34d399; }
[data-theme="dark"] .prose .box-warn strong:first-child { color: #fbbf24; }
.prose .box-answer ul, .prose .box-tip ul, .prose .box-warn ul, .prose .verdict ul { margin-bottom: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 720px); }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .home-columns { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .page-layout { grid-template-columns: minmax(0, 1fr); }
  .side-nav { display: none; }
}
@media (max-width: 980px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-grid; }
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .intro-band { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .container { padding: 0 16px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .card--row { flex-direction: column; align-items: stretch; gap: 14px; }
  .card--row .card-media { width: 100%; }
  .card--row .card-title { font-size: 20px; }
  .article-title { font-size: 31px; }
  .article-dek { font-size: 17.5px; }
  .byline { justify-content: flex-start; text-align: left; max-width: 100%; }
  .article-head { text-align: left; }
  .article-head .breadcrumbs ol { justify-content: flex-start; }
  .article-head .kicker { align-self: flex-start; }
  .article-hero { margin-left: -16px; margin-right: -16px; }
  .article-hero img { border-radius: 0; border-left: 0; border-right: 0; }
  .prose { font-size: 17.5px; line-height: 1.75; }
  .prose h2 { font-size: 25px; }
  .prose h3 { font-size: 20px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: auto; }
  .form-row { grid-template-columns: 1fr; }
  .topic-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; }
  .intro-band { padding: 22px; }
  .brand-name { font-size: 18px; }
  .breadcrumbs [aria-current] { max-width: 24ch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .toc, .toc-mobile, .share, .post-nav, .sidebar, .search-overlay, .mobile-menu { display: none !important; }
  .article-layout { display: block; }
}
