:root {
  --bg: #f5f0e8;
  --paper: #fffdf8;
  --ink: #1c1917;
  --muted: #5b5349;
  --line: #d8cfc0;
  --accent: #9a3412;
  --accent-soft: #f3e3d6;
  --code-bg: #f4efe7;
  --shadow: 0 18px 50px rgba(28, 25, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(154, 52, 18, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f3eb 0%, #efe5d7 100%);
  line-height: 1.7;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
}

img {
  max-width: 100%;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(247, 243, 235, 0.84);
  border-bottom: 1px solid rgba(216, 207, 192, 0.9);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav-links a,
.inline-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.inline-link:hover {
  color: var(--accent);
}

.hero {
  padding: 72px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.section-card,
.article-card,
.note-card,
.article-shell {
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(216, 207, 192, 0.95);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  border-radius: 28px 28px 80px 28px;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.lead {
  margin: 0 0 22px;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 28px;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.button {
  background: var(--accent);
  color: #fff8f1;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-metrics div {
  padding: 14px;
  background: var(--accent-soft);
  border-radius: 18px;
}

.hero-metrics strong {
  display: block;
  font-size: 1.3rem;
}

.hero-panel {
  padding: 28px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 52, 18, 0.16), transparent 65%);
}

.hero-panel h2,
.section-head h2,
.article-shell h1 {
  margin-top: 0;
}

.code-sample {
  margin: 18px 0 0;
  padding: 18px;
  border-radius: 20px;
  background: var(--code-bg);
  overflow-x: auto;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92rem;
}

main section {
  padding: 18px 0 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.grid-3,
.grid-2,
.article-list {
  display: grid;
  gap: 18px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.section-card,
.article-card,
.note-card {
  padding: 24px;
  border-radius: 24px;
}

.section-card h3,
.article-card h3,
.note-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 10px;
}

.article-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.article-card a,
.note-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.article-shell {
  padding: 36px;
  border-radius: 30px;
  margin: 34px auto 60px;
}

.article-shell p,
.article-shell li {
  color: #2b2623;
}

.article-shell h2 {
  margin-top: 32px;
}

.article-shell pre,
.article-shell code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.article-shell pre {
  padding: 18px;
  border-radius: 18px;
  background: var(--code-bg);
  overflow-x: auto;
}

.article-shell ul {
  padding-left: 20px;
}

.site-footer {
  padding: 20px 0 48px;
  color: var(--muted);
}

.footer-panel {
  padding: 22px 24px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid rgba(216, 207, 192, 0.95);
}

.footer-panel p {
  margin: 6px 0;
}

@media (max-width: 860px) {
  .hero-grid,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .article-shell {
    padding: 24px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .nav-bar,
  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
