/* ── CRAE Video Scroll – Front-end Styles ── */
*, *::before, *::after { box-sizing: border-box; }

#crae-loader {
  position: fixed; inset: 0; background: #f5f5f3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; z-index: 200; transition: opacity 0.6s ease;
}
#crae-loader.done { opacity: 0; pointer-events: none; }
.crae-loader-bar-wrap { width: 220px; height: 2px; background: rgba(0,0,0,0.1); border-radius: 2px; overflow: hidden; }
.crae-loader-bar { height: 100%; width: 0%; background: #1a1a1a; border-radius: 2px; transition: width 0.1s linear; }
.crae-loader-text { font-family: 'Poppins', sans-serif; font-size: 0.72rem; letter-spacing: 0.2em; color: rgba(0,0,0,0.4); text-transform: uppercase; }

.crae-sticky-wrap { height: 500vh; position: relative; }
.crae-sticky-inner { position: sticky; top: 0; height: 100vh; width: 100%; overflow: hidden; }

#crae-canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  display: block;
}

#crae-scrub-video {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; top: 0; left: -9999px;
}

.crae-overlay-scene {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  pointer-events: none;
  opacity: 0; will-change: opacity;
}
.crae-overlay-scene.visible { opacity: 1; }

/* ─── SCENE 1 ─── */
#crae-scene1 { padding: 0 60px; }
#crae-scene1 .s1-left {
  position: absolute; left: 30px; top: 50%; transform: translateY(-50%);
  max-width: 520px; display: flex; flex-direction: column; gap: 28px;
}
#crae-scene1 .s1-intro {
  font-size: 38px; font-weight: 600; line-height: 1.15;
  font-family: 'Poppins', sans-serif; color: #1a1a1a;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s ease 0.05s, transform 0.6s ease 0.05s;
}
#crae-scene1 .s1-body1, #crae-scene1 .s1-body2 {
  font-size: 18px; font-weight: 400; line-height: 1.6;
  font-family: 'Comfortaa', sans-serif; color: #2c2c2c;
  opacity: 0 !important; transform: translateY(16px) !important;
}
#crae-scene1 .s1-body1 { transition: opacity 0.5s ease, transform 0.5s ease; }
#crae-scene1 .s1-body2 { transition: opacity 0.5s ease, transform 0.5s ease; }
#crae-scene1 .s1-right {
  position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right;
}
#crae-scene1 .stat-block { text-align: right; opacity: 0; transform: translateY(14px); }
#crae-scene1 .stat-block:nth-child(1) { transition: opacity 0.6s ease 0.05s, transform 0.6s ease 0.05s; }
#crae-scene1 .stat-block:nth-child(2) { opacity: 0 !important; transform: translateY(14px) !important; transition: opacity 0.5s ease, transform 0.5s ease; }
#crae-scene1 .stat-block:nth-child(3) { opacity: 0 !important; transform: translateY(14px) !important; transition: opacity 0.5s ease, transform 0.5s ease; }
#crae-scene1 .stat-num {
  font-size: 68px; font-weight: 700; letter-spacing: -2px; line-height: 1;
  font-family: 'Poppins', sans-serif; color: #1a1a1a; display: block; margin-bottom: 12px;
}
#crae-scene1 .stat-num.medium { font-size: 55px; letter-spacing: -1.5px; }
#crae-scene1 .stat-desc {
  font-size: 16px; font-weight: 400; font-family: 'Comfortaa', sans-serif;
  color: #555; margin-bottom: 36px; display: block;
}
#crae-scene1.show-body1 .s1-body1 { opacity: 1 !important; transform: translateY(0) !important; }
#crae-scene1.show-body2 .s1-body2 { opacity: 1 !important; transform: translateY(0) !important; }
#crae-scene1.show-stat2 .stat-block:nth-child(2) { opacity: 1 !important; transform: translateY(0) !important; }
#crae-scene1.show-stat3 .stat-block:nth-child(3) { opacity: 1 !important; transform: translateY(0) !important; }
#crae-scene1.visible .s1-intro { opacity: 1; transform: translateY(0); }
#crae-scene1.visible .stat-block:nth-child(1) { opacity: 1; transform: translateY(0); }

