.calligraphy-body,
.calligraphy-page {
  overflow-x: hidden;
  background: var(--paper);
}

.back-link {
  width: max-content;
  margin-bottom: 42px;
  color: #727782;
  font-size: 11px;
  letter-spacing: .18em;
}

.back-link:hover {
  color: var(--blue);
}

.calligraphy-hero {
  display: grid;
  grid-template-columns: minmax(480px, .82fr) minmax(560px, 1.18fr);
  min-height: calc(100svh - 64px);
  border-bottom: 1px solid var(--line);
}

.calligraphy-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 76px 5vw 86px;
}

.calligraphy-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(94px, 10vw, 168px);
  line-height: .9;
}

.calligraphy-hero h2 {
  margin: 30px 0 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.2vw, 72px);
  line-height: 1.14;
}

.calligraphy-hero-copy > p {
  max-width: 640px;
  margin: 28px 0 0;
  color: #555b66;
  font-family: var(--serif);
  font-size: clamp(20px, 1.7vw, 30px);
  line-height: 1.75;
}

.hero-work {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(180px, .28fr);
  gap: 42px;
  align-items: end;
  min-width: 0;
  margin: 0;
  padding: 78px 5vw 70px;
  border-left: 1px solid var(--line);
  background: linear-gradient(90deg, #fff 0, #fff 55%, #f7f8fb 55%, #f7f8fb 100%);
}

.hero-work img {
  width: 100%;
  max-height: calc(100svh - 210px);
  object-fit: contain;
  align-self: center;
}

.hero-work figcaption {
  margin: 0 0 18px;
  color: #69707b;
  font-size: 14px;
  line-height: 1.9;
}

.calligraphy-thesis,
.practice-section,
.gallery-section,
.awards-section {
  display: grid;
  grid-template-columns: 188px 1fr;
  border-bottom: 1px solid var(--line);
}

.calligraphy-thesis-body,
.practice-body,
.gallery-body,
.awards-body {
  min-width: 0;
  padding: 72px 5vw;
}

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 54px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.thesis-grid span {
  display: grid;
  align-content: start;
  min-height: 176px;
  padding: 26px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.thesis-grid strong {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.thesis-grid small {
  margin-top: 22px;
  color: #69707b;
  font-size: 14px;
  line-height: 1.8;
}

.thesis-grid span:nth-child(2) {
  background: #f7f9ff;
}

.thesis-grid span:nth-child(4) strong {
  color: var(--blue);
}

.script-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 52px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.script-list article {
  min-height: 340px;
  padding: 28px 26px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.script-list span {
  color: #858a94;
  font-size: 9px;
  letter-spacing: .17em;
}

.script-list h3 {
  margin: 34px 0 22px;
  font-family: var(--serif);
  font-size: clamp(30px, 2.6vw, 46px);
  line-height: 1.12;
}

.script-list p {
  margin: 0;
  color: #555b66;
  font-size: 15px;
  line-height: 1.9;
}

.script-list article:nth-child(3) {
  background: #f8f9fb;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  gap: 1px;
  margin-top: 54px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.work-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  cursor: zoom-in;
  font: inherit;
  text-align: left;
}

.work-card.wide {
  grid-column: span 2;
}

.work-card.tall {
  grid-row: span 2;
}

.work-card.banner {
  grid-column: span 2;
  background: var(--paper);
}

.work-card.banner img {
  object-fit: contain;
  object-position: center;
  padding: 18px;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease, filter .45s ease;
}

.work-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.72));
}

.work-card strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.work-card small {
  color: rgba(255,255,255,.82);
  font-size: 13px;
}

.work-card:hover img {
  transform: scale(1.035);
  filter: contrast(1.04);
}

.work-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  z-index: 2;
}

.award-layout {
  display: grid;
  grid-template-columns: minmax(420px, .82fr) minmax(420px, 1.18fr);
  gap: 52px;
  margin-top: 54px;
}

.award-list {
  border-top: 1px solid var(--line);
}

