/* ==========================================================================
   GODev.de – static site styles
   ========================================================================== */

@font-face {
  font-family: "BwNista";
  src: url("../fonts/BwNistaInt-xBd.woff") format("woff");
  font-weight: 800;
  font-display: swap;
}

:root {
  --primary: #0062cc;
  --primary-strong: #004a9c;
  --primary-soft: #e6f0fb;
  --accent: #19c3a5;

  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #1c2433;
  --text-muted: #5b6678;
  --border: #dde3ec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, .08), 0 18px 40px rgba(16, 24, 40, .12);

  --hero-bg: #0a1426;
  --hero-text: #f2f6fc;

  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1160px;
  --font-head: "BwNista", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #4d9bff;
    --primary-strong: #7db5ff;
    --primary-soft: #13243d;
    --bg: #0b111c;
    --surface: #121a28;
    --surface-2: #182234;
    --text: #e5ebf4;
    --text-muted: #9aa7ba;
    --border: #243049;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
    --hero-bg: #060c17;
  }
}

:root[data-theme="dark"] {
  --primary: #4d9bff;
  --primary-strong: #7db5ff;
  --primary-soft: #13243d;
  --bg: #0b111c;
  --surface: #121a28;
  --surface-2: #182234;
  --text: #e5ebf4;
  --text-muted: #9aa7ba;
  --border: #243049;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .4);
  --hero-bg: #060c17;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 .6em;
}

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand span b { color: var(--primary); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-muted); font-weight: 600; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px; transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

.menu-toggle { display: none; }

@media (max-width: 719px) {
  .menu-toggle { display: inline-grid; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { border-radius: var(--radius-sm); padding: 12px 14px; }
  .header-actions { margin-left: auto; display: flex; gap: 8px; }
}
@media (min-width: 720px) { .header-actions { display: flex; gap: 8px; margin-left: 8px; } }

/* ---------- Reading progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 60; transition: width .1s linear;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-text);
  padding: 96px 0 104px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 85% 20%, rgba(0, 98, 204, .55), transparent 70%),
    radial-gradient(500px 360px at 10% 110%, rgba(25, 195, 165, .30), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.hero .container { position: relative; z-index: 1; display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero .container { grid-template-columns: 1.4fr 1fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }

.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 16px 0 20px; color: #fff; }
.hero h1 .dot { color: var(--accent); }
.hero p.lead { font-size: 1.2rem; color: #c6d3e6; max-width: 36em; margin: 0 0 32px; }

.hero-card {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px; padding: 28px; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.hero-card img { width: 136px; height: 136px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .25); margin-bottom: 10px; }
.hero-card strong { font-family: var(--font-head); font-size: 1.25rem; color: #fff; }
.hero-card span { color: #b4c3d9; font-size: .95rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 20px rgba(0, 98, 204, .35); }
.btn-primary:hover { background: var(--primary-strong); }
:root[data-theme="dark"] .btn-primary { color: #06101f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06101f; } }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-outline { color: var(--primary); border-color: var(--border); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); }

.social { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.social a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: inherit; border: 1px solid currentColor; opacity: .75; transition: opacity .15s, transform .15s;
}
.social a:hover { opacity: 1; transform: translateY(-2px); text-decoration: none; }
.social svg { width: 17px; height: 17px; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin: 6px 0 0; }
.section-head p { margin: 8px 0 0; color: var(--text-muted); max-width: 40em; }

/* ---------- Focus cards ---------- */
.focus-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.focus-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.focus-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: transparent; }
.focus-card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 18px;
}
.focus-card .icon svg { width: 26px; height: 26px; }
.focus-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.focus-card p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.focus-card .since { display: inline-block; margin-top: 14px; font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text);
  transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); text-decoration: none; }
