/* medicherry Brand Story — six-scene vertical narrative */
.brand-story-body {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.brand-story-body main { background-color: var(--bg-dark); }
.brand-story-body .site-header {
  border: 0;
  background: transparent;
  color: var(--text-on-dark);
}
.brand-story-body .site-header .brand,
.brand-story-body .site-nav a,
.brand-story-body .nav-toggle { color: var(--text-on-dark); }
.brand-story-body .site-nav a { opacity: .68; }
.brand-story-body .site-nav a:hover,
.brand-story-body .site-nav a.is-active { opacity: 1; }
.brand-story-body .site-footer {
  position: relative;
  z-index: 5;
  border-top-color: var(--border-on-dark);
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
}
.brand-story-body .footer-name { color: var(--text-on-dark); }

.brand-story { position: relative; overflow: clip; background: var(--bg-dark); }
.story-scene {
  --story-overlay-progress: 0;
  --story-overlay-alpha: .12;
  --story-line-opacity: 1;
  --story-line-scale: 1;
  position: relative;
  min-height: 122svh;
  background: var(--bg-dark);
}
.story-scene--distance,
.story-scene--started { --story-overlay-alpha: .16; }
.story-scene--started { min-height: 150svh; }
.story-scene--future { --story-overlay-alpha: .46; }
.story-scene__stage {
  position: sticky;
  top: 64px;
  display: grid;
  height: calc(100svh - 64px);
  min-height: 560px;
  align-items: center;
  overflow: hidden;
  padding: clamp(88px, 10vw, 144px) max(24px, 6vw);
  isolation: isolate;
}
.story-scene__stage--connect {
  align-content: center;
  gap: clamp(44px, 7vh, 72px);
  background: linear-gradient(to bottom, var(--bg-dark) 0%, var(--bg-dark-surface) 24%, var(--bg-dark-surface) 100%);
}

.story-photo,
.story-photo__overlay { position: absolute; inset: 0; }
.story-photo {
  z-index: 0;
  display: grid;
  background-color: var(--bg-surface);
  background-image: var(--story-image, linear-gradient(135deg, var(--brand-soft), var(--bg-surface) 50%, var(--brand-soft)));
  background-position: center;
  background-size: cover;
}
.story-photo::after {
  position: absolute;
  inset: 0;
  border: 0;
  content: "";
}
.story-photo--change {
  background-image: url("/assets/img/medicherry-brandstory-first.png");
  background-position: center;
}
.story-photo--distance {
  background-image: url("/assets/img/medicherry-brandstory-second.png");
  background-position: center;
}
.story-photo--started {
  background-image: url("/assets/img/medicherry-brandstory-third.png");
  background-position: center;
}
.story-photo--future {
  background-image: url("/assets/img/medicherry-brandstory-fourth.png");
  background-position: center bottom;
}
.story-photo__overlay {
  z-index: 1;
  background-color: rgba(7, 11, 19, var(--story-overlay-alpha));
  background-image: linear-gradient(to right, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .58) 48%, rgba(0, 0, 0, .18) 100%);
}
.story-scene--distance .story-photo__overlay {
  background-color: rgba(7, 11, 19, var(--story-overlay-alpha));
  background-image: linear-gradient(to left, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .58) 48%, rgba(0, 0, 0, .2) 100%);
}
.story-scene--started .story-photo__overlay {
  background-color: rgba(7, 11, 19, .42);
  background-image: linear-gradient(to bottom, rgba(7, 11, 19, .48) 0%, rgba(7, 11, 19, .68) 50%, rgba(7, 11, 19, .5) 100%);
  opacity: var(--story-overlay-alpha);
}
.story-scene--started .story-scene__content {
  filter: drop-shadow(0 3px 18px rgba(7, 11, 19, .84));
}
.story-scene--future-image .story-photo__overlay {
  background-color: rgba(7, 11, 19, .06);
  background-image: linear-gradient(
    to bottom,
    rgba(7, 11, 19, 0) 0%,
    rgba(7, 11, 19, 0) 76%,
    rgba(7, 11, 19, .18) 88%,
    rgba(7, 11, 19, .56) 96%,
    var(--bg-dark) 100%
  );
}

.story-image-slot {
  position: absolute;
  top: 50%;
  left: 75%;
  z-index: 2;
  padding: 18px 22px;
  border: 1px solid var(--brand-light);
  border-radius: 6px;
  background: var(--bg-dark-surface);
  color: var(--text-on-dark);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .08em;
  transform: translate(-50%, -50%);
}
.story-photo--split { grid-template-columns: 1fr 1fr; }
.story-photo--split .story-image-slot--study { top: 72%; left: 25%; }
.story-photo--split .story-image-slot--practice { top: 72%; left: 75%; }
.story-scene--future .story-image-slot { top: auto; bottom: 24px; left: 50%; transform: translateX(-50%); }
.story-distance-line {
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: 1px;
  background: var(--brand-light);
  opacity: var(--story-line-opacity);
  transform: scaleY(var(--story-line-scale));
  transform-origin: center;
}

