/* ---------------------------------------------------------------
   W6CMY
   Inter (display/body) · IBM Plex Mono (meta/labels, accent only)
--------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500&display=swap');

/* ---- Custom properties ---- */

:root {
  --bg:      #ffffff;
  --surface: #ffffff;
  --field:   #f7f7f8;   /* subtle inset / code background */
  --fg:      #18181b;
  --body:    #3f3f46;
  --muted:   #71717a;
  --border:  rgba(24, 24, 27, 0.09);
  --border-strong: rgba(24, 24, 27, 0.16);
  --accent:    #4f46e5;
  --accent-fg: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.08);

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 8px 24px rgba(24, 24, 27, 0.08);

  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', 'Courier New', monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --max-w: 46rem;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #09090b;
    --surface: #18181b;
    --field:   #141417;
    --fg:      #fafafa;
    --body:    #d4d4d8;
    --muted:   #8b8b93;
    --border:  rgba(250, 250, 250, 0.09);
    --border-strong: rgba(250, 250, 250, 0.16);
    --accent:    #818cf8;
    --accent-fg: #0b0b12;
    --accent-soft: rgba(129, 140, 248, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

/* ---- Reset ---- */

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

/* ---- Base ---- */

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--body);
  line-height: 1.6;
  padding: 0 1.25rem;
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:visited { color: var(--accent); }

/* ---- Site header ---- */

.site-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-call {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.site-call__de {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav {
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.site-nav a:hover { color: var(--fg); }

/* ---- Main ---- */

main {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 0 1rem;
}

/* ---- Site footer ---- */

.site-footer {
  max-width: var(--max-w);
  margin: 3rem auto 0;
  padding: 1.25rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 1.25rem;
}

.site-footer a { color: var(--muted); transition: color 0.15s var(--ease); }
.site-footer a:hover { color: var(--accent); }

/* ====================================================================
   Post header
==================================================================== */

.post-header {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.post-meta__dot { color: var(--border-strong); }

.post-ref { color: var(--accent); }

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

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

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.1rem;
}

/* ====================================================================
   Tags — shared pill component (post header + tag cloud)
==================================================================== */

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--body);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.tag-pill:visited { color: var(--body); }

.tag-pill:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.tag-pill--accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
  font-weight: 600;
  margin-left: auto;
}

.tag-pill--accent:visited { color: var(--accent); }
.tag-pill--accent:hover { background: var(--accent); color: var(--accent-fg); }

.tag-count { color: var(--muted); font-weight: 400; }

/* ====================================================================
   Post body
==================================================================== */

.post-body {
  margin-bottom: 2rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--body);
}

.post-body > * + * { margin-top: 1.1em; }

.post-body h1, .post-body h2, .post-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--fg);
  margin-top: 1.8em;
  margin-bottom: 0.4em;
}

.post-body h2 { font-size: 1.3rem; }
.post-body h3 { font-size: 1.1rem; }

.post-body a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 0.2em; }
.post-body a:hover { text-decoration-color: var(--accent); }

.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: 0.35em; }

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.15em 0 0.15em 1.1em;
  color: var(--muted);
  font-style: italic;
}

.post-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.post-body th, .post-body td {
  border-bottom: 1px solid var(--border);
  padding: 0.5em 0.75em;
  text-align: left;
}

.post-body th {
  background: var(--field);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.post-body pre {
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1em 1.1em;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ====================================================================
   Contacts table
==================================================================== */

.contacts {
  margin-top: 2.5rem;
}

.contacts__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 0.85rem;
}

.contacts-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden auto;
  box-shadow: var(--shadow-sm);
}

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.contacts-table th,
.contacts-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.contacts-table tbody tr:last-child td {
  border-bottom: none;
}

.contacts-table thead th {
  background: var(--field);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.contacts-call {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
}

/* ---- Post navigation ---- */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
}

.post-nav a {
  color: var(--muted);
  max-width: 44%;
  transition: color 0.15s var(--ease);
}

.post-nav a:hover { color: var(--accent); }
.post-nav-next { text-align: right; }

/* ====================================================================
   Inline post images
==================================================================== */

.post-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.post-body p:has(img) {
  margin-top: 0;
}

/* ====================================================================
   Archive, tags, post lists
==================================================================== */

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  color: var(--fg);
  margin-bottom: 2rem;
}

.post-list { list-style: none; }

.post-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child { border-bottom: none; }

.post-list a {
  color: var(--fg);
  font-weight: 500;
  transition: color 0.15s var(--ease);
}

.post-list a:hover { color: var(--accent); }

.post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}

@media (min-width: 40em) {
  .post-date { display: inline; margin-top: 0; margin-left: 0.85em; }
}

/* Archive */
.archive-year { margin-bottom: 2.5rem; }

.archive-year > h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.archive-month { margin: 0 0 1.25rem 0; }

.archive-month > h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* Tags */
.tag-cloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.back-link {
  margin-top: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.back-link a { color: var(--muted); }
.back-link a:hover { color: var(--accent); }

/* Recent posts on index */
.recent-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.recent-section__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ---- Focus / accessibility ---- */

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

/* ---- Reduced motion ---- */

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

/* ---- Wider screens ---- */

@media (min-width: 56em) {
  body { padding: 0 1.5rem; }
  .post-header { padding: 2.25rem 2.5rem; }
}
