/*
 * DREAM SKY · shared DREAM archive visual system
 * Source of truth: the existing DREAM content-warning sky, clouds, palette and arch.
 * Only dream.html and dream-detail.html opt in with <body class="dream-sky ...">.
 * The main memo and Project Moon pages are deliberately left untouched.
 * Per-couple customizations can replace the dream-sky class or override these
 * scoped styles after this file when the future data-driven Admin is connected.
 */

body.dream-sky {
  --color-background: #e7e2f4;
  --color-surface: rgba(255, 255, 255, .72);
  --color-text: #373d5b;
  --color-text-muted: #565d7c;
  --color-line: rgba(143, 143, 191, .36);
  --color-accent: #626caa;
  --sky-dark: #373d5b;
  --sky-muted: #565d7c;
  --sky-accent: #626caa;
  --sky-edge: rgba(143, 143, 191, .38);
  --sky-serif: "Gowun Batang", "Noto Serif KR", "Nanum Myeongjo", serif;
  --sky-cloud-far: 2000px;
  --sky-cloud-near: 2000px;
  background: #e7e2f4;
  overflow-x: clip;
  color: var(--sky-dark);
  isolation: isolate;
}

/* The same original drifting cloud assets used by the warning.
 * Decorative only; fixed sky continues while the archive scrolls. */