.story-scene__content { position: relative; z-index: 2; width: min(1120px, 100%); margin-inline: auto; }
.story-scene__content--left { text-align: left; }
.story-scene__content--right { text-align: right; }
.story-scene__content--right .story-title,
.story-scene__content--right .story-copy { margin-left: auto; }
.story-scene__content--center { text-align: center; }
.story-scene__content--center .story-title,
.story-scene__content--center .story-copy { margin-inline: auto; }

.story-title {
  max-width: 22ch;
  margin: 0;
  color: var(--text-on-dark);
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.12;
  text-wrap: balance;
}
.story-copy {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--text-on-dark-muted);
  font-size: var(--fs-lead);
  font-weight: 440;
  letter-spacing: 0;
  line-height: 1.75;
}
.story-emphasis {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--text-on-dark);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.5;
}
.story-scene__content--right .story-emphasis { margin-left: auto; }
.story-echo { margin-top: 30px; padding-top: 0; border-top: 0; }
.story-echo p { margin: 0; color: var(--text-on-dark); font-size: var(--fs-body); line-height: 1.7; }
.story-echo p + p { margin-top: 4px; }

.has-story-motion [data-story-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .65s ease, transform .75s cubic-bezier(.22, 1, .36, 1);
}
.has-story-motion .story-scene.is-visible [data-story-reveal] { opacity: 1; transform: translate3d(0, 0, 0); }
.has-story-motion [data-story-sequence] { opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity .5s ease, transform .6s ease; }
.has-story-motion .story-scene.is-visible [data-story-sequence]:first-child { opacity: 1; transform: none; transition-delay: .28s; }
.has-story-motion .story-scene.is-visible [data-story-sequence]:last-child { opacity: 1; transform: none; transition-delay: .48s; }

