@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@400;500;600;700;900&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

:root {
  color-scheme: dark;
  --night: #0b0c0f;
  --paper: #eee9df;
  --body: rgba(238, 233, 223, 0.84);
  --muted: #a6a19a;
  --faint: #706e73;
  --line: rgba(238, 233, 223, 0.13);
  --wine: #9a4054;
  --wine-soft: rgba(154, 64, 84, 0.14);
  --indigo: #7789bd;
  --gold: #c7a96f;
}

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

body {
  min-height: 100%;
  color: var(--paper);
  background:
    linear-gradient(180deg, #0b0c0f 0%, #111217 42%, #0c0d10 100%),
    repeating-linear-gradient(90deg, transparent 0 127px, rgba(255, 255, 255, 0.018) 127px 128px);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: #fff;
  background: rgba(154, 64, 84, 0.76);
}

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

.article-hero {
  position: relative;
  isolation: isolate;
  min-height: 86svh;
  max-height: 860px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 7.5rem max(1.25rem, calc((100vw - 1180px) / 2)) 0;
  border-bottom: 1px solid var(--line);
  background: #0a0b0d;
}

.article-hero::before {
  content: "";
  position: absolute;
  z-index: -3;
  inset: 0;
  background: url("/assets/saikoroshi/jinja.jpg") center 42% / cover no-repeat;
  filter: saturate(0.52) contrast(1.15) brightness(0.82);
  transform: scale(1.03);
}

.article-hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 8, 11, 0.97) 0%, rgba(7, 8, 11, 0.79) 49%, rgba(7, 8, 11, 0.16) 78%, rgba(7, 8, 11, 0.56) 100%),
    linear-gradient(180deg, rgba(7, 8, 11, 0.24) 0%, rgba(7, 8, 11, 0.1) 42%, #0b0c0f 100%);
}

.site-nav {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.25rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(238, 233, 223, 0.12);
  color: rgba(238, 233, 223, 0.7);
  font-size: 0.84rem;
}

.site-nav > div {
  display: flex;
  gap: 1.4rem;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav .wordmark {
  color: var(--paper);
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
}

.hero-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  min-height: 610px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 760px) 300px;
  gap: 2rem;
  align-items: end;
}

.hero-copy {
  align-self: center;
  padding-bottom: 4.5rem;
}

.article-kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gold);
  font-size: 0.76rem;
  line-height: 1.5;
  text-transform: uppercase;
  font-weight: 700;
}

.article-kicker span {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(154, 64, 84, 0.68);
  border-radius: 50%;
  color: #f0b2be;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
}

.hero-copy h1 {
  margin-top: 1rem;
  font-family: "Noto Serif SC", serif;
  font-size: 4.5rem;
  line-height: 1.08;
  font-weight: 900;
}

.hero-copy h1 small {
  display: block;
  max-width: 47rem;
  margin-top: 0.8rem;
  color: rgba(238, 233, 223, 0.86);
  font-size: 2rem;
  line-height: 1.4;
  font-weight: 600;
  text-wrap: balance;
}

.deck {
  max-width: 43rem;
  margin-top: 1.4rem;
  color: rgba(238, 233, 223, 0.67);
  font-family: "Noto Serif SC", serif;
  font-size: 1.02rem;
  line-height: 1.9;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  margin-top: 1.2rem;
  color: rgba(238, 233, 223, 0.45);
  font-size: 0.75rem;
}

.begin-reading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  margin-top: 1.55rem;
  padding: 0.58rem 0.95rem;
  border: 1px solid rgba(199, 169, 111, 0.42);
  border-radius: 6px;
  background: rgba(199, 169, 111, 0.11);
  color: #f1dfbb;
  font-size: 0.86rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.begin-reading:hover {
  transform: translateY(-1px);
  border-color: rgba(199, 169, 111, 0.7);
  background: rgba(199, 169, 111, 0.18);
}

.rika-portrait {
  position: relative;
  width: 300px;
  height: 570px;
  align-self: end;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(-12px 24px 34px rgba(0, 0, 0, 0.65));
}

.rika-portrait img {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
}

.rika-portrait figcaption {
  position: absolute;
  right: -0.7rem;
  bottom: 2.1rem;
  color: rgba(238, 233, 223, 0.38);
  font-size: 0.7rem;
  writing-mode: vertical-rl;
}

.article-shell {
  display: grid;
  grid-template-columns: 13rem minmax(0, 760px);
  gap: 4rem;
  justify-content: center;
  padding: 5.5rem max(1.25rem, calc((100vw - 1180px) / 2)) 4rem;
}

.toc {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  padding-top: 0.2rem;
}

.toc > p {
  margin-bottom: 0.65rem;
  color: var(--gold);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
}

.toc a {
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.52rem 0;
  border-bottom: 1px solid rgba(238, 233, 223, 0.08);
  color: var(--faint);
  font-size: 0.84rem;
  line-height: 1.4;
}

.toc a span {
  color: rgba(119, 137, 189, 0.7);
  font-family: "Noto Serif SC", serif;
}

.toc a:hover {
  color: var(--paper);
}

.essay-body {
  min-width: 0;
  color: var(--body);
  font-family: "Noto Serif SC", serif;
  font-size: 1.06rem;
  line-height: 2.08;
}

.essay-body section {
  scroll-margin-top: 2rem;
  padding: 4.25rem 0 3.8rem;
  border-top: 1px solid var(--line);
}

.essay-body .prologue {
  padding-top: 0;
  border-top: 0;
}

.essay-body p {
  margin-bottom: 1.2rem;
  text-align: justify;
}

