/*
Theme Name: Broadifi Blog
Theme URI: https://www.broadifitech.com
Author: Broadifi Technologies
Author URI: https://www.broadifitech.com
Description: The Broadifi blog theme. Stacked strata, mono labels, pill calls to action and a reading layout with a table of contents, built from the same design system as broadifitech.com. Classic PHP theme with block editor support, block patterns, Customizer settings and built-in SEO tags that step aside for SEO plugins.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: broadifi-blog
Tags: blog, one-column, two-columns, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready, wide-blocks, block-patterns, block-styles
*/

/* ---------- Tokens (same as broadifitech.com) ---------- */
:root {
  --canvas: #e9eef6;
  --card-dark: #101828;
  --card-light: #fcfdff;
  --ink: #121a28;
  --paper: #f2f5fa;
  --a1: #3d6bff;
  --a2: #c6f252;
  --tint: #8aa6ff;
  --muted: #7c8698;
  --line: rgba(0, 0, 0, 0.12);
  --line-dark: rgba(245, 244, 240, 0.14);
  --font-display: "Cabinet Grotesk", "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Satoshi", "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --pad-x: clamp(24px, 5vw, 88px);
  --radius: 40px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --measure: 720px;
  --wide: 1040px;
  --sticky-top: 32px;
}
.admin-bar { --sticky-top: 64px; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.62; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6, p, blockquote, figure { margin: 0; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
::selection { background: var(--a2); color: var(--card-dark); }
:focus-visible { outline: 2px solid var(--a1); outline-offset: 3px; border-radius: 4px; }
.stratum--dark :focus-visible, .hero :focus-visible, .menu :focus-visible { outline-color: var(--a2); }

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); }

/* ---------- WordPress core ---------- */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; width: auto; height: auto; margin: 0; z-index: 100000;
  top: 12px; left: 12px; padding: 12px 20px; border-radius: 999px;
  background: var(--a2); color: var(--card-dark); font-family: var(--font-mono); font-size: 13px;
}
.alignleft { float: left; margin: 0.3em 1.6em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.6em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.gallery-item { margin: 0; }
.sticky, .bypostauthor { position: relative; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; background: var(--canvas); padding-top: 16px; overflow-x: clip; }

/* ---------- Strata ---------- */
.stratum {
  position: relative;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: clamp(26px, 3vw, 40px) var(--pad-x) clamp(64px, 9vw, 130px);
  margin-top: -34px;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.08);
}
.stratum--dark { background: var(--card-dark); color: var(--paper); box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.12); }
.stratum--light { background: var(--card-light); color: var(--ink); }
.stratum--canvas { background: var(--canvas); color: var(--ink); }

.stratum__head { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(40px, 6vw, 80px); }
.stratum__label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; color: var(--muted); white-space: nowrap; }
.stratum--dark .stratum__label { color: rgba(245, 244, 240, 0.45); }
.stratum__rule { flex: 1; height: 1px; min-width: 12px; background: rgba(0, 0, 0, 0.1); }
.stratum--dark .stratum__rule { background: var(--line-dark); }

.h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 64px); line-height: 1.05; letter-spacing: -0.03em;
  max-width: 20ch; text-wrap: pretty;
}
.lede { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 56ch; }
.stratum--dark .lede { color: rgba(245, 244, 240, 0.58); }

/* ---------- Pills / chips / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 9px 9px 9px 24px; border-radius: 999px;
  font-weight: 500; font-size: 16px; line-height: 1.2; border: none; cursor: pointer;
  transition: opacity 0.2s; white-space: nowrap;
}
.pill--paper { background: var(--paper); color: var(--card-dark); }
.pill--dark { background: var(--card-dark); color: var(--paper); }
.pill--lg { padding: 10px 10px 10px 26px; font-size: 17px; }
.chip {
  width: 32px; height: 32px; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
  transition: transform 0.25s var(--ease);
}
.pill--lg .chip { width: 36px; height: 36px; font-size: 15px; }
.pill:hover .chip { transform: rotate(45deg); }
.chip--dark { background: var(--card-dark); color: var(--paper); }
.chip--a1 { background: var(--a1); color: var(--card-dark); }

.tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; line-height: 1.4;
  padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, 0.14);
  color: var(--muted); flex: none; white-space: nowrap;
}
a.tag:hover { opacity: 1; border-color: var(--a1); color: var(--a1); }
.stratum--dark .tag { border-color: rgba(245, 244, 240, 0.18); color: rgba(245, 244, 240, 0.65); }

.out { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 15px; color: var(--ink); }
.out__arrow { color: var(--a1); }
.stratum--dark .out { color: var(--paper); }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--muted);
}
.meta__sep { margin: 0 10px; opacity: 0.5; }
.meta__cat { color: var(--a1); }

/* ---------- Hero ---------- */
.hero {
  z-index: 1; margin-top: 0;
  padding-bottom: clamp(48px, 6vw, 80px);
  display: flex; flex-direction: column; box-shadow: none;
}
.hero__bar { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(48px, 8vw, 110px); }
.hero__tab { color: rgba(245, 244, 240, 0.45); }
.hero__brand { display: flex; align-items: center; gap: 8px; flex: none; }
.hero__brand:hover { opacity: 0.8; }
.hero__brand-dot { width: 16px; height: 16px; border-radius: 5px; background: var(--a1); }
.hero__brand-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--paper); }
.hero__logo { display: block; max-height: 28px; width: auto; }
.hero__menu {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; white-space: nowrap;
  color: rgba(245, 244, 240, 0.75); background: none; border: none; cursor: pointer; padding: 0;
}
.hero__body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 3.4vw, 44px); }
.hero__title {
  max-width: 19ch;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(42px, 8.2vw, 132px); line-height: 1.02; letter-spacing: -0.035em;
  color: var(--paper); text-wrap: pretty;
}
.hero__support { max-width: 52ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6; color: rgba(245, 244, 240, 0.6); }
.hero__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 28px; flex-wrap: wrap; padding-top: clamp(40px, 6vw, 80px); }