.story-scene--future { min-height: 100svh; }
.story-scene--question { min-height: 100svh; background: var(--bg-dark-surface); }
.story-scene--question .story-scene__stage {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 0;
  background: var(--bg-dark-surface);
}
.story-scene__content--future {
  display: grid;
  justify-items: center;
  padding: clamp(112px, 13vw, 176px) 24px;
  background: var(--bg-dark-surface);
}
.story-scene__content--future .story-question { font-size: clamp(30px, 2.8vw, 40px); }
.story-question {
  max-width: 28ch;
  margin: 0;
  color: var(--text-on-dark);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.18;
  text-wrap: balance;
}
.story-question--answer {
  margin-top: clamp(24px, 3.5vh, 36px);
  color: var(--brand-light);
}
.story-question__image {
  position: relative;
  height: calc(100svh - clamp(64px, 7vw, 104px));
  overflow: hidden;
  background: var(--bg-dark);
}
.story-scene--future-image { min-height: 112svh; background: var(--bg-dark-surface); }
.story-scene--future-image .story-scene__stage { padding-top: clamp(64px, 7vw, 104px); background: var(--bg-dark-surface); }
.story-question__image::before {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  z-index: 2;
  height: clamp(96px, 11vw, 152px);
  background: linear-gradient(
    to bottom,
    var(--bg-dark-surface) 0%,
    rgba(13, 19, 32, .58) 24%,
    rgba(13, 19, 32, .16) 62%,
    rgba(13, 19, 32, 0) 100%
  );
  content: "";
  pointer-events: none;
}
.story-question__image .story-photo,
.story-question__image .story-photo__overlay { position: absolute; inset: 0; }
.story-scene--reveal {
  min-height: 170svh;
  background: var(--bg-dark);
}
.story-scene__stage--reveal {
  background:
    radial-gradient(circle at 50% 56%, rgba(20, 107, 214, .12), transparent 34%),
    var(--bg-dark);
}
.story-reveal {
  display: grid;
  justify-items: center;
  text-align: center;
}
.story-reveal__copy {
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.35;
}
.story-reveal__brand {
  position: relative;
  width: min(190px, 52vw);
  height: 46px;
  overflow: hidden;
  margin-top: clamp(48px, 8vh, 88px);
  filter: drop-shadow(0 0 28px rgba(37, 134, 255, .28));
}
.story-reveal__brand-logo {
  position: absolute;
  filter: brightness(0) invert(1);   /* 공용 로고 파일은 검정 → 다크 위에서 흰색으로 */
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}
.story-reveal__slogan {
  margin: 28px 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: var(--fs-lead);
  line-height: 1.6;
}
.has-story-motion .story-scene--reveal .story-reveal__copy,
.has-story-motion .story-scene--reveal .story-reveal__brand,
.has-story-motion .story-scene--reveal .story-reveal__slogan,
.has-story-motion .story-scene--reveal .story-actions {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
.has-story-motion .story-scene--reveal.is-visible .story-reveal__copy,
.has-story-motion .story-scene--reveal.is-visible .story-reveal__brand,
.has-story-motion .story-scene--reveal.is-visible .story-reveal__slogan,
.has-story-motion .story-scene--reveal.is-visible .story-actions { opacity: 1; transform: none; }
.has-story-motion .story-scene--reveal.is-visible .story-reveal__brand { transition-delay: .35s; }
.has-story-motion .story-scene--reveal.is-visible .story-reveal__slogan { transition-delay: .65s; }
.has-story-motion .story-scene--reveal.is-visible .story-actions { transition-delay: .9s; }
.story-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.story-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; }
.story-action--outline { border: 0; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 12px 34px rgba(32,151,255,.3); color: #fff; }
.story-action--outline:hover { background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 16px 42px rgba(32,151,255,.42); transform: translateY(-2px); }
.story-action--text { border: 1px solid var(--border-on-dark); color: var(--text-on-dark); }
.story-action--text:hover { border-color: var(--text-on-dark-muted); }
.story-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

@media (max-width: 640px) {
  .brand-story-body .site-nav { background: var(--bg-dark); }
  .story-scene { min-height: 116svh; }
  .story-scene--started { min-height: 142svh; }
  .story-scene--future,
  .story-scene--question { min-height: auto; }
  .story-scene__stage { min-height: 520px; padding: 72px 24px; }
  .story-scene__content--right,
  .story-scene__content--center { text-align: left; }
  .story-scene__content--right .story-title,
  .story-scene__content--right .story-copy,
  .story-scene__content--center .story-title,
  .story-scene__content--center .story-copy { margin-left: 0; margin-right: 0; }
  .story-title { max-width: 18ch; }
  .story-copy { margin-top: 22px; line-height: 1.68; }
  .story-copy br { display: none; }
  .story-image-slot { padding: 14px 16px; font-size: var(--fs-label); }
  .story-photo > .story-image-slot { top: auto; bottom: 24px; left: 50%; transform: translateX(-50%); }
  .story-photo--split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .story-photo--split .story-image-slot--study { top: 25%; bottom: auto; left: 50%; transform: translate(-50%, -50%); }
  .story-photo--split .story-image-slot--practice { top: 75%; bottom: auto; left: 50%; transform: translate(-50%, -50%); }
  .story-distance-line { top: 50%; right: 12%; bottom: auto; left: 12%; width: auto; height: 1px; transform: scaleX(var(--story-line-scale)); }
  .story-scene--distance .story-photo__overlay {
    background-color: rgba(7, 11, 19, var(--story-overlay-alpha));
    background-image: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, .45));
  }
  .story-scene__stage--connect { align-content: start; padding-top: 70px; padding-bottom: 48px; }
  .story-scene--connect { min-height: auto; }
  .story-scene--connect .story-scene__stage {
    position: relative;
    top: auto;
    height: auto;
    min-height: calc(100svh - 64px);
    overflow: visible;
  }
  .story-scene--connect .story-title { font-size: var(--fs-h2); }
  .story-scene--connect .story-copy { font-size: var(--fs-body); }
  .story-scene__content--future {
    justify-items: center;
    padding: 88px 24px 64px;
    text-align: center;
  }
  .story-scene--future-image { min-height: auto; }
  .story-scene--future-image .story-scene__stage { min-height: auto; padding-top: 56px; }
  .story-question__image { height: clamp(420px, 112vw, 620px); }
  .story-scene--started .story-scene__content--center { text-align: center; }
  .story-scene--started .story-scene__content--center .story-title,
  .story-scene--started .story-echo { margin-inline: auto; }
  .story-question { max-width: 22ch; }
  .story-reveal { justify-items: center; text-align: center; }
  .story-reveal__brand { justify-content: center; }
  .story-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .story-scene { min-height: auto; }
  .story-scene__stage { position: relative; top: auto; min-height: calc(100svh - 64px); height: auto; }
  .has-story-motion [data-story-reveal],
  .has-story-motion [data-story-sequence],
  .has-story-motion .story-scene--reveal .story-reveal__copy,
  .has-story-motion .story-scene--reveal .story-reveal__brand,
  .has-story-motion .story-scene--reveal .story-reveal__slogan,
  .has-story-motion .story-scene--reveal .story-actions { opacity: 1; transform: none; transition: none; }
}
