/* pwn.dog - custom theme. Tweak the variables below to rebrand. */
:root {
  --bg:        #0b0c0e;
  --bg-soft:   #131519;
  --bg-code:   #15171c;
  --fg:        #e7ebf2;
  --fg-dim:    #9aa3b1;
  --fg-faint:  #646c79;
  --accent:    #f0a830;   /* warm amber - the pwn.dog accent */
  --accent-2:  #f0577a;   /* magenta for hover/secondary */
  --border:    #20242c;
  --radius:    12px;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 54rem;
}
::selection { background: rgba(240,168,48,.28); }
html { scroll-behavior: smooth; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* ---- header ---- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.6rem 0 1.2rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--fg); }
.brand-mark { width: 30px; height: 30px; display: block; border-radius: 7px; }
.brand-name { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.5px; }
.dot { color: var(--accent); }
.nav { display: flex; gap: 1.1rem; font-family: var(--mono); font-size: .9rem; }
.nav a { color: var(--fg-dim); text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--accent); }

/* ---- hero / home ---- */
.hero { padding: 2rem 0 2.5rem; }
.hero-title { font-family: var(--mono); font-size: 2.6rem; margin: 0 0 .3rem; letter-spacing: -1.5px; }
.hero-tag { color: var(--fg-dim); font-size: 1.05rem; margin: 0; }

