
/* ==========================================
   TBPOST CHARACTER
   RETRO LUXURY / EDITORIAL DESIGN
========================================== */

/* FONTS */

@font-face {
  font-family: "Lobster";
  src: url("./fonts/Lobster-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NewClearMincho";
  src: url("./fonts/NewClear-mincho.ttf") format("truetype");
  font-display: swap;
}

/* COLORS */

:root {
  --blue: #0644e8;
  --deep-blue: #092d9b;
  --red: #db3528;
  --ivory: #faf8ef;
  --white: #fff;
  --ink: #252b3c;
  --line: #d8d9d4;
}

/* ==========================================
   BASE
========================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Lobster", "NewClearMincho", serif;
  background: var(--ivory);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

/* 印刷物のようなノイズ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background-image: radial-gradient(
    rgba(75, 48, 30, .16) .45px,
    transparent .7px
  );
  background-size: 5px 5px;
  opacity: .1;
}

/* 背景の巨大文字 */

body::after {
  content: "CHARACTER";
  position: fixed;
  right: 2vw;
  bottom: -3vw;
  z-index: -1;
  font-family: "Lobster", cursive;
  font-size: 15vw;
  line-height: 1;
  color: rgba(6, 68, 232, .035);
  pointer-events: none;
}

::selection {
  background: var(--blue);
  color: white;
}

/* ==========================================
   MAIN VISUAL
========================================== */

.main-visual {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 80px 30px;
  background: var(--ivory);
  border-bottom: 1px solid var(--blue);
}

/* 装飾ラベル */

.main-visual::before {
  content: "TBPOST / CHARACTERS";
  position: absolute;
  top: 25px;
  left: 3vw;
  font-family: "Lobster", cursive;
  font-size: 12px;
  color: var(--red);
}

/* メイン画像 */

.main-visual img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: contain;

  padding: 8px;
  background: white;
  border: 1px solid var(--blue);
  box-shadow: 14px 14px 0 var(--blue);
}

/* ==========================================
   MAIN CONTENT
========================================== */

main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 100px 40px;
}

/* ==========================================
   CHARACTER GRID
========================================== */

.character-section {
  position: relative;
  display: grid;
  gap: 30px;
  padding: 65px 0 110px;
}

/* メインキャラクター */

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

/* サブキャラクター */

.small-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1100px;
  margin: 0 auto;
}

/* セクションラベル */

.large-grid::before {
  content: "Main Characters";
}

.small-grid::before {
  content: "Other Characters";
}

.large-grid::before,
.small-grid::before {
  position: absolute;
  top: 10px;
  left: 0;

  font-family: "Lobster", cursive;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--blue);
}

/* ==========================================
   CHARACTER CARD
========================================== */

.character {
  position: relative;
  min-width: 0;
  padding: 12px 12px 22px;

  background: #fffdf8;
  border: 1px solid var(--blue);

  cursor: pointer;

  transition:
    transform .4s cubic-bezier(.16, 1, .3, 1),
    border-color .4s,
    box-shadow .4s;
}

.character img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;

  filter: saturate(.88) contrast(1.04);

  transition:
    filter .4s,
    transform .4s;
}

/* ホバー */

.character:hover {
  transform: translateY(-7px);
  border-color: var(--red);
  box-shadow: 8px 8px 0 rgba(6, 68, 232, .16);
}

.character:hover img {
  filter: saturate(1.12) contrast(1.05);
}

/* 赤い装飾 */

.character::after {
  content: "✳";
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 2;

  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--red);

  transition: color .3s;
}

.character:hover::after {
  color: var(--blue);
}

/* ==========================================
   MODAL
========================================== */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;

  justify-content: center;
  align-items: center;

  padding: 40px;
  background: rgba(250, 248, 239, .94);
  backdrop-filter: blur(15px);

  animation: fadeIn .3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  display: block;
  width: auto;
  max-width: min(500px, 90%);
  max-height: 80vh;
  max-height: 80dvh;
  object-fit: contain;

  padding: 12px;
  background: white;
  border: 1px solid var(--blue);
  box-shadow: 14px 14px 0 var(--blue);

  animation: slideUp .4s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* モーダル背景の装飾 */

.modal::before {
  content: "TBPOST / CHARACTER ARCHIVE";
  position: absolute;
  left: 3vw;
  bottom: 3vw;

  font-family: "Lobster", cursive;
  font-size: clamp(1.5rem, 4vw, 4rem);
  color: rgba(6, 68, 232, .08);

  pointer-events: none;
}

/* 閉じるボタン */

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  z-index: 510;

  color: var(--blue);
  font-family: "Lobster", cursive;
  font-size: 3rem;
  font-weight: 400;
  line-height: 1;

  cursor: pointer;
  transition: color .3s, transform .3s;
}

.close:hover {
  color: var(--red);
  transform: rotate(90deg);
}

/* ==========================================
   HOME BUTTON
========================================== */

.home-btn {
  margin: 40px 0 100px;
  text-align: center;
}

.home-btn a {
  display: inline-block;
  padding: 18px 60px;

  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);

  font-family: "Lobster", "NewClearMincho", serif;
  font-size: 1.15rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-decoration: none;

  transition: background .3s, color .3s;
}

.home-btn a:hover {
  background: var(--blue);
  color: white;
}

/* 矢印なし */

.home-btn a::after {
  content: none;
}

/* ==========================================
   FOOTER
========================================== */

footer {
  padding: 50px 20px;
  background: var(--blue);
  border-top: 4px double var(--ivory);
  color: white;

  font-family: "Lobster", "NewClearMincho", serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-align: center;
}

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

@media (max-width: 900px) {

  main {
    padding: 60px 20px;
  }

  .main-visual {
    padding: 70px 30px 80px;
  }

  .main-visual img {
    max-width: calc(100% - 14px);
    box-shadow: 10px 10px 0 var(--blue);
  }

  .character-section {
    gap: 20px;
    padding: 60px 0 90px;
  }

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

  .large-grid::before,
  .small-grid::before {
    font-size: 1.3rem;
  }

  .modal {
    padding: 20px;
  }

  .modal-content {
    max-width: 88%;
    max-height: 75vh;
    box-shadow: 8px 8px 0 var(--blue);
  }

  .close {
    top: 20px;
    right: 25px;
    font-size: 2.5rem;
  }

}

@media (max-width: 600px) {

  .main-visual {
    padding: 65px 25px 70px;
  }

  .character-section {
    gap: 14px;
    padding-bottom: 70px;
  }

  .character {
    padding: 8px 8px 16px;
  }

  .large-grid::before,
  .small-grid::before {
    font-size: 1.2rem;
  }

  .home-btn {
    margin: 30px 0 100px;
  }

  .home-btn a {
    padding: 15px 50px;
  }

  footer {
    padding: 40px 20px;
  }

}

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }

}
