/* iNtegra Counselling - fresh index landing page (V3).
   Loads AFTER css/redesign.css and only styles what this page adds.
   Story model: every scene card plays its problem loop by default; on hover,
   focus (or .is-hover) the next chapter fades in with a story line. All motion
   is CSS, transform and opacity only; prefers-reduced-motion freezes each
   scene on its settled, hopeful frame. */

/* ==================== HERO: rotating relate line ==================== */

.relate-box {
  margin: 0 0 1.6rem;
  padding: .8rem 1.1rem;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, .05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  max-width: 32rem;
}
.relate-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .25rem;
}
.relate-line {
  position: relative;
  display: block;
  min-height: 3.2em;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.5;
  color: #e9f2ef;
}
.relate-line span {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}
.relate-line span:first-child { opacity: 1; }
.fx .relate-line span { animation: relate-cycle 27s ease-in-out infinite; }
.fx .relate-line span:nth-child(2) { animation-delay: -4.5s; }
.fx .relate-line span:nth-child(3) { animation-delay: -9s; }
.fx .relate-line span:nth-child(4) { animation-delay: -13.5s; }
.fx .relate-line span:nth-child(5) { animation-delay: -18s; }
.fx .relate-line span:nth-child(6) { animation-delay: -22.5s; }
@keyframes relate-cycle {
  0%, 4%   { opacity: 0; transform: translateY(8px); }
  8%, 26%  { opacity: 1; transform: translateY(0); }
  30%, 100% { opacity: 0; transform: translateY(-8px); }
}

/* ==================== HERO: animated session-room scene ==================== */