.prologue > p:first-child::first-letter {
  float: left;
  margin: 0.16rem 0.5rem 0 0;
  color: #e1c78e;
  font-size: 4rem;
  line-height: 0.82;
  font-weight: 700;
}

.section-title {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 2rem;
}

.section-title > span {
  color: rgba(119, 137, 189, 0.75);
  font-family: "Noto Serif SC", serif;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 700;
}

.section-title > div > p:first-child {
  margin: 0 0 0.25rem;
  color: var(--gold);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.7rem;
  line-height: 1.4;
  text-transform: uppercase;
  font-weight: 700;
}

.section-title h2 {
  color: var(--paper);
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 700;
  text-wrap: balance;
}

.section-title .section-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.essay-body h3 {
  margin: 2.2rem 0 0.85rem;
  color: #e4d9c7;
  font-size: 1.18rem;
  line-height: 1.65;
  font-weight: 700;
}

.essay-body blockquote {
  margin: 2rem 0;
  padding: 1.3rem 1.4rem;
  border-left: 3px solid var(--wine);
  border-radius: 0 6px 6px 0;
  background: var(--wine-soft);
  color: #f0ced5;
  font-size: 1.18rem;
  line-height: 1.9;
  font-weight: 500;
}

.pull-quote {
  margin: 2.2rem 0 !important;
  padding: 1.2rem 0;
  border-top: 1px solid rgba(199, 169, 111, 0.3);
  border-bottom: 1px solid rgba(199, 169, 111, 0.3);
  color: #ead49f;
  font-size: 1.2rem;
  line-height: 1.85;
  text-align: center !important;
}

.consequence-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.consequence-pair p {
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid rgba(119, 137, 189, 0.48);
  color: rgba(238, 233, 223, 0.72);
  font-size: 0.96rem;
  line-height: 1.9;
}

.choice-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 2rem 0 2.3rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.choice {
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.choice + .choice {
  padding-right: 0;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.choice .choice-label {
  margin-bottom: 0.7rem;
  color: var(--paper);
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
  line-height: 1.6;
  font-weight: 700;
}

.choice .choice-label span {
  display: block;
  margin-bottom: 0.2rem;
  color: #d995a3;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.72rem;
  line-height: 1.4;
}

.choice > p:last-child {
  margin: 0;
  color: rgba(238, 233, 223, 0.68);
  font-size: 0.94rem;
  line-height: 1.9;
  text-align: left;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 8rem;
  padding: 2rem max(1.25rem, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: #090a0c;
  color: var(--faint);
  font-size: 0.8rem;
}

.article-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem 1.2rem;
}

.article-footer a:hover {
  color: var(--paper);
}

@media (max-width: 980px) {
  .article-hero {
    min-height: 82svh;
  }

  .hero-stage {
    grid-template-columns: minmax(0, 1fr) 250px;
    min-height: 570px;
  }

  .hero-copy h1 {
    font-size: 3.5rem;
  }

  .hero-copy h1 small {
    font-size: 1.65rem;
  }

  .rika-portrait {
    width: 250px;
    height: 480px;
  }

  .article-shell {
    grid-template-columns: 1fr;
    gap: 2.4rem;
    padding-top: 3.5rem;
  }

  .toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
  }

  .toc > p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .site-nav {
    min-height: 4rem;
    padding: 0 1rem;
  }

  .site-nav > div {
    gap: 0.9rem;
  }

  .site-nav > div a:first-child {
    display: none;
  }

  .article-hero {
    min-height: 84svh;
    padding: 5.5rem 1rem 0;
  }

  .article-hero::after {
    background:
      linear-gradient(90deg, rgba(7, 8, 11, 0.96), rgba(7, 8, 11, 0.48)),
      linear-gradient(180deg, rgba(7, 8, 11, 0.24), rgba(7, 8, 11, 0.42) 48%, #0b0c0f 100%);
  }

  .hero-stage {
    min-height: 610px;
    display: block;
  }

  .hero-copy {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 2.4rem 0 3rem;
  }

  .hero-copy h1 {
    max-width: 19rem;
    font-size: 2.75rem;
  }

  .hero-copy h1 small {
    max-width: 20rem;
    font-size: 1.42rem;
    line-height: 1.5;
  }

  .deck {
    max-width: 21rem;
    font-size: 0.94rem;
  }

  .rika-portrait {
    position: absolute;
    z-index: 1;
    right: -4.4rem;
    bottom: -0.8rem;
    width: 220px;
    height: 390px;
    opacity: 0.38;
  }

  .rika-portrait figcaption {
    display: none;
  }

  .article-shell {
    gap: 1.8rem;
    padding: 3rem 1rem;
  }

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

  .essay-body {
    font-size: 1rem;
    line-height: 2;
  }

  .essay-body section {
    padding: 3.2rem 0 2.8rem;
  }

  .essay-body p {
    text-align: left;
  }

  .section-title {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.7rem;
  }

  .section-title h2 {
    font-size: 1.65rem;
  }

  .essay-body blockquote {
    padding: 1.1rem;
    font-size: 1.06rem;
  }

  .consequence-pair,
  .choice-pair {
    grid-template-columns: 1fr;
  }

  .consequence-pair {
    gap: 1rem;
  }

  .choice {
    padding: 1.25rem 0;
  }

  .choice + .choice {
    padding: 1.25rem 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .article-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 2rem 1rem;
  }

  .article-footer nav {
    justify-content: flex-start;
  }
}

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

  .begin-reading {
    transition: none;
  }
}
