/*
  ADOBE KAITI SETUP
  -----------------
  Add Adobe Kaiti to an Adobe Fonts Web Project, then paste the project embed
  <link> into index.html and the character pages where marked.

  This stylesheet already uses the Adobe Kaiti web family name:
      adobe-kaiti-std

  If the Adobe Fonts project is not configured yet, the Chinese text falls
  back to system Chinese fonts.
*/

:root {
  --paper: #f1ece6;
  --ink: #111111;
  --muted: #5e5b58;
  --line: #6f6f6f;
  --page-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

/* Chinese typography */
.intro-chinese,
.character-chinese-name,
.character-cn,
.character-paragraph-cn,
.bilingual-title .cn {
  font-family: adobe-kaiti-std, "KaiTi", "STKaiti", "Microsoft YaHei", "PingFang SC", serif;
}

/* ==========================
   MAIN PAGE
========================== */

.home-header {
  padding: 34px 28px 74px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(60, 50, 40, 0.015) 0,
      rgba(60, 50, 40, 0.015) 1px,
      transparent 1px,
      transparent 3px
    ),
    var(--paper);
}

.author-name {
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 400;
}

.project-title {
  margin: 8px 0 82px;
  text-align: center;
  font-size: clamp(36px, 4.3vw, 58px);
  font-weight: 400;
  line-height: 1;
}

.project-intro {
  width: min(900px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.seal {
  display: block;
  width: 38px;
  height: auto;
  object-fit: contain;
}

.intro-seal {
  margin-top: 1px;
}

.intro-text {
  max-width: 780px;
}

.intro-chinese,
.intro-english {
  margin: 0 0 23px;
  font-size: 14px;
  line-height: 1.38;
}

.intro-chinese {
  font-size: 15px;
}

.character-section {
  width: min(var(--page-width), calc(100% - 60px));
  margin: 0 auto;
  padding: 72px 0 110px;
}

.character-section-heading {
  width: min(900px, 100%);
  margin: 0 auto 58px;

  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);

  gap: 24px;

  align-items: start;
}

.character-section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 88px;
  row-gap: 84px;
}

.work-item {
  text-align:center;
}

.character-link {
  display: flex;
  width: 100%;
  height: 285px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  text-decoration: none;
}

.character-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 180ms ease;
}

.character-link:hover img,
.character-link:focus-visible img {
  filter: brightness(55%);
}

.character-chinese-name {
  margin: 0;
  font-size: 15px;
  line-height: 1.18;
}

.character-english-name {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.15;
  
}

/* ==========================
   CHARACTER PAGES
========================== */

.character-body {
  margin: 0;
  padding: 0;
  background: #ffffff;
}

.character-sheet {
  position: relative;
  width: min(900px, calc(100% - 40px));
  min-height: 100vh;

  margin: 0 auto;
  padding: 84px 72px 76px;

  background: #ffffff;
}

.character-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: start;
  min-height: 260px;
  margin-bottom: 25px;
}

.character-title-line {
  display: flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
}

.character-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
}

.character-divider {
  font-size: 29px;
  font-weight: 300;
}

.character-cn {
  font-size: 31px;
  font-weight: 400;
}

.character-en {
  margin: 5px 0 0 69px;
  font-size: 31px;
  line-height: 1;
  font-weight: 400;
}

.character-art {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-content {
  width: 66%;
  max-width: 555px;
}

.character-section-block {
  margin-bottom: 52px;
}

.bilingual-title {
  margin: 0 0 27px;

  display: block;

  padding-left: 14px;
  text-indent: -14px;

  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
}

.bilingual-title::before {
  content: "•";
  margin-right: 8px;
}

.bilingual-title .cn {
  font-size: 16px;

  white-space: nowrap;
}

.bilingual-title .en {
  margin-left: 6px;
}

.character-paragraph-cn,
.character-paragraph-en {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.35;
}

.character-paragraph-cn {
  font-size: 14px;
}

.character-back {
  display: inline-block;
  margin-top: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #bbb;
  text-decoration: none;
  font-size: 12px;
}

.character-back:hover {
  opacity: .55;
}

.page-seal {
  position: absolute;
  right: 72px;
  bottom: 68px;
  width: 42px;
  height: auto;
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 850px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 42px;
  }

  .character-top {
    grid-template-columns: 1fr 250px;
  }

  .character-content {
    width: 78%;
  }
}

@media (max-width: 620px) {
  .home-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .project-title {
    margin-bottom: 52px;
  }

  .project-intro,
  .character-section-heading {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 16px;
  }

  .seal {
    width: 32px;
  }

  .character-section {
    width: calc(100% - 30px);
  }

  .work-grid {
    grid-template-columns: 1fr;
    row-gap: 54px;
  }

  .character-link {
    height: 340px;
  }

  .character-body {
    padding: 0;
    background: #fff;
  }

  .character-sheet {
    min-height: 100vh;
    padding: 48px 24px 70px;
    border: 0;
  }

  .character-top {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 42px;
  }

  .character-title-line {
    white-space: normal;
  }

  .character-en {
    margin-left: 0;
    margin-top: 8px;
  }

  .character-art {
    height: 300px;
  }

  .character-content {
    width: 100%;
    max-width: none;
  }

  .page-seal {
    position: static;
    display: block;
    width: 38px;
    margin: 45px 0 0 auto;
  }
}
