/* =============================================================
   Homepage brand story — interactive showcase panel
   ============================================================= */

.home-cafe .hp-story {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 6vw, 60px) 0;
  background:
    radial-gradient(ellipse 50% 45% at 15% 15%, rgba(var(--green-rgb), 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 90% 85%, rgba(var(--text-primary-rgb), 0.07) 0%, transparent 50%),
    linear-gradient(180deg, var(--cafe-cream) 0%, var(--cafe-latte) 55%, var(--cafe-latte-deep) 100%);
}

.home-cafe .hp-story::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23396D1B' fill-opacity='0.035'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

.home-cafe .hp-story__orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}

.home-cafe .hp-story__orb--1 {
  top: -40px;
  right: 6%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(var(--green-rgb), 0.16), transparent 70%);
}

.home-cafe .hp-story__orb--2 {
  bottom: -60px;
  left: -30px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(var(--text-primary-rgb), 0.1), transparent 70%);
}

.home-cafe .hp-story .container {
  position: relative;
  z-index: 1;
}

.home-cafe .hp-story__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(var(--green-rgb), 0.25);
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

/* ---- Layout ---- */
.home-cafe .hp-story__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
  margin-top: clamp(36px, 4.5vw, 52px);
}

/* ---- Stage (main panel) ---- */
.home-cafe .hp-story__stage {
  display: flex;
  flex-direction: column;
  width: min(100%, 420px);
  max-width: 420px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid rgba(var(--green-rgb), 0.1);
  box-shadow:
    0 16px 40px rgba(var(--green-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.home-cafe .hp-story__stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 2.2vw, 22px) 12px;
  border-bottom: 1px solid rgba(var(--green-rgb), 0.08);
  background: linear-gradient(180deg, #fafdfa 0%, var(--white) 100%);
}

.home-cafe .hp-story__counter {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(var(--text-secondary-rgb), 0.55);
  white-space: nowrap;
}

.home-cafe .hp-story__counter span {
  color: var(--green);
  font-size: 0.95rem;
}

.home-cafe .hp-story__track {
  flex: 1;
  max-width: 200px;
  height: 4px;
  border-radius: 999px;
  background: rgba(var(--green-rgb), 0.12);
  overflow: hidden;
}

.home-cafe .hp-story__track-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cafe-brown) 0%, var(--cafe-caramel) 100%);
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-cafe .hp-story__stage-body {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  opacity: 1;
  transform: translateY(0);
}

.home-cafe .hp-story__stage-body.is-exiting {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.48s ease, transform 0.48s ease;
}

.home-cafe .hp-story__stage-body.is-changing {
  opacity: 0;
  transform: translateY(16px);
  transition: none;
}

.home-cafe .hp-story__stage-body.is-revealing {
  animation: hp-story-reveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hp-story-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Square image card — image fills the card edge to edge */
.home-cafe .hp-story__stage-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cafe-latte);
}

.home-cafe .hp-story__stage-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  line-height: 0;
}

.home-cafe .hp-story__stage-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* ---- Nav rail ---- */
.home-cafe .hp-story__nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-cafe .hp-story__nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: clamp(14px, 2vw, 18px) clamp(16px, 2.2vw, 20px);
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  text-align: left;
  cursor: pointer;
  transition:
    background 0.42s ease,
    border-color 0.42s ease,
    box-shadow 0.42s ease,
    transform 0.42s ease;
}

.home-cafe .hp-story__nav-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(var(--green-rgb), 0.12);
}

.home-cafe .hp-story__nav-item.is-active {
  background: var(--white);
  border-color: rgba(var(--green-rgb), 0.18);
  box-shadow: 0 10px 28px rgba(var(--green-rgb), 0.1);
  transform: translateX(4px);
}

.home-cafe .hp-story__nav-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(var(--text-secondary-rgb), 0.55);
  background: rgba(var(--green-rgb), 0.08);
  transition: background 0.42s ease, color 0.42s ease;
}

.home-cafe .hp-story__nav-item.is-active .hp-story__nav-num {
  color: var(--white);
  background: linear-gradient(145deg, var(--cafe-caramel) 0%, var(--cafe-brown) 100%);
}

.home-cafe .hp-story__nav-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-cafe .hp-story__nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(var(--text-secondary-rgb), 0.55);
}

.home-cafe .hp-story__nav-item.is-active .hp-story__nav-label {
  color: var(--cafe-caramel);
}

.home-cafe .hp-story__nav-title {
  font-family: var(--hp-font-display, var(--font-primary));
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--cafe-brown-mid);
}

.home-cafe .hp-story__nav-icon {
  flex-shrink: 0;
  font-size: 14px;
  color: rgba(var(--green-rgb), 0.35);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.42s ease, transform 0.42s ease, color 0.42s ease;
}

.home-cafe .hp-story__nav-item.is-active .hp-story__nav-icon {
  opacity: 1;
  transform: translateX(0);
  color: var(--green);
}

/* ---- Responsive ---- */
@media screen and (max-width: 991px) {
  .home-cafe .hp-story__layout {
    grid-template-columns: 1fr;
  }

  .home-cafe .hp-story__stage {
    max-width: min(100%, 420px);
    margin-inline: auto;
  }

  /* Card on top; the four chapters stacked in a column below it */
  .home-cafe .hp-story__nav {
    order: 0;
    flex-direction: column;
    gap: 10px;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  .home-cafe .hp-story__nav-item {
    flex: 1 1 auto;
    width: 100%;
    scroll-snap-align: none;
    transform: none;
  }

  .home-cafe .hp-story__nav-item.is-active {
    transform: none;
  }

  .home-cafe .hp-story__nav-copy {
    gap: 4px;
  }
}

@media screen and (max-width: 767px) {
  .home-cafe .hp-story {
    padding: 56px 0;
  }

  .home-cafe .hp-story__track {
    max-width: 120px;
  }

  /* Card on top, the four points stacked in a column below it */
  .home-cafe .hp-story__nav {
    order: 0;
    flex-direction: column;
    gap: 10px;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  .home-cafe .hp-story__nav-item {
    flex: 1 1 auto;
    width: 100%;
    scroll-snap-align: none;
  }

  .home-cafe .hp-story__nav-icon {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-cafe .hp-story__stage-body.is-exiting,
  .home-cafe .hp-story__stage-body.is-revealing,
  .home-cafe .hp-story__track-fill,
  .home-cafe .hp-story__nav-item {
    animation: none;
    transition: none;
  }

  .home-cafe .hp-story__nav-item.is-active {
    transform: none;
  }
}