/* Blog home hero */
.bhero { min-height: min(80vh, 820px); }
.bhero__title { font-size: clamp(42px, 7.4vw, 118px); max-width: 16ch; }
.bhero__page { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; color: rgba(245, 244, 240, 0.45); }
.bhero__foot { align-items: center; }

/* Narrative-style hero for archives, posts and pages */
.nhero { min-height: 0; padding-bottom: clamp(48px, 6vw, 80px); }
.nhero .hero__bar { margin-bottom: clamp(32px, 5vw, 64px); }
.nhero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 6.4vw, 96px); line-height: 1.03; letter-spacing: -0.035em;
  color: var(--paper); text-wrap: pretty; max-width: 16ch; overflow-wrap: break-word;
}
.nhero__q { color: var(--tint); }
.nhero__opening { max-width: 60ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6; color: rgba(245, 244, 240, 0.72); }
.nhero__opening p + p { margin-top: 12px; }
.nhero__body { display: flex; flex-direction: column; gap: clamp(20px, 2.6vw, 32px); }
.nhero__foot { padding-top: clamp(32px, 5vw, 60px); }
.crumbs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(28px, 4vw, 48px); padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; color: rgba(245, 244, 240, 0.5);
}
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.5; }
.crumbs a { color: rgba(245, 244, 240, 0.75); }
.ahero__count { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; color: rgba(245, 244, 240, 0.45); }
.ahero__avatar img { display: block; width: 72px; height: 72px; border-radius: 22px; }

/* Post hero */
.phero__title { max-width: 22ch; font-size: clamp(36px, 5.4vw, 82px); }
.phero__foot { align-items: center; }
.byline { display: flex; align-items: center; gap: 14px; color: var(--paper); }
.byline:hover { opacity: 0.8; }
.byline__avatar { display: block; width: 44px; height: 44px; border-radius: 14px; background: var(--a1); }
.byline__text { display: flex; flex-direction: column; gap: 2px; }
.byline__name { font-weight: 500; font-size: 16px; }
.byline__role { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; color: rgba(245, 244, 240, 0.45); order: -1; }
.phero__meta {
  display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; color: rgba(245, 244, 240, 0.55);
}
.phero__meta li + li::before { content: "·"; margin: 0 10px; color: rgba(245, 244, 240, 0.28); }
.phero__meta a { color: var(--tint); }

/* 404 */
.nf__code { font-family: var(--font-mono); font-size: 13px; line-height: 1.9; color: rgba(245, 244, 240, 0.7); overflow-wrap: anywhere; }
.term__p { color: var(--a1); margin-right: 6px; }
.term__dim { color: rgba(245, 244, 240, 0.42); }

/* ---------- Topic chips ---------- */
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.3; padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(245, 244, 240, 0.16); color: rgba(245, 244, 240, 0.72);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.topic:hover { opacity: 1; border-color: var(--a1); color: var(--paper); }
.topic.is-current { background: var(--paper); border-color: var(--paper); color: var(--card-dark); }
.topic__n { color: var(--a1); font-size: 10.5px; }
.stratum--light .topic, .stratum--canvas .topic { border-color: rgba(0, 0, 0, 0.14); color: var(--muted); }
.stratum--light .topic:hover, .stratum--canvas .topic:hover { color: var(--ink); border-color: var(--a1); }
.stratum--light .topic.is-current, .stratum--canvas .topic.is-current { background: var(--card-dark); border-color: var(--card-dark); color: var(--paper); }

/* ---------- Search, terminal style ---------- */
.grep {
  display: flex; align-items: center; gap: 10px;
  width: min(100%, 420px); padding: 6px 6px 6px 18px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 13px;
  border: 1px solid rgba(245, 244, 240, 0.18); background: rgba(245, 244, 240, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.grep:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(61, 107, 255, 0.18); }
.grep__field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: text; }
.grep__p { color: var(--a1); }
.grep__cmd { color: rgba(245, 244, 240, 0.42); white-space: nowrap; }
.grep__input {
  flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: none; background: transparent;
  font-family: var(--font-mono); font-size: 13px; color: var(--paper);
}
.grep__input::placeholder { color: rgba(245, 244, 240, 0.35); }
.grep__input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; }
.grep__go {
  width: 36px; height: 36px; flex: none; border-radius: 999px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--card-dark); font-size: 15px; transition: transform 0.25s var(--ease);
}
.grep__go:hover { transform: rotate(-90deg); }
.grep--light { border-color: rgba(0, 0, 0, 0.14); background: var(--card-light); }
.stratum--light .grep--light { background: var(--canvas); border-color: transparent; }
.grep--light .grep__cmd { color: var(--muted); }
.grep--light .grep__input { color: var(--ink); }
.grep--light .grep__input::placeholder { color: var(--muted); }
.grep--light .grep__input::-webkit-search-cancel-button { filter: none; }
.grep--light .grep__go { background: var(--card-dark); color: var(--paper); }