body.dream-sky .dream-sky-clouds::before,
body.dream-sky .dream-sky-clouds::after {
  content: "";
  position: fixed;
  left: 0;
  z-index: 0;
  width: calc(100% + var(--sky-cloud-near));
  pointer-events: none;
  background-repeat: repeat-x;
  background-position: 0 100%;
}
body.dream-sky .dream-sky-clouds::before {
  top: 2%;
  height: min(36vh, 340px);
  opacity: .72;
  background-image: url("../assets/images/dream/clouds-far.webp");
  background-size: var(--sky-cloud-far) 100%;
  animation: dream-sky-drift-far 225s linear infinite;
}
body.dream-sky .dream-sky-clouds::after {
  bottom: -6%;
  height: clamp(310px, 57vh, 590px);
  opacity: .72;
  background-image: url("../assets/images/dream/clouds-near.webp");
  background-size: var(--sky-cloud-near) 100%;
  animation: dream-sky-drift-near 160s linear infinite;
}
@keyframes dream-sky-drift-far { to { transform: translate3d(calc(-1 * var(--sky-cloud-far)),0,0); } }
@keyframes dream-sky-drift-near { to { transform: translate3d(calc(-1 * var(--sky-cloud-near)),0,0); } }
body.dream-sky .site {
  position: relative;
  z-index: 1;
  isolation: isolate;
  background:
    radial-gradient(ellipse 24% 5% at 13% 18%, rgba(255,255,255,.63), transparent 85%),
    radial-gradient(ellipse 21% 4% at 88% 20%, rgba(255,255,255,.58), transparent 86%),
    radial-gradient(ellipse 44% 30% at 49% 41%, rgba(255,255,255,.67), transparent 85%),
    linear-gradient(172deg, #c7d8f0 0%, #d7d8f1 35%, #e2daf2 70%, #f5eff8 100%);
}
body.dream-sky .dream-sky-clouds {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
body.dream-sky .site-footer { position: relative; z-index: 1; }
body.dream-sky .site-main { position: relative; }

/* Header / footer belong to the sky only when the DREAM page is open. */
body.dream-sky .site-header {
  border-bottom-color: rgba(255,255,255,.72);
  background: rgba(253,251,255,.68);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 26px rgba(87,83,140,.055);
}
body.dream-sky .site-logo {
  color: var(--sky-dark);
  font-family: var(--sky-serif);
  font-weight: 700;
  letter-spacing: .16em;
}
body.dream-sky .site-nav a { color: #636a94; }
body.dream-sky .site-nav a[aria-current="page"] { color: #424b80; font-weight: 700; }
body.dream-sky .site-nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 5px;
  background: #7f86b6;
}
body.dream-sky .site-footer {
  border-top: 1px solid rgba(255,255,255,.85);
  background: rgba(253,251,255,.6);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  color: #646b8a;
}
body.dream-sky .footer-label { color: #3d476e; }
body.dream-sky :focus-visible { outline-color: #48548c; }
body.dream-sky ::selection { color: #fff; background: #626caa; }

/* Shared glass-window surface inspired by the warning card. */
body.dream-sky .dream-page-header,
body.dream-sky .dream-intro,
body.dream-sky .dream-card,
body.dream-sky .dream-detail-hero .dream-detail-inner,
body.dream-sky .dream-detail-section > .dream-detail-inner {
  border: 1px solid rgba(255,255,255,.88);
  background: linear-gradient(155deg, rgba(255,255,255,.86), rgba(252,249,255,.73) 61%, rgba(248,245,255,.84));
  box-shadow:
    0 6px 14px rgba(73,68,120,.025),
    0 26px 65px rgba(90,87,143,.09),
    inset 0 1px rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

body.dream-sky .dream-eyebrow,
body.dream-sky .dream-section-label,
body.dream-sky .dream-card-label,
body.dream-sky .dream-detail-eyebrow,
body.dream-sky .dream-detail-section-label,
body.dream-sky .character-role,
body.dream-sky .timeline-label {
  color: #777baa;
  font-family: var(--sky-serif);
  font-weight: 700;
  letter-spacing: .20em;
}
body.dream-sky .dream-page-title,
body.dream-sky .dream-section-title,
body.dream-sky .dream-card-title,
body.dream-sky .dream-detail-title,
body.dream-sky .dream-detail-section-title,
body.dream-sky .character-name,
body.dream-sky .relationship-lead,
body.dream-sky .timeline-title {
  color: var(--sky-dark);
  font-family: var(--sky-serif);
  font-weight: 700;
  word-break: keep-all;
}

/* ================ DREAM INDEX ================ */
body.dream-sky .section-dream {
  min-height: calc(100vh - var(--header-height));
  padding-top: clamp(54px, 8vw, 112px);
  padding-bottom: clamp(100px, 12vw, 170px);
}
body.dream-sky .dream-page-header {
  position: relative;
  width: min(100%, 870px);
  margin: 0 auto clamp(50px, 8vw, 104px);
  padding: clamp(102px, 15vw, 146px) clamp(28px, 7vw, 88px) clamp(46px, 6vw, 76px);
  border-radius: 50% 50% 28px 28px / 165px 165px 28px 28px;
  text-align: center;
}
body.dream-sky .dream-page-header::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--sky-edge);
  border-radius: 50% 50% 19px 19px / 155px 155px 19px 19px;
  pointer-events: none;
}
body.dream-sky .dream-page-header::after {
  content: "✦";
  display: block;
  margin: 27px auto 0;
  color: #898cba;
  font-family: var(--sky-serif);
  font-size: 1.1rem;
  line-height: 1;
}
body.dream-sky .dream-eyebrow { margin-bottom: 24px; font-size: .78rem; }
body.dream-sky .dream-page-title {
  margin-bottom: 26px;
  font-size: clamp(3.4rem, 10vw, 7rem);
  line-height: 1.22;
  letter-spacing: .06em;
}
body.dream-sky .dream-page-description {
  margin-inline: auto;
  max-width: 600px;
  color: var(--sky-muted);
  font-size: clamp(.96rem, 1.7vw, 1.1rem);
  line-height: 1.95;
  word-break: keep-all;
}
body.dream-sky .dream-local-nav {
  justify-content: center;
  margin-top: 0;
}
body.dream-sky .dream-local-nav:empty { display: none; }

body.dream-sky .dream-section {
  width: min(100%, 970px);
  margin: 0 auto;
  padding: 0;
}
body.dream-sky .dream-section + .dream-section { border-top: 0; margin-top: clamp(42px, 6vw, 80px); }
body.dream-sky .dream-section-header { margin: 0 0 30px; text-align: center; }
body.dream-sky .dream-section-label { margin-bottom: 11px; font-size: .75rem; }
body.dream-sky .dream-section-title { font-size: clamp(1.95rem, 4.4vw, 3.15rem); }
body.dream-sky .dream-section-header::after {
  content: "── ✦ ──";
  display: block;
  margin: 12px auto 0;
  color: #989cca;
  font-size: .77rem;
  letter-spacing: .25em;
}
body.dream-sky .dream-intro {
  position: relative;
  max-width: 785px;
  margin: auto;
  padding: clamp(38px, 6vw, 64px) clamp(28px, 7vw, 84px);
  border-radius: 28px;
  text-align: center;
  color: var(--sky-muted);
  font-size: .96rem;
  line-height: 2.15;
}
body.dream-sky .dream-intro::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(143,143,191,.25);
  border-radius: 20px;
  pointer-events: none;
}
body.dream-sky .dream-intro p + p { margin-top: 20px; }
body.dream-sky .dream-intro-sub { color: #4e5888; }
body.dream-sky .dream-content { gap: 30px; }
body.dream-sky .dream-card {
  overflow: hidden;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  border-radius: 30px;
}
body.dream-sky .dream-card-image {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  background:
    url("../assets/images/dream/clouds-near.webp") center 110% / 160% auto no-repeat,
    radial-gradient(ellipse at 60% 30%, rgba(255,255,255,.82), transparent 55%),
    linear-gradient(160deg, #c6d9f2 0%, #d8d8f2 55%, #f4eafa 100%);
}
body.dream-sky .dream-card-image::before {
  content: "";
  position: absolute;
  inset: 36px 32px 0;
  border: 1px solid rgba(255,255,255,.72);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 150px 150px 0 0;
}
body.dream-sky .dream-card-image::after {
  content: "✧";
  position: absolute;
  top: 27%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.94);
  font-family: var(--sky-serif);
  font-size: 2.5rem;
  text-shadow: 0 3px 16px rgba(103,112,170,.2);
}
body.dream-sky .dream-card-body { padding: clamp(28px, 5vw, 62px); }
body.dream-sky .dream-card-title { margin-bottom: 23px; font-size: clamp(2.25rem, 4vw, 3.8rem); }
body.dream-sky .dream-card-description { line-height: 1.9; word-break: keep-all; }
body.dream-sky .dream-card-link,
body.dream-sky .dream-back-link,
body.dream-sky .character-profile-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 21px;
  border: 1px solid rgba(130,133,184,.45);
  border-radius: 999px;
  color: #505b92;
  background: rgba(255,255,255,.68);
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .075em;
  text-align: center;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
body.dream-sky .dream-card-link:hover,
body.dream-sky .dream-back-link:hover,
body.dream-sky .character-profile-link:hover {
  border-color: #626caa;
  background: #626caa;
  color: #fff;
  transform: translateY(-1px);
}
body.dream-sky .character-profile-link[hidden] { display: none; }

/* ================ DREAM DETAIL ================
   This is only the *default* DREAM skin; custom couple-specific themes may
   intentionally replace it without changing the content templates. */
body.dream-sky .dream-detail { padding-bottom: clamp(70px, 10vw, 136px); }
body.dream-sky .dream-detail-hero {
  padding-top: clamp(62px, 8vw, 108px);
  padding-bottom: clamp(26px, 4vw, 45px);
}
body.dream-sky .dream-detail-hero .dream-detail-inner {
  position: relative;
  max-width: 945px;
  padding: clamp(92px, 11vw, 136px) clamp(28px, 6vw, 78px) clamp(40px, 6vw, 72px);
  border-radius: 50% 50% 28px 28px / 154px 154px 28px 28px;
  text-align: center;
}
body.dream-sky .dream-detail-hero .dream-detail-inner::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid var(--sky-edge);
  border-radius: 50% 50% 19px 19px / 145px 145px 19px 19px;
  pointer-events: none;
}
body.dream-sky .dream-back-link { position: relative; z-index: 1; margin: 0 auto 34px; }
body.dream-sky .dream-detail-eyebrow { margin-bottom: 17px; }
body.dream-sky .dream-detail-title {
  margin: 0 auto 24px;
  font-size: clamp(2.5rem, 7vw, 5.75rem);
  line-height: 1.24;
  letter-spacing: .025em;
}
body.dream-sky .dream-detail-summary { margin: 0 auto; line-height: 1.95; }
body.dream-sky .dream-keyword-list { justify-content: center; margin-top: 30px; }
body.dream-sky .dream-keyword-list li {
  padding: 9px 15px;
  border: 1px solid rgba(130,133,184,.4);
  color: #535d8b;
  background: rgba(255,255,255,.52);
}
body.dream-sky .dream-detail-section {
  padding-top: clamp(23px, 4vw, 44px);
  padding-bottom: 0;
  border-top: 0;
}
body.dream-sky .dream-detail-section > .dream-detail-inner {
  max-width: 1100px;
  padding: clamp(28px, 5vw, 62px);
  border-radius: 28px;
}
body.dream-sky .dream-detail-section-header { margin-bottom: 37px; text-align: center; }
body.dream-sky .dream-detail-section-label { margin-bottom: 12px; }
body.dream-sky .dream-detail-section-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.35;
}
body.dream-sky .dream-detail-section-header::after {
  content: "── ✦ ──";
  display: block;
  margin-top: 8px;
  color: #989cca;
  font-size: .75rem;
  letter-spacing: .24em;
}
body.dream-sky .dream-main-visual-placeholder,
body.dream-sky .character-image,
body.dream-sky .dream-gallery-image {
  border: 1px solid rgba(164,164,198,.3);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 26%, rgba(255,255,255,.82), transparent 60%),
    linear-gradient(155deg, rgba(206,219,244,.78), rgba(234,222,246,.63));
  color: #757aa0;
  font-size: .76rem;
  letter-spacing: .12em;
}
body.dream-sky .dream-main-visual-placeholder { min-height: 500px; }
body.dream-sky .character-grid { gap: 25px; }
body.dream-sky .character-card {
  overflow: hidden;
  border: 1px solid rgba(164,164,198,.28);
  border-radius: 21px;
  background: rgba(255,255,255,.5);
}
body.dream-sky .character-image {
  border: 0;
  border-radius: 0;
  min-height: 355px;
}
body.dream-sky .character-body { padding: clamp(25px, 4vw, 38px); }
body.dream-sky .character-role { margin-bottom: 14px; }
body.dream-sky .character-name { margin-bottom: 30px; font-size: clamp(2rem, 4vw, 3.25rem); }
body.dream-sky .character-meta { gap: 0; }
body.dream-sky .character-meta div {
  grid-template-columns: minmax(85px, .37fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(143,143,191,.22);
}
body.dream-sky .character-meta dt { color: #757ca3; }
body.dream-sky .character-description { line-height: 1.9; }
body.dream-sky .character-profile-link { margin-top: 24px; }
body.dream-sky .relationship-lead { font-size: clamp(1.35rem, 2.6vw, 2.2rem); line-height: 1.65; }
body.dream-sky .relationship-copy { line-height: 1.95; }
body.dream-sky .dream-timeline { border-top-color: rgba(143,143,191,.23); }
body.dream-sky .dream-timeline-item { border-bottom-color: rgba(143,143,191,.23); }
body.dream-sky .timeline-title { font-size: 1.12rem; }
body.dream-sky .dream-gallery { gap: 17px; }
body.dream-sky .dream-gallery-image { min-height: 260px; }
body.dream-sky .dream-note-content { line-height: 1.95; }

@media (max-width: 800px) {
  body.dream-sky .dream-card { grid-template-columns: 1fr; }
  body.dream-sky .dream-card-image { min-height: 295px; }
  body.dream-sky .dream-card-body { padding: 38px 32px; }
}
@media (max-width: 720px) {
  body.dream-sky { --sky-cloud-near: 1350px; --sky-cloud-far: 1500px; }
  body.dream-sky .section-dream { padding-top: 46px; padding-bottom: 84px; }
  body.dream-sky .dream-page-header {
    padding: 93px 28px 41px;
    border-radius: 50% 50% 23px 23px / 115px 115px 23px 23px;
  }
  body.dream-sky .dream-page-header::before { inset: 8px; border-radius: 50% 50% 16px 16px / 107px 107px 16px 16px; }
  body.dream-sky .dream-page-title { margin-bottom: 20px; font-size: clamp(2.7rem, 10vw, 4rem); }
  body.dream-sky .dream-eyebrow { font-size: .68rem; letter-spacing: .16em; }
  body.dream-sky .dream-section + .dream-section { margin-top: 50px; }
  body.dream-sky .dream-section-header { margin-bottom: 24px; }
  body.dream-sky .dream-intro { padding: 34px 26px; line-height: 2; }
  body.dream-sky .dream-card-body { padding: 33px 27px; }
  body.dream-sky .dream-detail-hero { padding-top: 45px; }
  body.dream-sky .dream-detail-hero .dream-detail-inner {
    padding: 92px 25px 43px;
    border-radius: 50% 50% 24px 24px / 114px 114px 24px 24px;
  }
  body.dream-sky .dream-detail-hero .dream-detail-inner::before { border-radius: 50% 50% 16px 16px / 106px 106px 16px 16px; }
  body.dream-sky .dream-detail-section { padding-top: 26px; }
  body.dream-sky .dream-detail-section > .dream-detail-inner { padding: 28px 22px; }
  body.dream-sky .dream-main-visual-placeholder { min-height: 280px; }
  body.dream-sky .character-image { min-height: 275px; }
  body.dream-sky .dream-gallery-image { min-height: 250px; }
  body.dream-sky .dream-detail-section-header { margin-bottom: 26px; }
}
@media (max-width: 370px) {
  body.dream-sky .dream-page-header { padding-inline: 22px; }
  body.dream-sky .dream-detail-hero .dream-detail-inner { padding-inline: 20px; }
  body.dream-sky .dream-detail-section > .dream-detail-inner { padding-inline: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  body.dream-sky::before, body.dream-sky .dream-sky-clouds::after { animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  body.dream-sky .site-header,
  body.dream-sky .site-footer,
  body.dream-sky .dream-page-header,
  body.dream-sky .dream-intro,
  body.dream-sky .dream-card,
  body.dream-sky .dream-detail-hero .dream-detail-inner,
  body.dream-sky .dream-detail-section > .dream-detail-inner {
    background: #f8f7fd;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  body.dream-sky::before, body.dream-sky .dream-sky-clouds::after { display: none; }
  body.dream-sky .dream-page-header,
  body.dream-sky .dream-intro,
  body.dream-sky .dream-card,
  body.dream-sky .dream-detail-hero .dream-detail-inner,
  body.dream-sky .dream-detail-section > .dream-detail-inner { border-color: CanvasText; }
}
