:root {
  --bg: #070a11;
  --bg-soft: #101624;
  --surface: #0c111c;
  --surface-2: #131a2b;
  --line: #1d273b;
  --line-strong: #2c3a57;
  --text: #e8edf9;
  --muted: #95a5c2;
  --accent: #7d5cf7;
  --accent-soft: rgba(125, 92, 247, 0.18);
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 20px 45px rgba(1, 4, 10, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at 10% -20%, #1d2842 0%, transparent 50%),
    radial-gradient(circle at 90% 0%, #1a2340 0%, transparent 44%),
    linear-gradient(180deg, #060911 0%, var(--bg) 100%);
  color: var(--text);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.3;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 20%, transparent 85%);
}

.bg-glow {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(80px);
}

.glow-1 {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -60px;
  background: rgba(123, 94, 250, 0.24);
}

.glow-2 {
  width: 420px;
  height: 420px;
  right: -80px;
  bottom: -150px;
  background: rgba(37, 152, 255, 0.2);
}

.shell {
  width: min(1120px, calc(100% - 36px));
  margin: 20px auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(11, 16, 27, 0.94), rgba(7, 11, 20, 0.97));
  box-shadow: var(--shadow);
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  animation: fadeSlide 0.55s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-badge {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 1.35rem;
  color: #f5f2ff;
  background: linear-gradient(140deg, #8c67ff, #6547cf);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 20px;
}

.top-nav a {
  color: #b3bfd6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.top-nav a:hover {
  color: #f0f4ff;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

.intro-card,
.info-card,
.post-card,
.post-view {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 23, 36, 0.86), rgba(11, 16, 27, 0.9));
}

.intro-card {
  padding: 24px;
  animation: fadeSlide 0.6s ease;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #889bc1;
}

.intro-card h1 {
  margin: 8px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.15;
}

.intro-card .lede {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 50ch;
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.cta {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  background: rgba(13, 18, 31, 0.5);
}

.cta.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #8b68ff, #6a4de6);
}

.info-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
  animation: fadeSlide 0.68s ease;
}

.info-card p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #d5def0;
}

.info-card p span {
  color: #91a3c7;
  font-weight: 600;
}

.info-card h2 {
  margin: 4px 0 2px;
  font-size: 1.5rem;
  font-family: "Fraunces", serif;
}

.info-card p a {
  color: #c8b8ff;
  text-decoration: none;
  font-weight: 500;
}

.info-card p a:hover {
  color: #dfd4ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.info-card > a {
  text-decoration: none;
  color: #cabaff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(16, 22, 37, 0.65);
}

.info-card > a:hover {
  border-color: #3f5276;
}

.list-head {
  margin-top: 26px;
}

.list-head h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.list-head p {
  color: var(--muted);
}

.list-head code {
  font-family: "IBM Plex Mono", monospace;
  background: rgba(20, 31, 50, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 2px 8px;
}

.post-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.post-card {
  display: block;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, border-color 0.22s ease;
  animation: fadeSlide 0.55s ease both;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: #3f5276;
}

.post-card h2 {
  margin: 8px 0 0;
  font-family: "Fraunces", serif;
  font-size: 1.8rem;
}

.post-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #8ea0c7;
  font-size: 0.92rem;
}

.post-view {
  margin-top: 18px;
  padding: 22px;
  animation: fadeSlide 0.4s ease;
}

.hidden {
  display: none;
}

.back-button {
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(18, 26, 44, 0.85);
  color: #c8d5ef;
  font-weight: 600;
  cursor: pointer;
}

.post-header {
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.post-date {
  margin: 0;
  color: #8b9ec5;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#post-title {
  margin: 8px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.post-excerpt {
  color: var(--muted);
  max-width: 70ch;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags span {
  background: var(--accent-soft);
  color: #d6caff;
  border: 1px solid rgba(137, 110, 252, 0.4);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.84rem;
}

.markdown-body {
  margin-top: 22px;
  color: #dbe4f6;
  font-size: 1.05rem;
  line-height: 1.8;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-family: "Fraunces", serif;
  margin-top: 1.5em;
  margin-bottom: 0.45em;
  scroll-margin-top: 20px;
}

.markdown-body h2 {
  font-size: 2rem;
}

.markdown-body h3 {
  font-size: 1.5rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  color: #ced8ef;
}

.markdown-body a {
  color: #b19fff;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.header-anchor {
  margin-left: 0.36em;
  text-decoration: none;
  color: #7487ae;
}

.markdown-body blockquote {
  margin: 1.2em 0;
  border-left: 4px solid #536794;
  background: rgba(34, 44, 69, 0.5);
  color: #d0daef;
  padding: 8px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.markdown-body pre {
  background: #080d17;
  border: 1px solid #1f2a40;
  border-radius: 14px;
  padding: 16px;
  overflow-x: auto;
}

.markdown-body code {
  font-family: "IBM Plex Mono", monospace;
}

.markdown-body p code,
.markdown-body li code {
  background: rgba(18, 31, 54, 0.8);
  color: #bed2ff;
  border-radius: 6px;
  padding: 2px 6px;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin: 20px auto;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.markdown-body th,
.markdown-body td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.md-callout {
  margin: 1.4rem 0;
  border-radius: var(--radius-md);
  border: 1px solid;
  padding: 14px 16px;
}

.md-callout .md-callout-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.md-callout.md-note {
  background: rgba(72, 101, 167, 0.2);
  border-color: rgba(113, 145, 216, 0.42);
}

.md-callout.md-tip {
  background: rgba(52, 133, 110, 0.2);
  border-color: rgba(88, 200, 166, 0.4);
}

.md-callout.md-warn {
  background: rgba(143, 102, 48, 0.2);
  border-color: rgba(231, 168, 80, 0.42);
}

.md-callout.md-danger {
  background: rgba(130, 53, 68, 0.22);
  border-color: rgba(220, 101, 132, 0.44);
}

.x-highlight {
  border-radius: 6px;
  padding: 2px 6px;
  color: #ffecbb;
  background: rgba(198, 137, 29, 0.38);
}

.x-chip {
  display: inline-block;
  margin: 0 2px;
  border-radius: 999px;
  padding: 2px 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86em;
  color: #ddcbff;
  background: rgba(125, 92, 247, 0.24);
}

.site-footer {
  margin-top: 28px;
  color: #7f8faf;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    gap: 14px;
    font-size: 0.92rem;
  }

  .post-card,
  .post-view,
  .intro-card,
  .info-card {
    padding: 16px;
    border-radius: 14px;
  }

  .markdown-body {
    font-size: 1rem;
  }
}
