/* LeetPrep v2 polish: refinement layer on top of style.css. Tokens follow the LeetPrep Editorial design (hairlines, no shadows, one accent). */
:root{--line-strong:#C9CFD8;--accent-soft:#FFF4EC;--ink-soft:#2A323D}
html{scroll-padding-top:88px}
::selection{background:#FFD9C4;color:var(--ink)}
body{text-rendering:optimizeLegibility;font-kerning:normal}
h1,h2,h3,h4{letter-spacing:-.02em;text-wrap:balance}
p,li{text-wrap:pretty}
a{text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}

/* header and navigation */
.bar{min-height:68px}
.brand{font-size:1.3rem}
.brand__mark{width:36px;height:36px;letter-spacing:-.02em}
.nav__list a{transition:background-color .15s,color .15s}
.nav__list .current-menu-item>a,.nav__list .current_page_item>a{background:var(--accent-soft);color:var(--accent-dark)}
.search-form input[type=search]{transition:border-color .15s,background-color .15s}
.search-form input[type=search]:focus{border-color:var(--ink);background:var(--surface)}
.search-form button{transition:background-color .15s}
.search-form button:hover{background:var(--ink-soft)}
.topics-nav a{border:1px solid transparent;transition:border-color .15s,color .15s,background-color .15s}
.topics-nav a:hover{border-color:var(--line-strong)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 24px;letter-spacing:.01em;transition:background-color .15s,color .15s,border-color .15s}
.btn:active{transform:translateY(1px)}

/* hero */
.hero{padding:80px 0 72px}
.hero h1{font-size:clamp(2.2rem,5vw,3.35rem);line-height:1.08;letter-spacing:-.03em}
.hero p.lead{line-height:1.6}
.code-card{border:1px solid #232B36}
.code-card__title{padding:12px 18px}

/* stats strip */
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0 20px}
.stats li{display:flex;flex-direction:column;gap:2px;padding:18px 20px;border-left:1px solid var(--line);line-height:1.3}
.stats li:first-child{border-left:0;padding-left:0}
.stats strong{margin:0;font-size:1.4rem;letter-spacing:-.01em}

/* sections */
.section{padding:72px 0}
.section__head h2{margin:0}
.more{transition:color .15s}

/* cards: whole card is clickable, hover darkens the hairline */
.card{position:relative;display:flex;flex-direction:column;transition:border-color .15s}
.card:hover{border-right-color:var(--ink);border-bottom-color:var(--ink);border-left-color:var(--ink)}
.card h3{margin:.35em 0 0;font-size:1.2rem;line-height:1.25}
.card--lead h3{font-size:1.7rem;line-height:1.15}
.card h3 a::after{content:'';position:absolute;inset:0}
.card .cat{position:relative;z-index:1;align-self:flex-start}
.card p.ex{line-height:1.6}
.card .meta{margin-top:auto}

/* article */
.article-head{padding-bottom:22px;margin-bottom:32px;border-bottom:1px solid var(--line)}
.article-head h1{font-size:clamp(1.9rem,4vw,2.6rem);line-height:1.12;margin-bottom:.45em}
.byline{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:0;color:var(--muted);font-size:.92rem}
.byline__mark{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--ink);color:#fff;font:700 .72rem var(--mono);letter-spacing:.02em}
.byline a{color:var(--ink);font-weight:700;text-decoration:none}
.byline a:hover{text-decoration:underline}
.byline__sep{color:var(--line-strong)}
.prose{font-size:1.08rem;line-height:1.75}
.prose>p:first-of-type{font-size:1.17rem;color:var(--ink)}
.prose h2{margin-top:2.2em}
.prose a{font-weight:600}
.prose ul,.prose ol{padding-left:1.3em;margin:0 0 1.3em}
.prose li{margin-bottom:.45em}
.prose li::marker{color:var(--muted)}
.prose img{border-radius:var(--r);border:1px solid var(--line)}
.prose figcaption{font-size:.88rem;color:var(--muted);margin-top:6px}
.prose pre{border:1px solid #232B36;line-height:1.65}
.prose :not(pre)>code{background:#EEF1F5;border:1px solid var(--line);color:var(--ink)}
.prose blockquote{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:var(--r);padding:14px 20px;color:var(--ink-soft)}
.prose blockquote p:last-child{margin:0}
.prose hr{border:0;border-top:1px solid var(--line);margin:2.5em 0}
.toc a{text-decoration:none}
.toc a:hover{text-decoration:underline}
.tags a{transition:border-color .15s,color .15s}
.tags a:hover{border-color:var(--ink);color:var(--ink)}
.postnav a{font-weight:600;text-decoration:none}
.postnav a:hover{text-decoration:underline}

/* author box (articles and About page) */
.author{align-items:center;gap:18px;padding:22px 24px;border-top:4px solid var(--ink)}
.author__mark{width:56px;height:56px;font-size:1rem;letter-spacing:.02em}
.author strong{display:block;font-size:1.08rem;line-height:1.3}
.author__role{display:block;margin-top:2px;color:var(--muted);font-size:.88rem;font-weight:600}
.author p{margin:.55em 0 0;line-height:1.6}
.author--page{margin:1.5em 0 2em}
#author{scroll-margin-top:96px}

/* home: author band */
.founder{display:grid;grid-template-columns:auto minmax(0,1fr);gap:28px;align-items:start}
.founder__mark{display:grid;place-items:center;width:76px;height:76px;border-radius:50%;background:var(--ink);color:#fff;font:700 1.3rem var(--mono);letter-spacing:.02em}
.founder h2{margin-bottom:.4em}
.founder p{max-width:62ch;color:var(--muted);margin-bottom:.9em}

/* sidebar widgets */
.widget h2{font-size:.82rem;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.widget li a{display:block;line-height:1.4}

/* ads: quiet labelled surface, collapses when AdSense leaves a slot unfilled */
.ad{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:10px 12px 12px;margin:36px auto}
.ad:has(ins.adsbygoogle[data-ad-status="unfilled"]){display:none}

/* pages and forms */
.page-head{padding:56px 0 12px}
.page-head h1{margin-bottom:.3em}
.form{max-width:600px;padding:24px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.form input,.form textarea{border-color:var(--line-strong);transition:border-color .15s}
.form input:focus,.form textarea:focus{border-color:var(--ink)}
.form .btn{justify-self:start}

/* footer */
.footer{padding:64px 0 32px}
.footer h2{font-size:.82rem;letter-spacing:.08em;text-transform:uppercase;color:#9AA6B5}
.footer p{max-width:46ch;line-height:1.65}
.footer .footer__author{margin-top:14px;color:#fff;font-weight:600}
.footer .footer__author a{text-decoration:underline;text-underline-offset:3px}
.footer a:focus-visible,.footer__author a:focus-visible{outline-color:#FFA26B}
.footer .footer__base{max-width:none;display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 24px}
.footer__base span+span{color:#9AA6B5}

/* responsive */
@media(max-width:900px){.hero{padding:48px 0 44px}.section{padding:48px 0}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stats li:nth-child(odd){border-left:0;padding-left:0}}
@media(max-width:700px){.stats{padding:0 16px}.stats li{padding:14px 12px}.founder{grid-template-columns:1fr;gap:16px}.founder__mark{width:60px;height:60px;font-size:1.05rem}.author{align-items:flex-start;padding:18px}.form{padding:18px}.page-head{padding:36px 0 8px}}
@media print{.byline__mark,.founder__mark{display:none}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
