:root {
  --bg: #f4efe7;
  --panel: #fffaf4;
  --panel-strong: #fff;
  --text: #1c1917;
  --muted: #57534e;
  --line: #d6d0c7;
  --accent: #c2410c;
  --accent-soft: #ffedd5;
  --shadow: 0 18px 40px rgba(28, 25, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(194, 65, 12, 0.08), transparent 28%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.7;
}

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

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.95em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(248, 244, 238, 0.86);
  border-bottom: 1px solid rgba(214, 208, 199, 0.8);
}

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

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

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

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--panel);
  color: var(--text);
}

.page {
  padding: 40px 0 80px;
}

.hero,
.recent-section,
.domain-section {
  margin-bottom: 28px;
}

.hero {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 237, 0.95));
  box-shadow: var(--shadow);
}

.hero h1,
.domain-heading h2,
.article-card h3 {
  margin: 0;
}

.lead,
.section-note,
.article-card p,
.article-row-desc,
.empty-state p {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.section-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 36px;
}

.section-map a,
.article-card,
.article-row,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.92);
  box-shadow: var(--shadow);
}

.section-map a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
}

.section-map-label {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.domain-heading {
  margin-bottom: 16px;
}

.article-list,
.article-row-list {
  display: grid;
  gap: 16px;
}

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

.article-card {
  display: block;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.article-card:hover,
.article-card:focus-visible,
.article-row:hover,
.article-row:focus-visible,
.section-map a:hover,
.section-map a:focus-visible {
  transform: translateY(-2px);
  border-color: #bfae99;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
}

.article-date,
.meta,
.article-row-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.meta,
.article-row-meta {
  font-weight: 600;
}

.article-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
}

.article-row-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-state {
  padding: 18px 22px;
}

.article-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.article-shell {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 244, 0.96);
  box-shadow: var(--shadow);
}

.article-shell h1,
.article-shell h2,
.article-shell h3 {
  line-height: 1.3;
}

.article-shell h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

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

.article-shell ul,
.article-shell ol {
  padding-left: 1.25rem;
}

.note-box,
.compare-box {
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: #fff7ed;
}

.compare-box {
  border-left-color: #0f766e;
  background: #f0fdfa;
}

.diagram-card {
  margin: 20px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fffdf9;
}

.diagram-card svg {
  display: block;
  width: 100%;
  height: auto;
}

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

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.mini-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdf9;
}

.mini-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 820px) {
  .section-map,
  .article-list,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .article-row {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }
}
