:root {
  color-scheme: light;
  --paper: #f7f3ec;
  --paper-strong: #fffdf9;
  --ink: #171927;
  --muted: #646474;
  --line: rgba(23, 25, 39, 0.16);
  --blue: #2b4eaf;
  --blue-deep: #19337d;
  --gold: #a98326;
  --gold-bright: #c9a84c;
  --lilac: #8972bb;
  --shadow: 0 24px 70px rgba(22, 28, 60, 0.14);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --content: min(1180px, calc(100vw - 48px));
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1120;
  --paper-strong: #17192b;
  --ink: #f2efe8;
  --muted: #b3b0be;
  --line: rgba(237, 232, 222, 0.17);
  --blue: #83a2ff;
  --blue-deep: #b7c8ff;
  --gold: #e0bd61;
  --gold-bright: #f0d68c;
  --lilac: #baa4e9;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--lilac) 12%, transparent), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 4px;
}

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

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  width: var(--content);
  min-height: 92px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.site-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
}

.site-identity:hover {
  color: inherit;
}

.site-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50% 50% 46% 54%;
  color: var(--blue);
  font-family: var(--serif);
  font-size: 24px;
}

.site-identity strong,
.site-identity small {
  display: block;
}

.site-identity strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.site-identity small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.5vw, 32px);
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

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

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: var(--gold);
  content: "";
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
}

.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
}

main {
  min-height: 65vh;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
  width: var(--content);
  min-height: 720px;
  margin: 0 auto;
  padding: 68px 0 84px;
}

.hero::before {
  position: absolute;
  top: 74px;
  left: -28px;
  color: color-mix(in srgb, var(--blue) 8%, transparent);
  content: "L";
  font-family: var(--serif);
  font-size: clamp(220px, 30vw, 430px);
  line-height: 0.8;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 6.4vw, 92px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.hero h1 em {
  position: relative;
  color: var(--blue-deep);
  font-style: normal;
}

.hero h1 em::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  content: "";
}

.hero-lead {
  max-width: 620px;
  margin: 34px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  margin-top: 38px;
}

.primary-action,
.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.primary-action {
  border: 1px solid var(--blue-deep);
  background: var(--blue-deep);
  color: var(--paper-strong);
  padding: 11px 26px;
  text-decoration: none;
}

.primary-action:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #11121b;
}

.text-action {
  gap: 10px;
  color: var(--blue-deep);
  font-weight: 700;
}

.hero-portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 480px);
  align-self: end;
  margin: 0;
}

.portrait-halo {
  position: absolute;
  z-index: -1;
  top: 1%;
  left: 3%;
  width: 94%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--gold-bright) 18%, transparent), transparent 63%),
    repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--blue) 9%, transparent) 0 1deg, transparent 1deg 12deg);
}

.hero-portrait img {
  width: 100%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 28px 28px rgba(32, 34, 73, 0.18));
}

.hero-portrait figcaption {
  position: absolute;
  right: 0;
  bottom: 3%;
  display: grid;
  min-width: 230px;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--paper-strong) 88%, transparent);
  box-shadow: var(--shadow);
  padding: 13px 18px;
  backdrop-filter: blur(14px);
}

.hero-portrait figcaption strong {
  font-family: var(--serif);
  letter-spacing: 0.04em;
}

.hero-portrait figcaption span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.opening-note,
.home-section,
.home-pair {
  width: var(--content);
  margin-right: auto;
  margin-left: auto;
}

.opening-note {
  display: grid;
  grid-template-columns: 80px minmax(230px, 0.7fr) minmax(300px, 1.3fr);
  gap: 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 72px 0;
}

.section-number,
.item-count strong {
  margin: 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
}

.opening-note h2,
.section-heading h2,
.page-intro h1,
.article-header h1,
.not-found h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.35;
}

.opening-note h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.opening-body {
  columns: 2 260px;
  column-gap: 34px;
  color: var(--muted);
}

.opening-body p {
  margin: 0;
}

.opening-body p + p {
  margin-top: 1.4em;
}