/* ---- landing page ---- */
.home-hero { text-align: center; padding: 2.5rem 0 1rem; border-bottom: 1px solid var(--border); }
.home-logo { width: 96px; height: 96px; margin: 0 auto .6rem; display: block; }
.home-title { font-family: var(--mono); font-size: 3rem; margin: 0; letter-spacing: -2px; }
.home-hero .hero-tag { margin-top: .35rem; }
.home-blurb { max-width: 38rem; margin: 1.1rem auto 0; color: var(--fg-dim); }
.home-blurb p { margin: 0; }
.home-links { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin: 1.6rem 0 .5rem; }
.btn { font-family: var(--mono); font-size: .85rem; text-decoration: none; padding: .45rem .9rem; border-radius: 8px; background: var(--accent); color: #0b0c0e; font-weight: 600; }
.btn:hover { background: #ffc46b; }
.btn.ghost { background: transparent; color: var(--fg-dim); border: 1px solid var(--border); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.home-series { padding: 2.2rem 0 1rem; }
.series-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem 1.2rem; background: var(--bg-soft); }
.series-card + .series-card { margin-top: 1.2rem; }
.series-card-head { display: flex; align-items: baseline; gap: .65rem; flex-wrap: wrap; }
.series-card-title { font-family: var(--mono); font-size: 1.2rem; margin: 0; letter-spacing: -.3px; }
.series-card-title a { color: var(--fg); text-decoration: none; }
.series-card-title a:hover { color: var(--accent); }
.series-card-desc { color: var(--fg-dim); font-size: .95rem; margin: .55rem 0 .2rem; }
.series-card-desc p { margin: 0; }
.series-card-parts { margin: .7rem 0 0; padding-left: 1.4rem; }
.series-card-parts li { margin: .32rem 0; }
.series-card-parts a { color: var(--fg-dim); text-decoration: none; }
.series-card-parts a:hover { color: var(--accent); }
.home-latest { padding: 2rem 0 2.5rem; }
.section-label { font-family: var(--mono); font-size: .8rem; color: var(--fg-faint); letter-spacing: 1px; text-transform: uppercase; margin: 0 0 1.3rem; }
.more-link { display: inline-block; margin-top: 1.6rem; font-family: var(--mono); font-size: .88rem; color: var(--fg-dim); text-decoration: none; }
.more-link:hover { color: var(--accent); }

/* ---- post list ---- */
.post-list { display: flex; flex-direction: column; gap: 1.9rem; padding-bottom: 2rem; }
.post-item { border-left: 2px solid var(--border); padding-left: 1rem; transition: border-color .15s; }
.post-item:hover { border-left-color: var(--accent); }
.post-item-title { margin: .15rem 0 .35rem; font-size: 1.35rem; line-height: 1.3; }
.post-item-title a { color: var(--fg); text-decoration: none; }
.post-item-title a:hover { color: var(--accent); }
.post-item-sum { color: var(--fg-dim); margin: 0; font-size: .98rem; }
.post-meta { font-family: var(--mono); font-size: .8rem; color: var(--fg-faint); display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.tags { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.tag { background: var(--bg-soft); border: 1px solid var(--border); color: var(--fg-dim); padding: .05rem .45rem; border-radius: 6px; font-size: .72rem; text-decoration: none; }
a.tag:hover { color: var(--accent); border-color: var(--accent); }
.sep { color: var(--fg-faint); }

/* ---- series grouping (posts list) ---- */
.series-group { margin-bottom: 2.6rem; }
.series-title { font-family: var(--mono); font-size: 1.15rem; margin: 0 0 1.1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: .6rem; }
.series-title a { color: var(--fg); text-decoration: none; }
.series-title a:hover { color: var(--accent); }
.series-count { font-size: .72rem; color: var(--fg-faint); font-weight: 400; }
.part-badge { background: var(--accent); color: #0b0c0e; font-weight: 700; padding: .03rem .4rem; border-radius: 5px; font-size: .68rem; text-transform: uppercase; letter-spacing: .5px; }

/* ---- series box (on a post) ---- */
.series-box { background: var(--bg-soft); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: .8rem 1.1rem; margin-bottom: 2rem; }
.series-box-head { font-family: var(--mono); font-size: .82rem; color: var(--fg-dim); margin-bottom: .5rem; }
.series-box-head a { color: var(--accent); text-decoration: none; }
.series-box-list { margin: 0; padding-left: 1.3rem; }
.series-box-list li { margin: .2rem 0; font-size: .92rem; }
.series-box-list a { color: var(--fg-dim); text-decoration: none; }
.series-box-list a:hover { color: var(--accent); }
.series-box-list .current { color: var(--fg); }
.series-box-list .here { color: var(--fg-faint); font-family: var(--mono); font-size: .78rem; }

/* ---- term lists (/series/, /tags/) ---- */
.term-list { list-style: none; padding: 0; }
.term-list li { display: flex; align-items: baseline; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.term-list a { font-family: var(--mono); color: var(--fg); text-decoration: none; }
.term-list a:hover { color: var(--accent); }
.term-count { font-size: .75rem; color: var(--fg-faint); }

/* ---- post ---- */
.post-head { padding: 1rem 0 1.4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.8rem; }
.post-title { font-size: 2.35rem; line-height: 1.18; margin: 0 0 .8rem; letter-spacing: -1px; }
.page-title { font-family: var(--mono); font-size: 1.8rem; }

.toc { border: 1px solid var(--border); border-radius: 10px; padding: .4rem .95rem; margin-bottom: 2.4rem; font-size: .9rem; background: rgba(255,255,255,.012); }
.toc[open] { padding-bottom: .7rem; }
.toc summary { cursor: pointer; font-family: var(--mono); color: var(--fg-dim); font-size: .8rem; letter-spacing: .3px; }
.toc summary:hover { color: var(--accent); }
.toc ul { margin: .5rem 0 0; }
.toc a { color: var(--fg-dim); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* ---- content typography ---- */
.content { font-size: 1.04rem; line-height: 1.8; }
.content > *:first-child { margin-top: 0; }
.content h2 { font-family: var(--mono); font-size: 1.45rem; margin: 3rem 0 1rem; letter-spacing: -.5px; scroll-margin-top: 1.5rem; }
.content h3 { font-family: var(--mono); font-size: 1.15rem; margin: 2.2rem 0 .7rem; color: #eef2f7; scroll-margin-top: 1.5rem; }
.content h2 .anchor, .content h3 .anchor { color: var(--fg-faint); text-decoration: none; }
.content p { margin: 1.2rem 0; }
.content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(240,168,48,.3); }
.content a:hover { border-bottom-color: var(--accent); }
.content strong { color: #eef2f7; }
.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin: .35rem 0; }
.content blockquote {
  margin: 1.4rem 0; padding: .2rem 1.1rem; border-left: 3px solid var(--accent-2);
  background: var(--bg-soft); color: var(--fg-dim); border-radius: 0 var(--radius) var(--radius) 0;
}
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.content img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

/* inline code */
.content code {
  font-family: var(--mono); font-size: .88em;
  background: var(--bg-code); border: 1px solid var(--border);
  padding: .08em .35em; border-radius: 5px;
}
/* code blocks (Chroma classes; palette in chroma.css, frame here) */
.content .highlight { margin: 1.6rem 0; }
.content pre {
  font-family: var(--mono); font-size: .8rem; line-height: 1.6;
  padding: 1.05rem 1.2rem; border-radius: var(--radius);
  background: var(--bg-code); border: 1px solid var(--border);
  overflow-x: auto; margin: 1.6rem 0;
}
.content .highlight pre { margin: 0; }
.content pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.content pre code::-webkit-scrollbar { height: 8px; }


/* tables */
.content table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .92rem; }
.content th, .content td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; }
.content th { background: var(--bg-soft); font-family: var(--mono); font-size: .82rem; color: var(--fg-dim); }
.content tr:nth-child(even) td { background: rgba(255,255,255,.012); }

/* ---- nav between posts ---- */
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--border); font-family: var(--mono); font-size: .85rem; }
.post-nav a { color: var(--fg-dim); text-decoration: none; }
.post-nav a:hover { color: var(--accent); }

/* ---- footer ---- */
.site-foot { margin: 3.5rem 0 2rem; padding-top: 1.3rem; border-top: 1px solid var(--border); color: var(--fg-faint); font-family: var(--mono); font-size: .8rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.site-foot a { color: var(--fg-dim); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.empty { color: var(--fg-dim); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero-title { font-size: 2rem; }
  .post-title { font-size: 1.6rem; }
}
