@charset "UTF-8";
/* トップページのヒーロー（index.html の section.hero）
   アニメーションは CSS のみ。transform と opacity だけを動かす。
   ラベルの解析アニメーションは 9 秒周期で、各要素のタイミングはキーフレームの % で揃えている。 */

html {
  scroll-behavior: smooth;
}

#journal {
  scroll-margin-top: 72px;
}

.hero {
  --hero-navy: #2B4B65;
  --hero-deep: #183244;
  --hero-aqua: #86d3dc;
  --hero-aqua-soft: rgba(134, 211, 220, .18);
  --hero-ink: #1d3446;
  --hero-gold: #f0b54a;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 2rem;
  padding: 4.5rem 0 4rem;
  color: #fff;
  background:
    radial-gradient(ellipse 60% 70% at 82% 30%, rgba(134, 211, 220, .20), transparent 70%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(134, 211, 220, .12), transparent 70%),
    linear-gradient(160deg, #2B4B65 0%, #213f56 50%, #183244 100%);
}

/* ---------- 泡 ---------- */
.hero-foam {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-bubble {
  position: absolute;
  bottom: -80px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55) 0 8%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 55%, rgba(190, 236, 242, .18) 80%, rgba(255, 255, 255, .32) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  opacity: 0;
  will-change: transform, opacity;
  animation: hero-bubble-rise var(--d) linear var(--delay) infinite;
}

.hero-bubble:nth-child(1)  { --x: 5%;  --s: 14px; --d: 13s; --delay: -2s; }
.hero-bubble:nth-child(2)  { --x: 13%; --s: 34px; --d: 19s; --delay: -9s; }
.hero-bubble:nth-child(3)  { --x: 21%; --s: 10px; --d: 11s; --delay: -5s; }
.hero-bubble:nth-child(4)  { --x: 30%; --s: 22px; --d: 16s; --delay: -12s; }
.hero-bubble:nth-child(5)  { --x: 39%; --s: 12px; --d: 12s; --delay: -1s; }
.hero-bubble:nth-child(6)  { --x: 47%; --s: 40px; --d: 22s; --delay: -15s; }
.hero-bubble:nth-child(7)  { --x: 56%; --s: 16px; --d: 14s; --delay: -7s; }
.hero-bubble:nth-child(8)  { --x: 63%; --s: 26px; --d: 18s; --delay: -3s; }
.hero-bubble:nth-child(9)  { --x: 70%; --s: 11px; --d: 10s; --delay: -6s; }
.hero-bubble:nth-child(10) { --x: 77%; --s: 48px; --d: 24s; --delay: -18s; }
.hero-bubble:nth-child(11) { --x: 84%; --s: 18px; --d: 15s; --delay: -10s; }
.hero-bubble:nth-child(12) { --x: 90%; --s: 13px; --d: 12s; --delay: -4s; }
.hero-bubble:nth-child(13) { --x: 94%; --s: 28px; --d: 20s; --delay: -13s; }
.hero-bubble:nth-child(14) { --x: 34%; --s: 60px; --d: 28s; --delay: -20s; }

@keyframes hero-bubble-rise {
  0%   { transform: translate3d(0, 0, 0) scale(.7); opacity: 0; }
  10%  { opacity: .9; }
  30%  { transform: translate3d(12px, -270px, 0) scale(.85); }
  55%  { transform: translate3d(-8px, -500px, 0) scale(.95); }
  80%  { transform: translate3d(10px, -720px, 0) scale(1); opacity: .7; }
  100% { transform: translate3d(0, -900px, 0) scale(1.05); opacity: 0; }
}

/* ---------- レイアウト ---------- */
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 3rem;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- テキスト ---------- */
.hero .hero-title {
  margin: 0 0 .9rem;
  color: #fff;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .06em;
}

.hero-title::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 1.1rem;
  border-radius: 2px;
  background: var(--hero-aqua);
}

.hero-tagline {
  margin: 0 0 2rem;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.8;
  letter-spacing: .03em;
}

.hero-points {
  margin: 0 0 2.2rem;
  padding: 0;
  list-style: none;
}

.hero-point {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  margin: 0;
  padding: .7rem 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.hero-point:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.hero-point-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--hero-aqua);
  background: rgba(134, 211, 220, .12);
  box-shadow: inset 0 0 0 1px rgba(134, 211, 220, .35);
}

.hero-point-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.hero-point-text small {
  display: block;
  margin-top: .1rem;
  color: rgba(255, 255, 255, .7);
  font-size: .85rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.hero .hero-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem 1.4rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .04em;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}

.hero .hero-btn:hover,
.hero .hero-btn:focus {
  text-decoration: none;
  transform: translateY(-2px);
}

.hero .hero-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.hero .hero-btn-primary {
  color: var(--hero-ink);
  background: var(--hero-aqua);
  box-shadow: 0 8px 22px rgba(8, 24, 36, .3);
}

