/* Fermentation & maturation motion: a living onggi hero, the time-lapse figure
   and the research flow. Built on detail-motion.css (stage, labels, legend,
   in-view gating by detail-motion.js). Pause motion and reduced motion are
   handled by detail-pages.css; every element rests on a meaningful still frame,
   which is also the frame each loop starts on. Kit faces only. */

/* 1. Hero: sunlit onggi courtyard ----------------------------------------- */
.food-hero-image { isolation: isolate; }
.food-hero-image::after { content: ""; position: absolute; inset: -10% auto -10% -50%; z-index: 2; width: 34%; background: linear-gradient(100deg, transparent 0%, rgba(255, 236, 206, .34) 50%, transparent 100%); mix-blend-mode: screen; transform: skewX(-12deg); pointer-events: none; opacity: 0; }
.fm-motes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fm-motes i { position: absolute; width: var(--s, 4px); height: var(--s, 4px); border-radius: 50%; background: rgba(255, 240, 214, .85); box-shadow: 0 0 8px 2px rgba(255, 230, 196, .55); opacity: 0; }
.fm-motes i:nth-child(1) { left: 18%; top: 62%; --s: 6px; }
.fm-motes i:nth-child(2) { left: 32%; top: 48%; --s: 4.5px; }
.fm-motes i:nth-child(3) { left: 46%; top: 70%; --s: 7px; }
.fm-motes i:nth-child(4) { left: 61%; top: 40%; --s: 4.5px; }
.fm-motes i:nth-child(5) { left: 74%; top: 58%; --s: 6px; }
.fm-motes i:nth-child(6) { left: 26%; top: 30%; --s: 4.5px; }
.fm-motes i:nth-child(7) { left: 84%; top: 34%; --s: 5px; }
.fm-motes i:nth-child(8) { left: 55%; top: 22%; --s: 4.5px; }

@keyframes fm-hero-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes fm-hero-light { 0%, 55% { opacity: 0; transform: translateX(0) skewX(-12deg); } 60% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; transform: translateX(560%) skewX(-12deg); } }
@keyframes fm-mote { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: .9; } 75% { opacity: .55; } 100% { opacity: 0; transform: translate(14px, -70px); } }

.food-hero-figure.is-live .food-hero-image img { animation: fm-hero-zoom 26s ease-in-out infinite alternate; }
.food-hero-figure.is-live .food-hero-image::after { animation: fm-hero-light 11s ease-in-out infinite; }
.food-hero-figure.is-live .fm-motes i { animation: fm-mote 7s ease-in-out infinite; }
.food-hero-figure.is-live .fm-motes i:nth-child(2) { animation-duration: 8.5s; animation-delay: -2s; }
.food-hero-figure.is-live .fm-motes i:nth-child(3) { animation-duration: 9s; animation-delay: -5s; }
.food-hero-figure.is-live .fm-motes i:nth-child(4) { animation-duration: 7.5s; animation-delay: -3.5s; }
.food-hero-figure.is-live .fm-motes i:nth-child(5) { animation-duration: 8s; animation-delay: -6s; }
.food-hero-figure.is-live .fm-motes i:nth-child(6) { animation-duration: 10s; animation-delay: -1s; }
.food-hero-figure.is-live .fm-motes i:nth-child(7) { animation-duration: 9.5s; animation-delay: -7s; }
.food-hero-figure.is-live .fm-motes i:nth-child(8) { animation-duration: 8.8s; animation-delay: -4.2s; }
.food-hero-figure.is-off *, .food-hero-figure.is-off *::after { animation-play-state: paused !important; }

/* 2. Photographic concept scenes with HTML captions at every viewport.
   The images stay still; only soft environmental light changes around them. */
