:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --text: #253032;
  --muted: #687477;
  --line: #ded8cc;
  --accent: #256d7b;
  --accent-strong: #174f5b;
  --warm: #f4b942;
  --soft: #d9ebe3;
  --code-bg: #1f282b;
  --code-text: #f4f7f5;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-header,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
}

.brand,
.site-nav,
.tag-row,
.category-grid,
.article-grid {
  display: flex;
}

.brand {
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark,
.hero-character {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.site-nav {
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a,
.text-link,
.back-link {
  text-decoration: none;
}

.site-nav a:hover,
.text-link:hover,
.back-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.hero,
.page-heading,
.content-section,
.article-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 32px;
  align-items: stretch;
  padding: 56px 0 32px;
}

.hero-copy h1,
.page-heading h1,
.article-header h1 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  max-width: 760px;
}

.hero-copy p,
.page-heading p,
.lead {
  color: var(--muted);
  max-width: 760px;
}

.eyebrow,
.category-label {
  color: var(--accent-strong);
  font-weight: 800;
}

.hero-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.hero-character {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: var(--warm);
  color: var(--text);
  font-size: 2rem;
}

.content-section,
.page-heading,
.article-shell {
  padding: 32px 0;
}

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

.section-header h2,
.summary-box h2 {
  margin: 0;
}

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

.search-box {
  margin: 18px 0 24px;
}

.search-box label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  background: var(--surface-strong);
}

.search-result-count {
  color: var(--muted);
  min-height: 1.5em;
  margin: 8px 0 0;
}

.article-grid {
  flex-wrap: wrap;
  gap: 16px;
}

.article-card {
  flex: 1 1 280px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-card a {
  display: block;
  height: 100%;
  padding: 20px;
  text-decoration: none;
}

.article-card span {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.article-card h2 {
  margin: 8px 0;
  font-size: 1.2rem;
  line-height: 1.35;
}

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

.category-grid {
  flex-wrap: wrap;
  gap: 12px;
}

.category-grid a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-width: 220px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.category-grid span {
  color: var(--muted);
}

.article-shell {
  max-width: 900px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
}

.article-header {
  padding-bottom: 20px;
}

.article-header h1,
.page-heading h1 {
  font-size: clamp(2rem, 7vw, 3.4rem);
}

.tag-row {
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  background: var(--soft);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.88rem;
}

.hero-figure,
.image-placeholder,
.character-tip,
.summary-box,
.ad-slot {
  border-radius: 8px;
  border: 1px solid var(--line);
}

.image-placeholder {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 220px;
  background: linear-gradient(135deg, #fffdf8, #d9ebe3);
  color: var(--muted);
  text-align: center;
}

.image-placeholder strong {
  color: var(--text);
}

.character-tip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 24px 0;
  padding: 18px;
  background: var(--surface);
}

.character-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #ffffff;
}

.character-name {
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-weight: 800;
}

.character-message p {
  margin: 0;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin: 24px 0;
  padding: 16px;
  background: #f2efe8;
  color: var(--muted);
  text-align: center;
}

.ad-slot span {
  font-weight: 800;
  color: var(--text);
}

.ad-slot p {
  margin: 0;
}

.ad-slot-live {
  background: transparent;
}

.article-body {
  font-size: 1.05rem;
}

.article-content-panel {
  background: transparent;
}

.article-body h2 {
  margin-top: 40px;
  line-height: 1.35;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body code {
  background: #e9e3d7;
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

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

.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.summary-box {
  margin: 36px 0 0;
  padding: 20px;
  background: #f7fbf8;
}

.summary-box ul {
  margin-bottom: 0;
}

.related-section {
  margin-top: 36px;
}

.related-section h2 {
  margin-top: 0;
}

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

.footer-nav {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.88rem;
}

.footer-nav a {
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.static-page {
  width: min(900px, calc(100% - 32px));
  margin: 32px auto;
  padding: 32px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.static-page h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.static-page h2 {
  margin: 36px 0 8px;
  line-height: 1.35;
}

.static-page p {
  margin: 0 0 16px;
}

.static-page a {
  color: var(--accent-strong);
}

.policy-date {
  color: var(--muted);
}

[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .site-header,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 32px;
  }

  .article-content-panel {
    padding: 0;
  }

  .article-shell {
    padding: 20px;
  }

  .static-page {
    padding: 20px;
  }

  .category-grid a {
    width: 100%;
  }
}
