/* Client story pages. Loads after styles.css, home.css (overlay header, map form,
   booking section, network) and seat.css (claim section with the V cut). */

/* ---------- Hero ---------- */

.story-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(55% 70% at 80% 40%, rgba(29, 79, 216, .5), rgba(29, 79, 216, 0) 70%),
    var(--navy);
  color: #fff;
  padding-block: 7.5rem 5.5rem;
  --v: 40px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - var(--v)), 0 100%);
}
.story-hero .wrap { max-width: 52rem; }
.story-hero .crumbs { font-size: var(--t-sm); color: var(--on-dark-muted); margin-bottom: 1.25rem; }
.story-hero .crumbs a { color: var(--on-dark-muted); }
.story-hero .eyebrow { color: var(--lagoon); }
.story-hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 3.75rem); max-width: 18ch; }
.story-hero .lede { color: var(--on-dark-muted); margin: 1.25rem 0 1.75rem; max-width: 36rem; }
.story-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.story-tags li {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .85rem; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
  font-size: .8125rem; font-weight: 600;
}
.story-tags .dot { width: .5rem; height: .5rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
/* Hero text rises in on load */
.js .story-hero .rise { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease-out) forwards; animation-delay: calc(var(--d, 0) * 120ms + 100ms); }
@media (max-width: 760px) { .story-hero { padding-block: 6.5rem 4rem; --v: 20px; } }

/* ---------- Story sections: a numbered label on the left, the story on the right ---------- */

.story-grid { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); max-width: 60rem; }
.story-label { font: 700 .8125rem/1.4 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--ocean); padding-top: .4rem; }
.story-label span { display: block; font: 600 2.25rem/1 var(--font-display); letter-spacing: 0; color: var(--claimed); margin-bottom: .4rem; }
.story-section h2 { margin-bottom: 1rem; }
.story-section p { color: var(--slate); font-size: var(--t-lg); max-width: 38rem; }
.story-section p + p { margin-top: 1rem; }
@media (max-width: 760px) {
  .story-grid { grid-template-columns: 1fr; gap: .75rem; }
  .story-label span { display: inline; font-size: 1rem; margin-right: .5rem; }
}

/* Text fades up as it scrolls into view (story.js adds .is-in) */
.js .reveal-up { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal-up.is-in { opacity: 1; transform: none; }

/* Cards pop up one after another as they scroll in: rise, a slight overshoot, then
   the number or status badge pops after its card */
.js .pop-up { opacity: 0; transform: translateY(28px) scale(.94); }
.js .pop-up.is-in { animation: card-pop .6s cubic-bezier(.3, 1.4, .5, 1) forwards; animation-delay: calc(var(--d, 0) * 160ms); }
@keyframes card-pop { to { opacity: 1; transform: none; } }
.js .pop-up .ico, .js .pop-up .state-pill { transform: scale(0); }
.js .pop-up.is-in .ico, .js .pop-up.is-in .state-pill { animation: badge-pop .4s cubic-bezier(.3, 1.6, .5, 1) forwards; animation-delay: calc(var(--d, 0) * 160ms + 300ms); }
@keyframes badge-pop { to { transform: scale(1); } }

/* The challenge */
.challenge-list { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .9rem; }
.challenge-list li {
  display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: .9rem; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  color: var(--slate); font-size: var(--t-sm);
}
.challenge-list strong { display: block; color: var(--ink); font: 600 var(--t-base)/1.3 var(--font-display); margin-bottom: .2rem; }
.challenge-list .ico { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid #e5484d; color: #e5484d; font: 700 .875rem/1 var(--font-display); }

/* What we built */
.built-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; margin-top: 1.75rem; }
.built-card {
  background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.25rem; display: grid; gap: .4rem; align-content: start;
  transition: border-color .2s ease, transform .2s var(--ease-out);
}
.built-card:hover { border-color: var(--ocean); transform: translateY(-2px); }
.built-card h3 { font-size: var(--t-lg); }
.built-card p { font-size: var(--t-sm); color: var(--slate); }
.state-pill { justify-self: start; padding: .25rem .6rem; border-radius: 999px; background: #dcfce7; color: #166534; font: 700 .6875rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.built-card.is-next .state-pill { background: #e8edf3; color: var(--slate); }

/* Where it's at */
.story-timeline { list-style: none; padding: 0; margin: 1.75rem 0 0; position: relative; display: grid; gap: 1.1rem; }
.story-timeline::before { content: ""; position: absolute; left: 7px; top: .5rem; bottom: .5rem; width: 2px; background: var(--line); }
.story-timeline li { position: relative; padding-left: 2rem; }
.story-timeline li::before {
  content: ""; position: absolute; left: 0; top: .2rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--claimed); z-index: 1;
}
.story-timeline li.done::before { background: var(--ocean); border-color: var(--ocean); }
.story-timeline li.here::before { background: var(--lagoon); border-color: var(--lagoon); box-shadow: 0 0 0 6px rgba(56, 189, 248, .22); }
.story-timeline .when { display: block; font-size: .8125rem; font-weight: 700; color: var(--slate); }
.story-timeline li.here .when { color: var(--ocean); }
.story-timeline .what { display: block; font-weight: 500; color: var(--ink); }

/* ---------- Booking ---------- */

.story-book .seat-count {
  display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1rem;
  padding: .45rem .9rem; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  font-size: var(--t-sm); font-weight: 600; color: #fff;
}
.story-book .seat-count .dot { width: .5rem; height: .5rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }

.story-book .not-ready { margin-top: 1.25rem; color: var(--on-dark-muted); font-size: var(--t-sm); }
.story-book .link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: #fff; text-decoration: underline; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .js .story-hero .rise, .js .reveal-up, .js .pop-up, .js .pop-up .ico, .js .pop-up .state-pill { opacity: 1; transform: none; animation: none; transition: none; }
}
