:root {
  --paper: #f2ede2;
  --paper-deep: #e9e1d4;
  --paper-light: #faf7f0;
  --ink: #161512;
  --ink-soft: #312f2b;
  --cinnabar: #b72b20;
  --cinnabar-dark: #8f2119;
  --smoke: #766f65;
  --line: #d7cfc2;
  --line-dark: #b9ae9e;
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --shell: 1180px;
  --reading: 760px;
  --shadow: 0 24px 60px rgb(22 21 18 / 12%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 15% 4%, rgb(255 255 255 / 44%), transparent 25rem),
    linear-gradient(90deg, rgb(22 21 18 / 2%) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 88px 100%, auto;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
}

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

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

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--cinnabar);
  outline-offset: 4px;
}

::selection {
  background: var(--cinnabar);
  color: var(--paper-light);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0;
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1.25;
  text-wrap: balance;
}

p,
ul,
ol,
blockquote,
figure {
  margin-block-start: 0;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

main.shell {
  min-height: 62vh;
  padding-block: clamp(44px, 6vw, 84px) clamp(76px, 9vw, 132px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgb(242 237 226 / 18%);
  background: rgb(22 21 18 / 96%);
  color: var(--paper);
  box-shadow: 0 8px 26px rgb(22 21 18 / 11%);
  backdrop-filter: blur(14px);
}

.masthead {
  width: min(var(--shell), calc(100% - 48px));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
}

.brand {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper-light);
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-decoration: none;
}

.brand::before {
  content: "魔";
  width: 35px;
  height: 35px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  color: #d75a4d;
  font-size: 16px;
  line-height: 1;
  transform: rotate(-2deg);
}

.brand:hover {
  color: var(--paper-light);
}

.primary-nav {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1.8vw, 24px);
}

.primary-nav a {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding-inline: 4px;
  color: #ded6ca;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 6px;
  left: 4px;
  height: 2px;
  background: var(--cinnabar);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: #fff9ee;
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.78fr);
  align-items: center;
  gap: clamp(42px, 8vw, 112px);
  min-height: min(690px, calc(100vh - 120px));
  padding-block: clamp(34px, 5vw, 72px) clamp(74px, 8vw, 112px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, var(--cinnabar) 0 82px, var(--line) 82px 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-copy h1 {
  max-width: 10em;
  margin: 12px 0 24px;
  font-size: clamp(52px, 6.2vw, 88px);
  letter-spacing: 0.055em;
  line-height: 1.08;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  margin-right: 10px;
  display: inline-block;
  vertical-align: 0.35em;
  background: currentColor;
}

.lede {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--smoke);
  font-size: clamp(17px, 1.55vw, 20px);
  line-height: 1.9;
}

.hero-image,
img.hero-image {
  width: 100%;
  min-height: 520px;
  display: block;
  border: 1px solid var(--line-dark);
  background: var(--paper-deep);
  box-shadow: var(--shadow);
}

.hero-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 12px solid rgb(242 237 226 / 13%);
  box-shadow: inset 0 0 70px rgb(22 21 18 / 15%);
  pointer-events: none;
}

.hero-image img,
img.hero-image {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-light);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
  color: #fff;
  transform: translateY(-2px);
}

.button-row .button + .button {
  background: transparent;
  color: var(--ink);
}

.button-row .button + .button:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.section-heading {
  margin: clamp(72px, 9vw, 120px) 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  align-items: end;
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section-heading h2,
.section-heading > :is(h1, h2) {
  font-size: clamp(34px, 4.3vw, 58px);
}

.section-heading > p {
  max-width: 540px;
  margin-bottom: 2px;
  color: var(--smoke);
  line-height: 1.8;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 36px);
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line-dark);
  background: rgb(250 247 240 / 46%);
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  background: var(--paper-light);
  box-shadow: 0 18px 42px rgb(22 21 18 / 9%);
  transform: translateY(-3px);
}

.card-image,
img.card-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper-deep);
}

.card-image img,
img.card-image {
  height: 100%;
  object-fit: cover;
  transition: filter 240ms ease, transform 420ms ease;
}

.card:hover .card-image img,
.card:hover img.card-image {
  filter: contrast(1.04);
  transform: scale(1.025);
}

.card-copy {
  padding: 22px 22px 26px;
}

.card-copy .eyebrow {
  margin-bottom: 8px;
  font-size: 10px;
}

.card-title {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 900;
  line-height: 1.42;
  text-wrap: balance;
}

.card-title a {
  text-decoration: none;
}

.card-copy > p:last-child {
  margin-bottom: 0;
  color: var(--smoke);
  font-size: 15px;
  line-height: 1.75;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-block: 36px clamp(72px, 9vw, 118px);
  border: 1px solid var(--line);
  background: var(--line);
}

