/* Closing scene: restrained archive-to-cosmos handoff */
.closing-origin {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  min-height: 680px;
  padding: 120px 0 132px;
  overflow: visible;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(49, 73, 154, 0.12), transparent 43%),
    linear-gradient(180deg, #06101e 0%, #050912 22%, #05070d 72%, #04060a 100%);
  border-top: 0;
}

.closing-origin::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 180px;
  display: block;
  background: linear-gradient(180deg, rgba(6, 16, 30, 0.86), rgba(6, 16, 30, 0));
  pointer-events: none;
}

.closing-origin::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  background: radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(1, 3, 8, 0.38) 100%);
  pointer-events: none;
}

.closing-ripples {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(590px, 41vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: none;
}

.closing-ripples::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(152, 119, 255, 0.24), rgba(152, 119, 255, 0.07) 42%, transparent 72%);
  filter: blur(18px);
  animation: closing-ripple-core 3.6s cubic-bezier(0.77, 0, 0.175, 1) infinite alternate;
  will-change: transform, opacity;
}

.closing-ripples i {
  position: absolute;
  inset: 0;
  display: block;
  border: 2px solid rgba(201, 164, 108, 0.42);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 22px rgba(201, 164, 108, 0.12), inset 0 0 22px rgba(201, 164, 108, 0.065);
  animation: closing-radiate 5.8s cubic-bezier(0.23, 1, 0.32, 1) infinite both;
  will-change: transform, opacity;
}

.closing-ripples i:nth-child(2) {
  border-color: rgba(158, 130, 255, 0.5);
  box-shadow: 0 0 22px rgba(129, 107, 255, 0.13), inset 0 0 22px rgba(129, 107, 255, 0.07);
  animation-delay: -1.45s;
}

.closing-ripples i:nth-child(3) {
  border-color: rgba(78, 220, 226, 0.4);
  box-shadow: 0 0 22px rgba(56, 207, 233, 0.11), inset 0 0 22px rgba(56, 207, 233, 0.06);
  animation-delay: -2.9s;
}

.closing-ripples i:nth-child(4) {
  border-color: rgba(226, 181, 119, 0.42);
  box-shadow: 0 0 22px rgba(226, 181, 119, 0.1), inset 0 0 22px rgba(226, 181, 119, 0.055);
  animation-delay: -4.35s;
}

@keyframes closing-radiate {
  0% { opacity: 0; transform: scale(0.5); }
  10% { opacity: 0.82; }
  58% { opacity: 0.38; }
  100% { opacity: 0; transform: scale(1.72); }
}

@keyframes closing-ripple-core {
  from { opacity: 0.48; transform: scale(0.92); }
  to { opacity: 0.86; transform: scale(1.06); }
}

.closing-origin-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
}

.closing-kicker {
  margin: 0 0 16px;
  color: #b8884c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: none;
}

.closing-origin h2 {
  max-width: 760px;
  margin: 0 auto 42px;
  color: #f7f5f2;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Yu Gothic", "Malgun Gothic", Arial, sans-serif;
  font-size: clamp(44px, 4.45vw, 68px);
  font-weight: 500;
  letter-spacing: -0.038em;
  line-height: 1.1;
  text-wrap: balance;
}

.closing-origin .primary-action {
  min-width: 0;
  min-height: 52px;
  padding: 0 25px;
  justify-content: center;
  gap: 0;
  border-radius: 5px;
  box-shadow: 0 13px 30px rgba(94, 90, 255, 0.22);
  color: #f7f9ff;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Yu Gothic", "Malgun Gothic", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.closing-origin .primary-action span:last-child {
  font-size: inherit;
  line-height: inherit;
}

.footer-origin {
  position: relative;
  z-index: 0;
  padding: 78px 0 40px;
  background: linear-gradient(180deg, #04060a 0%, #03050a 35%, #03050a 100%);
  border-top: 0;
}

.footer-origin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.12fr) minmax(330px, 1fr) minmax(200px, 0.58fr);
  gap: clamp(44px, 7vw, 100px);
  align-items: start;
}

.footer-origin-brand .brand {
  display: inline-flex;
  align-items: center;
  color: #fbfaf8;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.footer-origin-brand .brand-mark {
  width: 34px;
  height: 34px;
  margin-right: 12px;
}

.footer-origin-brand p {
  max-width: 255px;
  margin: 15px 0 0 46px;
  color: #71809f;
  font-size: 13px;
  line-height: 1.65;
}

.footer-origin-chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  column-gap: 26px;
}

.footer-origin-chapters a {
  display: flex;
  align-items: baseline;
  gap: 15px;
  min-height: 67px;
  padding: 22px 3px 15px;
  color: #f5f2ed;
  border-top: 1px solid rgba(141, 161, 204, 0.11);
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease;
}

.footer-origin-chapters a:hover,
.footer-origin-chapters a:focus-visible {
  color: #c9a164;
  border-color: rgba(201, 161, 100, 0.5);
}

.footer-origin-chapters span {
  color: #667692;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.footer-origin-chapters b,
.footer-origin-return b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.footer-origin-return {
  display: grid;
  gap: 21px;
}

.footer-origin-return > span {
  padding-bottom: 20px;
  color: #657491;
  border-bottom: 1px solid rgba(141, 161, 204, 0.11);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.15em;
}

.footer-origin-return a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 21px;
  color: #f5f2ed;
  border-bottom: 1px solid rgba(141, 161, 204, 0.11);
  text-decoration: none;
}

.footer-origin-return a:hover,
.footer-origin-return a:focus-visible { color: #c9a164; }

.footer-origin-return i {
  color: #c18b42;
  font-size: 21px;
  font-style: normal;
  line-height: 0.8;
}

@media (max-width: 820px) {
  .closing-origin { min-height: 590px; padding: 100px 0; }
  .closing-origin h2 { max-width: 650px; }
  .footer-origin-grid { grid-template-columns: 1fr 1fr; }
  .footer-origin-return { grid-column: 1 / -1; max-width: 360px; }
}

@media (max-width: 580px) {
  .closing-origin { min-height: 530px; padding: 82px 0; }
  .closing-origin h2 { margin-bottom: 34px; font-size: clamp(38px, 11vw, 52px); }
  .closing-ripples { width: 75vw; }
  .footer-origin { padding-top: 54px; }
  .footer-origin-grid { grid-template-columns: 1fr; gap: 42px; }
  .footer-origin-return { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .closing-ripples::before {
    animation: none !important;
    opacity: 0.28;
    transform: scale(1);
  }

  .closing-ripples i {
    animation: none !important;
    box-shadow: none;
    opacity: 0.16;
  }

  .closing-ripples i:nth-child(1) { transform: scale(0.62); }
  .closing-ripples i:nth-child(2) { transform: scale(0.84); }
  .closing-ripples i:nth-child(3) { transform: scale(1.06); }
  .closing-ripples i:nth-child(4) { transform: scale(1.28); }
}

/* Footer brand synced with global nav logo */
.footer-origin-brand .brand {
  gap: 12px;
  background: linear-gradient(to right, #D4A5A5, #9093ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: "Lexend", "Inter", Arial, sans-serif;
}
.footer-origin-brand .brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

/* Specificity fixes: keep footer grid over legacy .footer .shell rules */
.footer .shell.footer-origin-grid { display: grid; }
@media (max-width: 720px) {
  .footer .shell.footer-origin-grid { display: grid; }
  .footer-origin-brand .brand span { display: inline; margin: 0; }
}
