@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap");

/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg:          #060d14;
  --bg-card:     rgba(10, 20, 32, 0.85);
  --border:      rgba(0, 210, 180, 0.12);
  --border-soft: rgba(100, 160, 210, 0.1);
  --text:        #c8dce8;
  --text-muted:  #5e7f96;
  --heading:     #f0f8ff;
  --accent:      #00d2b4;
  --accent-dim:  rgba(0, 210, 180, 0.12);
  --accent-glow: rgba(0, 210, 180, 0.25);
  --amber:       #f59e0b;
  --radius:      14px;
  --radius-lg:   22px;
  --width:       1100px;
  --transition:  200ms ease;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 210, 180, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(0, 100, 200, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../grid.svg") center top / 640px auto repeat;
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout shell ───────────────────────────────────────────────────────── */
.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.site-main {
  flex: 1;
}

.markdown-body {
  width: min(calc(100% - 2.5rem), var(--width));
  margin: 0 auto;
  padding: 1rem 0 6rem;
  text-align: center;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: rgba(6, 13, 20, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, var(--width));
  margin: 0 auto;
}

.site-header__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  border: none;
}

.site-header__brand img {
  width: 260px;
  height: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.site-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.site-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--heading);
}

.site-menu-toggle:hover,
.site-menu-toggle:focus-visible {
  border-color: rgba(0, 210, 180, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav a {
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  background: rgba(0, 210, 180, 0.08);
  border-color: rgba(0, 210, 180, 0.3);
}

.site-nav a.is-active {
  color: var(--accent);
  background: rgba(0, 210, 180, 0.12);
  border-color: rgba(0, 210, 180, 0.4);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 2rem 0 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.hero__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--heading);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.hero h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: rgba(200, 230, 245, 0.9);
  margin: 0 0 1.5rem;
  max-width: 22ch;
}

.hero .hero__lede {
  font-size: 1.08rem;
  color: var(--text);
  max-width: 58ch;
  margin: 0 0 0.6rem;
  line-height: 1.78;
}

.hero p {
  max-width: 60ch;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

.markdown-body > h1:first-child {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--heading);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  text-align: center;
}

.markdown-body--home > h1:first-child {
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
}

.markdown-body > h1:first-child + h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: rgba(200, 230, 245, 0.9);
  margin: 0 0 1.5rem;
  max-width: 22ch;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.markdown-body > h1:first-child + h2::after {
  display: none;
}

.markdown-body > h1:first-child + h2 + p,
.markdown-body > h1:first-child + h2 + p + p {
  max-width: 60ch;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.markdown-body--home {
  position: relative;
}

.markdown-body--home::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 50%;
  width: min(72rem, 96vw);
  height: 24rem;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 210, 180, 0.16), transparent 36%),
    radial-gradient(circle at 20% 25%, rgba(255, 184, 77, 0.08), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(92, 168, 255, 0.08), transparent 28%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

.markdown-body--home > * {
  position: relative;
  z-index: 1;
}

.markdown-body--home > h1:first-child {
  margin-top: 0.35rem;
}

.markdown-body--home > h2:nth-of-type(2) {
  margin-top: 4.2rem;
}

.markdown-body--home > h2:nth-of-type(2)::after {
  margin-top: 0.8rem;
}

.markdown-body--home > h2:nth-of-type(2) ~ h3 {
  max-width: 34rem;
  margin-top: 1.6rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  backdrop-filter: none;
}

.markdown-body--home > h2:nth-of-type(2) ~ h3 + p {
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
}

.markdown-body--home > h2:last-of-type {
  margin-top: 4rem;
}

.markdown-body--home > h2:last-of-type + p {
  max-width: 46rem;
  font-size: 1.05rem;
}

/* ─── Services grid (desktop) ──────────────────────────────────────────────── */
@media (min-width: 900px) {
  .markdown-body--home {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  /* Full-width for intro and closing sections */
  .markdown-body--home > h1,
  .markdown-body--home > h2:nth-of-type(1),
  .markdown-body--home > h2:nth-of-type(1) + p,
  .markdown-body--home > h2:nth-of-type(1) + p + p,
  .markdown-body--home > h2:nth-of-type(2),
  .markdown-body--home > h2:last-of-type,
  .markdown-body--home > h2:last-of-type + p,
  .markdown-body--home > h2:last-of-type + p + p {
    grid-column: 1 / -1;
  }

  .markdown-body--home > h2:last-of-type {
    grid-row: 8;
  }

  /* Position services in 3-column layout with explicit rows */
  /* Service 1 */
  .markdown-body--home > h2:nth-of-type(2) ~ h3:first-of-type {
    grid-column: 1;
    grid-row: 6;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    text-align: left;
    max-width: none;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .markdown-body--home > h2:nth-of-type(2) ~ h3:first-of-type + p {
    grid-column: 1;
    grid-row: 7;
    margin: 0;
    text-align: left;
    max-width: none;
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
    transition: border-color var(--transition), box-shadow var(--transition);
  }

  /* Service 2 */
  .markdown-body--home > h2:nth-of-type(2) ~ h3:nth-of-type(2) {
    grid-column: 2;
    grid-row: 6;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    text-align: left;
    max-width: none;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .markdown-body--home > h2:nth-of-type(2) ~ h3:nth-of-type(2) + p {
    grid-column: 2;
    grid-row: 7;
    margin: 0;
    text-align: left;
    max-width: none;
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
    transition: border-color var(--transition), box-shadow var(--transition);
  }

  /* Service 3 */
  .markdown-body--home > h2:nth-of-type(2) ~ h3:nth-of-type(3) {
    grid-column: 3;
    grid-row: 6;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    text-align: left;
    max-width: none;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .markdown-body--home > h2:nth-of-type(2) ~ h3:nth-of-type(3) + p {
    grid-column: 3;
    grid-row: 7;
    margin: 0;
    text-align: left;
    max-width: none;
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
    transition: border-color var(--transition), box-shadow var(--transition);
  }

  /* Hover state for all service cards */
  .markdown-body--home > h2:nth-of-type(2) ~ h3 + p:hover {
    border-color: rgba(0, 210, 180, 0.22);
    box-shadow: 0 8px 36px rgba(0, 210, 180, 0.12);
  }

  /* Remove decorative underline from services h2 */
  .markdown-body--home > h2:nth-of-type(2)::after {
    display: block;
    width: 36px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--amber));
    margin: 0.55rem auto 0;
    grid-column: 1 / -1;
  }
}

/* ─── Section headings ───────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--heading);
}

h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-top: 3.5rem;
  text-align: center;
}

h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  margin: 0.55rem auto 0;
}

h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 1.8rem auto 0.5rem;
  max-width: 34ch;
  text-align: center;
}

/* ─── Body text ──────────────────────────────────────────────────────────── */
p {
  margin: 0.8rem 0 0;
  max-width: 68ch;
  color: var(--text);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  line-height: 1.72;
}

h2 + p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 58ch;
}

h3 + p {
  max-width: 56ch;
  color: var(--text-muted);
  margin-top: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 210, 180, 0.28);
  transition: color var(--transition), border-color var(--transition);
}

a:hover,
a:focus-visible {
  color: #fff;
  border-color: rgba(0, 210, 180, 0.65);
}

.text-link,
.markdown-body .text-link,
.markdown-body p .text-link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid rgba(0, 210, 180, 0.45);
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  box-shadow: none;
  transform: none;
}