/* ---------- Cover cards ---------- */
.frame { border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); }
.cover { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--card-dark); }
.cover__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.cover--ph {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--card-dark) repeating-linear-gradient(135deg, rgba(245, 244, 240, 0.045) 0 7px, transparent 7px 14px);
}
.cover__dot { width: 14px; height: 14px; border-radius: 4px; background: var(--a1); flex: none; }
.cover__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: rgba(245, 244, 240, 0.55); }

/* ---------- Latest (featured) ---------- */
.feat {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px clamp(32px, 5vw, 80px); align-items: center;
}
.feat__media { display: block; min-width: 0; }
.feat__media .frame { transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease); }
.feat__media:hover { opacity: 1; }
.feat__media:hover .frame {
  transform: translateY(-3px); border-color: rgba(61, 107, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(61, 107, 255, 0.08), 0 24px 60px -24px rgba(16, 24, 40, 0.35);
}
.feat__media:hover .cover__img { transform: scale(1.02); }
.feat__copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.feat__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.6vw, 54px); line-height: 1.05; letter-spacing: -0.03em; text-wrap: pretty;
}
.feat__excerpt p { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.62; color: var(--muted); max-width: 48ch; }
.feat .out { margin-top: 4px; }
.sticky .feat__copy .meta::before {
  content: "pinned /"; margin-right: 10px; padding: 3px 9px; border-radius: 999px;
  background: var(--a2); color: var(--card-dark); font-size: 10px;
}
@media (max-width: 880px) { .feat { grid-template-columns: 1fr; } }

/* ---------- Recent grid ---------- */
.recent__title { margin-bottom: clamp(32px, 4vw, 56px); }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 640px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1060px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--canvas); border-radius: 28px; padding: 12px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.stratum--canvas .pcard { background: var(--card-light); }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -30px rgba(16, 24, 40, 0.35); }
.pcard:hover .cover__img { transform: scale(1.03); }
.pcard:hover .chip { transform: rotate(45deg); }
.pcard:focus-within { outline: 2px solid var(--a1); outline-offset: 3px; }
.pcard__link:focus-visible { outline: none; }
.pcard__cover { border-radius: 18px; }
.pcard__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 12px 8px; }
.pcard__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.18; letter-spacing: -0.015em; text-wrap: pretty; }
.pcard__link::after { content: ""; position: absolute; inset: 0; border-radius: 28px; }
.pcard__link:hover { opacity: 1; }
.pcard__excerpt p {
  font-size: 15px; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.pcard__read { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }

/* ---------- Rows (archives, search) ---------- */
.rows { display: flex; flex-direction: column; border-bottom: 1px solid rgba(0, 0, 0, 0.13); }
.prow { border-top: 1px solid rgba(0, 0, 0, 0.13); }
.prow__link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center;
  gap: 10px clamp(14px, 2vw, 30px); padding: clamp(20px, 2.4vw, 30px) 0;
  transition: padding-left 0.22s var(--ease);
}
.prow__link:hover { opacity: 1; padding-left: 12px; }
.prow__link:hover .prow__name { color: var(--a1); }
.prow__n { font-family: var(--font-mono); font-size: 12px; color: var(--a1); align-self: start; padding-top: 0.7em; }
.prow__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.prow__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 2.6vw, 36px); line-height: 1.12; letter-spacing: -0.025em; transition: color 0.2s;
}
.prow__desc { font-size: 15.5px; line-height: 1.55; color: var(--muted); max-width: 64ch; }
.prow__side { display: flex; align-items: center; gap: 12px; }
.prow__date { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.prow__sign { font-family: var(--font-mono); font-size: 15px; color: var(--a1); }
@media (max-width: 720px) {
  .prow__link { grid-template-columns: auto minmax(0, 1fr); }
  .prow__side { grid-column: 2; }
  .prow__sign { display: none; }
  .prow__desc { display: none; }
}

/* ---------- Pagination ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: clamp(32px, 4vw, 56px); padding-top: 22px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12.5px;
}
.rows + .pager { border-top: 0; }
.pager__count { letter-spacing: 0.1em; color: var(--muted); }
.pager__links { display: flex; flex-wrap: wrap; gap: 6px; }
.pager .page-numbers, .pager__links > a, .pager__links > span {
  display: inline-flex; align-items: center; gap: 6px; min-width: 38px; justify-content: center;
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink);
}
.pager a:hover { opacity: 1; border-color: var(--a1); color: var(--a1); }
.pager .current, .pager__links > span:not(.dots) { background: var(--card-dark); border-color: var(--card-dark); color: var(--paper); }
.pager .dots { border-color: transparent; color: var(--muted); }
.pager--post { margin-top: 40px; }

/* ---------- Related / topics (dark) ---------- */
.nblock__h2 { margin-bottom: clamp(24px, 3vw, 40px); }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 40px; }
.related__item { display: flex; flex-direction: column; gap: 10px; padding: 26px 0 30px; border-top: 1px solid var(--line-dark); color: var(--paper); }
.related__item:hover { opacity: 1; }
.related__item:hover .related__title { color: var(--tint); }
.related__tab { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: rgba(245, 244, 240, 0.45); }
.related__title { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.25; letter-spacing: -0.015em; transition: color 0.2s; }
.related__title span { color: var(--a1); }
.related__desc { font-size: 15px; line-height: 1.55; color: rgba(245, 244, 240, 0.6); }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; gap: 22px; max-width: 640px; }
.empty__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.25; letter-spacing: -0.02em; }