.pillar {
  position: relative;
  min-height: 240px;
  padding: 28px;
  background: var(--paper-light);
}

.pillar::before {
  content: counter(pillar, decimal-leading-zero);
  display: block;
  margin-bottom: 42px;
  color: var(--cinnabar);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.pillars {
  counter-reset: pillar;
}

.pillar {
  counter-increment: pillar;
}

.pillar h2,
.pillar h3 {
  margin-bottom: 10px;
  font-size: clamp(23px, 2.4vw, 30px);
}

.pillar p {
  margin-bottom: 0;
  color: var(--smoke);
}

.breadcrumb {
  max-width: var(--reading);
  margin: 0 auto 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  color: var(--smoke);
  font-size: 13px;
}

.breadcrumb a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.article-header {
  max-width: 940px;
  margin-inline: auto;
  padding-top: clamp(12px, 3vw, 34px);
  text-align: center;
}

.article-header .eyebrow::before {
  display: none;
}

.article-header h1 {
  margin: 12px auto 20px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.18;
}

.article-header .lede {
  margin-inline: auto;
}

.article-cover,
img.article-cover {
  width: min(1080px, 100%);
  display: block;
  aspect-ratio: 16 / 10;
  margin: clamp(34px, 5vw, 58px) auto;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  background: var(--paper-deep);
  box-shadow: var(--shadow);
}

.article-cover img,
img.article-cover {
  height: 100%;
  object-fit: cover;
}

.prose {
  width: min(var(--reading), 100%);
  margin-inline: auto;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.95;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose figure,
.prose pre,
.prose table {
  margin-bottom: 1.5em;
}

.prose h2 {
  margin: 2.25em 0 0.7em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.4;
}

.prose h3 {
  margin: 1.9em 0 0.65em;
  color: var(--ink);
  font-size: clamp(23px, 2.5vw, 28px);
}

.prose :is(ul, ol) {
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.55em;
  padding-left: 0.25em;
}

.prose li::marker {
  color: var(--cinnabar);
  font-weight: 800;
}

.prose blockquote {
  margin-inline: 0;
  padding: 22px 26px 22px 30px;
  border-left: 4px solid var(--cinnabar);
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.12em;
  font-weight: 700;
  line-height: 1.8;
}

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

.prose a {
  color: var(--cinnabar-dark);
  font-weight: 600;
}

.prose strong {
  color: var(--ink);
}

.prose img {
  width: 100%;
  height: auto;
  display: block;
  margin-block: 2em;
}

.prose hr {
  height: 1px;
  margin-block: 3em;
  border: 0;
  background: var(--line-dark);
}

.prose :is(pre, table) {
  max-width: 100%;
  overflow-x: auto;
}

.search-form {
  max-width: 760px;
  margin: 34px auto 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 2px solid var(--ink);
}

.search-form label {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--smoke);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.search-form input {
  min-width: 0;
  min-height: 52px;
  padding: 9px 12px 9px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
}

.search-form input::placeholder {
  color: #8f887e;
}

.search-form input:focus-visible {
  box-shadow: inset 0 -3px var(--cinnabar);
}

.search-form button {
  min-width: 92px;
  min-height: 52px;
  padding-inline: 18px;
  border: 0;
  background: var(--ink);
  color: var(--paper-light);
  font-weight: 800;
  cursor: pointer;
}

.search-form button:hover {
  background: var(--cinnabar);
}

.search-status {
  min-height: 28px;
  max-width: 760px;
  margin: 14px auto 32px;
  color: var(--smoke);
  font-size: 14px;
}

.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 5px solid var(--cinnabar);
  background:
    radial-gradient(circle at 85% 20%, rgb(183 43 32 / 20%), transparent 24rem),
    var(--ink);
  color: #d8d0c5;
}

.site-footer::after {
  content: "";
  position: absolute;
  right: -75px;
  bottom: -90px;
  width: 260px;
  aspect-ratio: 1;
  border: 1px solid rgb(242 237 226 / 10%);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgb(242 237 226 / 3%), 0 0 0 58px rgb(242 237 226 / 2%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  width: min(var(--shell), calc(100% - 48px));
  min-height: 220px;
  margin-inline: auto;
  padding-block: 52px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.2fr);
  align-items: start;
  gap: clamp(42px, 8vw, 120px);
}

.footer-inner h2,
.footer-inner h3 {
  margin-bottom: 12px;
  color: var(--paper-light);
}

.footer-inner p {
  max-width: 560px;
  margin-bottom: 0;
  color: #bcb3a7;
}

.footer-inner a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #e8e0d4;
}

.footer-inner a:hover {
  color: #ef776b;
}

