:root {
  --ink: #16211c;
  --bg: #f5f7f4;
  --accent: #2e6b52;
  --accent-dark: #214d3b;
  --line: #d9e2da;
  --muted: #5e6b64;
  --paper: #ffffff;
  --tint: #eaf1ec;
  --badge: #e1ece5;
  --badge-hover: #cfe0d6;
  --media-bg: #e4ebe6;
  --code-bg: #e7eee9;
  --serif: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1120px;
  --space: clamp(1.25rem, 3vw, 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.05rem);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.35rem);
}

p {
  margin: 0 0 1.15em;
}

ul,
ol {
  margin: 0 0 1.3em;
  padding-left: 1.25em;
}

li {
  margin-bottom: 0.4em;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2.5rem, 760px);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  flex-wrap: wrap;
  padding-block: 0.5rem;
}

.logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.4rem);
  font-size: 0.92rem;
  flex-wrap: wrap;
}

.nav > a,
.dropdown summary {
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.nav > a:hover,
.dropdown summary:hover {
  border-color: var(--accent);
}

.dropdown {
  position: relative;
}

.dropdown summary {
  cursor: pointer;
  list-style: none;
}

.dropdown summary::-webkit-details-marker {
  display: none;
}

.dropdown summary::after {
  content: " +";
  color: var(--accent);
}

.dropdown[open] summary::after {
  content: " \2212";
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 200px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem;
  display: grid;
  gap: 0.1rem;
  box-shadow: 0 12px 30px rgba(47, 42, 36, 0.12);
}

.dropdown-menu a {
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.dropdown-menu a:hover {
  background: var(--tint);
  color: var(--ink);
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(460px, 60vh, 660px);
  display: flex;
  align-items: center;
  color: #fdfaf5;
  background-image:
    linear-gradient(100deg, rgba(9, 24, 18, 0.9) 0%, rgba(9, 24, 18, 0.62) 52%, rgba(9, 24, 18, 0.28) 100%),
    url("../img/hero.jpg");
  background-size: cover;
  background-position: center;
}

.hero-inner {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  max-width: 760px;
}

.hero h1 {
  color: #fffdf8;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero .kicker {
  color: #e9dcc4;
}

.hero .lede {
  color: #f1e9dc;
  font-size: clamp(1.05rem, 1rem + 0.45vw, 1.28rem);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  color: var(--muted);
  max-width: 68ch;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--ink);
  color: #fffdf8;
  text-decoration: none;
  padding: 0.62rem 1.1rem;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--ink);
  transition: background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-lg {
  padding: 0.8rem 1.35rem;
  font-size: 0.98rem;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.hero .btn {
  background: var(--accent);
  border-color: var(--accent);
}

.hero .btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.hero .btn-ghost {
  background: transparent;
  color: #fffdf8;
  border-color: rgba(255, 253, 248, 0.75);
}

.hero .btn-ghost:hover {
  background: rgba(255, 253, 248, 0.14);
}

/* Sections */
.section {
  padding-block: clamp(2.4rem, 5vw, 4rem);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-sub {
  color: var(--muted);
  max-width: 65ch;
  margin-top: -0.35rem;
  margin-bottom: 2rem;
}

.page-head {
  padding-block: clamp(2rem, 4vw, 3.2rem) 1rem;
}

.page-head .lede {
  margin-bottom: 0;
}

.intro-2 {
  max-width: 72ch;
}

/* Grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(1.2rem, 2.4vw, 1.9rem);
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--media-bg);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.15rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
  background: var(--badge);
  padding: 0.24rem 0.55rem;
  border-radius: 3px;
  text-decoration: none;
  margin-bottom: 0.7rem;
}

.badge:hover {
  background: var(--badge-hover);
  color: var(--ink);
}

.card-title {
  font-size: 1.18rem;
  margin-bottom: 0.45rem;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-body p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 1rem;
}

.card-body .btn {
  margin-top: auto;
  font-size: 0.86rem;
  padding: 0.45rem 0.85rem;
}

/* Category tiles */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.cat-tile {
  display: block;
  padding: 1.35rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.cat-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.cat-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cat-desc {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Values */
.values {
  background: var(--tint);
}

.value {
  padding: 1.3rem 1.35rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.value h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

.value p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* Breadcrumb */
.breadcrumb {
  padding-top: 1.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.35rem;
  color: #b9ae9d;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Article */
.article-wrap {
  width: min(100% - 2.5rem, 860px);
  margin-inline: auto;
  padding-bottom: 3.5rem;
}

.article-head {
  padding-block: 2rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.article-head h1 {
  margin-bottom: 0.55rem;
}

.article-head .lede {
  margin-bottom: 0.9rem;
}

.meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

.prose {
  padding-top: 1.8rem;
  font-size: clamp(1.02rem, 1rem + 0.15vw, 1.1rem);
}

.prose h2 {
  margin-top: 2rem;
}

.prose h3 {
  margin-top: 1.6rem;
}

.prose > p,
.prose > ul,
.prose > ol {
  max-width: 70ch;
}

.prose li {
  max-width: 66ch;
}

.article-figure {
  margin: 2rem 0;
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  background: var(--media-bg);
}

.article-figure figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.faq {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.8rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}

.faq details p {
  margin: 0.7rem 0 0.2rem;
  color: var(--muted);
}

.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 2.5rem;
  padding: 1.4rem;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.author-avatar {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}

.author-box h2 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.author-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.related {
  margin-top: 3.2rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.related h2 {
  font-size: 1.5rem;
}

.related .grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

/* Category page */
.subtopics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
}

.subtopics li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 0.35rem 0.85rem;
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
}

.other-cats ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  list-style: none;
  padding: 0;
}

/* Forms and prose extras */
.updated {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--tint);
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-block: 2.6rem 2rem;
}

.footer-grid p {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 40ch;
}

.footer-grid h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 0.45rem;
}

.footer-grid a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-grid a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-logo {
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-block: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}

/* Responsive */
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .header-inner {
    min-height: 60px;
  }

  .nav {
    font-size: 0.86rem;
    gap: 0.9rem;
  }

  .dropdown-menu {
    right: auto;
    left: 0;
  }
}

@media (max-width: 480px) {
  .wrap,
  .narrow,
  .article-wrap {
    width: min(100% - 1.6rem, var(--wrap));
  }

  .hero {
    min-height: 74vh;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .author-box {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cat-tile:hover {
    transform: none;
  }
}


/* NestMio editorial theme */
.site-header { border-bottom: 2px solid var(--ink); }
.logo { text-transform: uppercase; letter-spacing: 0.08em; font-size: 1.05rem; font-weight: 800; }
.hero { min-height: clamp(430px, 56vh, 620px); }
.hero h1 { font-weight: 800; letter-spacing: -0.03em; }
h1, h2, h3, h4 { font-weight: 750; letter-spacing: -0.025em; }
.card { border-radius: 0; border-top: 3px solid var(--ink); }
.card-media img { filter: saturate(0.95); }
.badge { border-radius: 0; background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.badge:hover { background: var(--badge); color: var(--accent-dark); }
.cat-tile { border-radius: 0; border-left: 3px solid var(--accent); }
.btn { border-radius: 0; text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.8rem; }
.btn-lg { font-size: 0.86rem; }
.value { border-radius: 0; }
.dropdown-menu { border-radius: 0; }
.subtopics li { border-radius: 0; }
.article-figure img { border-radius: 0; }
.author-box { border-radius: 0; }
.site-footer { background: var(--ink); color: #c9d6ce; }
.site-footer .logo, .site-footer .footer-logo { color: #f2f7f3; }
.site-footer .logo span, .site-footer .footer-logo span { color: #8fc3a9; }
.footer-grid h3 { color: #e8f0ea; }
.footer-grid p, .footer-grid a, .footer-bottom { color: #a9bdb1; }
.footer-grid a:hover { color: #ffffff; }
.footer-bottom { border-top-color: #33443b; }

/* === Modern grid layout (NestMio) === */
.hero { align-items: flex-end; min-height: 72vh; background-image: linear-gradient(180deg, rgba(9, 24, 18, 0.12), rgba(9, 24, 18, 0.88)), url("../img/hero.jpg"); }
.hero-inner { max-width: 900px; padding-bottom: clamp(2.6rem, 6vw, 4.5rem); }
.hero h1 { font-size: clamp(2.5rem, 6.5vw, 4.3rem); letter-spacing: -0.02em; }
.grid { gap: 1.6rem; }
.card { border: 0; border-radius: 0; background: transparent; }
.card-media { aspect-ratio: 4 / 3; }
.card-body { padding: 1.1rem 0 0; }
.card .btn { display: none; }
.card .badge { background: transparent; border: 1px solid var(--line); border-radius: 0; }
.card-title { font-size: 1.35rem; margin-top: 0.6rem; }
.cat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.cat-tile { background: transparent; }
@media (max-width: 720px) { .hero { min-height: 62vh; } .cat-grid { grid-template-columns: 1fr; } }