/* ---------- Article layout ---------- */
.article__cover { margin: 0 0 clamp(36px, 5vw, 72px); }
.article__cover .cover { aspect-ratio: 16 / 9; }
.article__cover figcaption { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 12px; }
.article__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.article__aside { min-width: 0; }
.article__sticky { display: flex; flex-direction: column; gap: 28px; }
.aside__label { display: block; margin-bottom: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.toc { background: var(--canvas); border-radius: 22px; padding: 20px 22px; }
.toc__list { margin: 0; padding: 0; list-style: none; }
.toc__item a {
  display: flex; gap: 10px; padding: 6px 0;
  font-size: 14px; line-height: 1.4; color: var(--muted); transition: color 0.2s, border-color 0.2s;
}
.toc__item a:hover { opacity: 1; color: var(--ink); }
.toc__item a.is-active { color: var(--ink); }
.toc__item a.is-active .toc__n { color: var(--ink); }
.toc__item--h3 a { padding-left: 30px; font-size: 13.5px; }
.toc__n { font-family: var(--font-mono); font-size: 11px; color: var(--a1); padding-top: 2px; flex: none; transition: color 0.2s; }
.share__links { display: flex; flex-wrap: wrap; gap: 8px; }
.share__btn {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.3; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.share__btn:hover { opacity: 1; color: var(--ink); border-color: var(--a1); }
.share__btn.is-done { color: var(--card-dark); background: var(--a2); border-color: var(--a2); }
.article__body { min-width: 0; }
.article__foot { max-width: var(--measure); margin-top: clamp(40px, 5vw, 64px); padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.article__dates { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--muted); }

@media (min-width: 1100px) {
  .article__grid { grid-template-columns: 240px minmax(0, 1fr); gap: clamp(48px, 5vw, 96px); }
  .article--page .article__grid:not(:has(.article__aside)) { grid-template-columns: minmax(0, 1fr); }
  .article__sticky { position: sticky; top: var(--sticky-top); max-height: calc(100vh - var(--sticky-top) - 24px); overflow-y: auto; scrollbar-width: none; }
  .article__sticky::-webkit-scrollbar { display: none; }
  .toc { background: none; padding: 0; border-radius: 0; }
  .toc__list { border-left: 1px solid var(--line); }
  .toc__item a { padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent; }
  .toc__item a.is-active { border-left-color: var(--a1); }
  .toc__item--h3 a { padding-left: 38px; }
}
@media (max-width: 1099px) {
  .share { order: 2; }
  .article__grid .article__aside { order: 0; }
  .article__aside .share { display: none; }
}

/* entry:start (mirrored into assets/css/editor-style.css) */
.entry { font-size: clamp(17px, 1.2vw, 18.5px); line-height: 1.72; color: var(--ink); overflow-wrap: break-word; }
.entry > * { max-width: var(--measure); margin-top: 0; margin-bottom: 0; }
.entry > * + * { margin-top: 1.3em; }
.entry > .alignwide { max-width: var(--wide); }
.entry > .alignfull { max-width: none; }
.entry > .alignleft, .entry > .alignright { max-width: min(50%, 360px); }
.entry::after { content: ""; display: table; clear: both; }

.entry h2, .entry h3, .entry h4, .entry h5, .entry h6 { scroll-margin-top: calc(var(--sticky-top) + 12px); text-wrap: pretty; }
.entry h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(27px, 2.7vw, 40px); line-height: 1.1; letter-spacing: -0.028em; margin-top: 2.1em; }
.entry h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(21px, 1.8vw, 26px); line-height: 1.22; letter-spacing: -0.015em; margin-top: 1.8em; }
.entry h4 { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.3; margin-top: 1.6em; }
.entry h5, .entry h6 { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; color: var(--muted); text-transform: lowercase; margin-top: 1.8em; }
.entry h2 + *, .entry h3 + *, .entry h4 + *, .entry h5 + *, .entry h6 + * { margin-top: 0.7em; }
.entry > :first-child { margin-top: 0; }

.entry a { color: var(--a1); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: rgba(61, 107, 255, 0.4); }
.entry a:hover { opacity: 1; text-decoration-color: currentColor; }
.entry strong, .entry b { font-weight: 700; }
.entry em { font-style: italic; }
.entry small { font-size: 0.85em; }
.entry sup, .entry sub { font-size: 0.7em; line-height: 0; }
.entry mark { background: var(--a2); color: var(--card-dark); padding: 0.05em 0.25em; border-radius: 4px; }
.entry abbr[title] { text-decoration: underline dotted; cursor: help; }
.entry kbd {
  font-family: var(--font-mono); font-size: 0.8em; padding: 0.12em 0.45em; border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.18); border-bottom-width: 2px; background: var(--card-light);
}
.entry .has-drop-cap:not(:focus)::first-letter {
  float: left; font-family: var(--font-display); font-weight: 700; font-size: 4.4em; line-height: 0.86;
  margin: 0.06em 0.12em 0 0; color: var(--a1);
}
.entry .has-text-align-center { text-align: center; }
.entry .has-text-align-right { text-align: right; }

