* {
  box-sizing: border-box;
}

:root {
  --background: #f7f7f5;
  --surface: #ffffff;
  --text: #15171a;
  --muted: #686d75;
  --line: #dedfdc;
  --accent: #1d3557;
  --sidebar-width: 340px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
}

.content-area {
  min-height: 100vh;
  margin-right: var(--sidebar-width);
  padding: 88px clamp(32px, 7vw, 112px);
}

.article {
  width: min(820px, 100%);
  margin: 0 auto;
}

.article h1 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.article .subtitle {
  max-width: 620px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.05rem;
}

.article.article-page h1 {
  font-size: clamp(2.25rem, 4vw, 4rem);
}

.article-body {
  margin-top: 48px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--sidebar-width);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 44px 34px 48px;
}

.site-title {
  display: inline-block;
  margin-bottom: 44px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-section + .nav-section {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.nav-section h2 {
  margin: 0 0 13px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nav-section a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 120ms ease, transform 120ms ease;
}

.nav-section a:hover,
.nav-section a:focus-visible,
.nav-section a.active {
  color: var(--accent);
}

.nav-section a:hover {
  transform: translateX(-3px);
}

.nav-section a:focus-visible,
.site-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.loading,
.error {
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-shell {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    order: 1;
    width: 100%;
    max-height: none;
    border-bottom: 1px solid var(--line);
    border-left: 0;
    padding: 30px clamp(22px, 6vw, 52px);
  }

  .content-area {
    order: 2;
    min-height: auto;
    margin-right: 0;
    padding: 56px clamp(22px, 6vw, 52px) 80px;
  }

  .site-title {
    margin-bottom: 28px;
  }
}