@media (max-width: 900px) {
  .masthead {
    min-height: 70px;
    gap: 18px;
  }

  .primary-nav {
    gap: 7px;
  }

  .primary-nav a {
    font-size: 13px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.68fr);
    gap: 38px;
  }

  .hero-copy h1 {
    font-size: clamp(48px, 7vw, 66px);
  }

  .hero-image,
  img.hero-image {
    min-height: 440px;
  }

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

  .pillars .pillar:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .shell,
  main.shell,
  .masthead,
  .footer-inner {
    width: min(100% - 32px, var(--shell));
  }

  .site-header {
    position: relative;
  }

  .masthead {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 12px;
  }

  .brand {
    width: max-content;
    max-width: 100%;
    font-size: 18px;
  }

  .brand::before {
    width: 32px;
    height: 32px;
  }

  .primary-nav {
    width: calc(100% + 32px);
    margin-inline: -16px;
    padding-inline: 12px;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .primary-nav a {
    min-height: 48px;
    padding-inline: 7px;
    font-size: 14px;
  }

  main.shell {
    padding-block: 34px 82px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: 36px;
    padding-block: 20px 64px;
  }

  .hero-copy h1 {
    max-width: 9em;
    margin-block: 10px 19px;
    font-size: clamp(43px, 13.2vw, 58px);
    letter-spacing: 0.035em;
    line-height: 1.12;
  }

  .lede {
    font-size: 17px;
    line-height: 1.82;
  }

  .hero-image,
  img.hero-image {
    order: 2;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

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

  .button {
    min-height: 50px;
    padding-inline: 12px;
  }

  .section-heading {
    margin-top: 68px;
    display: block;
    padding-top: 18px;
  }

  .section-heading h2,
  .section-heading > :is(h1, h2) {
    font-size: 38px;
  }

  .section-heading > p {
    margin-top: 15px;
  }

  .cards,
  .pillars {
    grid-template-columns: 1fr;
  }

  .pillars .pillar:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .card-copy {
    padding: 20px 18px 24px;
  }

  .card-title {
    font-size: 25px;
  }

  .pillar {
    min-height: 190px;
    padding: 24px;
  }

  .pillar::before {
    margin-bottom: 28px;
  }

  .article-header {
    text-align: left;
  }

  .article-header .eyebrow::before {
    display: inline-block;
  }

  .article-header h1 {
    margin-block: 9px 18px;
    font-size: clamp(39px, 11.8vw, 52px);
    line-height: 1.23;
  }

  .article-cover,
  img.article-cover {
    aspect-ratio: 4 / 5;
    margin-block: 30px 38px;
  }

  .prose {
    font-size: 17px;
    line-height: 1.9;
  }

  .prose h2 {
    font-size: 28px;
  }

  .prose h3 {
    font-size: 23px;
  }

  .prose blockquote {
    padding: 19px 18px 19px 21px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .search-form button {
    min-width: 84px;
    padding-inline: 10px;
  }

  .footer-inner {
    min-height: 0;
    padding-block: 46px 60px;
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 390px) {
  .hero-copy h1 {
    font-size: 43px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .button-row .button {
    width: 100%;
  }

  .section-heading h2,
  .section-heading > :is(h1, h2) {
    font-size: 35px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .search-form button {
    min-width: 76px;
  }
}

@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;
  }
}

@media print {
  .site-header,
  .site-footer,
  .button-row,
  .search-form,
  .search-status {
    display: none !important;
  }

  body {
    background: #fff;
  }

  main.shell,
  .shell,
  .prose {
    width: 100%;
    max-width: none;
  }

  a {
    color: inherit;
  }
}

/* Match the static templates' image and form structure. */
figure {
  margin: 0;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(calc(-100% - 8px));
  background: var(--ink);
  color: var(--paper-light);
}

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

.hero-image figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 5px 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}

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

.pillar {
  display: block;
  min-height: 0;
  padding: 0;
  text-decoration: none;
}

.pillar::before {
  content: none;
}

.pillar > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 5;
  object-fit: cover;
}

.pillar > span {
  display: block;
  padding: 16px;
}

.pillar strong,
.pillar small {
  display: block;
}

.pillar strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.35;
}

.pillar small {
  margin-top: 6px;
  color: var(--smoke);
  font-size: 14px;
}

.search-form > div {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
}

.card[hidden] {
  display: none;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}

@media (max-width: 900px) {
  .pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .primary-nav {
    width: 100%;
    margin: 0;
    padding: 0 0 6px;
    flex-wrap: wrap;
    gap: 0 8px;
    overflow: visible;
  }

  .primary-nav a {
    min-height: 44px;
    padding-inline: 4px;
    font-size: 13px;
  }

  .hero-image {
    aspect-ratio: 5 / 4;
  }

  .pillar > span {
    padding: 12px;
  }
}