/* Lists: arrows for bullets, zero-padded mono numbers */
.entry ul, .entry ol { padding-left: 0; list-style: none; }
.entry li { position: relative; padding-left: 1.9em; }
.entry li + li { margin-top: 0.5em; }
.entry li > ul, .entry li > ol { margin-top: 0.5em; }
.entry ul > li::before { content: "→"; position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-size: 0.9em; color: var(--a1); }
.entry ol:not([start]):not([reversed]) { counter-reset: bb-li; }
.entry ol:not([start]):not([reversed]) > li { counter-increment: bb-li; }
.entry ol:not([start]):not([reversed]) > li::before {
  content: counter(bb-li, decimal-leading-zero); position: absolute; left: 0; top: 0.42em;
  font-family: var(--font-mono); font-size: 0.68em; line-height: 1.4; color: var(--a1);
}
.entry ol[start], .entry ol[reversed] { list-style: decimal; padding-left: 1.4em; }
.entry ol[start] > li, .entry ol[reversed] > li { padding-left: 0.4em; }
.entry ol[start] > li::marker, .entry ol[reversed] > li::marker { font-family: var(--font-mono); font-size: 0.8em; color: var(--a1); }
.entry dl { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 8px 24px; }
.entry dt { font-family: var(--font-mono); font-size: 0.8em; color: var(--muted); padding-top: 0.25em; }
.entry dd { margin: 0; }

/* Quotes */
.entry blockquote {
  padding: 2px 0 2px 24px; border-left: 2px solid var(--a1);
  font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 1.8vw, 25px); line-height: 1.38; letter-spacing: -0.015em;
}
.entry blockquote p + p { margin-top: 0.7em; }
.entry blockquote cite, .entry .wp-block-pullquote cite, .entry blockquote footer {
  display: block; margin-top: 16px; font-family: var(--font-mono); font-style: normal; font-weight: 400;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.entry .wp-block-pullquote { padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.entry .wp-block-pullquote blockquote { border: 0; padding: 0; font-size: clamp(26px, 3vw, 42px); line-height: 1.16; letter-spacing: -0.025em; }
.entry .is-style-bb-signature { border: 0; padding: 0; font-size: clamp(26px, 3.2vw, 44px); line-height: 1.16; letter-spacing: -0.025em; max-width: 26ch; }
.entry .is-style-bb-signature::before { content: ""; display: block; width: 32px; height: 32px; margin-bottom: 20px; border-radius: 999px; background: var(--a1); }

/* Code */
.entry code {
  font-family: var(--font-mono); font-size: 0.84em; padding: 0.14em 0.4em; border-radius: 6px;
  background: rgba(61, 107, 255, 0.08); color: var(--ink); overflow-wrap: anywhere;
}
.entry pre {
  position: relative; overflow-x: auto; padding: 50px 22px 22px; border-radius: 18px;
  background: var(--card-dark); color: rgba(245, 244, 240, 0.84); border: 1px solid rgba(245, 244, 240, 0.06);
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.85; tab-size: 2; white-space: pre;
  box-shadow: 0 30px 60px -40px rgba(16, 24, 40, 0.6);
}
.entry pre::before {
  content: ""; position: absolute; top: 19px; left: 20px; width: 8px; height: 8px; border-radius: 999px;
  background: rgba(245, 244, 240, 0.16); box-shadow: 14px 0 0 rgba(245, 244, 240, 0.16), 28px 0 0 rgba(245, 244, 240, 0.16);
}
.entry pre::after {
  content: ""; position: absolute; top: 40px; left: 0; right: 0; height: 1px; background: rgba(245, 244, 240, 0.07);
}
.entry pre code { padding: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }
.entry .wp-block-code { margin-left: 0; margin-right: 0; }
.entry .wp-block-preformatted, .entry .wp-block-verse { white-space: pre-wrap; }
.entry .wp-block-verse { font-family: var(--font-display); font-size: 1.1em; background: var(--canvas); color: var(--ink); padding: 24px 28px; border: 0; box-shadow: none; }
.entry .wp-block-verse::before, .entry .wp-block-verse::after { display: none; }
.code-copy {
  position: absolute; top: 10px; right: 12px; padding: 5px 11px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  border: 1px solid rgba(245, 244, 240, 0.16); background: transparent; color: rgba(245, 244, 240, 0.6); cursor: pointer;
}
.code-copy:hover { color: var(--paper); border-color: var(--a1); }
.code-copy.is-done { background: var(--a2); border-color: var(--a2); color: var(--card-dark); }
.code-wrap { position: relative; }

/* Media */
.entry img { border-radius: 18px; }
.entry figure > img, .entry .wp-block-image img { display: block; }
.entry figcaption, .entry .wp-element-caption { margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: left; }
.entry .wp-block-image.aligncenter figcaption, .entry .aligncenter > figcaption { text-align: center; }
.entry .wp-block-image.is-style-rounded img { border-radius: 999px; }
.entry .wp-block-image.is-style-bb-frame {
  position: relative; padding-top: 32px; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08); background: rgba(0, 0, 0, 0.035);
}
.entry .wp-block-image.is-style-bb-frame::before {
  content: ""; position: absolute; top: 12px; left: 14px; width: 8px; height: 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.14); box-shadow: 14px 0 0 rgba(0, 0, 0, 0.14), 28px 0 0 rgba(0, 0, 0, 0.14);
}
.entry .wp-block-image.is-style-bb-frame img { border-radius: 0; width: 100%; }
.entry .wp-block-image.is-style-bb-frame figcaption { margin: 0; padding: 10px 14px 12px; background: #fff; }
.entry .wp-block-gallery { gap: 12px; }
.entry .wp-block-gallery img { border-radius: 14px; }
.entry video { display: block; width: 100%; border-radius: 18px; }
.entry .wp-block-embed__wrapper { position: relative; }
.entry .wp-block-embed iframe, .entry > iframe { display: block; width: 100%; border: 0; border-radius: 18px; }
.entry .wp-block-cover { border-radius: 28px; overflow: hidden; }
.entry .wp-block-cover img { border-radius: 0; }
.entry .wp-block-media-text { gap: 28px; }
.entry .wp-block-media-text__content { padding: 0; }

/* Separator */
.entry hr, .entry .wp-block-separator { width: 100%; height: 1px; border: 0; background: var(--line); margin: 2.4em 0; opacity: 1; }
.entry .wp-block-separator.is-style-dots { background: none; height: auto; text-align: center; }
.entry .wp-block-separator.is-style-dots::before { content: "···"; font-family: var(--font-mono); font-size: 20px; line-height: 1; color: var(--a1); letter-spacing: 0.8em; padding-left: 0.8em; }
.entry .wp-block-separator.is-style-wide { max-width: var(--wide); }

/* Tables */
.entry table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.entry th { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: left; }
.entry th, .entry td { padding: 12px 18px 12px 0; border: 0; border-top: 1px solid var(--line); vertical-align: top; }
.entry thead th { border-top: 0; padding-top: 0; }
.entry tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.entry .wp-block-table { overflow-x: auto; }
.entry .wp-block-table.is-style-stripes { border-bottom: 0; }
.entry .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--canvas); }
.entry .wp-block-table.is-style-stripes td, .entry .wp-block-table.is-style-stripes th { padding-left: 14px; }
.table-scroll { overflow-x: auto; }

