/* =========================================================
   Graumatic – Global Stylesheet
   Colors: #03BF67 (accent), #000000 (ink), #ffffff (paper)
   Font: Roboto (local, /fonts)
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design Tokens ---------- */
:root {
  --accent: #03bf67;
  --accent-dark: #029a52;
  --accent-soft: rgba(3, 191, 103, 0.12);
  --ink: #000000;
  --ink-80: #1a1a1a;
  --ink-60: #4d4d4d;
  --ink-40: #808080;
  --paper: #ffffff;
  --line: #e6e8ea;
  --bg-soft: #f6f8f7;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
  --shadow-accent: 0 18px 40px rgba(3, 191, 103, 0.28);

  --maxw: 1180px;
  --gap: clamp(1rem, 3vw, 2rem);
  --section-y: clamp(3.5rem, 8vw, 7rem);

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink-80);
  background: var(--paper);
  line-height: 1.65;
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.075rem);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

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

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
}
h2 {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
}
h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

p {
  color: var(--ink-60);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 2000;
  background: var(--accent);
  color: #03210f;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

.lead {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  color: var(--ink-60);
  max-width: 60ch;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.section {
  padding-block: var(--section-y);
}

.section--soft {
  background: var(--bg-soft);
}

.section--dark {
  background: var(--ink);
  color: #d9dcdf;
}
.section--dark h2,
.section--dark h3 {
  color: #fff;
}
.section--dark p {
  color: #aeb4ba;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.section--dark .eyebrow {
  color: var(--accent);
  background: rgba(3, 191, 103, 0.16);
}

.section-head {
  max-width: 50rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}
.section-head p {
  margin-top: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.95rem;
  --pad-x: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition);
  will-change: transform;
}
.btn svg {
  width: 1.1em;
  height: 1.1em;
}
.btn-primary {
  background: var(--accent);
  color: #03210f;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-3px);
}
.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: var(--ink);
}
.section--dark .btn-ghost {
  color: #fff;
}
.btn-ghost:hover {
  background: var(--ink);
  color: #fff;
  transform: translateY(-3px);
}
.section--dark .btn-ghost:hover {
  background: #fff;
  color: var(--ink);
}
.btn-light {
  background: #fff;
  color: var(--ink);
}
.btn-light:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
}
.brand svg,
.brand img {
  height: 30px;
  width: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.nav-links a {
  font-weight: 500;
  font-size: 0.97rem;
  color: var(--ink-80);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-links a:hover::after {
  width: 100%;
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin-inline: auto;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      60% 60% at 85% 0%,
      var(--accent-soft),
      transparent 60%
    ),
    radial-gradient(50% 50% at 0% 100%, rgba(3, 191, 103, 0.08), transparent 60%);
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-media svg {
  width: 100%;
  max-width: 560px;
  height: auto;
}
.hero h1 span {
  color: var(--accent);
}
.hero .lead {
  margin-top: 1.4rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.hero-trust {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.2rem;
}
.hero-trust div {
  display: flex;
  flex-direction: column;
}
.hero-trust strong {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--ink);
  font-weight: 900;
}
.hero-trust span {
  font-size: 0.85rem;
  color: var(--ink-40);
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 2.5vw, 2rem);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  height: 100%;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.card .icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  color: var(--accent-dark);
}
.card .icon svg {
  width: 26px;
  height: 26px;
}
.card h3 {
  margin-bottom: 0.6rem;
}
.card p {
  font-size: 0.97rem;
}

.section--dark .card {
  background: #0d0d0d;
  border-color: #1f1f1f;
}
.section--dark .card:hover {
  border-color: var(--accent);
}
.section--dark .card h3 {
  color: #fff;
}

/* ---------- Feature split ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split.reverse .split-media {
  order: -1;
}
.feature-list {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.75rem;
}
.feature-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.feature-list .check {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.feature-list .check svg {
  width: 15px;
  height: 15px;
  color: #03210f;
}
.feature-list strong {
  color: var(--ink);
  display: block;
  font-weight: 700;
}
.feature-list span {
  font-size: 0.95rem;
  color: var(--ink-60);
}

/* ---------- Workflow diagram ---------- */
.workflow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0.75rem;
}
.wf-col {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}
.wf-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.2rem;
}
.wf-node {
  background: #0d0d0d;
  border: 1px solid #1f1f1f;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #e9ebed;
  transition: border-color var(--transition), transform var(--transition);
}
.wf-node:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.wf-node svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: 0 0 auto;
}
.wf-core {
  background: var(--accent);
  border: none;
  color: #03210f;
  font-weight: 700;
  flex-direction: column;
  text-align: center;
  align-items: center;
  gap: 0.35rem;
  padding: 1.2rem 1rem;
  box-shadow: var(--shadow-accent);
}
.wf-core svg {
  color: #03210f;
  width: 28px;
  height: 28px;
}
.wf-core small {
  font-weight: 500;
  font-size: 0.78rem;
  opacity: 0.85;
}
.wf-arrow {
  align-self: center;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.wf-arrow svg {
  width: 26px;
  height: 26px;
}

/* ---------- Steps ---------- */
.steps {
  counter-reset: step;
  display: grid;
  gap: 1.4rem;
}
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.step:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--accent);
  background: var(--accent-soft);
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.step h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