.text-link:hover,
.text-link:focus-visible,
.markdown-body p .text-link:hover,
.markdown-body p .text-link:focus-visible {
  color: #fff;
  border-bottom-color: rgba(0, 210, 180, 0.65);
  background: none;
  box-shadow: none;
  transform: none;
}

strong { color: var(--heading); font-weight: 700; }

ul, ol {
  margin: 1rem auto 0;
  padding: 0;
  max-width: 64ch;
}

ul { list-style: none; }

ul li,
ol li {
  position: relative;
  padding-left: 0;
  margin: 0.45rem 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
  text-align: center;
}

ul li::before {
  content: "";
  position: static;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 210, 180, 0.5);
}

ol {
  counter-reset: step;
  list-style: none;
}

ol li {
  padding-left: 0;
}

ol li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: static;
  display: inline-block;
  margin-right: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.7;
}

blockquote {
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-dim);
  color: var(--text);
}

hr {
  margin: 3rem 0 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--border) 15%,
    rgba(0, 210, 180, 0.35) 50%,
    var(--border) 85%,
    transparent 100%
  );
}

code {
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 210, 180, 0.07);
  border: 1px solid var(--border);
  font-size: 0.87em;
  font-family: "Cascadia Code", "Fira Code", monospace;
  color: var(--accent);
}

pre {
  overflow-x: auto;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(3, 9, 16, 0.95);
  border: 1px solid var(--border);
}

img, svg { max-width: 100%; display: block; }