.post-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .thumb img { transform: scale(1.04); }
.post-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.15rem; margin: 10px 0 8px; }
.post-card p { margin: 0 0 16px; color: var(--text-muted); font-size: .95rem; }
.post-card .more { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.post-card .more svg { width: 14px; height: 14px; transition: transform .2s; }
.post-card:hover .more svg { transform: translateX(3px); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .82rem; color: var(--text-muted); }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: .75rem; letter-spacing: .03em;
}
.badge-new { background: var(--accent); color: #04211c; }

/* Featured (first) card */
@media (min-width: 900px) {
  .post-grid.featured .post-card:first-child { grid-column: span 2; flex-direction: row; }
  .post-grid.featured .post-card:first-child .thumb { aspect-ratio: auto; flex: 1.2; min-height: 300px; background: #eef4fd; }
  .post-grid.featured .post-card:first-child .thumb img { object-fit: contain; }
  .post-grid.featured .post-card:first-child .body { flex: 1; padding: 32px; justify-content: center; }
  .post-grid.featured .post-card:first-child h3 { font-size: 1.6rem; }
}

/* ---------- Blog filter ---------- */
.page-head { padding: 64px 0 32px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 8px 0 12px; }
.page-head p { color: var(--text-muted); margin: 0; max-width: 42em; }

.labels { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 20px 0 0; }
.labels li {
  padding: 7px 16px; border-radius: 999px; font-size: .9rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-muted); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: #06101f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { color: #06101f; } }
.chip .count { opacity: .65; margin-left: 4px; font-weight: 500; }

.search { position: relative; flex: 1 1 240px; max-width: 320px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-muted); }
.search input {
  width: 100%; padding: 10px 14px 10px 40px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.empty { text-align: center; color: var(--text-muted); padding: 48px 0; display: none; }
.empty.show { display: block; }

/* ---------- Article ---------- */
.article-head { padding: 56px 0 24px; }
.article-head .container, .article-body .container, .article-foot .container { max-width: 820px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 24px; }
.back svg { width: 14px; height: 14px; }
.article-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 14px 0 12px; }
.article-head .desc { font-size: 1.2rem; color: var(--text-muted); margin: 0; }

.article-cover { max-width: 1000px; margin: 16px auto 0; padding: 0 16px; }
.article-cover img { width: 100%; max-height: 580px; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }

.article-body { padding: 40px 0 24px; }
.prose { font-size: 1.08rem; }
.prose h2 { font-size: 1.6rem; margin-top: 2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.8em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose li > ul { margin-top: .35em; }
.prose blockquote {
  margin: 1.6em 0; padding: 16px 22px; border-left: 4px solid var(--primary);
  background: var(--primary-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text);
}
.prose blockquote p:last-child { margin: 0; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose pre {
  background: #0d1626; color: #dbe6f5; padding: 18px 20px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: .88rem; line-height: 1.55; margin: 0 0 1.4em;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.prose figcaption { font-size: .88rem; color: var(--text-muted); text-align: center; margin-top: 8px; }

.cta-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin: 2em 0; padding: 22px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.cta-box p { margin: 0; font-weight: 600; }
.cta-box small { display: block; color: var(--text-muted); font-weight: 400; word-break: break-all; }

.article-foot { padding: 16px 0 80px; }
.pager { display: grid; gap: 16px; grid-template-columns: 1fr; border-top: 1px solid var(--border); padding-top: 32px; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: block; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s;
}
.pager a:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-2px); }
.pager small { display: block; color: var(--text-muted); font-size: .8rem; margin-bottom: 4px; }
.pager .next { text-align: right; }
.pager strong { font-family: var(--font-head); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 48px; align-items: start; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 320px 1fr; } }
.profile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px;
  text-align: center; box-shadow: var(--shadow); color: var(--text);
}
@media (min-width: 900px) { .profile { position: sticky; top: 96px; } }
.profile img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; margin: 0 auto 18px; }
.profile h2 { font-size: 1.5rem; margin-bottom: 4px; }
.profile p { margin: 0; color: var(--text-muted); }
.profile .social { color: var(--text-muted); }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 28px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--primary);
}
.timeline .when { font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.timeline h3 { margin: 4px 0 4px; font-size: 1.15rem; }
.timeline p { margin: 0; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--hero-bg); color: #b4c3d9; padding: 56px 0 32px; font-size: .95rem; }
.site-footer .container { display: grid; gap: 32px; }
@media (min-width: 720px) { .site-footer .container { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer a { color: #d6e2f2; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .social { justify-content: flex-start; color: #d6e2f2; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 24px; font-size: .85rem; color: #7f8ea6; }

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

/* Small screenshot thumbnails beside the text – click opens full size */
.prose figure.shot { max-width: 360px; margin: .4em auto 1.4em; }
.prose figure.shot img { transition: transform .2s; }
.prose figure.shot a:hover img { transform: scale(1.02); }
@media (min-width: 720px) {
  .prose figure.shot { float: right; width: 42%; margin: .3em 0 1.2em 1.6em; }
  .prose h2 { clear: both; }
}
