* {
  box-sizing: border-box;
}

:root {
  color: #13245c;
  background: #f7faff;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: #f7faff;
  background-image:
    linear-gradient(rgba(74, 118, 220, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 118, 220, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
}

a {
  color: inherit;
}

.home {
  width: min(1440px, calc(100% - 48px));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid rgba(19, 36, 92, 0.2);
}

.home-header__logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.home-header__identity {
  margin: 0;
  color: rgba(19, 36, 92, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.home-layout {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.65fr)
    minmax(460px, 1.7fr)
    minmax(240px, 0.8fr);
  gap: clamp(32px, 4vw, 72px);
  padding: clamp(48px, 6vw, 96px) 0 120px;
}

.home-character {
  min-width: 0;
}

.home-character__placeholder {
  position: sticky;
  top: 104px;
  display: grid;
  width: 100%;
  min-height: 480px;
  place-items: center;
  border: 1px solid rgba(19, 36, 92, 0.18);
  background: rgba(255, 255, 255, 0.45);
  color: rgba(19, 36, 92, 0.35);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.home-main {
  min-width: 0;
}

.home-title {
  margin-bottom: 72px;
}

.home-title__system {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.home-title h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.25rem, 6vw, 7.25rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.home-title__description {
  max-width: 580px;
  margin: 32px 0 0;
  color: rgba(19, 36, 92, 0.72);
  font-size: 0.95rem;
  line-height: 2;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading__label,
.section-heading__status {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.section-heading__status {
  color: rgba(19, 36, 92, 0.5);
}

.current-feature {
  margin-bottom: 32px;
}

.current-feature__content {
  border: 1px solid rgba(19, 36, 92, 0.24);
  background: rgba(255, 255, 255, 0.72);
}

.current-feature__visual {
  display: grid;
  min-height: 340px;
  place-items: center;
  border-bottom: 1px solid rgba(19, 36, 92, 0.18);
  background:
    linear-gradient(
      135deg,
      rgba(74, 118, 220, 0.08),
      rgba(255, 255, 255, 0.8)
    );
  color: rgba(19, 36, 92, 0.32);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
}

.current-feature__body {
  padding: clamp(24px, 4vw, 44px);
}

.current-feature__category {
  margin: 0 0 12px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.current-feature__body h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.current-feature__body p:last-child {
  max-width: 620px;
  margin: 24px 0 0;
  font-size: 0.9rem;
  line-height: 1.9;
}

.enter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 116px;
  padding: 24px clamp(24px, 4vw, 44px);
  border: 1px solid #3567d8;
  background: #3567d8;
  color: #ffffff;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.enter-link:hover,
.enter-link:focus-visible {
  background: #ffffff;
  color: #13245c;
}

.enter-link__label {
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.enter-link__description {
  max-width: 240px;
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: right;
}

.control-panel {
  min-width: 0;
}

.control-panel__navigation {
  display: grid;
  gap: 12px;
}

.control-card {
  display: block;
  padding: 20px;
  border: 1px solid rgba(19, 36, 92, 0.22);
  background: rgba(255, 255, 255, 0.52);
  text-decoration: none;
  transition:
    border-color 180ms ease,
    background-color 180ms ease;
}

.control-card:hover,
.control-card:focus-visible {
  border-color: #3567d8;
  background: #ffffff;
}

.control-card__label,
.control-card__description {
  display: block;
}

.control-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.control-card__description {
  margin-top: 8px;
  color: rgba(19, 36, 92, 0.62);
  font-size: 0.76rem;
  line-height: 1.65;
}

.system-status {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(19, 36, 92, 0.2);
}

.system-status__label {
  margin: 0 0 16px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.system-status__list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.system-status__list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.system-status__list dt,
.system-status__list dd {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.system-status__list dd {
  color: #3567d8;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 28px max(24px, calc((100% - 1440px) / 2));
  border-top: 1px solid rgba(19, 36, 92, 0.18);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration: none;
}

@media (max-width: 1050px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr);
  }

  .home-character {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    background-size: 24px 24px;
  }

  .home {
    width: min(100% - 32px, 1440px);
  }

  .home-header {
    min-height: 64px;
  }

  .home-header__identity {
    font-size: 0.66rem;
  }

  .home-layout {
    display: flex;
    flex-direction: column;
    gap: 56px;
    padding: 48px 0 80px;
  }

  .home-main {
    display: contents;
  }

  .home-title {
    order: 1;
    margin-bottom: 0;
  }

  .current-feature {
    order: 2;
    margin-bottom: 0;
  }

  .enter-link {
    order: 3;
  }

  .control-panel {
    order: 4;
  }

  .home-title h1 {
    font-size: clamp(3rem, 14vw, 5.4rem);
  }

  .home-title__description {
    margin-top: 24px;
  }

  .current-feature__visual {
    min-height: 260px;
  }

  .enter-link {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .enter-link__description {
    max-width: none;
    text-align: left;
  }

  .site-footer {
    padding: 24px 16px;
  }
}

/* ========================================================
   Current Feature priority adjustment
   ======================================================== */

.home-layout {
  align-items: start;
  padding-top: clamp(42px, 5vw, 72px);
}

.home-title {
  margin-bottom: 48px;
}

.home-title h1 {
  max-width: 700px;
  font-size: clamp(2.7rem, 4.8vw, 5.8rem);
  line-height: 1;
}

.home-title__description {
  max-width: 620px;
  margin-top: 24px;
}

.current-feature__content {
  overflow: hidden;
}

.current-feature__visual {
  display: block;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ffffff;
  text-decoration: none;
}

.current-feature__visual--empty {
  display: grid;
  place-items: center;
}

.current-feature__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.current-feature__visual:hover .current-feature__image,
.current-feature__visual:focus-visible .current-feature__image {
  transform: scale(1.015);
}

.current-feature__body {
  padding: clamp(22px, 3vw, 36px);
}

.current-feature__metadata {
  margin: 14px 0 0;
  color: rgba(19, 36, 92, 0.58);
  font-size: 0.72rem;
  line-height: 1.7;
}

.current-feature__description {
  max-width: 620px;
  margin: 20px 0 0;
  font-size: 0.88rem;
  line-height: 1.9;
}

.current-feature__detail-link {
  display: inline-flex;
  margin-top: 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.enter-link {
  position: relative;
  min-height: 104px;
  overflow: hidden;
}

.enter-link__arrow {
  font-size: 1.8rem;
  transition: transform 180ms ease;
}

.enter-link:hover .enter-link__arrow,
.enter-link:focus-visible .enter-link__arrow {
  transform: translateX(8px);
}

@media (max-width: 720px) {
  .home-title h1 {
    font-size: clamp(2.8rem, 13vw, 4.8rem);
  }

  .current-feature__visual {
    aspect-ratio: 4 / 3;
  }

  .enter-link__arrow {
    position: absolute;
    right: 24px;
    bottom: 20px;
  }
}

/* ========================================================
   Home balance refinement
   ======================================================== */

.home-layout {
  grid-template-columns:
    minmax(150px, 0.56fr)
    minmax(560px, 1.72fr)
    minmax(250px, 0.82fr);
  gap: clamp(28px, 3.5vw, 60px);
}

.home-title {
  margin-bottom: 36px;
}

.home-title h1 {
  max-width: none;
  font-size: clamp(2.55rem, 4.25vw, 5.1rem);
  letter-spacing: -0.065em;
  line-height: 1.02;
  word-break: keep-all;
  overflow-wrap: normal;
}

.home-title__description {
  margin-top: 20px;
  line-height: 1.85;
}

.current-feature {
  margin-bottom: 24px;
}

.current-feature__visual {
  display: grid;
  aspect-ratio: auto;
  min-height: 320px;
  max-height: 560px;
  place-items: center;
  background:
    linear-gradient(
      135deg,
      rgba(74, 118, 220, 0.05),
      rgba(255, 255, 255, 0.92)
    );
}

.current-feature__image {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

.enter-link {
  min-height: 92px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.enter-link__label {
  font-size: clamp(1.5rem, 2.5vw, 2.45rem);
}

@media (max-width: 1250px) {
  .home-layout {
    grid-template-columns:
      minmax(130px, 0.42fr)
      minmax(500px, 1.58fr)
      minmax(230px, 0.72fr);
    gap: 30px;
  }

  .home-title h1 {
    font-size: clamp(2.45rem, 4vw, 4.6rem);
  }
}

@media (max-width: 1050px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  }

  .home-title h1 {
    font-size: clamp(2.8rem, 6vw, 4.8rem);
  }
}

@media (max-width: 720px) {
  .home-title {
    margin-bottom: 0;
  }

  .home-title h1 {
    font-size: clamp(2.65rem, 12vw, 4.5rem);
    line-height: 1.04;
  }

  .current-feature__visual {
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .current-feature__image {
    max-height: none;
  }

  .enter-link {
    min-height: 96px;
  }
}

/* ========================================================
   Compact desktop feature layout
   ======================================================== */

@media (min-width: 721px) {
  .current-feature__content {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
    min-height: 360px;
  }

  .current-feature__visual {
    min-height: 360px;
    max-height: 440px;
    border-right: 1px solid rgba(19, 36, 92, 0.18);
    border-bottom: 0;
  }

  .current-feature__image {
    width: 100%;
    height: 100%;
    max-height: 440px;
    object-fit: contain;
  }

  .current-feature__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  .current-feature__body h2 {
    font-size: clamp(1.55rem, 2.3vw, 2.55rem);
  }

  .current-feature__description {
    margin-top: 18px;
  }

  .current-feature__detail-link {
    align-self: flex-start;
  }
}

@media (max-width: 1050px) and (min-width: 721px) {
  .current-feature__content {
    grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr);
  }

  .current-feature__visual {
    min-height: 320px;
  }
}

/* ========================================================
   Home character artwork
   ======================================================== */

.home-character {
  align-self: stretch;
  min-width: 0;
}

.home-character__frame {
  position: sticky;
  top: 96px;
  display: flex;
  min-height: 580px;
  margin: 0;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(19, 36, 92, 0.18);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.3),
      rgba(255, 255, 255, 0.68)
    );
  isolation: isolate;
}

.home-character__image {
  display: block;
  width: 148%;
  max-width: none;
  height: auto;
  margin-left: -18%;
  margin-bottom: -2%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 18px 24px rgba(19, 36, 92, 0.08));
}

.home-character__caption {
  position: absolute;
  left: 14px;
  bottom: 18px;
  z-index: 2;
  color: rgba(19, 36, 92, 0.45);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  writing-mode: vertical-rl;
}

@media (max-width: 1250px) and (min-width: 1051px) {
  .home-character__frame {
    min-height: 540px;
  }

  .home-character__image {
    width: 162%;
    margin-left: -25%;
  }
}

/* ========================================================
   Mobile entrance refinement
   ======================================================== */

@media (max-width: 720px) {
  .home-header {
    min-height: 58px;
  }

  .home-header__logo {
    font-size: 0.9rem;
  }

  .home-header__identity {
    max-width: 46%;
    font-size: 0.62rem;
    line-height: 1.45;
    text-align: right;
  }

  .home-layout {
    gap: 42px;
    padding-top: 36px;
  }

  .home-title__system {
    margin-bottom: 12px;
    font-size: 0.65rem;
  }

  .home-title h1 {
    max-width: 100%;
    font-size: clamp(2.25rem, 10.5vw, 3.6rem);
    letter-spacing: -0.055em;
    line-height: 1.08;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .home-title__description {
    margin-top: 18px;
    font-size: 0.84rem;
    line-height: 1.85;
  }

  .current-feature__content {
    display: block;
  }

  .current-feature__visual {
    display: grid;
    width: 100%;
    height: clamp(300px, 105vw, 440px);
    min-height: 0;
    max-height: 440px;
    place-items: center;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(19, 36, 92, 0.18);
    background:
      linear-gradient(
        135deg,
        rgba(74, 118, 220, 0.05),
        rgba(255, 255, 255, 0.92)
      );
  }

  .current-feature__image {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
  }

  .current-feature__body {
    padding: 24px 22px 28px;
  }

  .current-feature__body h2 {
    font-size: clamp(1.55rem, 7.5vw, 2.15rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .current-feature__metadata {
    font-size: 0.68rem;
  }

  .current-feature__description {
    font-size: 0.82rem;
    line-height: 1.85;
  }

  .enter-link {
    width: 100%;
    min-height: 136px;
    padding: 26px 24px;
  }

  .enter-link__label {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .enter-link__description {
    max-width: calc(100% - 44px);
    font-size: 0.78rem;
  }

  /*
   CONTROL PANELの外枠をレイアウト上だけ解除し、
   内部要素とキャラクター、SYSTEM STATUSへ個別に順序を設定する。
  */
  .control-panel {
    display: contents;
  }

  .control-panel > .section-heading {
    order: 4;
    margin-bottom: -26px;
  }

  .control-panel__navigation {
    order: 4;
  }

  .home-character {
    display: block;
    order: 5;
    width: 100%;
  }

  .home-character__frame {
    position: relative;
    top: auto;
    width: min(82%, 340px);
    min-height: 420px;
    margin: 0 auto;
  }

  .home-character__image {
    width: 138%;
    margin-left: -15%;
    margin-bottom: -3%;
  }

  .home-character__caption {
    left: 12px;
    bottom: 16px;
  }

  .system-status {
    order: 6;
    width: 100%;
    margin-top: 0;
    padding-top: 24px;
  }
}

@media (max-width: 420px) {
  .home {
    width: min(100% - 28px, 1440px);
  }

  .home-title h1 {
    font-size: clamp(2.15rem, 10vw, 3.15rem);
  }

  .current-feature__visual {
    height: clamp(280px, 100vw, 390px);
  }

  .control-card {
    padding: 24px 22px;
  }

  .home-character__frame {
    width: min(86%, 320px);
    min-height: 390px;
  }
}


/* ========================================================
   Design Philosophy hero refinement
   ======================================================== */

.home-title__subtitle {
  max-width: 580px;
  margin: 18px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.7;
}

.home-title__description {
  margin-top: 18px;
}

/*
  スマートフォンではキャラクターを独立したコンテンツとして
  並べず、Heroの背後に存在する世界観要素として扱う。
*/
@media (max-width: 720px) {
  .home-layout {
    position: relative;
    isolation: isolate;
  }

  .home-title {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: clamp(260px, 78vw, 360px);
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }

  .home-title__system,
  .home-title h1,
  .home-title__subtitle,
  .home-title__description {
    position: relative;
    z-index: 2;
  }

  .home-title h1 {
    font-size: clamp(2.9rem, 14vw, 4.8rem);
    word-break: normal;
    overflow-wrap: normal;
  }

  .home-title__subtitle {
    max-width: 72%;
    margin-top: 14px;
    font-size: 0.67rem;
    letter-spacing: 0.12em;
  }

  .home-title__description {
    max-width: 62%;
    margin-top: 16px;
    font-size: 0.78rem;
    line-height: 1.8;
  }

  .home-character {
    position: absolute;
    top: 12px;
    right: -34px;
    z-index: 0;
    display: block;
    width: min(68vw, 300px);
    height: clamp(250px, 76vw, 350px);
    opacity: 0.16;
    pointer-events: none;
  }

  .home-character__frame {
    position: static;
    width: 100%;
    min-height: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
  }

  .home-character__image {
    width: 145%;
    max-width: none;
    height: auto;
    margin: 0 0 -4% -28%;
    filter: none;
  }

  .home-character__caption {
    display: none;
  }
}

@media (max-width: 420px) {
  .home-title {
    min-height: clamp(245px, 82vw, 330px);
  }

  .home-title h1 {
    font-size: clamp(2.65rem, 13.5vw, 4rem);
  }

  .home-character {
    top: 8px;
    right: -46px;
    width: min(72vw, 280px);
  }
}

/* ========================================================
   Mobile hero final polish
   ======================================================== */

@media (max-width: 720px) {
  .home-layout {
    gap: 30px;
  }

  .home-title {
    min-height: clamp(220px, 66vw, 300px);
    justify-content: center;
  }

  .home-title__subtitle {
    max-width: 68%;
  }

  .home-title__description {
    max-width: 58%;
  }

  .home-character {
    top: 18px;
    right: -20px;
    width: min(66vw, 290px);
    height: clamp(220px, 65vw, 300px);
    opacity: 0.2;
  }

  .home-character__frame {
    isolation: auto;
  }

  .home-character__image {
    width: 132%;
    margin: 0 0 -8% -18%;
    mix-blend-mode: multiply;
    filter:
      saturate(0.88)
      contrast(0.94);
  }

  .current-feature {
    margin-top: 4px;
  }
}

@media (max-width: 420px) {
  .home-title {
    min-height: clamp(210px, 69vw, 275px);
  }

  .home-title__subtitle {
    max-width: 70%;
  }

  .home-title__description {
    max-width: 60%;
  }

  .home-character {
    top: 14px;
    right: -28px;
    width: min(68vw, 270px);
    height: clamp(210px, 67vw, 280px);
  }
}

/* ========================================================
   Archive entrance placement
   ======================================================== */

/*
  ENTERはHOME MAINやCONTROL PANELの内部機能ではなく、
  それらを確認した後にアーカイブへ進む独立アクションとして扱う。
*/
.home-enter {
  grid-column: 2 / 3;
  min-width: 0;
}

.home-enter .enter-link {
  width: 100%;
}

@media (max-width: 1050px) and (min-width: 721px) {
  .home-enter {
    grid-column: 1 / 2;
  }
}

@media (max-width: 720px) {
  .home-enter {
    order: 7;
    width: 100%;
  }
}

/* ========================================================
   Home entrance priority and archive connection
   ======================================================== */

.home-enter {
  margin-bottom: 56px;
}

.current-feature .section-heading__label {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .home-enter {
    order: 2;
    margin-bottom: 0;
  }

  .current-feature {
    order: 3;
  }

  .control-panel {
    order: 4;
  }
}

/* ========================================================
   Compact home hero
   ======================================================== */

.home-title {
  margin-bottom: 30px;
}

.home-title__system {
  margin-bottom: 10px;
}

.home-title__subtitle {
  margin-top: 18px;
}

.home-title__description {
  margin-top: 18px;
}

@media (max-width: 720px) {
  .home-title {
    margin-bottom: 0;
  }

  .home-title__system {
    margin-bottom: 10px;
  }

  .home-title__subtitle {
    margin-top: 18px;
  }

  .home-title__description {
    margin-top: 18px;
  }
}