.hero .hero-btn-primary:hover,
.hero .hero-btn-primary:focus {
  color: var(--hero-ink);
  background: #a6e2e8;
}

.hero .hero-btn-outline {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
}

.hero .hero-btn-outline:hover,
.hero .hero-btn-outline:focus {
  color: #fff;
  border-color: #fff;
  background: rgba(255, 255, 255, .08);
}

.hero .hero-btn-ghost {
  padding-left: .6rem;
  padding-right: .6rem;
  color: rgba(255, 255, 255, .85);
}

.hero .hero-btn-ghost:hover,
.hero .hero-btn-ghost:focus {
  color: #fff;
}

/* 読み込み時のフェードイン（順番にずらす） */
.hero-title,
.hero-tagline,
.hero-point,
.hero-actions,
.hero-visual {
  animation: hero-fade-up .9s cubic-bezier(.2, .7, .2, 1) both;
}

.hero-title              { animation-delay: .1s; }
.hero-tagline            { animation-delay: .25s; }
.hero-point:nth-child(1) { animation-delay: .4s; }
.hero-point:nth-child(2) { animation-delay: .5s; }
.hero-point:nth-child(3) { animation-delay: .6s; }
.hero-actions            { animation-delay: .75s; }
.hero-visual             { animation-delay: .35s; animation-duration: 1.1s; }

@keyframes hero-fade-up {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 成分ラベル ---------- */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 1.3rem 1.4rem 1.2rem;
  border-radius: 16px;
  color: var(--hero-ink);
  background: #fbfdfd;
  box-shadow:
    0 0 0 18px rgba(134, 211, 220, .08),
    0 0 0 19px rgba(134, 211, 220, .16),
    0 40px 70px -20px rgba(6, 20, 32, .65);
  animation: hero-float 7s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -8px, 0); }
}

.hero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--hero-ink);
}

.hero-card-label {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.hero-status {
  position: relative;
  display: inline-grid;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.hero-status > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-status-scan {
  color: #3a7f8a;
  background: rgba(134, 211, 220, .22);
  animation: hero-status-scan 9s linear infinite;
}

.hero-status-scan::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3aa7b5;
  animation: hero-blink 1s ease-in-out infinite;
}

.hero-status-done {
  color: #fff;
  background: var(--hero-navy);
  opacity: 0;
  animation: hero-status-done 9s linear infinite;
}

.hero-status-done::before {
  content: "✓";
  font-size: .75rem;
}

@keyframes hero-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .25; }
}

@keyframes hero-status-scan {
  0%, 77%   { opacity: 1; }
  80%, 95%  { opacity: 0; }
  98%, 100% { opacity: 1; }
}

@keyframes hero-status-done {
  0%, 77%   { opacity: 0; transform: scale(.85); }
  80%       { opacity: 1; transform: scale(1.06); }
  82%, 93%  { opacity: 1; transform: scale(1); }
  96%, 100% { opacity: 0; transform: scale(1); }
}

.hero-list {
  position: relative;
  overflow: hidden;
  margin: .35rem 0 .2rem;
}

.hero-ingredients {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-ing {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .5rem;
  border-bottom: 1px solid #e3ebef;
  font-size: .9rem;
  line-height: 1.35;
}

.hero-ing:last-child {
  border-bottom: 0;
}

.hero-ing::before {
  content: "";
  position: absolute;
  inset: 2px 0;
  z-index: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(134, 211, 220, .34), rgba(134, 211, 220, .10));
  opacity: 0;
}

.hero-ing > * {
  position: relative;
  z-index: 1;
}

.hero-ing-no {
  flex: none;
  color: #8aa1af;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .72rem;
  letter-spacing: .05em;
}

.hero-ing-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-ing-check {
  flex: none;
  color: #2f9aa8;
  opacity: 0;
}

.hero-ing:nth-child(1)::before, .hero-ing:nth-child(1) .hero-ing-check { animation: hero-ing-1 9s linear infinite; }
.hero-ing:nth-child(2)::before, .hero-ing:nth-child(2) .hero-ing-check { animation: hero-ing-2 9s linear infinite; }
.hero-ing:nth-child(3)::before, .hero-ing:nth-child(3) .hero-ing-check { animation: hero-ing-3 9s linear infinite; }
.hero-ing:nth-child(4)::before, .hero-ing:nth-child(4) .hero-ing-check { animation: hero-ing-4 9s linear infinite; }
.hero-ing:nth-child(5)::before, .hero-ing:nth-child(5) .hero-ing-check { animation: hero-ing-5 9s linear infinite; }
.hero-ing:nth-child(6)::before, .hero-ing:nth-child(6) .hero-ing-check { animation: hero-ing-6 9s linear infinite; }