.award-list article {
  display: grid;
  gap: 10px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.award-list span {
  color: #111318;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.35;
}

.award-list p {
  margin: 0;
  color: #414752;
  font-size: 15px;
  line-height: 1.75;
}

.award-list strong {
  display: inline-block;
  min-width: 54px;
  margin-right: 14px;
  color: #858a94;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
}

.award-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-content: start;
}

.award-images img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #f8f9fb;
  padding: 10px;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 5vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.image-preview.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  background: rgba(255,255,255,.94);
  border: 0;
  cursor: zoom-out;
}

.preview-figure {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  max-width: min(1100px, 90vw);
  max-height: 88vh;
  margin: 0;
}

.preview-figure img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0,0,0,.12);
}

.preview-figure figcaption {
  color: #555b66;
  font-size: 13px;
  letter-spacing: .08em;
  text-align: center;
}

.calligraphy-close {
  display: grid;
  grid-template-columns: minmax(260px, .36fr) 1fr auto;
  align-items: center;
  gap: 34px;
  padding: 64px 5vw;
  border-bottom: 1px solid var(--line);
}

.calligraphy-close p {
  margin: 0;
  color: #858a94;
  font-size: 9px;
  letter-spacing: .22em;
}

.calligraphy-close h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(31px, 3.8vw, 58px);
  line-height: 1.2;
}

.calligraphy-close a {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  min-width: 180px;
  padding: 15px 22px;
  color: #fff;
  background: var(--ink);
}

.calligraphy-close svg {
  width: 20px;
}

.calligraphy-close a:hover {
  background: var(--blue);
}

@media (max-width: 1180px) {
  .calligraphy-hero {
    grid-template-columns: 1fr;
  }

  .hero-work {
    min-height: 640px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .thesis-grid,
  .script-list {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .award-layout {
    grid-template-columns: 1fr;
  }

  .calligraphy-close {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .calligraphy-body .site-header,
  .calligraphy-page,
  .calligraphy-hero,
  .calligraphy-hero-copy,
  .hero-work,
  .calligraphy-thesis,
  .practice-section,
  .gallery-section,
  .awards-section,
  .calligraphy-close {
    width: 100vw;
    max-width: 100vw;
  }

  .calligraphy-body .header-end {
    display: none;
  }

  .calligraphy-hero-copy {
    padding: 52px 20px 62px;
  }

  .back-link {
    margin-bottom: 34px;
  }

  .calligraphy-hero h1 {
    font-size: 92px;
  }

  .calligraphy-hero h2 {
    font-size: 39px;
  }

  .calligraphy-hero-copy > p {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    font-size: 18px;
    word-break: break-all;
  }

  .hero-work {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding: 38px 20px 46px;
    background: #f7f8fb;
  }

  .hero-work img {
    justify-self: center;
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    max-height: 520px;
    object-fit: contain;
  }

  .hero-work figcaption {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    font-size: 13px;
    word-break: break-all;
  }

  .calligraphy-thesis,
  .practice-section,
  .gallery-section,
  .awards-section {
    display: block;
  }

  .calligraphy-thesis .section-rail,
  .practice-section .section-rail,
  .gallery-section .section-rail,
  .awards-section .section-rail {
    display: none;
  }

  .calligraphy-thesis-body,
  .practice-body,
  .gallery-body,
  .awards-body {
    padding: 64px 20px;
  }

  .thesis-grid,
  .script-list {
    grid-template-columns: 1fr;
  }

  .script-list article {
    min-height: auto;
  }

  .work-grid {
    display: block;
    background: transparent;
    border: 0;
  }

  .work-card {
    display: block;
    height: 360px;
    margin-bottom: 1px;
    border: 1px solid var(--line);
  }

  .work-card.tall {
    height: 520px;
  }

  .work-card.banner {
    height: 260px;
  }

  .work-card.banner img {
    padding: 12px;
  }

  .award-list article {
    gap: 8px;
  }

  .award-images {
    grid-template-columns: 1fr;
  }

  .calligraphy-close {
    padding: 56px 20px;
  }
}