.food-time { scroll-margin-top: 110px; }
.food-time .fm-time { margin-bottom: 0; }
.fm-time { --fm-plum: #563440; --fm-ink: #51444a; --fm-rule: #cbb89d; }
.fm-atlas { overflow: hidden; border: 1px solid #d8c8b5; border-radius: 3px 3px 22px 22px; background: #f6f0e5; box-shadow: 0 24px 65px #513a2b0c; }
.fm-atlas-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 38px 25px; border-bottom: 1px solid #d8c8b580; background: linear-gradient(115deg, #fcf8ee, #eee4d4); }
.fm-eyebrow { display: block; color: #856d55; font-family: var(--font-ui); font-size: 12px; line-height: 1.6; letter-spacing: .14em; text-transform: uppercase; }
.fm-atlas-heading h3 { margin: 10px 0 0; color: var(--fm-plum); font-family: var(--font-brand); font-size: clamp(27px, 3vw, 40px); line-height: 1.08; font-weight: 500; letter-spacing: -.025em; }
.fm-atlas-heading h3 em { font-weight: 400; }
.fm-day-cycle { flex: 0 1 210px; color: #7b6558; text-align: center; font-size: 12px; line-height: 1.6; }
.fm-day-cycle svg { display: block; width: 100%; height: auto; }
.fm-environments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 27px 18px 28px; }
.fm-environment { min-width: 0; padding: 0 19px; }
.fm-environment + .fm-environment { border-left: 1px solid #d0bea780; }
.fm-card-index { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; color: #796557; font-family: var(--font-ui); font-size: 12px; line-height: 1.6; }
.fm-card-index span:first-child { color: var(--fm-plum); font-weight: 600; }
.fm-card-index span:last-child { font-style: italic; }
.fm-photo-scene { position: relative; isolation: isolate; aspect-ratio: 4 / 5; overflow: hidden; margin: 15px 0 23px; border-radius: 3px 3px 12px 12px; background: #d4c2aa; }
.fm-photo-scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.fm-scene-light { position: absolute; inset: -12%; z-index: 1; pointer-events: none; opacity: 0; mix-blend-mode: screen; }
.fm-scene-earth .fm-scene-light { background: radial-gradient(ellipse at 20% 18%, #fff0cf75, transparent 64%); }
.fm-scene-water .fm-scene-light { background: radial-gradient(ellipse at 28% 32%, transparent 22%, #e2fcff4d 25%, transparent 29%), radial-gradient(ellipse at 73% 52%, transparent 25%, #d8f8ff38 29%, transparent 33%), linear-gradient(125deg, transparent 20%, #d9fbff29 43%, transparent 57%); }
.fm-scene-coast .fm-scene-light { background: linear-gradient(108deg, transparent 10%, #fff5dc52 42%, transparent 75%); }
.fm-card-copy { padding: 6px 4px 0; }
.fm-card-copy h4 { margin: 0 0 9px; color: var(--fm-plum); font-family: var(--font-brand); font-weight: 500; font-size: clamp(20px, 2vw, 25px); line-height: 1.2; letter-spacing: -.025em; }
.fm-card-copy p { margin: 0; color: #6b5b56; font-size: 14px; line-height: 1.7; }
.fm-environment-note { display: block; margin-top: 18px; padding-top: 12px; border-top: 1px solid #d2c2ad90; color: #80694e; font-size: 12px; line-height: 1.5; }
.fm-time-story { display: grid; grid-template-columns: .85fr 2fr; align-items: center; gap: 26px; padding: 25px 38px 28px; background: #eae0d1; border-top: 1px solid #d2c1aa; }
.fm-time-story-title { display: flex; align-items: center; gap: 14px; color: #725e51; font-size: 13px; line-height: 1.6; }
.fm-time-story-title strong { color: var(--fm-plum); font-weight: 500; }
.fm-time-orbit { position: relative; flex: 0 0 32px; height: 32px; border: 1px solid #bba078; border-radius: 50%; }
.fm-time-orbit::before { content: ""; position: absolute; inset: 5px; border: 1px solid #baa17b66; border-radius: 50%; }
.fm-time-orbit::after { content: ""; position: absolute; width: 6px; height: 6px; top: -3px; left: 12px; border-radius: 50%; background: #8f6745; box-shadow: 0 0 0 4px #eae0d1; }
.fm-story-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.fm-story-stages li { position: relative; padding-top: 13px; border-top: 1px solid #baa58d; }
.fm-story-stages li::before { content: ""; position: absolute; top: -3px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #9f7e57; }
.fm-story-stages span { display: block; color: #81694f; font-size: 12px; line-height: 1.6; }
.fm-story-stages strong { display: block; color: var(--fm-plum); font-weight: 500; font-size: 13px; line-height: 1.6; }
.fm-time > .detail-image-note { max-width: 850px; margin-top: 16px; font-size: 12px; line-height: 1.7; }
/* Scene motion begins only when the shared lifecycle marks the figure live.
   No image transforms: the food remains clear and physically grounded. */
@keyframes fm-atlas-sun { 0%, 100% { transform: translate(0, 0); opacity: .65; } 50% { transform: translate(10px, -7px); opacity: 1; } }
@keyframes fm-earth-light { 0%, 100% { opacity: .08; transform: translate(0, 0); } 50% { opacity: .24; transform: translate(3%, 2%); } }
@keyframes fm-water-light { 0%, 100% { opacity: .12; transform: translate(-2%, 1%) scale(1); } 50% { opacity: .3; transform: translate(2%, -1%) scale(1.04); } }
@keyframes fm-coast-light { 0%, 100% { opacity: .04; transform: translateX(-4%); } 50% { opacity: .2; transform: translateX(4%); } }
@keyframes fm-atlas-orbit { to { transform: rotate(360deg); } }
@keyframes fm-atlas-stage { 0%, 100% { opacity: .5; } 40%, 60% { opacity: 1; } }
.fm-time.is-live .fm-cycle-sun { animation: fm-atlas-sun 18s ease-in-out infinite; }
.fm-time.is-live .fm-scene-earth .fm-scene-light { animation: fm-earth-light 15s ease-in-out infinite; }
.fm-time.is-live .fm-scene-water .fm-scene-light { animation: fm-water-light 11s ease-in-out infinite; }
.fm-time.is-live .fm-scene-coast .fm-scene-light { animation: fm-coast-light 14s ease-in-out infinite; }
.fm-time.is-live .fm-time-orbit { animation: fm-atlas-orbit 24s linear infinite; }
.fm-time.is-live .fm-story-stages li::before { animation: fm-atlas-stage 9s ease-in-out infinite; }
.fm-time.is-live .fm-story-stages li:nth-child(2)::before { animation-delay: -3s; }
.fm-time.is-live .fm-story-stages li:nth-child(3)::before { animation-delay: -6s; }
.fm-time:not(.is-live) *, .fm-time:not(.is-live) *::before, .fm-time:not(.is-live) *::after, .fm-time.is-off *, .fm-time.is-off *::before, .fm-time.is-off *::after { animation-play-state: paused !important; }
@media (max-width: 900px) and (min-width: 641px) {
  .fm-atlas-heading { padding: 26px; }
  .fm-environments { grid-template-columns: 1fr; padding: 0 26px; }
  .fm-environment { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 26px; padding: 26px 0; }
  .fm-environment + .fm-environment { border-left: 0; border-top: 1px solid #d0bea7; }
  .fm-card-index { grid-column: 1 / -1; }
  .fm-photo-scene { margin-bottom: 0; }
  .fm-card-copy { align-self: center; padding: 15px 0 0; }
  .fm-time-story { padding-inline: 26px; gap: 20px; }
}
@media (max-width: 640px) {
  .fm-atlas { border-radius: 3px 3px 16px 16px; }
  .fm-atlas-heading { padding: 24px 20px; align-items: flex-start; gap: 10px; }
  .fm-atlas-heading h3 { font-size: 28px; }
  .fm-eyebrow { max-width: 150px; letter-spacing: .07em; }
  .fm-day-cycle { flex: 0 0 88px; margin-top: 12px; }
  .fm-day-cycle span { display: block; max-width: 85px; margin: 2px auto 0; }
  .fm-environments { display: block; padding: 0 20px; }
  .fm-environment { padding: 23px 0 25px; }
  .fm-environment + .fm-environment { border-left: 0; border-top: 1px solid #d0bea7; }
  .fm-photo-scene { margin-top: 12px; margin-bottom: 21px; }
  .fm-card-copy { padding-inline: 0; }
  .fm-card-copy h4 { font-size: 25px; }
  .fm-card-copy p { font-size: 14px; }
  .fm-environment-note { margin-top: 15px; }
  .fm-time-story { display: block; padding: 23px 20px; }
  .fm-time-story-title { margin-bottom: 22px; }
  .fm-story-stages { display: block; padding-left: 15px; }
  .fm-story-stages li { padding: 0 0 18px 20px; border-top: 0; border-left: 1px solid #baa58d; }
  .fm-story-stages li:last-child { padding-bottom: 0; }
  .fm-story-stages li::before { top: 6px; left: -3px; }
  .fm-story-stages strong { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
 .fm-time *, .fm-time *::before, .fm-time *::after { animation: none !important; }
}

/* 3. Research band: Understand, Respect, Connect lighting in turn ---------- */
.food-research-points article { position: relative; }
.food-research-points article::before { content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, #e2b6c3, #f3dfc6); transform-origin: left center; }
@keyframes fm-step-1 { 0%, 4% { transform: scaleX(0); } 22%, 88% { transform: scaleX(1); opacity: 1; } 96% { opacity: 0; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(0); } }
@keyframes fm-step-2 { 0%, 24% { transform: scaleX(0); } 42%, 88% { transform: scaleX(1); opacity: 1; } 96% { opacity: 0; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(0); } }
@keyframes fm-step-3 { 0%, 44% { transform: scaleX(0); } 62%, 88% { transform: scaleX(1); opacity: 1; } 96% { opacity: 0; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(0); } }
@keyframes fm-step-glow { 0%, 42%, 100% { text-shadow: none; color: #e2b6c3; } 12%, 28% { color: #fff3f6; text-shadow: 0 0 14px rgba(242, 196, 210, .7); } }
.food-research.is-live .food-research-points article:nth-child(1)::before { animation: fm-step-1 10s cubic-bezier(.45,0,.3,1) infinite; }
.food-research.is-live .food-research-points article:nth-child(2)::before { animation: fm-step-2 10s cubic-bezier(.45,0,.3,1) infinite; }
.food-research.is-live .food-research-points article:nth-child(3)::before { animation: fm-step-3 10s cubic-bezier(.45,0,.3,1) infinite; }
.food-research.is-live .food-research-points article::before { animation-delay: -7.5s !important; }
.food-research.is-live .food-research-points article span { animation: fm-step-glow 10s ease-in-out infinite; }
.food-research.is-live .food-research-points article:nth-child(1) span { animation-delay: -7.5s; }
.food-research.is-live .food-research-points article:nth-child(2) span { animation-delay: -5.5s; }
.food-research.is-live .food-research-points article:nth-child(3) span { animation-delay: -3.5s; }
.food-research.is-off *, .food-research.is-off *::before { animation-play-state: paused !important; }

@media (max-width: 760px) {
  .fm-motes i:nth-child(n+6) { display: none; }
}
