/* =============================================
   Ed Truderung — Personal Blog
   Clean dark theme, identity-security focused
   ============================================= */

:root {
  --bg:             #0c0f18;
  --bg-card:        #131720;
  --bg-nav:         #0c0f18f0;
  --border:         #1e2a3d;
  --text:           #dde4f0;
  --text-2:         #8496b0;
  --text-3:         #4a5a72;
  --accent:         #4f8ef7;
  --accent-dim:     #2d5ecc;
  --accent-glow:    rgba(79,142,247,0.12);
  --green:          #34d399;
  --yellow:         #fbbf24;
  --red:            #f87171;
  --font:           'Inter', system-ui, sans-serif;
  --mono:           'JetBrains Mono', 'Fira Code', monospace;
  --radius:         8px;
  --radius-lg:      14px;
  --max-w:          1100px;
  --max-prose:      720px;
  --t:              0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: #7aaeff; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.25; font-weight: 700; color: var(--text); }
p { color: var(--text-2); }
ul { list-style: none; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.prose     { max-width: var(--max-prose); margin: 0 auto; padding: 0 24px; }
.section   { padding: 80px 0; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px; gap: 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1rem;
  color: var(--text); letter-spacing: -0.02em;
}
.nav-logo .logo-box {
  width: 32px; height: 32px;
  background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 900; color: #fff;
  font-family: var(--mono);
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 13px; border-radius: var(--radius);
  color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  transition: all var(--t);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: rgba(255,255,255,0.06);
}
.nav-links .nav-li { color: var(--text) !important; background: var(--accent) !important; font-weight: 600 !important; }
.nav-links .nav-li:hover { background: #6ba4ff !important; color: #fff !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── Hero ── */
.hero {
  padding: 96px 0 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 55% 0%, rgba(79,142,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 5% 90%, rgba(52,211,153,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1fr 420px; gap: 64px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 22px;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--green);
}
.hero-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(1.35); }
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: -0.02em; margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: 1.05rem; color: var(--text-2);
  max-width: 520px; margin-bottom: 36px; line-height: 1.75;
}
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  border: none; transition: all var(--t);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #6ba4ff; color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,142,247,0.3); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--text); }

/* ── Terminal ── */
.terminal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(79,142,247,0.06);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.td-r { background: #ff5f57; }
.td-y { background: #febc2e; }
.td-g { background: #28c840; }
.term-title {
  margin-left: 6px; font-size: 0.75rem;
  color: var(--text-3); font-family: var(--mono);
}
.term-body {
  padding: 18px 20px 22px; font-family: var(--mono);
  font-size: 0.8rem; line-height: 1.9;
}
.t-c { color: var(--text-3); }
.t-p { color: var(--accent); }
.t-ok { color: var(--green); }
.t-w  { color: var(--yellow); }
.t-e  { color: var(--red); }
.t-d  { color: var(--text-3); }
.t-cursor {
  display: inline-block; width: 7px; height: 13px;
  background: var(--accent); vertical-align: middle;
  margin-left: 2px; animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Topic pills ── */
.topics { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 60px; }
.topic-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 100px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 500; color: var(--text-2);
  transition: all var(--t);
}
.topic-pill:hover { border-color: rgba(79,142,247,0.4); color: var(--accent); background: var(--accent-glow); }
.topic-pill span { font-size: 1rem; }

/* ── Section labels ── */
.label {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin-bottom: 10px;
}

/* ── Blog cards ── */
.posts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: all var(--t); display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.post-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0; transition: opacity var(--t);
}
.post-card:hover { border-color: rgba(79,142,247,0.3); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.post-card:hover::before { opacity: 1; }

.post-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.post-emoji { font-size: 1.8rem; line-height: 1; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 100px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(79,142,247,0.22);
}
.tag-green { background: rgba(52,211,153,0.1); color: var(--green); border-color: rgba(52,211,153,0.25); }
.tag-yellow { background: rgba(251,191,36,0.1); color: var(--yellow); border-color: rgba(251,191,36,0.25); }

.post-card h3 { font-size: 1rem; line-height: 1.4; margin-bottom: 10px; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { font-size: 0.87rem; color: var(--text-2); line-height: 1.65; flex: 1; margin-bottom: 18px; }
.post-meta { font-size: 0.78rem; color: var(--text-3); display: flex; align-items: center; gap: 12px; }
.post-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* Featured card — full width */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 36px;
  padding: 36px;
}
.featured-left {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1624, #0a1220);
  border-radius: var(--radius); border: 1px solid var(--border);
  min-height: 200px; font-size: 3.5rem;
}
.featured-right { display: flex; flex-direction: column; }
.featured-right h2 { font-size: 1.35rem; line-height: 1.35; margin-bottom: 12px; }
.featured-right h2 a { color: var(--text); }
.featured-right h2 a:hover { color: var(--accent); }
.featured-right p { font-size: 0.93rem; color: var(--text-2); line-height: 1.7; flex: 1; margin-bottom: 20px; }

.read-more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  transition: gap var(--t);
}
.read-more:hover { gap: 9px; color: #7aaeff; }

/* ── About strip ── */
.about-strip {
  background: var(--bg-card); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
}
.about-inner { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
.about-avatar {
  width: 88px; height: 88px; min-width: 88px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.6rem; font-weight: 800;
  color: #fff; font-family: var(--mono);
}
.about-text h2 { font-size: 1.35rem; margin-bottom: 6px; }
.about-role { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.about-bio { font-size: 0.95rem; color: var(--text-2); line-height: 1.75; max-width: 600px; margin-bottom: 20px; }
.about-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-2); font-weight: 500;
}
.badge svg { width: 13px; height: 13px; color: var(--accent); }

/* ── Article / prose ── */
.article-header {
  padding: 72px 0 52px;
  background: linear-gradient(180deg, rgba(79,142,247,0.07) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-2); margin-bottom: 24px;
  transition: color var(--t);
}
.back-link:hover { color: var(--accent); }
.article-header h1 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); max-width: 680px; margin-bottom: 22px; }
.article-meta-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.author-chip {
  display: flex; align-items: center; gap: 10px;
}
.author-chip-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #fff;
  font-family: var(--mono);
}
.author-chip-name { font-size: 0.88rem; font-weight: 600; }
.author-chip-role { font-size: 0.75rem; color: var(--text-3); }
.meta-div { width: 1px; height: 28px; background: var(--border); }
.meta-item { font-size: 0.8rem; color: var(--text-3); }

.article-body { padding: 56px 0 80px; }
.article-body h2 { font-size: 1.45rem; margin: 44px 0 14px; }
.article-body h3 { font-size: 1.15rem; margin: 32px 0 10px; }
.article-body p { margin-bottom: 20px; font-size: 1rem; line-height: 1.82; color: var(--text-2); }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 0; }
.article-body li {
  padding: 4px 0 4px 26px; position: relative;
  color: var(--text-2); font-size: 0.97rem; line-height: 1.75;
}
.article-body ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 0.82rem; }
.article-body ol { counter-reset: item; }
.article-body ol li { counter-increment: item; }
.article-body ol li::before { content: counter(item) '.'; position: absolute; left: 0; color: var(--accent); font-weight: 700; font-size: 0.82rem; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.callout {
  background: rgba(79,142,247,0.07); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; margin: 26px 0;
}
.callout p { margin: 0; }
.callout-warn { background: rgba(251,191,36,0.06); border-color: var(--yellow); }
.callout-danger { background: rgba(248,113,113,0.06); border-color: var(--red); }

.code-block {
  background: #060a12; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  font-family: var(--mono); font-size: 0.82rem; color: #a8c4e0;
  overflow-x: auto; margin: 22px 0; line-height: 1.75;
}

/* ── Author bio box ── */
.author-bio {
  max-width: var(--max-prose); margin: 0 auto 60px;
  padding: 24px 28px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; gap: 18px; align-items: flex-start;
}
.author-bio-av {
  width: 52px; height: 52px; min-width: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; color: #fff; font-family: var(--mono);
}
.author-bio h4 { font-size: 0.95rem; margin-bottom: 3px; }
.author-bio .role { font-size: 0.78rem; color: var(--accent); margin-bottom: 8px; }
.author-bio p { font-size: 0.84rem; margin: 0; }

/* ── Related posts ── */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── Footer ── */
.footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer-inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; flex-wrap: wrap; margin-bottom: 36px;
}
.footer-brand p { font-size: 0.87rem; color: var(--text-2); margin: 10px 0 18px; max-width: 260px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 0.87rem; color: var(--text-2); transition: color var(--t); }
.footer-links a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 8px; }
.soc-btn {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 0.82rem; font-weight: 700;
  transition: all var(--t);
}
.soc-btn:hover { background: var(--accent-glow); border-color: rgba(79,142,247,0.35); color: var(--accent); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-3); flex-wrap: wrap; gap: 12px;
}
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--accent); }

/* ── Blog page hero ── */
.page-hero {
  padding: 72px 0 52px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(79,142,247,0.06) 0%, transparent 100%);
}
.page-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: 12px; }
.page-hero p { font-size: 1.02rem; max-width: 540px; color: var(--text-2); }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .terminal { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .featured-left { min-height: 100px; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .about-inner { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }
  .nav-links { display: none; flex-direction: column; }
  .nav-links.open {
    display: flex; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-nav); border-bottom: 1px solid var(--border); padding: 12px;
  }
  .nav-toggle { display: flex; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .hero-links { flex-direction: column; }
  .hero-links .btn { width: 100%; justify-content: center; }
}