/* ─── SCENE 2 ─── */
#crae-scene2 { padding: 0 60px; }
#crae-scene2 .s2-left {
  position: absolute; left: 60px; top: 50%; transform: translateY(-50%); max-width: 420px;
}
#crae-scene2 .s2-title {
  font-size: 60px; font-weight: 700; letter-spacing: -2px; line-height: 1.1;
  font-family: 'Poppins', sans-serif; color: #1a1a1a;
  margin-bottom: 24px; opacity: 0; transform: translateY(16px);
  transition: opacity 0.65s ease 0.05s, transform 0.65s ease 0.05s;
}
#crae-scene2 .s2-desc {
  font-size: 16px; font-weight: 400; line-height: 1.7;
  font-family: 'Comfortaa', sans-serif; color: #2c2c2c;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.65s ease 0.18s, transform 0.65s ease 0.18s;
}
#crae-scene2.visible .s2-title, #crae-scene2.visible .s2-desc { opacity: 1; transform: translateY(0); }
#crae-scene2 .s2-right {
  position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
  text-align: center; min-width: 260px;
}
.flow-label {
  font-size: 16px; font-weight: 400; line-height: 1.6;
  font-family: 'Comfortaa', sans-serif; color: #555;
  text-align: center; margin-bottom: 20px;
  opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease;
}
.flow-word {
  font-size: 38px; font-weight: 700; letter-spacing: -0.8px;
  font-family: 'Poppins', sans-serif; color: #1a1a1a; display: block; text-align: center;
  opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease;
}
.flow-arrow {
  font-size: 30px; font-family: 'Poppins', sans-serif; color: #1a1a1a;
  display: block; text-align: center; line-height: 1.2; margin: 4px 0;
  opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease;
}
#crae-scene2.show-flow-label .flow-label { opacity: 1; transform: translateY(0); }
#crae-scene2.show-flow1 .flow-word.fw1, #crae-scene2.show-flow1 .flow-arrow.fa1 { opacity: 1; transform: translateY(0); }
#crae-scene2.show-flow2 .flow-word.fw2, #crae-scene2.show-flow2 .flow-arrow.fa2 { opacity: 1; transform: translateY(0); }
#crae-scene2.show-flow3 .flow-word.fw3 { opacity: 1; transform: translateY(0); }
#crae-scene2 .s2-right-circ {
  position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
  text-align: center; min-width: 260px;
  opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.s2-right-linear { transition: opacity 0.5s ease; }
#crae-scene2.show-circular .s2-right-circ { opacity: 1; }
#crae-scene2.show-circular .s2-right-linear { opacity: 0; }
#crae-scene2.show-circ-label .flow-label.circ-label { opacity: 1; transform: translateY(0); }
#crae-scene2.show-circ1 .flow-word.cw1, #crae-scene2.show-circ1 .flow-arrow.ca1 { opacity: 1; transform: translateY(0); }
#crae-scene2.show-circ2 .flow-word.cw2, #crae-scene2.show-circ2 .flow-arrow.ca2 { opacity: 1; transform: translateY(0); }
#crae-scene2.show-circ3 .flow-word.cw3 { opacity: 1; transform: translateY(0); }

/* ─── SCENE 3 ─── */
#crae-scene3 { padding: 0 60px; }
#crae-scene3 .s3-left {
  position: absolute; left: 60px; top: 50%; transform: translateY(-50%);
  max-width: 500px; display: flex; flex-direction: column; align-items: flex-start; gap: 0;
}
#crae-scene3 .s3-title {
  font-size: 72px; font-weight: 700; letter-spacing: -2.5px; line-height: 1.05;
  font-family: 'Poppins', sans-serif; color: #1a1a1a;
  margin-bottom: 28px; opacity: 0; transform: translateY(16px);
  transition: opacity 0.65s ease 0.05s, transform 0.65s ease 0.05s;
}
#crae-scene3 .s3-desc {
  font-size: 17px; font-weight: 400; line-height: 1.7;
  font-family: 'Comfortaa', sans-serif; color: #2c2c2c;
  margin-bottom: 18px; opacity: 0; transform: translateY(16px);
  transition: opacity 0.65s ease 0.18s, transform 0.65s ease 0.18s;
}
#crae-scene3 .s3-tagline {
  font-size: 17px; font-weight: 400; line-height: 1.6;
  font-family: 'Comfortaa', sans-serif; color: #555; font-style: italic;
  margin-bottom: 32px; opacity: 0; transform: translateY(16px);
  transition: opacity 0.65s ease 0.28s, transform 0.65s ease 0.28s;
}
#crae-scene3 .s3-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 30px; background: rgba(125,211,192,0.95);
  color: #000; text-decoration: none; font-size: 15px; font-weight: 600;
  font-family: 'Poppins', sans-serif; border-radius: 50px; pointer-events: auto;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.65s ease 0.38s, transform 0.65s ease 0.38s,
              background 0.25s ease, box-shadow 0.25s ease;
}
#crae-scene3 .s3-cta:hover { background: rgba(125,211,192,1); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(125,211,192,0.45); }
#crae-scene3 .s3-cta-arrow { transition: transform 0.25s ease; }
#crae-scene3 .s3-cta:hover .s3-cta-arrow { transform: translateX(5px); }
#crae-scene3.visible .s3-title, #crae-scene3.visible .s3-desc,
#crae-scene3.visible .s3-tagline, #crae-scene3.visible .s3-cta { opacity: 1; transform: translateY(0); }

