/* ============================================
   martinmuc.de — Terminal Elegance
   Clean, technical, developer-blog aesthetic
   ============================================ */

/* --- Self-hosted Fonts (kein Google-Request) --- */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/css/fonts/dm-sans-v17-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/css/fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/css/fonts/dm-sans-v17-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/css/fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/css/fonts/dm-sans-v17-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/css/fonts/dm-sans-v17-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/css/fonts/fraunces-v38-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/css/fonts/fraunces-v38-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/css/fonts/fraunces-v38-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/css/fonts/fraunces-v38-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/css/fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/css/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
}

/* --- Custom Properties --- */
:root {
  --bg: #f4f1eb;
  --bg-card: #ffffff;
  --bg-code: #e8e4dc;
  --bg-nav: rgba(244, 241, 235, 0.92);
  --text: #3a3631;
  --text-muted: #635e57;
  --text-light: #6b6660;
  --accent: #1a7a6d;
  --accent-light: #257b6b;
  --accent-bg: #e6f5f2;
  --accent-border: #b8e0d9;
  --border: #ddd8cf;
  --border-light: #eae6df;
  --shadow: 0 1px 3px rgba(58, 54, 49, 0.06);
  --shadow-hover: 0 4px 12px rgba(58, 54, 49, 0.1);
  --radius: 6px;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --max-width: 720px;
  --nav-height: 60px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent-light);
}

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

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  letter-spacing: -0.01em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

@media (max-width: 600px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.7rem 0.65rem;
    font-size: 0.85rem;
  }
}

/* --- Main Content --- */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
  word-break: break-word;
}

/* --- Page Header / Hero --- */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.hero .subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero .intro {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.75;
  max-width: 600px;
}

.hero .intro a {
  font-weight: 500;
}

.mastodon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  transition: all 0.2s;
}

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

.mastodon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Blog Post Cards --- */
.posts-section h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.25s;
  box-shadow: var(--shadow);
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.post-card .post-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.post-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.post-card h3 a {
  color: var(--text);
  transition: color 0.2s;
}

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

.post-card .post-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  letter-spacing: -0.01em;
}

/* --- Blog Post (single article) --- */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header .post-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.reading-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.article-body pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-body .hashtags {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 2rem;
}

.article-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Share on Mastodon */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.share-btn:hover {
  color: var(--accent);
}

.share-icon {
  width: 18px;
  height: 18px;
}

.share-dialog {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.share-dialog label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.share-input-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.share-prefix {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 0.5rem 0 0.5rem 0.75rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
}

.share-input-row input {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 0.5rem;
  border: 1px solid var(--border);
  border-right: none;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  min-width: 0;
  flex: 1;
}

.share-input-row input:focus {
  border-color: var(--accent);
}

.share-submit {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.share-submit:hover {
  background: var(--accent-light);
}

.article-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* --- Spenden (Donations) page --- */
.spenden-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.spenden-intro .highlight {
  background: linear-gradient(to bottom, transparent 60%, var(--accent-bg) 60%);
  font-weight: 500;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 500px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.service-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-hover);
}

.service-card .service-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.service-card .service-type {
  font-size: 0.8rem;
  color: var(--text-light);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

.section-label:first-child {
  margin-top: 0;
}

.about-text {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 2rem;
  color: var(--text);
}

/* Cost table */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  table-layout: fixed;
  word-wrap: break-word;
}

.cost-table th,
.cost-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.cost-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  background: var(--bg);
}

.cost-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: nowrap;
  width: 5.5rem;
}

.cost-table tr.total {
  font-weight: 600;
}

.cost-table tr.total td {
  border-top: 2px solid var(--accent);
  border-bottom: none;
  color: var(--accent);
}

.cost-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

/* Wero highlight */
.wero-highlight {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.wero-qr img {
  display: block;
  border-radius: var(--radius);
  width: 180px;
  height: auto;
}

.wero-info p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 0.75rem 0;
}

.wero-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.wero-link:hover {
  text-decoration: underline;
}

.wero-mobile-text,
.wero-mobile-btn {
  display: none;
}

.wero-mobile-btn {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  transition: background 0.2s;
}

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

@media (max-width: 600px) {
  .wero-highlight {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem;
  }

  .wero-qr,
  .wero-desktop-text,
  .wero-desktop-link {
    display: none;
  }

  .wero-mobile-text,
  .wero-mobile-btn {
    display: block;
  }
}

/* Donation methods */
.donate-methods {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.donate-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all 0.25s;
  box-shadow: var(--shadow);
}

.donate-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  color: var(--accent);
}

.donate-btn .donate-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.donate-btn .donate-label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.donate-btn .donate-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.donate-btn .donate-privacy {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  line-height: 1.45;
  font-style: normal;
  opacity: 0.7;
}

.donate-btn:hover .donate-label {
  color: var(--accent);
}

/* Hetzner box */
.partner-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.partner-box h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.references {
  margin-top: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.6;
}

.references p {
  margin: 0 0 0.4rem 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.references li {
  margin-bottom: 0.2rem;
}

.references a {
  color: var(--text-muted);
}

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

.partner-box p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.partner-box a {
  font-weight: 500;
}

/* --- Legal pages (Impressum, Datenschutz) --- */
.legal-page h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
}

.legal-page h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.legal-page p {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--text);
}

.legal-page .contact-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.legal-page .contact-block p {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.legal-page .contact-block .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

.legal-page .contact-block .label:first-child {
  margin-top: 0;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 500px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.article-header {
  animation: fadeUp 0.5s ease-out;
}

.post-card {
  animation: fadeUp 0.5s ease-out both;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.12s; }
.post-card:nth-child(3) { animation-delay: 0.19s; }

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