/* Buttons */
.entry .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.entry .wp-block-button__link, .entry .wp-block-file__button {
  display: inline-flex; align-items: center; gap: 14px; padding: 9px 9px 9px 24px; border-radius: 999px; border: 0;
  background: var(--card-dark); color: var(--paper); font-family: var(--font-body); font-weight: 500; font-size: 16px; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.entry .wp-block-button__link::after {
  content: "↗"; width: 32px; height: 32px; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--a1); color: var(--card-dark); transition: transform 0.25s var(--ease);
}
.entry .wp-block-button__link:hover { opacity: 1; }
.entry .wp-block-button__link:hover::after { transform: rotate(45deg); }
.entry .is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.entry .is-style-outline .wp-block-button__link::after { background: var(--card-dark); color: var(--paper); }
.entry .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.entry .wp-block-file__button { padding: 9px 20px; font-size: 14px; }

/* Details, like the FAQ on the main site */
.entry .wp-block-details, .entry details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.entry details + details { border-top: 0; margin-top: 0; }
.entry details summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 0; cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: clamp(18px, 1.5vw, 21px);
}
.entry details summary::-webkit-details-marker { display: none; }
.entry details summary::after { content: "+"; font-family: var(--font-mono); font-size: 16px; color: var(--muted); flex: none; }
.entry details[open] summary::after { content: "\2212"; }
.entry details > :not(summary) { margin-bottom: 20px; color: var(--muted); }

/* Footnotes */
.entry .wp-block-footnotes { font-size: 14.5px; line-height: 1.6; color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; }
.entry .wp-block-footnotes li::before { top: 0.35em; }
.entry .fn, .entry sup a { text-decoration: none; font-family: var(--font-mono); }

