/* Experience: a dictionary entry under a Jamdani border. The title waits on the left while the words are read;
   a dotted route draws itself down beside them, stopping at each paragraph (scripts/scenes/experience.js). */

.exp {
  --exp-bg: #efe7da;
  --exp-ink: #3a2a20;
  position: relative;
  background: var(--exp-bg);
  color: var(--exp-ink);
}

.exp__border { line-height: 0; overflow: hidden; }
.exp__border svg { display: block; }

/* The boats ride a little swell of their own. */
.jb-boat { animation: bob 3.2s ease-in-out calc(var(--b) * -1.1s) infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

.exp__inner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vh, 48px);
  padding: clamp(56px, 10vh, 120px) max(20px, 8vw) clamp(80px, 16vh, 180px);
}

/* The sari's body, woven faintly into the page behind the words. */
.exp__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--field, none);
  background-position: center top;
  opacity: 0.075;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 75%, transparent 100%);
}

.exp__title {
  margin: 0;
  font-family: 'Nanum Pen Script', var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 2.6rem + 5vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
}

.exp__say {
  margin: 0.25em 0 0;
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.9rem);
  font-variation-settings: 'opsz' 36;
  letter-spacing: 0.01em;
  color: rgba(58, 42, 32, 0.86);
}

.exp__say em { font-style: italic; }

.exp__body {
  position: relative;
  max-width: 34rem;
  padding-left: 46px; /* the route's lane */
  font-family: 'Figtree', var(--font-ui);
  font-size: clamp(1.02rem, 0.94rem + 0.36vw, 1.28rem);
  line-height: 1.6;
}

.exp__body p { margin: 0 0 1.3em; }
.exp__body b { font-weight: 700; }

.exp__def { font-size: 1.08em; }
.exp__last { margin-bottom: 0; }

/* The route: a dotted line that draws itself down the lane, and a woven waypoint at each paragraph. */
.exp__route {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 100%;
  overflow: visible;
}

.exp__route .route-trail {
  fill: none;
  stroke: #b06e47;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.1 7;
}

.exp__route .route-stop {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0.25;
  transform: scale(0.7);
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out);
}

.exp__route .route-stop.is-reached { opacity: 1; transform: none; }

/* Side by side: the title stays put on the left while the words are read; they start lower, as in a spread. */
@media (min-width: 900px) {
  .exp__inner {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    column-gap: 6vw;
  }

  .exp__head {
    position: sticky;
    top: 16vh;
    align-self: start;
  }

  .exp__body { margin-top: clamp(80px, 22vh, 240px); }
}

/* Arriving. */
.exp.is-armed [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
}

.exp.is-armed [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .jb-boat { animation: none; }
  .exp.is-armed [data-reveal] { transform: none; transition: opacity 0.8s linear; }
  .exp__route .route-stop { opacity: 1; transform: none; transition: none; }
}
