/* Editorial layout on top of Bootstrap 5. Noto Sans SC is self-hosted. */

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-sc-400.woff2") format("woff2");
  unicode-range: U+2E80-2EFF, U+2F00-2FDF, U+3000-303F, U+3100-312F, U+31C0-31EF, U+3200-9FFF, U+F900-FAFF, U+FE10-FE1F, U+FE30-FE6F, U+FF00-FFEF;
}

@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-sc-600.woff2") format("woff2");
  unicode-range: U+2E80-2EFF, U+2F00-2FDF, U+3000-303F, U+3100-312F, U+31C0-31EF, U+3200-9FFF, U+F900-FAFF, U+FE10-FE1F, U+FE30-FE6F, U+FF00-FFEF;
}

:root,
[data-bs-theme="light"] {
  color-scheme: light;
  --paper: #f4f1eb;
  --ink: #1d1b17;
  --muted: #514c46;
  --line: #ddd6cb;
  --accent: #23415f;
  --accent-hover: #1a3148;
  --bs-body-bg: #f4f1eb;
  --bs-body-color: #1d1b17;
  --bs-emphasis-color: #1d1b17;
  --bs-secondary-color: #514c46;
  --bs-border-color: #ddd6cb;
  --bs-link-color: #23415f;
  --bs-link-hover-color: #1a3148;
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --paper: #1c1b19;
  --ink: #e7e2d8;
  --muted: #c2bbb0;
  --line: #3c3934;
  --accent: #c5d4e2;
  --accent-hover: #e2ebf3;
  --bs-body-bg: #1c1b19;
  --bs-body-color: #e7e2d8;
  --bs-emphasis-color: #e7e2d8;
  --bs-secondary-color: #c2bbb0;
  --bs-border-color: #3c3934;
  --bs-link-color: #c5d4e2;
  --bs-link-hover-color: #e2ebf3;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.85;
  font-weight: 400;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.2rem;
  margin: 2.4rem 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

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

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
  padding-bottom: 0.9rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.logo,
.logo:visited {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
}

.site-nav a,
.site-nav a:visited {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--ink);
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
  margin-bottom: 0.35rem;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.75;
  max-width: 36rem;
  margin-top: 1rem;
}

.entry {
  padding: 0.95rem 0 0.15rem;
  border-top: 1px solid var(--line);
}

.entry h2,
.entry h3 {
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
}

.entry h2 a,
.entry h3 a,
.entry h2 a:visited,
.entry h3 a:visited {
  color: var(--ink);
  text-decoration: none;
}

.entry h2 a:hover,
.entry h3 a:hover {
  color: var(--accent);
}

.entry p:last-child {
  margin-bottom: 0.85rem;
}

.more {
  margin-top: 1rem;
}

.section-lead {
  margin-top: 2.4rem;
}

.about-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  flex: none;
}

.prose h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
}

