:root {
  --bg: #f4ead7;
  --paper: rgba(255, 251, 239, 0.9);
  --ink: #2c2419;
  --muted: rgba(44, 36, 25, 0.68);
  --line: rgba(138, 105, 52, 0.22);
  --gold: #a97d2c;
  --primary: #183a95;
  --secondary: #d6b16d;
  --support: #8f4b25;
  --primary-ink: #1e2d5f;
  --primary-skin: url("/assets/masks/shujinkou/完遂者.png");
  --support-image: url("/assets/masks/shujinkou/完遂者.png");
  --shadow: 0 24px 70px rgba(83, 58, 28, 0.16);
}

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

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.75;
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--primary), white 72%), transparent 30%),
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--support), white 75%), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 239, 0.92), rgba(238, 224, 196, 0.86)),
    var(--primary-skin),
    var(--bg);
  background-size: cover, cover, cover, 720px 720px, auto;
  background-attachment: fixed;
}

button {
  font: inherit;
}

.protagonist-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 251, 239, 0.94), rgba(255, 251, 239, 0.72)),
    var(--primary-skin);
  background-size: cover, 560px 560px;
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif JP", "M PLUS Rounded 1c", serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(151, 120, 67, 0.26);
  border-radius: 999px;
  color: rgba(44, 36, 25, 0.72);
  background: rgba(255, 251, 239, 0.54);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.site-nav a.is-current {
  color: #21190e;
  background: linear-gradient(135deg, #f0cf79, #fff4bd);
}

main {
  width: min(1440px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.hero {
  min-height: min(720px, calc(100vh - 132px));
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 0.86fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 5vw, 72px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(100deg, rgba(255, 251, 239, 0.94), rgba(255, 251, 239, 0.72), rgba(255, 251, 239, 0.5)),
    var(--primary-skin);
  background-size: cover, min(980px, 110vw);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    var(--support-image),
    linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 78%), transparent 46%);
  background-repeat: no-repeat;
  background-position: right -4% center, center;
  background-size: min(540px, 40vw), auto;
  opacity: 0.18;
  filter: saturate(0.85);
}

.hero-copy {
  min-width: 0;
  width: 100%;
  max-width: 720px;
}

.hero-copy h2 {
  margin-bottom: 20px;
  color: #2b2116;
  font-size: clamp(42px, 6.2vw, 90px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  line-break: strict;
}

.hero-copy p:last-child {
  max-width: 60ch;
  margin: 0;
  color: rgba(44, 36, 25, 0.72);
  font-size: clamp(15px, 1.55vw, 18px);
  font-weight: 700;
}

.hero-stage {
  min-height: 520px;
  position: relative;
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: 12% 7% 10%;
  border: 1px solid rgba(151, 120, 67, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 251, 239, 0.66), rgba(255, 251, 239, 0.22)),
    var(--primary-skin);
  background-size: cover, 560px 560px;
  box-shadow: 0 28px 66px rgba(83, 58, 28, 0.16);
}

.hero-main-mask,
.hero-source-mask,
.hero-support-mask {
  position: absolute;
  display: block;
  object-fit: contain;
  background: rgba(255, 251, 239, 0.72);
  border: 1px solid rgba(151, 120, 67, 0.18);
  box-shadow: 0 22px 54px rgba(83, 58, 28, 0.2);
}

.hero-main-mask {
  width: 64%;
  aspect-ratio: 1 / 1;
  left: 18%;
  top: 4%;
  z-index: 3;
}

.hero-source-mask,
.hero-support-mask {
  width: 34%;
  aspect-ratio: 1 / 1;
  bottom: 3%;
  z-index: 2;
  opacity: 0.9;
}

.hero-primary-mask {
  left: 2%;
}

.hero-support-mask {
  right: 2%;
}

.hero-line {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 52%;
  height: 2px;
  z-index: 1;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  transform: rotate(-12deg);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.mask-menu,
.detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 251, 239, 0.9), rgba(255, 251, 239, 0.64)),
    var(--primary-skin);
  background-size: cover, 540px 540px;
  box-shadow: var(--shadow);
}

.mask-menu {
  overflow: hidden;
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.menu-head span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-head strong {
  font-size: 20px;
}

#maskList,
.mask-list {
  display: flex;
  gap: 6px;
  margin: 10px;
  padding: 10px;
  max-width: calc(100% - 20px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  border: 1px solid rgba(151, 120, 67, 0.18);
  border-radius: 8px;
  background: rgba(255, 251, 239, 0.62);
  scrollbar-color: color-mix(in srgb, var(--primary), transparent 34%) rgba(151, 120, 67, 0.12);
  scrollbar-width: thin;
}

#maskList::-webkit-scrollbar,
.mask-list::-webkit-scrollbar {
  height: 10px;
}

#maskList::-webkit-scrollbar-track,
.mask-list::-webkit-scrollbar-track {
  background: rgba(151, 120, 67, 0.12);
  border-radius: 999px;
}

#maskList::-webkit-scrollbar-thumb,
.mask-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 251, 239, 0.8);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), var(--gold) 28%);
}

