@font-face {
  font-family: 'Cal Sans';
  font-display: swap;
  src: url('../fonts/cal-sans/cal-sans-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter/inter-latin.woff2') format('woff2');
}

:root {
  --bg: #050408;
  --surface: #18151f;
  --surface-2: #211d29;
  --text: #f7f1f7;
  --muted: #b9aebb;
  --accent: #ff4f9a;
  --violet: #8428df;
  --line: rgba(255, 79, 154, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 79, 154, 0.09), transparent 18rem),
    linear-gradient(90deg, rgba(132, 40, 223, 0.08), transparent 32%, transparent 68%, rgba(255, 79, 154, 0.045)),
    var(--bg);
}

a {
  color: inherit;
}

.site-header {
  flex: 0 0 auto;
  min-height: 10px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent, rgba(255, 79, 154, 0.68), rgba(132, 40, 223, 0.42), transparent),
    rgba(5, 4, 8, 0.96);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(255, 79, 154, 0.22),
    0 42px 90px -46px rgba(255, 79, 154, 0.8);
}

.nav-logo {
  display: block;
  width: min(150px, 100%);
  margin: 0 0 1.25rem;
}

.nav-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(255, 79, 154, 0.24));
}

.menu-toggle {
  display: none;
}

.layout {
  width: min(1280px, 100%);
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 900px);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1rem, 4vw, 2rem);
  overflow: hidden;
}

.article-nav {
  position: sticky;
  top: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem 0.5rem 1rem 1.1rem;
  border-left: 1px solid rgba(255, 79, 154, 0.42);
}

.article-menu h2 {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--accent) 66%, var(--muted));
}

.article-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-menu li + li {
  margin-top: 0.55rem;
}

.article-menu a {
  display: block;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.25;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(255, 79, 154, 0.24);
  transition: color .15s ease, transform .15s ease;
}

.article-menu a:hover,
.article-menu a.active {
  color: #fff;
  transform: translateX(3px);
}

main {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.content-card {
  height: auto;
  max-height: 100%;
  max-width: 900px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: clamp(2rem, 4vw, 3rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 44%),
    color-mix(in oklab, var(--surface) 92%, #2c1830);
  box-shadow:
    0 0 0 1px rgba(255, 79, 154, 0.045),
    0 24px 70px -48px rgba(255, 79, 154, 0.72),
    0 18px 50px -36px rgba(0, 0, 0, 0.95);
}

.content-card::before {
  content: '';
  display: block;
  width: 72px;
  height: 2px;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(132, 40, 223, 0.78));
}

.article-date {
  margin: -0.75rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

h1,
h2,
h3 {
  font-family: 'Cal Sans', 'Inter', sans-serif;
  color: #fff;
  letter-spacing: 0;
  line-height: 1.1;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.45rem, 2vw, 1.95rem);
  font-weight: 400;
  max-width: 28ch;
}

h2 {
  margin: 1.8em 0 0.7rem;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
}

h1 + h2 {
  margin-top: 0;
  color: var(--accent);
}

h3 {
  margin-top: 1.6em;
  font-size: 1.35rem;
}

p,
li {
  color: color-mix(in oklab, var(--text) 92%, var(--muted));
  font-size: 1rem;
  line-height: 1.75;
}

p {
  margin: 0 0 1.15rem;
}

strong {
  color: #fff;
  font-weight: 700;
}

blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.55;
}

code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
}

.empty {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.site-footer {
  flex: 0 0 auto;
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 900px);
  gap: clamp(2rem, 4vw, 4rem);
  padding: 1.6rem 1rem 2rem;
}

.site-footer p {
  grid-column: 2;
  justify-self: center;
  width: 100%;
  max-width: min(1000px, calc(100vw - 2rem));
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 920px) {
  html {
    overflow: auto;
  }

  body {
    height: auto;
    min-height: 100vh;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    overflow: visible;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer p {
    grid-column: 1;
  }

  .article-nav {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    max-height: none;
    overflow: visible;
    border-left: 0;
    border-bottom: 0;
    padding: 0;
  }

  .nav-logo {
    width: 150px;
    margin: 0;
  }

  .menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    margin: 0.2rem 0 0;
    padding: 0;
    border: 1px solid rgba(255, 79, 154, 0.34);
    border-radius: 8px;
    background: rgba(24, 21, 31, 0.72);
    color: #fff;
    box-shadow: 0 14px 36px -28px rgba(255, 79, 154, 0.8);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    transition: transform .18s ease, opacity .18s ease;
  }

  .article-menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .article-menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .article-menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .article-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    z-index: 10;
    width: min(320px, calc(100vw - 2rem));
    max-height: min(440px, calc(100vh - 9rem));
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid rgba(255, 79, 154, 0.28);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 48%),
      color-mix(in oklab, var(--surface) 94%, #2c1830);
    box-shadow:
      0 0 0 1px rgba(255, 79, 154, 0.045),
      0 24px 70px -48px rgba(255, 79, 154, 0.82),
      0 18px 50px -36px rgba(0, 0, 0, 0.95);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .article-menu-open .article-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .article-menu h2 {
    margin-bottom: 0.85rem;
  }

  .article-menu a {
    max-width: none;
    padding-block: 0.25rem;
  }

  main,
  .content-card {
    height: auto;
  }

  .content-card {
    overflow: visible;
  }
}