.home-section {
  padding: 100px 0 0;
}

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

.section-heading h2 {
  font-size: clamp(32px, 4vw, 52px);
}

.section-heading > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.home-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 70px);
}

.home-pair > .home-section {
  width: auto;
  margin-right: 0;
  margin-left: 0;
}

.content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  box-shadow: 0 14px 46px rgba(31, 34, 72, 0.08);
}

.content-card-featured {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
  align-items: stretch;
}

.card-image {
  display: block;
  min-height: 260px;
  overflow: hidden;
  background: color-mix(in srgb, var(--lilac) 14%, var(--paper));
}

.card-image:empty {
  min-height: 18px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.content-card:hover .card-image img {
  transform: scale(1.018);
}

.card-copy {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: clamp(26px, 4vw, 50px);
}

.card-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.45;
}

.card-copy h3 a {
  text-decoration: none;
}

.card-copy > p:not(.eyebrow, .card-meta) {
  color: var(--muted);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: auto 0 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  width: var(--content);
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  padding: 96px 0 64px;
}

.page-intro > div {
  max-width: 820px;
}

.page-intro h1,
.article-header h1 {
  font-size: clamp(40px, 6vw, 74px);
  letter-spacing: -0.035em;
}

.page-intro > div > p:last-child {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
}

.item-count {
  display: grid;
  gap: 7px;
  min-width: 96px;
  margin: 0;
  text-align: center;
}

.item-count strong {
  font-size: 54px;
}

.item-count span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  width: var(--content);
  margin: 0 auto;
  padding: 58px 0 110px;
}

.notebook-page .content-grid {
  grid-template-columns: minmax(0, 780px);
}

.character-intro {
  align-items: center;
}

.character-intro img {
  width: min(42vw, 420px);
  max-height: 500px;
  object-fit: contain;
  filter: drop-shadow(0 24px 30px rgba(32, 34, 73, 0.16));
}

.reader {
  width: min(790px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 54px 0 120px;
}

.character-reader {
  padding-top: 76px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 56px;
  color: var(--muted);
  font-size: 12px;
}

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

.article-summary {
  margin: 24px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 19px;
}

.article-byline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.article-image {
  width: min(100%, 680px);
  overflow: hidden;
  margin: 0 auto 58px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.article-image img {
  width: 100%;
  height: auto;
}

.prose {
  color: color-mix(in srgb, var(--ink) 93%, var(--muted));
  font-family: var(--serif);
  font-size: clamp(17px, 2.2vw, 19px);
  line-height: 2.08;
}

.prose p {
  margin: 0 0 1.55em;
}

.prose h2,
.prose h3,
.prose h4 {
  margin: 2.7em 0 1em;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.55;
}

.prose h2 {
  font-size: 1.55em;
}

.prose h3 {
  font-size: 1.28em;
}

.prose blockquote {
  margin: 2.4em 0;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold-bright) 8%, transparent);
  padding: 1.3em 1.6em;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  width: 64px;
  margin: 4em auto;
  border: 0;
  border-top: 1px solid var(--gold);
}

.prose ul {
  margin: 1.8em 0;
  padding-left: 1.4em;
}

.prose code {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-strong);
  padding: 0.12em 0.35em;
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 68px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--muted);
  font-size: 12px;
}

.tag-list li::before {
  color: var(--gold);
  content: "#";
}

.reader-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.reader-navigation a {
  display: grid;
  min-height: 98px;
  align-content: center;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  padding: 16px 20px;
  text-decoration: none;
}

.reader-navigation a:last-child {
  text-align: right;
}

.reader-navigation span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.reader-navigation strong {
  margin-top: 5px;
  font-family: var(--serif);
  font-weight: 500;
}