/* warm backdrop behind the SVG, replacing the old static image */
.scene-frame {
  background: linear-gradient(160deg, #f7f2e9 0%, #f1e8d7 100%);
  border-radius: var(--radius);
}

.hg-scene { width: 100%; height: auto; display: block; }
.hg-floor { stroke: #c3d6d0; stroke-width: 3; stroke-linecap: round; }
.hg-glow { opacity: .5; }

/* static base state = the hopeful, settled frame (used when JS is off or
   reduced motion is on). The .fx animations below retell the whole story. */
.hg-bubA, .hg-bubB { opacity: 0; }
.hg-coun { opacity: 1; }
.hg-arc { opacity: 1; }
.hg-arc path { stroke-dashoffset: 0; }
.hg-gap { opacity: .25; }
.hg-figL { transform: translateX(36px); }
.hg-figR { transform: translateX(-34px); }

.fx .hg-bubA { animation: hg-bubA 16s ease-in-out infinite; }
@keyframes hg-bubA {
  0%, 3%   { opacity: 0; transform: translateY(6px); }
  8%, 22%  { opacity: 1; transform: translateY(0); }
  30%, 100% { opacity: 0; transform: translateY(0); }
}
.fx .hg-bubB { animation: hg-bubB 16s ease-in-out infinite; }
@keyframes hg-bubB {
  0%, 9%   { opacity: 0; transform: translateY(6px); }
  14%, 27% { opacity: 1; transform: translateY(0); }
  35%, 100% { opacity: 0; transform: translateY(0); }
}
.fx .hg-gap { animation: hg-gap 16s ease-in-out infinite; }
@keyframes hg-gap {
  0%, 34%  { opacity: .55; }
  54%, 88% { opacity: 0; }
  100%     { opacity: .55; }
}
.fx .hg-coun { animation: hg-coun 16s ease-in-out infinite; }
@keyframes hg-coun {
  0%, 26%  { opacity: 0; transform: translateY(10px); }
  37%, 88% { opacity: 1; transform: translateY(0); }
  96%, 100% { opacity: 0; transform: translateY(0); }
}
.fx .hg-figL { animation: hg-figL 16s ease-in-out infinite; }
@keyframes hg-figL {
  0%, 36%  { transform: translateX(0); }
  56%, 88% { transform: translateX(36px); }
  100%     { transform: translateX(0); }
}
.fx .hg-figR { animation: hg-figR 16s ease-in-out infinite; }
@keyframes hg-figR {
  0%, 36%  { transform: translateX(0); }
  56%, 88% { transform: translateX(-34px); }
  100%     { transform: translateX(0); }
}
.fx .hg-arc { animation: hg-arc 16s ease-in-out infinite; }
@keyframes hg-arc {
  0%, 38%  { opacity: 0; }
  48%, 86% { opacity: 1; }
  96%, 100% { opacity: 0; }
}
.fx .hg-arc path { animation: hg-arc-draw 16s ease-in-out infinite; }
@keyframes hg-arc-draw {
  0%, 40%  { stroke-dashoffset: 270; }
  62%, 86% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: 270; }
}
.fx .hg-glow { animation: hg-glow 3.5s ease-in-out infinite; }
@keyframes hg-glow {
  0%, 100% { opacity: .3; }
  50%      { opacity: .75; }
}

/* ==================== ISSUES GRID: story cards ==================== */

.issues-grid {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .issues-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .issues-grid { grid-template-columns: repeat(4, 1fr); } }

.scene-card { display: block; }
.scene-stage {
  display: block;
  position: relative;
  aspect-ratio: 5 / 3;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background:
    radial-gradient(12rem 8rem at 20% 15%, rgba(217, 160, 91, .12), transparent 65%),
    radial-gradient(14rem 9rem at 85% 90%, rgba(31, 91, 85, .1), transparent 60%),
    var(--teal-light);
  overflow: hidden;
}
.scene-stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.scene-card h3 { margin: 0 0 .4rem; font-size: 1.08rem; }
.scene-card p { margin: 0 0 .8rem; font-size: .9rem; color: var(--ink-soft); }

/* two-chapter story: problem layer plays, hope layer waits underneath */
.sc-part { transition: opacity .45s var(--ease-out); }
.sc-hope { opacity: 0; }
.scene-card:hover .sc-problem,
.scene-card:focus-visible .sc-problem,
.scene-card.is-hover .sc-problem { opacity: 0; }
.scene-card:hover .sc-hope,
.scene-card:focus-visible .sc-hope,
.scene-card.is-hover .sc-hope {
  opacity: 1;
  animation: sc-hope-in .6s var(--ease-out);
}
@keyframes sc-hope-in {
  from { transform: scale(.96); }
  to   { transform: scale(1); }
}

/* the "next story" line that rises over the scene on hover */
.story-next {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.7rem .9rem .7rem;
  background: linear-gradient(transparent, rgba(10, 35, 32, .9));
  color: #eaf3f1;
  font-size: .85rem;
  line-height: 1.45;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
  pointer-events: none;
}
.scene-card:hover .story-next,
.scene-card:focus-visible .story-next,
.scene-card.is-hover .story-next { opacity: 1; transform: translateY(0); }

/* touch screens have no hover: show the next-chapter line as a caption */
@media (hover: none) {
  .story-next {
    position: static;
    opacity: 1;
    transform: none;
    background: var(--teal-deep);
    padding: .7rem .9rem .8rem;
  }
  .sc-hope { opacity: 1; }
  .sc-problem { opacity: 0; }
}

/* ==================== SHARED FIGURE COLOURS ==================== */

.sc-fig  { fill: var(--teal); }
.sc-fig2 { fill: var(--accent); }
.sc-head { fill: var(--teal); }
.sc-head2 { fill: var(--accent); }
.sc-floor { stroke: #c3d6d0; stroke-width: 2; stroke-linecap: round; fill: none; }
.sc-prop  { fill: var(--gold); }
.sc-soft  { fill: #cfe0da; }

/* ==================== CHAPTER 1 LOOPS (the problem) ==================== */

/* scene 1: the same fight on repeat */
.sc1-a { animation: sc1-push 4.5s ease-in-out infinite; }
.sc1-b { animation: sc1-push 4.5s ease-in-out infinite reverse; }
@keyframes sc1-push {
  0%, 12%  { transform: translateX(0); }
  42%, 58% { transform: translateX(14px); }
  88%, 100% { transform: translateX(0); }
}
.sc1-clash {
  transform-origin: 100px 44px;
  opacity: 0;
  animation: sc1-clash 4.5s ease-in-out infinite;
}
@keyframes sc1-clash {
  0%, 38% { opacity: 0; transform: scale(.3); }
  46%     { opacity: .9; transform: scale(1); }
  62%     { opacity: 0; transform: scale(1.5); }
  100%    { opacity: 0; transform: scale(.3); }
}

/* scene 2: living like roommates */
.sc2-glow { animation: sc2-glow 3.4s ease-in-out infinite; }
.sc2-glow.g2 { animation-delay: 1.1s; }
@keyframes sc2-glow {
  0%, 100% { opacity: .25; }
  50%      { opacity: .85; }
}
.sc2-dot { opacity: .15; }
.sc2-dot.d1 { animation: sc2-dot 2.6s ease-in-out infinite; }
.sc2-dot.d2 { animation: sc2-dot 2.6s ease-in-out infinite .4s; }
.sc2-dot.d3 { animation: sc2-dot 2.6s ease-in-out infinite .8s; }
@keyframes sc2-dot {
  0%, 100% { opacity: .15; transform: translateY(0); }
  40%      { opacity: 1; transform: translateY(-3px); }
}

/* scene 3: after an affair, the gold stitch */
.sc3-crack {
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: sc3-stitch 8s ease-in-out infinite;
}
@keyframes sc3-stitch {
  0%, 12%   { stroke-dashoffset: 150; }
  55%, 82%  { stroke-dashoffset: 0; }
  95%, 100% { stroke-dashoffset: 150; }
}
.sc3-stitchline {
  stroke-dasharray: 4 7;
  opacity: .25;
  animation: sc3-line 8s ease-in-out infinite;
}
@keyframes sc3-line {
  0%, 40%  { opacity: .25; }
  60%, 82% { opacity: .9; }
  95%, 100% { opacity: .25; }
}

/* scene 4: in-laws in the middle */
.sc4-third { animation: sc4-step 6s ease-in-out infinite; }
@keyframes sc4-step {
  0%, 100% { transform: translateX(0); }
  45%, 60% { transform: translateX(9px); }
}
.sc4-door {
  transform-origin: 60px 84px;
  animation: sc4-door 6s ease-in-out infinite;
}
@keyframes sc4-door {
  0%, 100% { transform: scaleX(1); }
  45%, 60% { transform: scaleX(.55); }
}

/* scene 5: thinking about separation */
.sc5-left  { animation: sc5-drift 9s ease-in-out infinite; }
@keyframes sc5-drift {
  0%, 100% { transform: translateX(0); }
  40%, 60% { transform: translateX(-8px); }
}
.sc5-right { animation: sc5-drift-r 9s ease-in-out infinite; }
@keyframes sc5-drift-r {
  0%, 100% { transform: translateX(0); }
  40%, 60% { transform: translateX(8px); }
}
.sc5-gap {
  transform-origin: 100px 70px;
  animation: sc5-gap 9s ease-in-out infinite;
}
@keyframes sc5-gap {
  0%, 100% { transform: scaleX(.55); opacity: .35; }
  40%, 60% { transform: scaleX(1.15); opacity: .8; }
}
.sc5-bridge {
  opacity: 0;
  animation: sc5-bridge 9s ease-in-out infinite;
}
@keyframes sc5-bridge {
  0%, 55%  { opacity: 0; transform: translateY(4px); }
  70%, 88% { opacity: .95; transform: translateY(0); }
  100%     { opacity: 0; transform: translateY(0); }
}

/* scene 6: the shadow that grew */
.sc6-shadow {
  transform-origin: 100px 88px;
  animation: sc6-shadow 7s ease-in-out infinite;
}
@keyframes sc6-shadow {
  0%, 100% { transform: scale(1); opacity: .18; }
  50%      { transform: scale(1.14); opacity: .32; }
}
.sc6-fig { animation: sc6-fig 7s ease-in-out infinite; }
@keyframes sc6-fig {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* scene 7: about to marry, two halves, one circle */
.sc7-left {
  transform-origin: 100px 60px;
  animation: sc7-left 6.5s ease-in-out infinite;
}
@keyframes sc7-left {
  0%, 10%  { transform: translateX(-14px); }
  45%, 78% { transform: translateX(0); }
  95%, 100% { transform: translateX(-14px); }
}
.sc7-right {
  transform-origin: 100px 60px;
  animation: sc7-right 6.5s ease-in-out infinite;
}
@keyframes sc7-right {
  0%, 10%  { transform: translateX(14px); }
  45%, 78% { transform: translateX(0); }
  95%, 100% { transform: translateX(14px); }
}
.sc7-spark {
  opacity: 0;
  transform-origin: 100px 60px;
  animation: sc7-spark 6.5s ease-in-out infinite;
}
@keyframes sc7-spark {
  0%, 40%  { opacity: 0; transform: scale(.4); }
  52%, 76% { opacity: 1; transform: scale(1); }
  90%, 100% { opacity: 0; transform: scale(.4); }
}

/* scene 8: a session from another country */
.sc8-dot { opacity: .15; }
.sc8-dot.p1 { animation: sc8-dot 3.6s ease-in-out infinite; }
.sc8-dot.p2 { animation: sc8-dot 3.6s ease-in-out infinite .45s; }
.sc8-dot.p3 { animation: sc8-dot 3.6s ease-in-out infinite .9s; }
.sc8-dot.p4 { animation: sc8-dot 3.6s ease-in-out infinite 1.35s; }
.sc8-dot.p5 { animation: sc8-dot 3.6s ease-in-out infinite 1.8s; }
@keyframes sc8-dot {
  0%, 100% { opacity: .15; }
  30%      { opacity: 1; }
}
.sc8-ping {
  transform-origin: center;
  animation: sc8-ping 3.6s ease-out infinite;
}
@keyframes sc8-ping {
  0%       { opacity: .8; transform: scale(.6); }
  70%, 100% { opacity: 0; transform: scale(1.6); }
}

/* ==================== ISSUE LIST CALLOUT ==================== */

.issue-note {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}
.issue-note h3 { margin-top: 0; }
.issue-note ul { columns: 2; column-gap: 2rem; }
@media (max-width: 40rem) { .issue-note ul { columns: 1; } }

/* ==================== REDUCED MOTION: kill switch ==================== */

@media (prefers-reduced-motion: reduce) {
  .relate-line span { animation: none !important; opacity: 0 !important; }
  .relate-line span:first-child { opacity: 1 !important; }

  /* hero: freeze on the settled, hopeful frame */
  .hg-bubA, .hg-bubB { animation: none !important; opacity: 0 !important; }
  .hg-coun { animation: none !important; opacity: 1 !important; transform: none !important; }
  .hg-arc { animation: none !important; opacity: 1 !important; }
  .hg-arc path { animation: none !important; stroke-dashoffset: 0 !important; }
  .hg-gap { animation: none !important; opacity: .25 !important; }
  .hg-figL { animation: none !important; transform: translateX(36px) !important; }
  .hg-figR { animation: none !important; transform: translateX(-34px) !important; }
  .hg-glow { animation: none !important; opacity: .5 !important; }

  /* cards: show chapter two, the hopeful frame */
  .sc1-a, .sc1-b, .sc1-clash, .sc2-glow, .sc2-dot, .sc3-crack, .sc3-stitchline,
  .sc4-third, .sc4-door, .sc5-left, .sc5-right, .sc5-gap, .sc5-bridge,
  .sc6-shadow, .sc6-fig, .sc7-left, .sc7-right, .sc7-spark,
  .sc8-dot, .sc8-ping {
    animation: none !important;
  }
  .sc-problem { opacity: 0 !important; }
  .sc-hope { opacity: 1 !important; animation: none !important; transform: none !important; }
  .story-next { opacity: 1 !important; transform: none !important; }
}