/* ---------- Use cases ---------- */
.usecase {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.usecase:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.usecase-visual {
  background: var(--ink);
  padding: 1.5rem;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}
.usecase-visual svg {
  width: 100%;
  height: 100%;
}
.usecase-body {
  padding: 1.5rem 1.6rem 1.7rem;
}
.usecase-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}
.usecase-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.usecase-result {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 1.25rem;
}
.usecase-result div {
  flex: 1;
  min-width: 0;
}
.usecase-result div span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-40);
  margin-bottom: 0.15rem;
}
.usecase-result div strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--accent-dark);
  font-weight: 900;
}

/* ---------- Stats band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stats .stat strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--accent);
}
.stats .stat span {
  color: #aeb4ba;
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 800px;
  margin-inline: auto;
  display: grid;
  gap: 0.9rem;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  padding: 1.2rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q .plus {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  position: relative;
}
.faq-q .plus::before,
.faq-q .plus::after {
  content: "";
  position: absolute;
  inset: 50% 0;
  height: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: transform var(--transition);
}
.faq-q .plus::after {
  transform: translateY(-50%) rotate(90deg);
}
.faq-item.open .plus::after {
  transform: translateY(-50%) rotate(0);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}
.faq-a p {
  padding: 0 1.4rem 1.3rem;
  font-size: 0.97rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  color: #03210f;
  box-shadow: var(--shadow-accent);
}
.cta-band h2 {
  color: #03210f;
}
.cta-band p {
  color: #053d1f;
  max-width: 52ch;
  margin: 1rem auto 2rem;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #aeb4ba;
  padding-top: clamp(3rem, 6vw, 4.5rem);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 3rem;
}
.footer-brand svg {
  height: 28px;
  margin-bottom: 1.2rem;
}
.footer-brand p {
  color: #8b9197;
  font-size: 0.95rem;
  max-width: 32ch;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.footer-col a {
  display: block;
  padding: 0.35rem 0;
  color: #aeb4ba;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid #1f1f1f;
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #6f757b;
}
.footer-bottom a {
  color: #8b9197;
  transition: color var(--transition);
}
.footer-bottom a:hover {
  color: var(--accent);
}
.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- Legal / content pages ---------- */
.page-hero {
  background: var(--ink);
  color: #fff;
  padding-block: clamp(3rem, 7vw, 5rem);
}
.page-hero .eyebrow {
  color: var(--accent);
  background: rgba(3, 191, 103, 0.16);
}
.page-hero h1 {
  color: #fff;
}
.page-hero p {
  color: #aeb4ba;
  margin-top: 0.75rem;
}
.legal {
  max-width: 850px;
}
.legal h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
}
.legal h3 {
  font-size: 1.2rem;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}
