/* 出戸レディースクリニック 動き・素材感 */
:root { --ease: cubic-bezier(.65, 0, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---------- 紙の質感（全体にうっすら） ---------- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .3 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- オープニング ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--base); display: grid; place-items: center;
  transition: opacity 1.1s var(--ease) .15s, visibility 0s linear 1.3s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { text-align: center; position: relative; transition: transform 1.2s var(--ease), filter 1.2s var(--ease), opacity .9s; }
.loader.is-done .loader__inner { transform: scale(1.12); filter: blur(8px); opacity: 0; }
/* ハートを1本の線で描いてから、ピンクに染まる */
.loader__svg { width: 104px; margin: 0 auto; display: block; overflow: visible; }
.loader__svg path {
  fill: var(--rose-logo); fill-opacity: 0; stroke: var(--rose-logo); stroke-width: .9; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.7s cubic-bezier(.45, 0, .25, 1) .2s forwards, fillIn .9s ease 1.6s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { fill-opacity: 1; stroke-opacity: 0; } }
.loader__bar { display: block; width: 120px; height: 1px; margin: 22px auto 0; background: var(--line); position: relative; overflow: hidden; }
.loader__bar::after { content: ""; position: absolute; inset: 0; background: var(--rose); transform: scaleX(0); transform-origin: left; animation: bar 2.4s var(--ease) .1s forwards; }
@keyframes bar { to { transform: scaleX(1); } }
.loader__name { font-family: var(--round); font-weight: 500; font-size: 20px; margin-top: 24px; letter-spacing: .1em; opacity: 0; animation: softIn 1.1s var(--ease-out) 1.4s forwards; }
.loader__en { font-family: var(--round); font-size: 10px; letter-spacing: .4em; color: var(--ink-sub); opacity: 0; animation: softIn 1.1s var(--ease-out) 1.6s forwards; }
.loader__bg { position: absolute; width: 70vmin; aspect-ratio: 1; mix-blend-mode: multiply; opacity: 0; animation: bloom 2.2s var(--ease-out) forwards; }
@keyframes bloom { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: .55; transform: scale(1) rotate(0); } }
@keyframes softIn { from { opacity: 0; filter: blur(6px); transform: translateY(8px); } to { opacity: 1; filter: blur(0); transform: none; } }
.no-loader .loader { display: none; }

/* ---------- 見出しが1行ずつ下から出る ---------- */
.line { display: block; overflow: hidden; padding-bottom: .08em; }
.line__in { display: inline-block; transform: translateY(105%); transition: transform 1.3s var(--ease-out); transition-delay: calc(var(--l) * 160ms + var(--d, 0ms)); }
.is-in .line__in { transform: none; }
.hero__title .line__in { --d: 500ms; }
/* 英字見出しは字間がほどけるように */
.ttl__en { opacity: 0; letter-spacing: .25em; filter: blur(4px); transition: opacity 1.6s var(--ease-out), letter-spacing 1.8s var(--ease-out), filter 1.6s var(--ease-out); }
.is-in .ttl__en, .is-in.ttl__en { opacity: .85; letter-spacing: .02em; filter: none; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- 文字が1文字ずつ浮かぶ（旧） ---------- */
.char { display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(.35em); transition: opacity 1s var(--ease-out), filter 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--c) * 55ms + var(--d, 0ms)); white-space: pre; }
.is-in .char, .char.is-in { opacity: 1; filter: blur(0); transform: none; }

/* ---------- メインビジュアルの登場 ---------- */
/* 写真がハートの位置から円く広がって現れる */
.hero__slides { clip-path: circle(0% at 22% 62%); transition: clip-path 2.2s cubic-bezier(.7, 0, .2, 1) .1s; }
.is-start .hero__slides { clip-path: circle(150% at 22% 62%); }
/* スライド：次の写真が右からやわらかく重なり、ゆっくりズームアウト */
.hero__slides img { opacity: 1 !important; clip-path: inset(0 0 0 100%); transform: scale(1.14); transition: clip-path 1.8s cubic-bezier(.7, 0, .2, 1), transform 9s cubic-bezier(.2, .6, .3, 1); z-index: 0; }
.hero__slides img.is-active { clip-path: inset(0 0 0 0); transform: scale(1); z-index: 2; }
.hero__slides img.is-prev { clip-path: inset(0 0 0 0); transform: scale(1); z-index: 1; transition: none; }
.hero__slides img.is-first { transition: transform 9s cubic-bezier(.2, .6, .3, 1); }
.hero__badge, .hero__lead, .hero__info, .hero__btns { opacity: 0; transform: translateY(14px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.hero__badge { transform: scale(.7); }
.is-start .hero__badge { opacity: 1; transform: none; transition-delay: 1.6s; }
.is-start .hero__lead { opacity: 1; transform: none; transition-delay: .6s; }
.is-start .hero__info { opacity: 1; transform: none; transition-delay: 1.4s; }
.is-start .hero__btns { opacity: 1; transform: none; transition-delay: 1.6s; }
.hero__title .char { --d: 600ms; transition-duration: .9s; filter: none; }
.hero__dots { position: absolute; right: 28px; bottom: 50%; transform: translateY(50%); display: grid; gap: 12px; z-index: 3; }
.hero__dots button { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #fff; background: transparent; cursor: pointer; transition: .4s; padding: 0; }
.hero__dots button.is-active { background: #fff; transform: scale(1.3); }
.hero__progress { position: absolute; left: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .8); width: 0; z-index: 3; }
.hero__progress.is-run { animation: progress 6s linear forwards; }
@keyframes progress { to { width: 100%; } }

/* ---------- 写真が幕を引くように現れる ---------- */
.reveal { position: relative; overflow: hidden; clip-path: inset(18% 0 0 0 round 20px); opacity: 0; transition: clip-path 1.6s var(--ease-out) var(--rd, 0s), opacity 1.2s var(--ease-out) var(--rd, 0s); }
.reveal img { transform: scale(1.12); transition: transform 2.4s var(--ease-out) var(--rd, 0s); }
.reveal.is-in { clip-path: inset(0 0 0 0 round 0); opacity: 1; }
.reveal.is-in img { transform: scale(1); }

/* ---------- ふわっと（順番に） ---------- */
.fade { opacity: 0; transform: translateY(28px); filter: blur(3px); transition: opacity 1.1s var(--ease-out), transform 1.2s var(--ease-out), filter 1.1s var(--ease-out); }
.fade.is-in { opacity: 1; transform: none; filter: none; }
.stagger > * { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.stagger.is-in > * { opacity: 1; transform: none; }

/* 見出しの細い線 */
.ttl h2 { position: relative; }

/* ---------- 水彩のにじみ（ゆっくり漂う） ---------- */
.blot { position: absolute; z-index: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .55; width: 420px; }
.blot img { width: 100%; animation: drift 22s ease-in-out infinite alternate; }
.blot--sm { width: 240px; opacity: .45; }
.blot--lg { width: 620px; opacity: .4; }
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(22px, -18px) rotate(8deg) scale(1.05); }
  100% { transform: translate(-16px, 14px) rotate(-6deg) scale(.97); }
}
.botanical { position: absolute; z-index: 0; pointer-events: none; mix-blend-mode: multiply; width: 260px; opacity: .8; }
.botanical img { width: 100%; transform-origin: bottom left; animation: sway 9s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-2deg); } to { transform: rotate(2.5deg); } }
.sec > .inner, .news .inner { position: relative; z-index: 1; }

