/* swcguild.com -- Software craftsmanship editorial */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap');

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

/* ── Tokens ────────────────────────────────────── */
:root {
  --bg:          #0E1F1C;
  --bg-deep:     #091411;
  --surface:     #0F3F3B;
  --surface-hi:  #144f49;
  --aqua:        #75E0D4;
  --green:       #7EDF7A;
  --mint:        #E6FAF5;
  --off-white:   #F6F6F4;
  --text:        #F6F6F4;
  --text-muted:  rgba(246,246,244,.5);
  --text-dim:    rgba(246,246,244,.3);
  --border:      rgba(117,224,212,.1);
  --border-hi:   rgba(117,224,212,.2);
  --glow:        rgba(117,224,212,.25);
  --glow-strong: rgba(117,224,212,.4);
  --green-glow:  rgba(126,223,122,.15);
  --font:        'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w:       780px;
  --max-w-wide:  1080px;
}

/* ── Base ──────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--aqua); text-decoration: none; transition: color .15s; }
a:hover { color: var(--green); }
img { max-width: 100%; height: auto; display: block; }

/* ── Top bar ───────────────────────────────────── */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,20,17,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.bar-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-mark {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--text-dim);
}
.site-mark .bracket { color: var(--text-dim); }
.site-mark .slash { color: var(--aqua); opacity: .6; }
.site-mark .name {
  color: var(--off-white);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  margin: 0 2px;
}
.site-mark .cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--green);
  margin-left: 3px;
  animation: blink 1.1s step-end infinite;
  vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Hero ──────────────────────────────────────── */
.hero {
  position: relative;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 72px 24px 56px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(117,224,212,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(36px, 5.5vw, 58px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--off-white);
  margin-bottom: 20px;
  position: relative;
}
.hero-title em {
  font-style: normal;
  color: var(--aqua);
}
.hero-desc {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* decorative lines flanking the hero */
.hero-lines {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}
.hero-line {
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, var(--glow));
}
.hero-line:last-child {
  background: linear-gradient(90deg, var(--glow), transparent);
}
.hero-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aqua);
  opacity: .5;
}

/* ── Glow separator ────────────────────────────── */
.glow-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--glow-strong) 50%, transparent 95%);
  margin: 0;
  border: none;
  max-width: var(--max-w-wide);
  margin-left: auto;
  margin-right: auto;
}

/* ── Feed ──────────────────────────────────────── */
.feed {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Article card ──────────────────────────────── */
.feed-card {
  margin: 40px 0;
  background: linear-gradient(135deg, rgba(15,63,59,.35) 0%, rgba(14,31,28,.6) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.feed-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 40px rgba(117,224,212,.04), inset 0 1px 0 rgba(117,224,212,.06);
}
/* top glow accent on card */
.feed-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow), transparent);
}

.feed-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.feed-meta .tag {
  background: rgba(117,224,212,.08);
  color: var(--aqua);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid rgba(117,224,212,.12);
}
.feed-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
}
.feed-card h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.01em;
  margin-bottom: 20px;
}
.feed-card h2 a { color: var(--off-white); }
.feed-card h2 a:hover { color: var(--aqua); }

/* ── Prose ─────────────────────────────────────── */
.prose { color: rgba(246,246,244,.82); line-height: 1.72; }
.prose p { margin-bottom: 18px; }
.prose h2 {
  font-size: 21px;
  font-weight: 500;
  margin: 40px 0 14px;
  color: var(--off-white);
  padding-left: 14px;
  border-left: 2px solid var(--aqua);
}
.prose h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 32px 0 10px;
  color: var(--off-white);
}
.prose a { border-bottom: 1px solid rgba(117,224,212,.25); }
.prose a:hover { border-bottom-color: var(--green); }
.prose blockquote {
  border-left: 2px solid var(--aqua);
  padding-left: 20px;
  margin: 28px 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose ul, .prose ol { margin: 14px 0; padding-left: 24px; }
.prose li { margin-bottom: 6px; }

.permalink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--aqua);
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid rgba(117,224,212,.15);
  border-radius: 6px;
  transition: border-color .15s, background .15s;
}
.permalink:hover {
  border-color: rgba(117,224,212,.35);
  background: rgba(117,224,212,.04);
  color: var(--aqua);
}
.permalink svg { transition: transform .15s; }
.permalink:hover svg { transform: translateX(3px); }

/* ── Article page ──────────────────────────────── */
.article-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 0;
}
.article-header .back {
  font-size: 13px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 500;
}
.article-header .back:hover { color: var(--aqua); }
.article-header h1 {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.015em;
  margin-bottom: 16px;
}
.article-header .meta {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.article-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 56px;
}

/* ── Cross-references ──────────────────────────── */
.cross-refs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 72px;
}
.cross-refs h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.cross-refs-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cross-ref-card {
  display: block;
  background: linear-gradient(135deg, rgba(15,63,59,.3) 0%, rgba(14,31,28,.5) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  transition: border-color .15s, box-shadow .15s;
}
.cross-ref-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 24px rgba(117,224,212,.05);
}
.cross-ref-card .ref-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--off-white);
  margin-bottom: 3px;
}
.cross-ref-card .ref-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── 404 ───────────────────────────────────────── */
.page-404 {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 24px;
  text-align: center;
}
.page-404 .code-404 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.page-404 h1 {
  font-size: 48px;
  font-weight: 400;
  color: var(--off-white);
  margin-bottom: 12px;
}
.page-404 p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.page-404 a.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: var(--bg-deep);
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  transition: opacity .15s;
}
.page-404 a.btn-home:hover { opacity: .9; color: var(--bg-deep); }

/* ── Footer ────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 48px 20px 40px; }
  .feed { padding: 0 16px; }
  .feed-card { padding: 28px 22px; margin: 28px 0; }
  .feed-card::before { left: 20px; right: 20px; }
  .article-header, .article-body, .cross-refs { padding-left: 20px; padding-right: 20px; }
  .hero-line { width: 48px; }
}