.legal p,
.legal li {
  color: var(--ink-60);
  margin-bottom: 0.9rem;
}
.legal ul {
  list-style: disc;
  padding-left: 1.4rem;
}
.legal a {
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal strong {
  color: var(--ink);
}
.legal .meta {
  color: var(--ink-40);
  font-size: 0.9rem;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 0.5rem 1.25rem 1.25rem;
    transform: translateY(-100%);
    transition: transform var(--transition), visibility 0s linear 0.35s;
    visibility: hidden;
    pointer-events: none;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
  }
  .nav-links.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform var(--transition), visibility 0s;
  }
  .nav-links a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
  }
  .nav-links li:last-child a {
    border-bottom: none;
  }
  .nav-links a::after {
    display: none;
  }
  .nav-cta .btn-ghost {
    display: none;
  }
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }
  .split.reverse .split-media {
    order: 0;
  }
  .hero-media {
    order: -1;
  }
  .workflow {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .wf-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 720px) {
  .grid-3,
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   Blog – Overview & Post styles
   ========================================================== */

/* ---------- Blog card grid ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.blog-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--ink-40);
}
.blog-card-meta time {
  font-weight: 500;
}
.blog-rt {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.blog-card-title {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}
.blog-card-title a {
  color: inherit;
  transition: color var(--transition);
}
.blog-card-title a:hover {
  color: var(--accent-dark);
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--ink-60);
  flex: 1;
  line-height: 1.6;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-top: auto;
  transition: gap var(--transition), color var(--transition);
}
.blog-card-link:hover {
  gap: 0.7rem;
  color: var(--accent);
}

/* ---------- Blog empty / error ---------- */
.blog-empty,
.blog-error {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 0;
  color: var(--ink-40);
  font-size: 1.1rem;
}

/* ---------- Pagination ---------- */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.blog-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.7rem 1.3rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.blog-page-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.blog-page-info {
  font-size: 0.9rem;
  color: var(--ink-40);
}

/* ---------- Single post hero ---------- */
.post-hero {
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.25rem;
  transition: gap var(--transition);
}
.post-back:hover {
  gap: 0.7rem;
}
.post-meta-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #aeb4ba;
}
.post-meta-top time {
  font-weight: 500;
}

/* ---------- Post layout (content + sidebar) ---------- */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

/* ---------- Post body (HTML from DB) ---------- */
.post-body {
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-60);
}
.post-body h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  color: var(--ink);
}
.post-body h3 {
  font-size: 1.25rem;
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.post-body p {
  margin-bottom: 1.2rem;
  color: var(--ink-60);
}
.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}
.post-body ul {
  list-style: disc;
}
.post-body ol {
  list-style: decimal;
}
.post-body li {
  margin-bottom: 0.4rem;
  color: var(--ink-60);
}
.post-body a {
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-body a:hover {
  color: var(--accent);
}
.post-body strong {
  color: var(--ink);
  font-weight: 700;
}
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--ink-60);
}
.post-body pre {
  background: var(--ink);
  color: #e9ebed;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.post-body code {
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.post-body th,
.post-body td {
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  text-align: left;
}
.post-body th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Post sidebar ---------- */
.post-sidebar {
  position: sticky;
  top: calc(72px + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.post-sidebar-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.post-sidebar-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}
.post-sidebar-card p {
  font-size: 0.92rem;
  margin-bottom: 1.1rem;
}

/* ---------- Post navigation ---------- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem 1.75rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.post-nav-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.post-nav-next {
  text-align: right;
}
.post-nav-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.post-nav-label svg,
.blog-card-link svg {
  display: inline-block;
  flex-shrink: 0;
}
.post-nav-next .post-nav-label {
  justify-content: flex-end;
}
.post-nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

/* ---------- Blog responsive ---------- */
@media (max-width: 980px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .post-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav-next {
    text-align: left;
  }
  .post-nav-next .post-nav-label {
    justify-content: flex-start;
  }
}