/* ---------- 水彩の波（区切り） ---------- */
.wc-wave { position: relative; height: 120px; margin: -60px 0; z-index: 2; pointer-events: none; }
.wc-wave span {
  position: absolute; inset: 0; background: url(img/tex-pink.webp) center / cover;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 64 C 180 20 360 20 540 54 S 900 104 1080 70 S 1320 24 1440 50 L1440 84 C 1300 64 1150 100 990 104 S 640 70 480 84 S 160 110 0 92Z'/%3E%3C/svg%3E") 0 0 / 1440px 100% repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 64 C 180 20 360 20 540 54 S 900 104 1080 70 S 1320 24 1440 50 L1440 84 C 1300 64 1150 100 990 104 S 640 70 480 84 S 160 110 0 92Z'/%3E%3C/svg%3E") 0 0 / 1440px 100% repeat-x;
  animation: waveMove 40s linear infinite; opacity: .9;
}
.wc-wave span:last-child { opacity: .45; filter: hue-rotate(-12deg) saturate(.8); animation-duration: 60s; animation-direction: reverse; transform: translateY(14px) scaleY(.8); }
@keyframes waveMove { to { -webkit-mask-position: 1440px 0; mask-position: 1440px 0; } }

/* ---------- 写真が流れる帯 ---------- */
.marquee { overflow: hidden; padding: 10px 0 90px; }
.marquee__track { display: flex; gap: 22px; width: max-content; animation: marquee 80s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee img { height: 270px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; }
.marquee img:nth-child(even) { transform: translateY(40px); }
@keyframes marquee { to { transform: translateX(calc(-50% - 11px)); } }
@media (max-width: 600px) { .marquee img { height: 160px; } .marquee img:nth-child(even) { transform: translateY(24px); } .marquee { padding-bottom: 60px; } }

/* ---------- 写真の上にうっすら光 ---------- */
.glow { position: relative; }
.glow::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(60% 50% at 20% 10%, rgba(255, 240, 225, .35), transparent 70%);
  mix-blend-mode: soft-light;
}

/* ---------- ボタンの光が流れる ---------- */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); transition: left .9s var(--ease-out);
}
.btn:hover::before { left: 130%; }

/* カード */
.trouble a, .med-card, .chips a, .vaccine li a { will-change: transform; }
.med-card { transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out); }
.med-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(120, 80, 70, .1); }
.med-card__img { overflow: hidden; }
.med-card__img img { transition: transform 1.4s var(--ease-out); }
.med-card:hover .med-card__img img { transform: scale(1.05); }

/* ヘッダー：下へスクロールで隠れ、上で戻る */
.header { transition: transform .6s var(--ease), background .4s, box-shadow .4s; }
.header.is-hide { transform: translateY(-100%); }

/* ページ上部へ戻る */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 55; width: 56px; height: 56px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer;
  opacity: 0; transform: translateY(16px); transition: .6s var(--ease-out); box-shadow: 0 6px 18px rgba(0, 0, 0, .05);
}
.to-top.is-show { opacity: 1; transform: none; }
.to-top img { width: 26px; transition: transform .5s var(--ease-out); }
.to-top:hover img { transform: translateY(-4px); }

@media (max-width: 600px) {
  .blot { width: 240px; } .blot--lg { width: 360px; } .blot--sm { width: 150px; }
  .botanical { display: none; }
  .wc-wave { height: 70px; margin: -35px 0; }
  .to-top { bottom: 80px; right: 14px; width: 46px; height: 46px; }
  .hero__dots { display: none; }
}

/* 動きを減らす設定の人には止める */
/* 「視差効果を減らす」設定の人：動き（移動・拡大・漂い）は止め、ふわっと出るフェードだけ残す */
@media (prefers-reduced-motion: reduce) {
  /* 常に動き続けるもの（漂う水彩・流れる写真・波）だけ止める */
  .blot img, .botanical img, .wc-wave span, .marquee__track { animation: none !important; }
}
