:root {
  --bg: #e8f4ff;
  --surface: #f7fbff;
  --ink: #0b1a2b;
  --muted: #2f4a63;
  --accent: #0b6eff;
  --accent-2: #16b879;
  --accent-3: #0f88c1;
  --line: #c4d8ef;
  --shadow: 0 20px 45px rgba(6, 32, 64, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -20% -10% -20%;
  background:
    radial-gradient(circle at 15% 10%, rgba(11, 110, 255, 0.28), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(22, 184, 121, 0.25), transparent 52%),
    radial-gradient(circle at 50% 90%, rgba(15, 136, 193, 0.25), transparent 60%),
    linear-gradient(180deg, #eff7ff 0%, #d8ecff 100%);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(60deg, rgba(11, 26, 43, 0.04) 0 1px, transparent 1px 7px);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}

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

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

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 6vw 16px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(232, 244, 255, 0.88);
  border-bottom: 1px solid rgba(11, 26, 43, 0.08);
  z-index: 5;
}

.brand {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand svg {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
}

.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.4);
}

.nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.main {
  flex: 1;
  padding: 10px 6vw 60px;
}

.hero {
  padding: 36px 0 28px;
}

.hero-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin: 0 0 12px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.6;
}

.section {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 28px 26px;
  box-shadow: var(--shadow);
}

.section h2 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.5rem;
  margin: 0 0 12px;
}

.section p {
  margin: 0 0 12px;
  line-height: 1.7;
  color: var(--muted);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.card {
  display: block;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 32px rgba(6, 32, 64, 0.12);
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: rise 500ms ease both;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 38px rgba(6, 32, 64, 0.2);
}

.card-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.card-note {
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.95rem;
}

.content h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  margin: 8px 0 16px;
}

.content p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.02rem;
  margin: 0 0 14px;
}

.md-viewer {
  padding: 22px;
}

.md-viewer-meta {
  margin: 0 0 14px;
}

.md-toc {
  display: flex;
  flex-direction: column;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  overflow: hidden;
}

.md-toc-link {
  display: block;
  padding: 8px 14px;
  font-size: 0.92rem;
  color: #24292f;
  border-bottom: 1px solid #d8dee4;
  background: transparent;
  transition: background 120ms ease;
}

.md-toc-link:last-child {
  border-bottom: none;
}

.md-toc-link:hover {
  background: #eaeef2;
  color: var(--accent);
}

.md-toc-level-1 {
  font-weight: 600;
  background: #eef1f4;
}

.md-toc-level-2 {
  padding-left: 28px;
  font-weight: 500;
}

.md-toc-level-3 {
  padding-left: 42px;
  font-size: 0.88rem;
  color: #57606a;
}

.md-render h1,
.md-render h2,
.md-render h3,
.md-render h4 {
  font-family: "Fraunces", "Times New Roman", serif;
  color: var(--ink);
  margin: 18px 0 12px;
}

.md-render h1 {
  font-size: clamp(1.9rem, 3.8vw, 2.6rem);
}

.md-render h2 {
  font-size: 1.45rem;
}

.md-render h3 {
  font-size: 1.2rem;
}

.md-render table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 18px;
  background: rgba(247, 251, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 28px rgba(6, 32, 64, 0.08);
}

.md-render th,
.md-render td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(11, 26, 43, 0.08);
  vertical-align: top;
  text-align: left;
}

.md-render th {
  color: var(--ink);
  background: rgba(11, 110, 255, 0.1);
}

.md-render tr:last-child td {
  border-bottom: none;
}

.md-render code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 0.18em 0.36em;
  border-radius: 10px;
  background: rgba(22, 184, 121, 0.12);
  color: #0a2b1b;
  border: 1px solid rgba(22, 184, 121, 0.25);
}

.md-render pre {
  padding: 14px;
  border-radius: 16px;
  overflow: auto;
  background: rgba(11, 110, 255, 0.08);
  border: 1px solid rgba(11, 110, 255, 0.2);
  box-shadow: 0 16px 28px rgba(6, 32, 64, 0.08);
}

.md-render pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--ink);
}

.md-render blockquote {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent-2);
  border-radius: 14px;
  background: rgba(22, 184, 121, 0.08);
  color: var(--muted);
}

.md-render ul,
.md-render ol {
  margin: 12px 0 18px 1.3em;
  color: var(--muted);
}

.md-render li {
  margin: 6px 0;
}

.md-figure {
  margin: 18px 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 28px rgba(6, 32, 64, 0.08);
}

.md-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.md-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.md-render hr {
  border: none;
  height: 2px;
  margin: 22px 0;
  background: linear-gradient(90deg, rgba(11, 110, 255, 0.0), rgba(11, 110, 255, 0.6), rgba(22, 184, 121, 0.6), rgba(22, 184, 121, 0.0));
}

.diagram {
  margin-top: 22px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  box-shadow: 0 18px 36px rgba(6, 32, 64, 0.12);
}

.diagram svg,
.diagram img {
  width: 100%;
  height: auto;
  display: block;
}

.diagram figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  padding: 24px 6vw 32px;
  font-size: 0.9rem;
  color: var(--muted);
}

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

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

  .nav {
    flex-wrap: wrap;
  }

  .section {
    padding: 22px;
  }
}

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