.mask-row {
  flex: 0 0 clamp(220px, 24vw, 330px);
  width: clamp(220px, 24vw, 330px);
  display: grid;
  gap: 2px;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mask-row:hover,
.mask-row.is-active {
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 86%), rgba(255, 251, 239, 0.58));
}

.mask-row span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mask-row strong {
  font-family: "Noto Serif JP", serif;
  font-size: 20px;
  line-height: 1.25;
}

.mask-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail {
  padding: clamp(20px, 4vw, 42px);
  overflow: hidden;
  position: relative;
}

.detail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    var(--support-image),
    radial-gradient(circle at 84% 12%, color-mix(in srgb, var(--support), transparent 76%), transparent 28%);
  background-repeat: no-repeat;
  background-position: right -4% top 12%, center;
  background-size: min(460px, 38vw), auto;
  opacity: 0.12;
}

.detail-head,
.mask-composition,
.essence-grid,
.signature-line,
.climax {
  position: relative;
}

.detail-head h2 {
  color: #2b2116;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.05;
}

.story-structure {
  max-width: 72ch;
  margin: 18px 0 0;
  color: rgba(44, 36, 25, 0.72);
  font-size: 18px;
  font-weight: 700;
}

.mask-composition {
  display: grid;
  grid-template-columns: minmax(240px, 1.26fr) minmax(180px, 0.82fr) minmax(180px, 0.82fr);
  gap: 14px;
  align-items: stretch;
  margin: 26px 0;
}

.component-mask {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(151, 120, 67, 0.2);
  background: rgba(255, 251, 239, 0.58);
}

.component-mask span,
.essence-grid span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.component-mask img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: rgba(255, 251, 239, 0.64);
  border: 1px solid rgba(151, 120, 67, 0.18);
}

.protagonist-card {
  grid-row: span 1;
}

.protagonist-card img {
  min-height: 320px;
}

.component-mask strong {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.2;
}

.component-mask strong a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(151, 120, 67, 0.54);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.component-mask strong a:hover,
.component-mask strong a:focus-visible {
  color: var(--primary);
  text-decoration-color: currentColor;
}

.component-mask strong a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.functional-blessing {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(151, 120, 67, 0.18);
  color: rgba(44, 36, 25, 0.74);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.composition-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2b2116;
  background: linear-gradient(135deg, var(--secondary), #fff2b8);
  font-size: 26px;
  font-weight: 800;
}

.essence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(151, 120, 67, 0.18);
  background: rgba(151, 120, 67, 0.18);
}

.essence-grid article {
  min-height: 164px;
  padding: 18px;
  background: rgba(255, 251, 239, 0.7);
}

.essence-grid p {
  margin: 10px 0 0;
  color: rgba(44, 36, 25, 0.74);
  font-weight: 700;
}

.signature-line {
  margin: 26px 0;
  padding: 22px 26px;
  border-left: 5px solid var(--secondary);
  color: #2b2116;
  background:
    linear-gradient(90deg, rgba(255, 251, 239, 0.82), rgba(255, 251, 239, 0.52)),
    var(--primary-skin);
  background-size: cover, 520px 520px;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.45;
}

.climax {
  padding: 24px;
  border: 1px solid rgba(151, 120, 67, 0.2);
  background: rgba(255, 251, 239, 0.62);
}

.climax p:last-child {
  margin: 0;
  color: rgba(44, 36, 25, 0.76);
  font-size: 16px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .protagonist-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 440px;
  }

  .mask-menu {
    position: static;
    max-height: none;
  }

  #maskList {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
}

@media (max-width: 620px) {
  main {
    width: calc(100% - 18px);
    margin-top: 14px;
  }

  .hero {
    min-height: auto;
    padding: 20px;
  }

  .hero-copy h2 {
    font-size: 34px;
    line-height: 1.16;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
  }

  .hero-copy p:last-child {
    font-size: 15px;
  }

  .hero-stage {
    min-height: 360px;
  }

  .hero-main-mask {
    width: 70%;
    left: 15%;
  }

  .hero-source-mask,
  .hero-support-mask {
    width: 40%;
    bottom: 4%;
  }

  #maskList,
  .mask-composition,
  .essence-grid {
    grid-template-columns: 1fr;
  }

  #maskList {
    display: flex;
    max-height: none;
  }

  .mask-row {
    flex-basis: min(78vw, 280px);
    width: min(78vw, 280px);
  }

  .composition-mark {
    margin: 0 auto;
  }
}