.search-panel {
  width: min(900px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 60px 0 110px;
}

.search-panel form {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}

.search-panel label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.search-panel form > div {
  display: grid;
  grid-template-columns: 1fr auto;
}

.search-panel input {
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
}

.search-panel button {
  min-width: 90px;
  min-height: 52px;
  border: 1px solid var(--blue-deep);
  background: var(--blue-deep);
  color: var(--paper-strong);
  cursor: pointer;
  padding: 10px 20px;
}

.search-status {
  margin: 34px 0 16px;
  color: var(--muted);
}

.search-results {
  display: grid;
  gap: 16px;
}

.search-results .content-card {
  display: grid;
  grid-template-columns: 210px 1fr;
}

.search-results .card-image {
  min-height: 210px;
}

.search-results .card-copy {
  min-height: 210px;
  padding: 24px 30px;
}

.search-results .card-copy h3 {
  font-size: 24px;
}

.search-result {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  padding: 24px 28px;
}

.search-result h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.search-result h2 a {
  text-decoration: none;
}

.search-result > p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.result-tags {
  font-size: 12px;
}

.not-found {
  display: grid;
  place-items: start;
  width: min(720px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 140px 0;
}

.not-found h1 {
  font-size: clamp(38px, 6vw, 64px);
}

.not-found > p:not(.eyebrow) {
  max-width: 600px;
  margin: 28px 0;
  color: var(--muted);
}

.site-footer {
  width: var(--content);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 54px 0 66px;
  text-align: center;
}

.site-footer p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.site-footer .footer-name {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.08em;
}

.site-footer .ai-disclosure {
  margin-top: 20px;
  font-size: 11px;
}

@media (max-width: 920px) {
  :root {
    --content: min(100% - 36px, 760px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 80px;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: start;
    overflow-x: auto;
    margin-top: -16px;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 64px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero-portrait {
    justify-self: center;
    width: min(82%, 480px);
    margin: -10px auto 0;
  }

  .opening-note {
    grid-template-columns: 52px 1fr;
  }

  .opening-body {
    grid-column: 2;
  }

  .home-pair {
    grid-template-columns: 1fr;
  }

  .content-card-featured {
    grid-template-columns: 1fr;
  }

  .content-card-featured .card-image {
    max-height: 520px;
  }

  .article-image {
    margin-right: 0;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  :root {
    --content: calc(100vw - 28px);
  }

  body {
    line-height: 1.68;
  }

  .site-header {
    gap: 12px;
  }

  .site-nav {
    gap: 22px;
  }

  .site-nav a {
    min-height: 46px;
    white-space: nowrap;
  }

  .hero {
    gap: 24px;
    padding-top: 52px;
  }

  .hero::before {
    display: none;
  }

  .hero h1 {
    font-size: clamp(44px, 14vw, 66px);
  }

  .hero-lead {
    font-size: 16px;
    line-height: 1.9;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .text-action {
    width: 100%;
  }

  .hero-portrait figcaption {
    position: relative;
    bottom: auto;
    width: calc(100% - 24px);
    margin: -18px auto 0;
  }

  .opening-note {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 52px 0;
  }

  .opening-note .section-number {
    font-size: 28px;
  }

  .opening-body {
    grid-column: auto;
    columns: auto;
  }

  .home-section {
    padding-top: 72px;
  }

  .section-heading,
  .page-intro {
    align-items: start;
    flex-direction: column;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .page-intro {
    gap: 28px;
    padding: 68px 0 46px;
  }

  .item-count {
    grid-template-columns: auto auto;
    align-items: end;
    text-align: left;
  }

  .item-count strong {
    font-size: 40px;
  }

  .character-intro img {
    width: 100%;
    max-height: 420px;
  }

  .reader {
    width: calc(100vw - 30px);
    padding-top: 38px;
  }

  .article-header h1 {
    font-size: 40px;
  }

  .reader-navigation {
    grid-template-columns: 1fr;
  }

  .reader-navigation a:last-child {
    text-align: left;
  }

  .search-panel {
    width: calc(100vw - 28px);
  }

  .search-panel form > div {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-panel input {
    border-right: 1px solid var(--line);
  }

  .search-results .content-card {
    grid-template-columns: 1fr;
  }

  .search-results .card-image {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