.markdown-body img {
  width: min(100%, 220px);
  height: auto;
  margin: 1.25rem auto 0;
  padding: 0.6rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.markdown-body table {
  width: 100%;
  margin-top: 1.4rem;
  border-collapse: collapse;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.markdown-body thead {
  background: rgba(255, 255, 255, 0.04);
}

.markdown-body th,
.markdown-body td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.markdown-body th {
  color: var(--heading);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.markdown-body td {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.markdown-body tbody tr:last-child td {
  border-bottom: none;
}

::selection {
  background: rgba(0, 210, 180, 0.22);
  color: #fff;
}

/* ─── CTA buttons ────────────────────────────────────────────────────────── */
.markdown-body p:has(> a + a),
.markdown-body p:has(> a[href="/kontakt"]:only-child) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  max-width: none;
}

.markdown-body p:has(> a + a) a,
.markdown-body p:has(> a[href="/kontakt"]:only-child) a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.6rem 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.markdown-body p:has(> a + a) a:first-child,
.markdown-body p:has(> a[href="/kontakt"]:only-child) a {
  border-color: rgba(0, 210, 180, 0.38);
  background: linear-gradient(135deg, rgba(0, 210, 180, 0.1), rgba(0, 150, 130, 0.16));
  color: var(--accent);
}

.markdown-body p:has(> a + a) a:hover,
.markdown-body p:has(> a[href="/kontakt"]:only-child) a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 210, 180, 0.18);
  border-color: rgba(0, 210, 180, 0.55);
}

/* Keep selected inline links looking like normal text links, even after CTA rules. */
.markdown-body a.text-link,
.markdown-body p a.text-link,
.markdown-body p:has(> a + a) a.text-link,
.markdown-body p:has(> a[href="/kontakt"]:only-child) a.text-link {
  display: inline !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(0, 210, 180, 0.45) !important;
  border-radius: 0 !important;
  background: none !important;
  color: var(--accent) !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  box-shadow: none !important;
  transform: none !important;
}

.markdown-body a.text-link:hover,
.markdown-body a.text-link:focus-visible,
.markdown-body p a.text-link:hover,
.markdown-body p a.text-link:focus-visible,
.markdown-body p:has(> a + a) a.text-link:hover,
.markdown-body p:has(> a[href="/kontakt"]:only-child) a.text-link:hover {
  background: none !important;
  color: #fff !important;
  border-bottom-color: rgba(0, 210, 180, 0.65) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.panel,
.feature-grid article,
.card-grid article,
.contact-grid article,
.panel,
.feature-grid article,
.card-grid article,
.contact-grid article,
.post-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.panel p:last-child,
.feature-grid article p:last-child,
.card-grid article p:last-child,
.post-card p:last-child {
  margin-top: auto;
  padding-top: 1rem;
}

.panel:hover,
.feature-grid article:hover,
.card-grid article:hover,
.contact-grid article:hover,
.post-card:hover {
  border-color: rgba(0, 210, 180, 0.22);
  box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
}

.panel > :first-child,
.feature-grid article > :first-child,
.card-grid article > :first-child,
.contact-grid article > :first-child,
.post-card > :first-child {
  margin-top: 0;
}

/* ─── Feature / card grids ───────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card-grid,
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.posts-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.blog-intro {
  max-width: 64ch;
  margin-left: auto;
  margin-right: auto;
}

.blog-checklist {
  margin-top: 1.4rem;
}

.blog-posts {
  margin-top: 1.2rem;
}

.blog-posts .post-card h3 {
  line-height: 1.35;
}

.blog-table {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.blog-table__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 140px;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
}

.blog-table__row time {
  justify-self: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.blog-table__row p {
  margin: 0;
  max-width: none;
  color: var(--text);
  line-height: 1.5;
  font-size: 0.95rem;
}

.blog-table__row a {
  justify-self: center;
  font-size: 0.85rem;
  border-bottom-color: rgba(0, 210, 180, 0.45);
}

.section-stack {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ─── Contact grid ───────────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "a b c"
    "qr qr qr";
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-grid > article:nth-child(1) { grid-area: a; }
.contact-grid > article:nth-child(2) { grid-area: b; }
.contact-grid > article:nth-child(3) { grid-area: c; }

.contact-grid .contact-card--qr {
  grid-area: qr;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.75rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-grid .contact-card--qr:hover {
  border-color: rgba(0, 210, 180, 0.22);
  box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
}

.contact-qr {
  width: min(100%, 150px);
  height: auto;
  flex-shrink: 0;
  padding: 0.6rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.contact-card--qr p {
  max-width: 30ch;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  text-align: center;
}

/* ─── Contact page cards ─────────────────────────────────────────────────── */
.contact-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  width: 100%;
  max-width: var(--width);
  margin-left: auto;
  margin-right: auto;
}

.contact-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
}

.contact-card:hover {
  border-color: rgba(0, 210, 180, 0.22);
  box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
}

.contact-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.contact-card p {
  margin: 0;
  max-width: none;
}

