:root {
  --p: #2563EB; --p-d: #1D4ED8; --p-l: #EFF6FF; --ink: #111827; --body: #4B5563; --muted: #6B7280; --line: #E5E7EB; --bg2: #F9FAFB;
  --navy: #1E3A5F; --r: 8px; --head: "Outfit", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font: 16px/1.6 "Inter", system-ui, sans-serif; color: var(--body); background: #fff; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); margin: 0; line-height: 1.2; letter-spacing: -.01em; }
a { color: var(--p); }
img, svg { display: block; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--p) 55%, transparent); outline-offset: 2px; }

.btn, .btn-o { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 8px; font: 600 15px/1 "Inter", sans-serif; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s; white-space: nowrap; }
.btn { background: var(--p); color: #fff; border: 1px solid var(--p); }
.btn:hover { background: var(--p-d); border-color: var(--p-d); }
.btn-o { background: #fff; color: var(--ink); border: 1px solid #D1D5DB; }
.btn-o:hover { border-color: var(--p); color: var(--p); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--bg2); }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.nav.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 8px rgba(17, 24, 39, .04); }
.nav-in { display: flex; align-items: center; gap: 32px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 21px var(--head); color: var(--ink); }
.logo svg { width: 32px; height: 32px; }
.links { display: flex; align-items: center; gap: 4px; }
.links > a, .dd-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--body); text-decoration: none; font: 500 15px "Inter", sans-serif; background: none; border: 0; cursor: pointer; }
.links > a:hover, .dd-btn:hover { color: var(--ink); background: var(--bg2); }
.dd-btn.on { color: var(--p); }
.dd-btn .i { width: 16px; height: 16px; transition: transform .2s; }
.dd-btn[aria-expanded="true"] .i { transform: rotate(180deg); }
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 8px); left: -12px; width: 320px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(17, 24, 39, .12); }
.dd-menu a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.dd-menu a .i { margin-top: 2px; color: var(--p); }
.dd-menu a:hover, .dd-menu a[aria-current] { background: var(--p-l); }
.dd-menu b { display: block; font-weight: 600; font-size: 15px; }
.dd-menu small { color: var(--muted); font-size: 13px; }
.nav-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.signin { padding: 10px 12px; color: var(--ink); font-weight: 500; text-decoration: none; font-size: 15px; }
.signin:hover { color: var(--p); }
.burger { display: none; }
.mmenu { border-top: 1px solid var(--line); padding: 8px 20px 20px; background: #fff; max-height: calc(100vh - 64px); overflow-y: auto; }
.mmenu > a { display: flex; align-items: center; min-height: 48px; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }
.mmenu > a.sub { padding-left: 16px; color: var(--body); }
.mmenu > a[aria-current] { color: var(--p); }
.mm-h { margin: 14px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mm-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.mm-cta a { min-height: 48px; }

/* hero */
.hero { min-height: 50vh; display: flex; align-items: center; background: linear-gradient(180deg, #EFF6FF 0%, #fff 100%); padding: 64px 0 48px; }
.hero-in { text-align: center; width: 100%; }
.hero h1 { font-size: 60px; font-weight: 800; letter-spacing: -.025em; }
.hero .sub { margin: 14px auto 0; max-width: 620px; font-size: 19px; }
.search { position: relative; max-width: 480px; margin: 32px auto 0; }
.search > .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 52px; padding: 0 48px; border: 1px solid #D1D5DB; border-radius: 12px; background: #fff; font: 16px "Inter", sans-serif; color: var(--ink); box-shadow: 0 2px 6px rgba(17, 24, 39, .04); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.search .clear { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.pill { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid #D1D5DB; background: #fff; color: var(--body); font: 500 14px "Inter", sans-serif; cursor: pointer; white-space: nowrap; transition: all .2s; }
.pill:hover { border-color: var(--p); color: var(--p); }
.pill[aria-pressed="true"] { background: var(--p); border-color: var(--p); color: #fff; }

/* featured */
.featured-wrap { margin-top: 16px; }
.featured { display: grid; grid-template-columns: 55% 45%; height: 400px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 4px 16px rgba(17, 24, 39, .06); transition: transform .25s, box-shadow .25s; cursor: pointer; }
.featured:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(17, 24, 39, .12); }
.featured .art { border-radius: 12px; overflow: hidden; height: 100%; }
.featured .art svg { width: 100%; height: 100%; }
.featured .txt { padding: 32px 32px 32px 48px; display: flex; flex-direction: column; justify-content: center; }
.f-tag { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--p); }
.featured h2 { margin-top: 12px; font-size: 32px; font-weight: 700; }
.featured h2 a { color: inherit; text-decoration: none; }
.featured p { margin: 14px 0 0; font-size: 16px; }
.byline { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.byline .av { width: 40px; height: 40px; }
.byline b { color: var(--ink); font-weight: 600; }
.av { border-radius: 50%; overflow: hidden; flex: none; background: #E5E7EB; }
.av svg { width: 100%; height: 100%; }
.read { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font-weight: 600; color: var(--p); text-decoration: none; }
.read .i { width: 18px; height: 18px; transition: transform .2s; }
.featured:hover .read .i { transform: translateX(4px); }

/* main grid + rail */
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; margin-top: 80px; align-items: start; }
.feed-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.feed-h h2 { font-size: 28px; }
.count { margin: 0; font-size: 14px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; transition: box-shadow .25s, transform .25s; cursor: pointer; }
.card:hover { box-shadow: 0 12px 28px rgba(17, 24, 39, .1); }
.card .thumb { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r) var(--r) 0 0; }
.card .thumb svg { width: 100%; height: 100%; transition: transform .45s; }
.card:hover .thumb svg { transform: scale(1.05); }
.card .body { display: flex; flex-direction: column; flex: 1; padding: 18px 18px 16px; }
.badge { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.card h3 { margin-top: 12px; font-size: 20px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card .ex { margin: 8px 0 0; font-size: 14px; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--muted); min-width: 0; }
.meta .av { width: 28px; height: 28px; }
.meta b { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta span { white-space: nowrap; }
.card.new { animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.empty { padding: 56px 24px; border: 1px dashed #D1D5DB; border-radius: 12px; text-align: center; }
.empty .i { width: 32px; height: 32px; margin: 0 auto 8px; color: var(--muted); }
.empty p { margin: 0 0 16px; }

.pager { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 48px; }
.pager .more { min-width: 220px; min-height: 48px; }
.pages { display: flex; align-items: center; gap: 6px; }
.pages button, .pages span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--body); font: 500 15px "Inter", sans-serif; cursor: pointer; }
.pages button:hover:not(:disabled) { border-color: var(--line); color: var(--ink); }
.pages button[aria-current="page"] { background: var(--p); color: #fff; }
.pages button:disabled { opacity: .35; cursor: default; }
.pages .i { width: 18px; height: 18px; }
.showing { margin: 0; font-size: 14px; color: var(--muted); }

/* newsletter (moved into grid by JS) */
.news { position: relative; grid-column: 1 / -1; display: flex; align-items: center; gap: 40px; padding: 48px; border-radius: 12px; overflow: hidden; color: #CBD5E1; background-color: var(--navy); background-image: radial-gradient(rgba(255, 255, 255, .09) 1.5px, transparent 1.6px); background-size: 18px 18px; }
.news .env { width: 120px; flex: none; transform: rotate(-8deg); }
.news-c { flex: 1; min-width: 0; }
.news h2 { color: #fff; font-size: 30px; }
.news-c > p { margin: 8px 0 0; }
.news-f { display: flex; gap: 10px; max-width: 500px; margin-top: 22px; }
.news-f input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font: 16px "Inter", sans-serif; }
.news-f input[aria-invalid="true"] { border-color: #F87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .35); }
.news-f .btn { min-height: 48px; padding: 0 24px; }
.news .msg { margin: 10px 0 0; min-height: 1.4em; font-size: 14px; }
.news .msg.ok { color: #86EFAC; } .news .msg.bad { color: #FCA5A5; }
.news .fine { margin: 4px 0 0; font-size: 12px; color: #94A3B8; }
.news .fine a { color: #BFDBFE; }
.news.done .news-f { display: none; }

/* rail */
.rail { position: sticky; top: 92px; }
.rail h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.pop ol { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.pop li { counter-increment: p; }
.pop button { display: grid; grid-template-columns: 36px 1fr; gap: 4px 8px; width: 100%; padding: 10px 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.pop button::before { content: counter(p); grid-row: span 2; font: 800 28px/1 var(--head); color: #CBD5E1; }
.pop button:hover b { color: var(--p); }
.pop b { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.35; }
.pop small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.pop small .i { width: 14px; height: 14px; }
.rail hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.free ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.free li { display: grid; grid-template-columns: 80px 1fr; gap: 14px; align-items: center; }
.free .cv { width: 80px; height: 60px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.free .cv svg { width: 100%; height: 100%; }
.free b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; }
.free button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--p); font: 600 14px "Inter", sans-serif; cursor: pointer; }
.free button .i { width: 16px; height: 16px; }
.free button:hover { text-decoration: underline; }

/* topics */
.topics { margin-top: 80px; }
.topics h2 { font-size: 32px; margin-bottom: 28px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.topic { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; text-align: left; cursor: pointer; font: inherit; transition: border-color .2s, box-shadow .2s; }
.topic:hover, .topic:focus-visible { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.topic .ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.topic .ic .i { width: 26px; height: 26px; }
.topic b { display: block; font: 600 18px var(--head); color: var(--ink); }
.topic small { color: var(--muted); font-size: 14px; }
.topic > .i { margin-left: auto; color: #9CA3AF; transition: transform .2s, color .2s; }
.topic:hover > .i { transform: translateX(4px); color: var(--c); }

/* CTA + footer */
.cta { margin-top: 80px; background: #EFF6FF; padding: 80px 0; text-align: center; }
.cta h2 { font-size: 40px; font-weight: 800; }
.cta p { margin: 12px 0 0; font-size: 18px; }
.cta-b { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.foot { padding: 32px 0; border-top: 1px solid var(--line); font-size: 14px; }
.foot-in { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot .logo { font-size: 18px; }
.foot .logo svg { width: 26px; height: 26px; }
.foot nav { display: flex; gap: 4px; flex-wrap: wrap; }
.foot nav a { padding: 8px 10px; color: var(--body); text-decoration: none; }
.foot nav a:hover { color: var(--p); }
.foot p { margin: 0 0 0 auto; color: var(--muted); }

/* dialog + toast */
.dlg { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(17, 24, 39, .3); color: var(--body); }
.dlg::backdrop { background: rgba(17, 24, 39, .55); }
.dlg-x { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255, 255, 255, .92); }
.dlg-body { padding: 0 0 32px; }
.dlg .hero-art { aspect-ratio: 16 / 7; overflow: hidden; }
.dlg .hero-art svg { width: 100%; height: 100%; }
.dlg .in { padding: 28px 36px 0; }
.dlg h2 { margin-top: 12px; font-size: 30px; }
.dlg .lede { font-size: 18px; color: var(--ink); margin: 18px 0 0; }
.dlg .in p { margin: 14px 0 0; }
.dlg .in h3 { margin-top: 24px; font-size: 20px; }
.dlg .demo { margin-top: 24px; padding: 12px 14px; border-radius: 8px; background: var(--bg2); font-size: 14px; color: var(--muted); }
.dlg .acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.dlg form { display: flex; gap: 10px; margin-top: 18px; }
.dlg form input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid #D1D5DB; border-radius: 8px; font: 16px "Inter", sans-serif; }
.dlg form input[aria-invalid="true"] { border-color: #DC2626; }
.dlg .msg { margin: 8px 0 0; font-size: 14px; min-height: 1.4em; }
.dlg .msg.bad { color: #DC2626; } .dlg .msg.ok { color: #059669; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0F172A; margin-top: 18px; }
.player svg { width: 100%; height: 100%; }
.player .bar { position: absolute; left: 16px; right: 16px; bottom: 14px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.player .bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: #60A5FA; transition: width .3s linear; }
.chapters { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.chapters button { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 500 15px "Inter", sans-serif; color: var(--ink); cursor: pointer; align-items: center; }
.chapters button[aria-current="true"] { border-color: var(--p); background: var(--p-l); color: var(--p); }
.chapters small { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 140%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .3s; }
.toast.show { transform: translate(-50%, 0); }

/* responsive */
@media (max-width: 1100px) {
  .links { gap: 0; } .nav-in { gap: 18px; }
  .main-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
  .rail hr { display: none; }
  .featured { height: auto; min-height: 360px; }
  .featured h2 { font-size: 28px; }
}
@media (max-width: 900px) {
  .links, .signin, .nav-r > .btn { display: none; }
  .burger { display: inline-grid; }
  .nav-in { height: 64px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-template-columns: 1fr; padding: 12px; }
  .featured .art { aspect-ratio: 16 / 9; height: auto; }
  .featured .txt { padding: 24px 12px 12px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { min-height: 0; padding: 48px 0 32px; }
  .hero h1 { font-size: 40px; }
  .hero .sub { font-size: 17px; }
  .pills { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 20px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { min-height: 44px; scroll-snap-align: start; }
  .featured h2 { font-size: 24px; }
  .main-grid { margin-top: 56px; gap: 40px; }
  .feed-h { flex-direction: column; gap: 4px; }
  .grid { grid-template-columns: 1fr; gap: 24px; }
  .news { margin: 0 -16px; border-radius: 0; flex-direction: column; align-items: flex-start; gap: 20px; padding: 36px 20px; }
  .news .env { width: 80px; }
  .news h2 { font-size: 25px; }
  .news-f { flex-direction: column; }
  .news-f input, .news-f .btn { flex: none; width: 100%; }
  .rail { grid-template-columns: 1fr; }
  .rail hr { display: block; }
  .pop button { min-height: 44px; }
  .free button { min-height: 44px; }
  .topics { margin-top: 56px; }
  .topics h2 { font-size: 26px; }
  .topic-grid { grid-template-columns: 1fr; gap: 12px; }
  .pages button, .pages span { min-width: 44px; height: 44px; }
  .pages { gap: 2px; }
  .cta { margin-top: 56px; padding: 56px 0; }
  .cta h2 { font-size: 30px; }
  .cta-b a { width: 100%; }
  .foot-in { flex-direction: column; align-items: flex-start; gap: 12px; }
  .foot nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .foot p { margin: 0; }
  .dlg .in { padding: 22px 20px 0; }
  .dlg h2 { font-size: 24px; }
  .dlg form { flex-direction: column; }
  .dlg form input { flex: none; width: 100%; }
  .icon-btn { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
[hidden] { display: none !important; }
.meta .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.meta .av { width: 32px; height: 32px; }
.toast:not(.show) { visibility: hidden; transform: translate(-50%, 200%); }