/* Columns and groups */
.entry .wp-block-columns { gap: clamp(20px, 3vw, 40px); }
.entry .wp-block-group.has-background { border-radius: 28px; padding: clamp(24px, 3vw, 36px); }
.entry .is-style-bb-note { background: var(--canvas); border-radius: 28px; padding: clamp(24px, 3vw, 36px); }
.entry .is-style-bb-note > * + *, .entry .is-style-bb-dark > * + * { margin-top: 0.9em; }
.entry .is-style-bb-dark { background: var(--card-dark); color: var(--paper); border-radius: 28px; padding: clamp(26px, 3.4vw, 44px); }
.entry .is-style-bb-dark h2, .entry .is-style-bb-dark h3, .entry .is-style-bb-dark h4 { color: var(--paper); margin-top: 0.2em; }
.entry .is-style-bb-dark p { color: rgba(245, 244, 240, 0.7); }
.entry .is-style-bb-dark a:not(.wp-block-button__link) { color: var(--tint); }
.entry .is-style-bb-dark .wp-block-button__link { background: var(--paper); color: var(--card-dark); }
.entry .is-style-bb-dark .bb-label { color: rgba(245, 244, 240, 0.45); }
.entry .is-style-bb-dark .wp-block-buttons { margin-top: 1.4em; }
.entry .bb-label, .bb-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; line-height: 1.4; color: var(--muted); }
.entry .bb-diff { font-family: var(--font-mono); font-size: clamp(16px, 1.6vw, 22px); line-height: 1.8; }
.entry .bb-diff del { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.entry .bb-diff ins { color: var(--a1); text-decoration: none; margin-left: 0.8em; }
.entry .bb-caption { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.entry .is-style-bb-rules { counter-reset: bb-rule; list-style: none; padding-left: 0; }
.entry .is-style-bb-rules > li { counter-increment: bb-rule; padding-left: 2.4em; color: var(--muted); }
.entry .is-style-bb-rules > li::before {
  content: counter(bb-rule, decimal-leading-zero); position: absolute; left: 0; top: 0.42em;
  font-family: var(--font-mono); font-size: 0.68em; color: var(--a1);
}
.entry .is-style-bb-rules > li::marker { content: ""; }

/* TODO markers, never shipped */
.todo {
  background: var(--a2); color: var(--card-dark); font-family: var(--font-mono); font-size: 0.82em;
  padding: 2px 8px; border-radius: 6px; letter-spacing: 0.02em; white-space: nowrap;
}
/* entry:end */

/* ---------- Password-protected posts ---------- */
.post-password-form { max-width: var(--measure); display: flex; flex-direction: column; gap: 16px; }
.post-password-form p:first-child { font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 1.8vw, 24px); line-height: 1.35; }
.post-password-form p:last-child { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.post-password-form label { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 220px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.post-password-form input[type="password"] {
  width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid transparent; background: var(--canvas);
  font-family: var(--font-body); font-size: 16px; letter-spacing: 0; color: var(--ink);
}
.post-password-form input[type="password"]:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 4px rgba(61, 107, 255, 0.14); }
.post-password-form input[type="submit"] {
  padding: 14px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--card-dark); color: var(--paper); font-family: var(--font-body); font-weight: 500; font-size: 16px;
}

/* ---------- Author ---------- */
.author { display: flex; align-items: flex-start; gap: clamp(20px, 3vw, 36px); max-width: 860px; }
.author__avatar { display: block; width: clamp(72px, 8vw, 104px); height: auto; aspect-ratio: 1; border-radius: 26px; flex: none; background: var(--a1); }
.author__copy { display: flex; flex-direction: column; min-width: 0; }
.author__name { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.08; letter-spacing: -0.025em; }
.author__bio { margin-top: 14px; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.62; color: var(--muted); max-width: 60ch; }

/* ---------- Comments ---------- */
.comments { max-width: 860px; }
.comments__title { margin-bottom: clamp(28px, 4vw, 48px); font-size: clamp(28px, 3.4vw, 48px); }
.respond__title.comments__title { margin-bottom: 18px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list { margin-bottom: clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.comment-list .children { padding-left: clamp(18px, 4vw, 52px); border-left: 1px solid var(--line); }
.comment-body { padding: 24px 0; border-top: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.comment-author { display: flex; align-items: center; gap: 12px; }
.comment-author .avatar { width: 40px; height: 40px; border-radius: 12px; }
.comment-author .fn { font-style: normal; font-weight: 700; font-size: 16px; }
.comment-author .says { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.comment-metadata { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.comment-metadata .edit-link { margin-left: 10px; }
.comment-content { margin-top: 14px; font-size: 16.5px; line-height: 1.65; }
.comment-content p + p { margin-top: 0.8em; }
.comment-content a { color: var(--a1); text-decoration: underline; text-underline-offset: 0.2em; }
.comment-awaiting-moderation { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--a1); }
.reply { margin-top: 12px; }
.comment-reply-link { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--a1); }
.bypostauthor > .comment-body .fn::after {
  content: "author"; margin-left: 8px; padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
  font-family: var(--font-mono); font-weight: 400; font-size: 10px; background: var(--a2); color: var(--card-dark);
}
.pingback .comment-body, .trackback .comment-body { font-size: 15px; color: var(--muted); }
.comment-navigation .nav-links { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 40px; font-family: var(--font-mono); font-size: 12px; }
.comments__closed { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.respond { margin-top: 8px; }
.respond__title { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.015em; margin-bottom: 18px; }
.respond__title small { margin-left: 12px; font-family: var(--font-mono); font-weight: 400; font-size: 11.5px; }
.respond__title small a { color: var(--a1); }
.comment-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.comment-form > p { margin: 0; grid-column: 1 / -1; }
.comment-form .comment-form-author, .comment-form .comment-form-email { grid-column: auto; }
.comment-notes, .logged-in-as { font-size: 14px; color: var(--muted); }
.logged-in-as a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.comment-form label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.comment-form .required { color: var(--a1); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid transparent; background: var(--canvas);
  font-size: 16px; line-height: 1.5; color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s;
}
.stratum--canvas .comment-form input[type="text"], .stratum--canvas .comment-form input[type="email"], .stratum--canvas .comment-form input[type="url"], .stratum--canvas .comment-form textarea { background: var(--card-light); }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 4px rgba(61, 107, 255, 0.14); }
.comment-form textarea { min-height: 160px; resize: vertical; }
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 10px; }
.comment-form-cookies-consent label { margin: 0; font-family: var(--font-body); font-size: 14px; letter-spacing: 0; }
.comment-form-cookies-consent input { margin-top: 3px; accent-color: var(--a1); }
.form-submit { margin-top: 6px; }
.respond__submit { font-family: var(--font-body); }
@media (max-width: 640px) {
  .comment-form .comment-form-author, .comment-form .comment-form-email { grid-column: 1 / -1; }
  .author { flex-direction: column; }
}

/* ---------- Contact / footer ---------- */
.contact { padding-bottom: 44px; box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.07); }
.contact__head { margin-bottom: clamp(56px, 9vw, 120px); }
.contact__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.contact__title { font-size: clamp(36px, 7vw, 108px); line-height: 1.01; letter-spacing: -0.038em; max-width: 15ch; }
.contact__divider { height: 1px; background: var(--line); margin: clamp(48px, 7vw, 96px) 0 28px; }
.footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; font-size: 15px; color: var(--muted); }
.footer__col--brand { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .footer { display: flex; flex-wrap: wrap; gap: 32px 60px; justify-content: space-between; }
  .footer__col--brand { grid-column: auto; }
}
.footer__col { display: flex; flex-direction: column; gap: 8px; }
.footer__brand { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--ink); }
.footer__addr { max-width: 34ch; font-style: normal; display: flex; flex-direction: column; gap: 8px; }
.footer__phone { font-family: var(--font-mono); font-size: 12.5px; }
.footer__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink); }
.footer__legal { margin-top: 36px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; color: var(--muted); }