.contact-card a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: none;
}

.contact-card a:hover {
  color: #fff;
}

.contact-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
  width: 100%;
  max-width: var(--width);
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-qr-section:hover {
  border-color: rgba(0, 210, 180, 0.22);
  box-shadow: 0 8px 36px rgba(0, 210, 180, 0.06);
}

.contact-qr-section img {
  width: min(100%, 160px);
  margin: 0 auto;
}

.contact-qr-section p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .contact-methods {
    grid-template-columns: 1fr;
  }
}

/* ─── Post card meta ─────────────────────────────────────────────────────── */
.post-card__meta {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* ─── Brand lockup ───────────────────────────────────────────────────────── */
.brand-lockup img {
  display: block;
  width: min(100%, 380px);
  height: auto;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(3, 8, 14, 0.9);
  border-top: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: min(100%, var(--width));
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: left;
}

.site-footer__links {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-left: auto;
  font-size: inherit;
}

.site-footer__links span {
  color: inherit;
  font-size: inherit;
}

.site-footer__copyright {
  margin-right: auto;
}

.site-footer p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  max-width: none;
}

.site-footer a {
  color: inherit;
  border-bottom: none;
  font-size: inherit;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--accent);
  border-bottom: none;
}

/* ─── Tablet 900px ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  body::after { opacity: 0.045; }

  .site-header { padding: 0.65rem 1.25rem; }

  .site-header__inner {
    position: relative;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .site-header__brand img { width: 220px; }

   .site-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(6, 13, 20, 0.96);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 0.7rem 0.9rem;
    text-align: center;
  }

  .markdown-body {
    width: min(calc(100% - 2rem), var(--width));
    padding-bottom: 4rem;
  }

  .hero { padding: 2.5rem 0 2rem; }

  .feature-grid,
  .posts-grid--three {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-table__row {
    grid-template-columns: 110px minmax(0, 1fr) 120px;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "a b"
      "c c"
      "qr qr";
    grid-template-rows: auto auto auto;
  }

  .contact-grid > article:nth-child(3) {
    grid-area: c;
  }

  .contact-grid .contact-card--qr {
    gap: 2rem;
    padding: 1.5rem 2rem;
  }

  .site-footer__links {
    margin-left: 0;
  }

  h2 { margin-top: 2.75rem; }
}

/* ─── Mobile 640px ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body::after { opacity: 0.03; }

  .markdown-body {
    width: min(calc(100% - 1.5rem), var(--width));
    padding: 1rem 0 2.5rem;
  }

  .site-header { padding: 0.55rem 0.85rem; }

  .site-header__inner {
    flex-wrap: nowrap;
    gap: 0.45rem;
  }

  .site-header__brand img { width: 185px; }

  .site-nav a {
    font-size: 0.78rem;
    white-space: normal;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .site-footer__links {
    justify-content: center;
    margin-left: 0;
  }

  .hero {
    padding: 1.5rem 0 1.5rem;
  }

  .hero__eyebrow {
    font-size: 0.68rem;
    padding: 0.3rem 0.75rem;
  }

  .hero h1 { font-size: clamp(2rem, 8vw, 3rem); }

  .hero h2 {
    font-size: clamp(1.2rem, 5vw, 1.75rem);
    max-width: 100%;
  }

  .hero .hero__lede {
    font-size: 1rem;
  }

  h2 {
    font-size: clamp(1.2rem, 4.5vw, 1.7rem);
    margin-top: 2rem;
  }

  hr { margin-top: 2rem; }

  .feature-grid,
  .card-grid,
  .posts-grid,
  .posts-grid--three {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1.25rem;
  }

  .blog-checklist,
  .blog-posts {
    margin-top: 1rem;
  }

  .blog-table {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .blog-table__row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.35rem;
  }

  .blog-table__row a {
    justify-self: start;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    grid-template-rows: auto;
    gap: 1rem;
  }

  .contact-grid > article:nth-child(1),
  .contact-grid > article:nth-child(2),
  .contact-grid > article:nth-child(3) { grid-area: auto; }

  .contact-grid .contact-card--qr {
    grid-area: auto;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
  }

  .contact-card--qr p { text-align: center; }

  .panel,
  .card-grid article,
  .contact-grid article,
  .post-card {
    padding: 1.15rem;
    border-radius: var(--radius);
  }

  .markdown-body p:has(> a + a),
  .markdown-body p:has(> a:only-child) {
    flex-direction: column;
    align-items: stretch;
  }

  .markdown-body p:has(> a + a) a,
  .markdown-body p:has(> a:only-child) a {
    width: 100%;
    min-height: 48px;
  }
}