/* 走査バーが各行の中央を通過する時刻（周期の %）: 10, 18, 27, 35, 43, 51 */
@keyframes hero-ing-1 { 0%, 9%  { opacity: 0; } 12%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes hero-ing-2 { 0%, 17% { opacity: 0; } 20%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes hero-ing-3 { 0%, 26% { opacity: 0; } 29%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes hero-ing-4 { 0%, 34% { opacity: 0; } 37%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes hero-ing-5 { 0%, 42% { opacity: 0; } 45%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes hero-ing-6 { 0%, 50% { opacity: 0; } 53%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* 走査バー：.hero-scan はリストと同じ大きさで、上端にバーを持つ。
   translateY(100%) でリストの高さぶん下へ動く。 */
.hero-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  animation: hero-scan 9s linear infinite;
}

.hero-scan-bar {
  position: absolute;
  top: -1px;
  left: -6px;
  right: -6px;
  height: 2px;
  border-radius: 2px;
  background: #3fb8c6;
  box-shadow: 0 0 10px 2px rgba(63, 184, 198, .55), 0 0 26px 6px rgba(134, 211, 220, .35);
}

.hero-scan-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 46px;
  background: linear-gradient(to bottom, rgba(134, 211, 220, 0), rgba(134, 211, 220, .28));
}

@keyframes hero-scan {
  0%, 4%    { opacity: 0; transform: translate3d(0, 0, 0); }
  6%        { opacity: 1; transform: translate3d(0, 2%, 0); }
  56%       { opacity: 1; transform: translate3d(0, 100%, 0); }
  59%, 100% { opacity: 0; transform: translate3d(0, 100%, 0); }
}

.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: .85rem;
  border-top: 2px solid var(--hero-ink);
}

.hero-rating-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.hero-stars {
  display: inline-flex;
  gap: .2rem;
}

.hero-star {
  display: block;
  overflow: visible;
}

.hero-star-empty {
  fill: #eef3f5;
  stroke: #c3d2da;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.hero-star-fill {
  fill: var(--hero-gold);
  stroke: #d99a2b;
  stroke-width: 1;
  stroke-linejoin: round;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.hero-star:nth-child(1) .hero-star-fill { animation: hero-star-1 9s linear infinite; }
.hero-star:nth-child(2) .hero-star-fill { animation: hero-star-2 9s linear infinite; }
.hero-star:nth-child(3) .hero-star-fill { animation: hero-star-3 9s linear infinite; }
.hero-star:nth-child(4) .hero-star-fill { animation: hero-star-4 9s linear infinite; }
.hero-star:nth-child(5) .hero-star-fill { animation: hero-star-5 9s linear infinite; }

/* 星は 60, 64, 68, 72, 76% の順に点灯する */
@keyframes hero-star-1 { 0%, 60% { opacity: 0; transform: scale(.3); } 63% { opacity: 1; transform: scale(1.2); } 65%, 92% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(1); } }
@keyframes hero-star-2 { 0%, 64% { opacity: 0; transform: scale(.3); } 67% { opacity: 1; transform: scale(1.2); } 69%, 92% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(1); } }
@keyframes hero-star-3 { 0%, 68% { opacity: 0; transform: scale(.3); } 71% { opacity: 1; transform: scale(1.2); } 73%, 92% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(1); } }
@keyframes hero-star-4 { 0%, 72% { opacity: 0; transform: scale(.3); } 75% { opacity: 1; transform: scale(1.2); } 77%, 92% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(1); } }
@keyframes hero-star-5 { 0%, 76% { opacity: 0; transform: scale(.3); } 79% { opacity: 1; transform: scale(1.2); } 81%, 92% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(1); } }

/* ---------- スマートフォン ---------- */
@media (max-width: 767.98px) {
  .hero {
    padding: 3.5rem 0 3rem;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.75rem;
    padding: 0 20px;
  }

  .hero .hero-title {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
    letter-spacing: .02em;
  }

  .hero-tagline {
    margin-bottom: 1.5rem;
  }

  .hero-points {
    margin-bottom: 1.75rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }

  .hero .hero-btn {
    justify-content: center;
    padding: .8rem 1.15rem;
    font-size: .92rem;
  }

  .hero-card {
    max-width: 300px;
    padding: 1.05rem 1.1rem 1rem;
    border-radius: 14px;
  }

  .hero-card {
    box-shadow:
      0 0 0 12px rgba(134, 211, 220, .08),
      0 0 0 13px rgba(134, 211, 220, .16),
      0 30px 60px -20px rgba(6, 20, 32, .65);
  }

  .hero-ing {
    padding: .45rem .4rem;
    font-size: .82rem;
  }

  .hero-star {
    width: 19px;
    height: 19px;
  }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero *,
  .hero *::before,
  .hero *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-bubble,
  .hero-scan,
  .hero-status-scan {
    display: none;
  }

  .hero-title,
  .hero-tagline,
  .hero-point,
  .hero-actions,
  .hero-visual,
  .hero-status-done,
  .hero-ing-check,
  .hero-star-fill {
    opacity: 1;
    transform: none;
  }

  .hero .hero-btn:hover,
  .hero .hero-btn:focus {
    transform: none;
  }
}
