:root {
  --accent: #1F6F5B;
  --text: #1A2332;
  --bg: #F3F6F4;
  --muted: #5B6775;
  --border: #D5DDD8;
  --card: #FFFFFF;
  --danger: #B42318;
  --max: 1140px;
  --prose: 44rem;
  --radius: 14px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --shadow: 0 10px 30px rgba(26, 35, 50, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(31, 111, 91, 0.08), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(26, 35, 50, 0.05), transparent 55%),
    var(--bg);
  line-height: 1.65;
  font-size: 1.05rem;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: color-mix(in srgb, var(--accent) 80%, #000); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, #fff);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: .5rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 740px); }
.sr-only, .hp-field {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.site-header {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(10px);
}
.header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
}
.brand { text-decoration: none; color: var(--text); }
.brand-name {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.nav-toggle {
  display: inline-flex; border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 999px; padding: .45rem .85rem; font: inherit; font-weight: 600;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: none; flex-direction: column; gap: .55rem; }
@media (max-width: 860px) {
  .site-nav {
    position: absolute; left: 0; right: 0; top: 64px; background: var(--card);
    border-bottom: 1px solid var(--border); padding: 1rem 1rem 1.2rem; display: none; z-index: 40;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .site-nav.is-open ul { display: flex; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
  .site-nav ul {
    display: flex; flex-direction: row; align-items: center; gap: 1.15rem;
    font-size: .95rem; font-weight: 600;
  }
}
.site-nav a, .linkish {
  color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0;
}
.site-nav a:hover, .linkish:hover { color: var(--accent); }
.site-nav a.is-active { color: var(--accent); }
.inline-form { display: inline; }

.hero { position: relative; overflow: hidden; }
.hero-img {
  width: 100%; height: clamp(220px, 36vw, 400px); object-fit: cover; display: block;
}
.hero-copy {
  position: absolute; inset: auto 0 0 0; padding: 2rem 0 2.2rem;
  background: linear-gradient(transparent, rgba(17, 24, 28, 0.72));
  color: #fff;
}
.hero-brand {
  font-family: var(--font);
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  font-weight: 700; margin: 0 0 .4rem; letter-spacing: -0.03em; line-height: 1.05;
}
.hero-tagline { margin: 0; max-width: 36rem; opacity: .92; font-size: 1.02rem; }

.site-main { padding: 2.2rem 0 3.5rem; }
.layout-home { display: grid; gap: 2rem; }
@media (min-width: 960px) {
  .layout-home { grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; }
}

.section-title, h1 {
  font-family: var(--font);
  letter-spacing: -0.03em; line-height: 1.15; font-weight: 700;
  margin: 0 0 1.2rem;
}
.lead { color: var(--muted); font-size: 1.08rem; }
.empty {
  padding: 1.25rem 1.35rem; border: 1px dashed var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 70%, transparent); color: var(--muted);
}

.home-tools {
  display: grid; gap: 1rem; margin-bottom: 1.75rem;
}
@media (min-width: 700px) {
  .home-tools { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
.home-tools h2 {
  margin: 0 0 .55rem; font-size: .78rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-ui); font-weight: 700;
}
.search-inline {
  display: flex; gap: .5rem; align-items: stretch;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .25rem .25rem .85rem;
  box-shadow: var(--shadow);
}
.search-inline input { border: 0; background: transparent; padding: .55rem 0; }
.search-inline .btn { border-radius: 999px; }

.article-list { display: grid; gap: 1.15rem; }
.article-card {
  display: grid; gap: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .article-card { grid-template-columns: 220px minmax(0,1fr); }
}
.card-cover img { width: 100%; height: 100%; min-height: 160px; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.25rem; }
.card-title {
  margin: 0 0 .45rem; font-family: var(--font); font-size: 1.35rem;
  letter-spacing: -0.02em; line-height: 1.2;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { margin: 0 0 .85rem; color: var(--muted); }
.meta {
  color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem;
  margin-bottom: .9rem;
}
.cats a { margin-right: .4rem; }

.side-block {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
.side-block h2 {
  margin: 0 0 .7rem; font-size: .78rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-ui); font-weight: 700;
}
.author-thumb, .avatar {
  border-radius: 999px; object-fit: cover; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.avatar.lg { width: 120px; height: 120px; }
.cat-list, .social-list, .footer-links { list-style: none; padding: 0; margin: 0; }
.cat-list li, .footer-links li, .social-list li { margin: .4rem 0; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: 999px;
  padding: .65rem 1.1rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(0.96); color: #fff; }
.btn-small { padding: .42rem .85rem; font-size: .9rem; }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: color-mix(in srgb, var(--bg) 50%, var(--card)); color: var(--text); filter: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn.danger, .danger { color: var(--danger); }
button.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }

.form label, .stack > label { display: grid; gap: .35rem; margin-bottom: .15rem; font-weight: 600; font-size: .92rem; }
.stack { display: grid; gap: .9rem; }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: .7rem .8rem;
  background: var(--card); color: var(--text); font: inherit;
}
.check { display: flex !important; align-items: flex-start; gap: .55rem; grid-template-columns: none !important; font-weight: 400; }
.check input { width: auto; margin-top: .25rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }

.flash {
  padding: .9rem 1rem; border-radius: 12px; margin: .75rem 0;
  border: 1px solid var(--border); background: var(--card);
}
.flash-success { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, #fff); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, #fff); }
.flashes { margin-top: 1rem; }

.article-page { width: min(100% - 2rem, var(--prose)); }
.article-header { margin-bottom: 1.35rem; }
.article-header h1 { font-family: var(--font); margin-bottom: .7rem; }
.breadcrumbs { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.prose { font-family: var(--font); font-size: 1.12rem; }
.prose h2, .prose h3 { font-family: var(--font); line-height: 1.2; letter-spacing: -0.02em; }
.prose img { border-radius: 12px; margin: 1rem 0; }
.prose blockquote {
  border-left: 3px solid var(--accent); margin: 1rem 0; padding-left: 1rem; color: var(--muted);
  font-style: italic;
}
.article-cover { margin: 0 0 1.25rem; border-radius: var(--radius); overflow: hidden; }
.author-box, .newsletter-box {
  display: grid; gap: 1rem; grid-template-columns: auto 1fr; align-items: start;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem;
  margin: 2rem 0; background: var(--card); box-shadow: var(--shadow);
}
.newsletter-box { grid-template-columns: 1fr; }
.comments { margin-top: 2rem; }
.comment-list, .comment-replies { list-style: none; padding: 0; margin: 0; }
.comment { border-top: 1px solid var(--border); padding: 1rem 0; }
.comment-replies { margin-left: 1rem; padding-left: 1rem; border-left: 2px solid var(--border); }
.comment-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }

.video-embed { margin: 1.25rem 0; }
.video-frame {
  position: relative; aspect-ratio: 16/9; background: #111; border-radius: var(--radius); overflow: hidden;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 1.25rem;
  text-align: left; background: var(--card);
}
.video-placeholder img { margin: 0 0 1rem; max-width: 220px; opacity: .9; }
.muted-note { color: var(--muted); font-size: .95rem; max-width: 36rem; margin: .35rem 0 1rem; }

.pagination ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.pagination a, .pagination .is-current {
  display: inline-flex; min-width: 2.3rem; justify-content: center; padding: .4rem .55rem;
  border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text);
  background: var(--card);
}
.pagination .is-current { background: var(--accent); color: #fff; border-color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--border); padding: 2.2rem 0 2.6rem; margin-top: 0;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.35fr 1fr; } }
.footer-brand { font-family: var(--font); font-weight: 700; margin: 0 0 .4rem; font-size: 1.2rem; }
.copyright { margin-top: 1.25rem; color: var(--muted); font-size: .9rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: .55rem .65rem; text-align: left; vertical-align: top; }
.install-wrap { max-width: 760px; padding: 2rem 0 3rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