/* ---------- Menu (stack trace) ---------- */
.menu { position: fixed; inset: 0; z-index: 99990; display: none; }
.menu:target, .menu.is-open { display: block; }
.menu__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); border: none; padding: 0; cursor: pointer; animation: fadein 0.2s ease both; }
.menu__scrim:hover { opacity: 1; }
.menu__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 86vw);
  background: var(--card-dark); color: var(--paper); padding: 36px 34px;
  display: flex; flex-direction: column; animation: panelin 0.2s var(--ease) both; overflow-y: auto; overscroll-behavior: contain;
}
.admin-bar .menu__panel { top: 32px; }
.menu__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.menu__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: rgba(245, 244, 240, 0.42); }
.menu__label--pages { display: block; margin: 28px 0 10px; }
.menu__close { font-family: var(--font-mono); font-size: 12px; color: rgba(245, 244, 240, 0.7); background: none; border: none; cursor: pointer; padding: 0; }
.menu__list { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-mono); font-size: 14px; }
.trace {
  display: flex; gap: 12px; padding: 11px 0; color: rgba(245, 244, 240, 0.82);
  border-bottom: 1px solid rgba(245, 244, 240, 0.08);
  transition: padding-left 0.18s ease, opacity 0.18s;
}
.trace:last-child { border-bottom: none; }
.trace:hover { padding-left: 10px; opacity: 1; }
.trace[aria-current="page"] { color: var(--a2); }
.trace--child { padding-left: 22px; font-size: 13px; color: rgba(245, 244, 240, 0.6); }
.trace--child:hover { padding-left: 32px; }
.trace__arrow { color: var(--a1); }
.menu__foot { margin-top: auto; padding-top: 36px; }
.menu__foot .pill { width: 100%; justify-content: space-between; padding: 9px 9px 9px 22px; font-size: 15px; }
body.menu-open { overflow: hidden; }

/* ---------- Reading progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99980; pointer-events: none; }
.admin-bar .progress { top: 32px; }
.progress__bar { display: block; height: 100%; background: var(--a1); transform-origin: 0 50%; transform: scaleX(0); }

@media screen and (max-width: 782px) {
  .admin-bar { --sticky-top: 78px; }
  .admin-bar .menu__panel, .admin-bar .progress { top: 46px; }
}
@media screen and (max-width: 600px) {
  .admin-bar .progress { top: 0; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  :root { --radius: 30px; }
  .hero__bar { gap: 10px; }
  .hero__tab { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .grep { width: 100%; }
  .grep__cmd { display: none; }
  .bhero__foot { flex-direction: column; align-items: stretch; }
  .phero__foot { flex-direction: column; align-items: flex-start; }
  .entry > .alignleft, .entry > .alignright { float: none; max-width: 100%; margin: 1.3em 0 0; }
  .pager { justify-content: center; }
  .pager__count { width: 100%; text-align: center; }
}

/* ---------- Keyframes ---------- */
@keyframes panelin { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Print ---------- */
@media print {
  .shell { padding: 0; background: #fff; }
  .stratum { margin: 0; padding: 24px 0; border-radius: 0; box-shadow: none; background: #fff !important; color: #000 !important; }
  .hero__bar, .crumbs, .article__aside, .author-s, #related, .comments-s, .contact, .menu, .progress, .code-copy, .skip-link { display: none !important; }
  .nhero__title, .nhero__opening, .phero__meta, .byline { color: #000 !important; }
  .entry pre { background: #f4f4f4; color: #000; box-shadow: none; }
  .entry a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}