/* ─── TABLET ─── */
@media (max-width: 1023px) and (min-width: 768px) {
  #crae-scene1 .s1-left { left: 24px; max-width: 340px; gap: 20px; }
  #crae-scene1 .s1-intro { font-size: 26px; }
  #crae-scene1 .s1-body1, #crae-scene1 .s1-body2 { font-size: 15px; }
  #crae-scene1 .s1-right { right: 24px; }
  #crae-scene1 .stat-num { font-size: 50px; margin-bottom: 8px; }
  #crae-scene1 .stat-num.medium { font-size: 38px; }
  #crae-scene1 .stat-desc { font-size: 13px; margin-bottom: 24px; }
  #crae-scene2 .s2-left { left: 36px; max-width: 320px; }
  #crae-scene2 .s2-title { font-size: 44px; }
  #crae-scene2 .s2-desc { font-size: 14px; }
  #crae-scene2 .s2-right, #crae-scene2 .s2-right-circ { right: 36px; min-width: 200px; }
  .flow-word { font-size: 30px; }
  .flow-label { font-size: 14px; }
  #crae-scene3 .s3-left { left: 36px; max-width: 420px; }
  #crae-scene3 .s3-title { font-size: 52px; }
  #crae-scene3 .s3-desc { font-size: 15px; }
  #crae-scene3 .s3-tagline { font-size: 15px; }
}

/* ─── MOBILE ─── */
@media (max-width: 767px) {
  .crae-sticky-wrap { height: 420vh; }
  #crae-scene1 .s1-left { position: absolute; left: 16px; right: 16px; top: 15vh; transform: none; max-width: 100%; gap: 12px; }
  #crae-scene1 .s1-intro { font-size: 20px; }
  #crae-scene1 .s1-body1, #crae-scene1 .s1-body2 { font-size: 13px; }
  #crae-scene1 .s1-right { position: absolute; right: 16px; left: 16px; bottom: 28px; top: auto; transform: none; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 0; text-align: left; }
  #crae-scene1 .stat-block { text-align: left; flex: 0 0 48%; }
  #crae-scene1 .stat-num { font-size: 36px; margin-bottom: 4px; }
  #crae-scene1 .stat-num.medium { font-size: 28px; }
  #crae-scene1 .stat-desc { font-size: 11px; margin-bottom: 14px; }
  #crae-scene2 .s2-left { position: absolute; left: 16px; right: 16px; top: 15vh; transform: none; max-width: 100%; }
  #crae-scene2 .s2-title { font-size: 34px; margin-bottom: 14px;  }
  #crae-scene2 .s2-desc { font-size: 13px; }
  #crae-scene2 .s2-right { position: absolute; left: 16px; right: 16px; bottom: 32px; top: auto; transform: none; text-align: left; min-width: unset; }
  #crae-scene2 .s2-right-circ { position: absolute; left: 16px; right: 16px; bottom: 32px; top: auto; transform: none; text-align: left; min-width: unset; }
  .flow-label { font-size: 13px; text-align: left; margin-bottom: 10px; }
  .flow-word { font-size: 28px; text-align: left; }
  .flow-arrow { font-size: 22px; text-align: left; margin: 2px 0; }
  #crae-scene3 .s3-left { position: absolute; left: 16px; right: 16px; bottom: 32px; top: auto; transform: none; max-width: 100%;}
  #crae-scene3 .s3-title { font-size: 42px; margin-bottom: 18px; }
  #crae-scene3 .s3-desc { font-size: 13px; margin-bottom: 14px; }
  #crae-scene3 .s3-tagline { font-size: 13px; margin-bottom: 24px; }
  #crae-scene3 .s3-cta { font-size: 13px; padding: 11px 22px; }
}

@media (min-width: 1440px) {
  #crae-scene1 .s1-intro { font-size: 44px; }
  #crae-scene1 .s1-left { max-width: 600px; }
  #crae-scene1 .stat-num { font-size: 80px; }
  #crae-scene1 .stat-num.medium { font-size: 64px; }
  #crae-scene2 .s2-title { font-size: 72px; }
  #crae-scene2 .s2-left { max-width: 500px; }
  #crae-scene3 .s3-title { font-size: 84px; }
  #crae-scene3 .s3-left { max-width: 580px; }
  .flow-word { font-size: 46px; }
}