.prose h3 {
  font-size: 1.02rem;
  margin-top: 1.35rem;
  margin-bottom: 0.35rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose a,
.entry a {
  overflow-wrap: anywhere;
}

.prose code,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prose pre {
  background: rgba(0, 0, 0, 0.04);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border-radius: 6px;
  line-height: 1.6;
}

[data-bs-theme="dark"] .prose pre {
  background: rgba(255, 255, 255, 0.05);
}

.prose blockquote {
  margin: 1rem 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

.draft-note {
  font-size: 0.875rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  margin: 0.8rem 0 1rem;
}

.appendix {
  margin-top: 2.75rem;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  align-items: baseline;
}

.site-footer a,
.site-footer a:visited {
  color: var(--muted);
}

.footer-en {
  margin: 0.2rem 0 0;
}

.theme-toggle {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: #d5e0ea;
  color: #1d1b17;
}

[data-bs-theme="dark"] ::selection {
  background: #3d5368;
  color: #f4f1eb;
}

body.home {
  background:
    radial-gradient(90% 46% at 100% -6%, #ffb7a8 0%, rgba(255, 190, 170, 0.5) 28%, rgba(247, 244, 239, 0) 62%),
    #f7f4ef;
  color: #1c1c1c;
}

body.home .page {
  max-width: 880px;
}

body.home .home-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 20px;
  margin-bottom: 36px;
}

body.home .home-nav nav {
  display: flex;
  gap: 16px;
}

body.home .home-mark,
body.home .home-mark:visited,
body.home .home-nav nav a,
body.home .home-nav nav a:visited {
  color: #1c1c1c;
  text-decoration: none;
}

body.home .home-nav nav a,
body.home .home-nav nav a:visited,
body.home .home-eye,
body.home .home-stack,
body.home .home-cards p {
  color: #5e5954;
}

body.home .home-mark {
  font-weight: 650;
}

body.home .home-profile {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

body.home .home-portrait {
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(70, 40, 30, 0.12);
}

body.home .home-portrait svg {
  display: block;
  width: 100%;
  height: auto;
}

body.home .home-eye,
body.home .home-stack {
  font-size: 0.875rem;
  line-height: 1.7;
}

body.home h1 {
  margin: 4px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", Palatino, serif;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.05;
}

body.home .home-lead {
  max-width: 24em;
  margin: 12px 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

body.home .home-stack {
  margin-top: 6px;
}

body.home .home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

body.home .home-pill,
body.home .home-pill:visited {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 16px;
  background: #161616;
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
}

body.home .home-pill-ghost,
body.home .home-pill-ghost:visited {
  background: rgba(255, 255, 255, 0.72);
  color: #1c1c1c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

body.home .home-works {
  margin-top: 28px;
}

body.home .home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 40px rgba(60, 40, 30, 0.08);
}

body.home .home-swatch {
  height: 92px;
  border-radius: 14px;
}

body.home .home-swatch-a { background: linear-gradient(160deg, #f0c1b0, #d26a62); }
body.home .home-swatch-b { background: linear-gradient(160deg, #f0e2c8, #e0b07a); }
body.home .home-swatch-c { background: linear-gradient(160deg, #d5e4ef, #8eafc4); }

body.home .home-cards h2,
body.home .home-cards h3 {
  margin: 10px 0 0;
  font-size: 0.98rem;
  font-weight: 620;
}

body.home a.game-card,
body.home a.game-card:visited {
  display: block;
  color: inherit;
  text-decoration: none;
}

body.home .home-cards p {
  margin: 4px 0 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

body.home .site-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] body.home {
  background:
    radial-gradient(80% 42% at 100% -8%, rgba(196, 104, 84, 0.38) 0%, rgba(28, 27, 25, 0) 60%),
    #1c1b19;
  color: #e7e2d8;
}

[data-bs-theme="dark"] body.home .home-mark,
[data-bs-theme="dark"] body.home .home-mark:visited,
[data-bs-theme="dark"] body.home .home-lead {
  color: #e7e2d8;
}

[data-bs-theme="dark"] body.home .home-nav nav a,
[data-bs-theme="dark"] body.home .home-nav nav a:visited,
[data-bs-theme="dark"] body.home .home-eye,
[data-bs-theme="dark"] body.home .home-stack,
[data-bs-theme="dark"] body.home .home-cards p {
  color: #c2bbb0;
}

[data-bs-theme="dark"] body.home .home-pill,
[data-bs-theme="dark"] body.home .home-pill:visited {
  background: #e7e2d8;
  color: #1c1b19;
}

[data-bs-theme="dark"] body.home .home-pill-ghost,
[data-bs-theme="dark"] body.home .home-pill-ghost:visited {
  background: transparent;
  color: #e7e2d8;
  box-shadow: inset 0 0 0 1px #3c3934;
}

[data-bs-theme="dark"] body.home .home-cards {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px #3c3934;
}

[data-bs-theme="dark"] body.home .site-footer {
  border-top-color: #3c3934;
}

@media (max-width: 700px) {
  body.home .home-profile,
  body.home .home-cards {
    grid-template-columns: 1fr;
  }

  body.home .home-portrait {
    max-width: 200px;
  }
}

@media (min-width: 768px) {
  .page {
    padding: 2.25rem 1.5rem 4.5rem;
  }

  h1 {
    font-size: 2rem;
  }
}

@media print {
  .site-nav,
  .theme-toggle,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
