@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg: #0b0f14;
  --surface: #121822;
  --surface-2: #1a2230;
  --ink: #e9f0f6;
  --muted: #a4b1c1;
  --accent: #6ee7ff;
  --accent-2: #f7b2ff;
  --border: #263042;
  --shadow: rgba(9, 12, 17, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20vh -10vw auto auto;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(110, 231, 255, 0.22), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
  animation: float 18s ease-in-out infinite;
}

body::after {
  inset: auto auto -25vh -15vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(247, 178, 255, 0.2), transparent 65%);
  animation-delay: -6s;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  border-radius: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.75);
  border-bottom: 1px solid rgba(38, 48, 66, 0.6);
  z-index: 10;
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.site-logo__mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(110, 231, 255, 0.6);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.site-nav__link {
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav__link:hover {
  color: var(--accent);
}

.home-rail {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: sticky;
  top: 3.5rem;
  align-self: flex-start;
}

main.home {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.home-rail__card {
  padding: 1.25rem 1.35rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(18, 24, 34, 0.95), rgba(26, 34, 48, 0.92));
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px var(--shadow);
}

.home-rail__brand {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.home-rail__mark {
  display: none;
}

.home-rail__brandtext {
  min-width: 0;
}

.home-rail__eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.home-rail__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 2.2vw, 2.3rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.home-rail__tagline {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 28ch;
  overflow-wrap: anywhere;
}

.home-rail__tagline p {
  margin: 0;
}

.home-rail__footer p {
  margin: 0;
}

.home-rail__nav {
  display: grid;
  gap: 0.75rem;
}

.home-rail__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(18, 24, 34, 0.6);
  border: 1px solid transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 0.2s ease;
}

.home-rail__link:hover {
  border-color: rgba(110, 231, 255, 0.4);
  color: var(--ink);
  transform: translateX(4px);
}

.home-rail__footer {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 0.5rem;
}

.page-shell {
  max-width: none;
  margin: 0;
  padding: 3.5rem clamp(1.5rem, 4vw, 4.5rem) 4.5rem;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 3rem;
  position: relative;
  z-index: 1;
  align-items: start;
}

.page-shell__main {
  min-width: 0;
}

.page-shell .page {
  max-width: none;
  margin: 0;
  padding: 0;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.home-about {
  padding: 2rem;
  border-radius: 20px;
  background: rgba(18, 24, 34, 0.7);
  border: 1px solid var(--border);
  box-shadow: 0 24px 50px var(--shadow);
  animation: rise 0.7s ease both;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header__eyebrow {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0;
}

.section-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.post-grid--dense .post-card {
  background: rgba(18, 24, 34, 0.7);
}

.post-card {
  padding: 1.4rem;
  border-radius: 18px;
  background: rgba(18, 24, 34, 0.82);
  border: 1px solid rgba(38, 48, 66, 0.8);
  box-shadow: 0 16px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: rise 0.7s ease both;
  animation-delay: var(--delay, 0s);
}

.post-card__meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-card__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  margin: 0;
}

.post-card__summary {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.post-card__cta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.page {
  max-width: none;
  margin: 0;
  position: relative;
  z-index: 1;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header__eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.page-header h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.1rem, 3vw, 2.7rem);
  margin: 0;
}

.page-header__summary {
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.post-header {
  margin-bottom: 2rem;
}

.post-header__eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.post-header h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  margin: 0.5rem 0 0.75rem;
}

.post-header__summary {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.tag-row {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(110, 231, 255, 0.12);
  border: 1px solid rgba(110, 231, 255, 0.35);
  color: var(--accent);
  font-size: 0.75rem;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.term-card {
  padding: 1.2rem;
  border-radius: 14px;
  background: rgba(18, 24, 34, 0.8);
  border: 1px solid var(--border);
  display: grid;
  gap: 0.35rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding: 2.25rem clamp(1.5rem, 4vw, 4.5rem) 2.75rem;
  border-top: 1px solid rgba(38, 48, 66, 0.6);
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.35), rgba(11, 15, 20, 0.85));
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.site-footer__inner {
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.content {
  line-height: 1.75;
  font-size: 1.02rem;
  color: var(--ink);
}

.content p {
  margin: 0 0 1.1rem;
}

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

.content h2,
.content h3,
.content h4 {
  font-family: "Space Grotesk", sans-serif;
  margin: 2rem 0 1rem;
}

.content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: rgba(18, 24, 34, 0.6);
  color: var(--muted);
}

.content pre {
  position: relative;
  isolation: isolate;
  background: transparent !important;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: none;
  box-shadow: none;
  background-clip: border-box;
}

.content pre::before,
.content pre::after {
  content: none;
}

.content pre::before {
  content: none;
}

.content .highlight {
  margin: 1.35rem 0;
  position: relative;
  isolation: isolate;
  background: transparent;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  scrollbar-width: none;
}

.content .highlight::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.content pre {
  scrollbar-width: none;
}

.content pre::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.content .chroma,
.content pre.chroma,
.content .highlight pre {
  background: transparent !important;
  border: none;
  box-shadow: none;
  outline: none;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.content .highlight::before {
  content: "";
  position: absolute;
  inset: -6px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.35;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

.content .highlight .chroma {
  background: transparent;
}

.content .highlight table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  margin: 0;
}

.content .highlight .lntd {
  padding: 0;
}

.content .highlight td {
  padding: 0;
  border: 0;
  vertical-align: top;
}

.content .highlight td:first-child {
  padding-right: 0.75rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.8;
}

.content .highlight td:last-child {
  padding-left: 0.9rem;
}

.content .highlight .lnt {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.5;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}

.content .highlight pre {
  margin: 0;
  padding: 0;
  background: transparent !important;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.content .highlight pre::before {
  content: none;
}

.content .highlight code {
  padding: 0 !important;
  background: transparent !important;
}

.content .highlight .line {
  display: block;
}

.content .highlight .ln {
  display: inline-block;
  min-width: 2.4ch;
  padding-right: 0.9rem;
  text-align: right;
  color: var(--muted);
  user-select: none;
  pointer-events: none;
}

.content .highlight .cl {
  display: inline-block;
}

.content .highlight td:last-child .line {
  padding-left: 0.9rem;
  display: block;
}

.has-code-copy {
  position: relative;
  padding-right: 2.6rem;
}

.code-copy-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.code-copy-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(13, 18, 24, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 22px 34px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.code-copy-wrapper > .highlight,
.code-copy-wrapper > pre {
  position: relative;
  z-index: 1;
}

.code-copy-button {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 15, 20, 0.72);
  color: #f5f6f8;
  font-family: "Space Grotesk", sans-serif;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.code-copy-button:hover,
.code-copy-button:focus-visible {
  background: rgba(18, 24, 34, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.code-copy-button.is-copied {
  background: rgba(30, 92, 58, 0.9);
  border-color: rgba(110, 210, 160, 0.9);
  color: #eafff3;
}

.code-copy-button:active {
  transform: translateY(0);
}

.code-copy-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.content code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9em;
  background: transparent !important;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.content th,
.content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 980px) {
  .home-rail {
    position: static;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .page-shell {
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .page {
    padding: 2.5rem 1.25rem 3rem;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
