/* CREAHIVE homepage: the hero sky continues down through "It's All About Storytelling".
   Works without JS (gradient sky + static logo); JS adds a three.js scene (story.js). */

/* hero: soft fade at the bottom so the sky flows into the story, plus a scroll cue */
#home.low-back-gradient-r{overflow:hidden}
#home.low-back-gradient-r:before{content:"";position:absolute;left:0;right:0;bottom:0;height:34vh;z-index:1;pointer-events:none;
  background:linear-gradient(to bottom,rgba(14,26,68,0) 0%,rgba(14,26,68,.75) 70%,#0e1a44 100%)}
.epic-cue{position:absolute;left:50%;bottom:28px;z-index:6;width:2px;height:64px;margin-left:-1px;overflow:hidden;
  background:linear-gradient(to bottom,rgba(255,255,255,0),rgba(255,255,255,.35))}
.epic-cue:after{content:"";position:absolute;left:0;top:-30%;width:2px;height:30%;background:#fff;animation:epicCue 2.4s cubic-bezier(.6,0,.4,1) infinite}
@keyframes epicCue{0%{top:-30%}100%{top:110%}}

/* the story */
.ch-story.ch-epic{position:relative;padding:0;background:#0e1a44;color:#fff;overflow:clip}
.epic-stage{position:fixed;inset:0;z-index:1;pointer-events:none;opacity:0;transition:opacity 1.4s cubic-bezier(.37,0,.63,1)}
.epic-stage canvas{display:block;width:100%;height:100%}
html.epic-gl .epic-stage.is-on{opacity:1}

.epic-ch{position:relative;min-height:118vh;display:flex;align-items:center;padding:12vh 0}
.epic-ch > .container{position:relative}
.epic-ch--intro{min-height:200vh;align-items:flex-start;padding-top:22vh}
.epic-ch--hive{min-height:175vh}
.epic-ch--finale{min-height:130vh}

/* one continuous sky: night, red radiance, dawn, daylight (each chapter ends where the next one starts) */
.epic-ch--intro{background:linear-gradient(to bottom,#0e1a44 0%,#0a1233 45%,#070c26 100%)}
.epic-ch--journey{background:linear-gradient(to bottom,#070c26 0%,#070a22 100%)}
.epic-ch--bagua{background:linear-gradient(to bottom,#070a22 0%,#0c0a22 60%,#150a22 100%)}
.epic-ch--radiance{background:radial-gradient(ellipse 70% 55% at 70% 50%,rgba(192,0,14,.28),rgba(192,0,14,0) 70%),linear-gradient(to bottom,#150a22 0%,#240a1e 55%,#3b0c1c 100%)}
.epic-ch--hive{background:linear-gradient(to bottom,#3b0c1c 0%,#8e1224 22%,#c0000e 40%,#d9482c 62%,#f2a46c 84%,#fbd6ac 100%)}
.epic-ch--tech{background:linear-gradient(to bottom,#fbd6ac 0%,#fde6cc 45%,#fff1e2 100%)}
.epic-ch--partners{background:linear-gradient(to bottom,#fff1e2 0%,#fff8f1 100%)}
.epic-ch--finale{background:linear-gradient(to bottom,#fff8f1 0%,#ffffff 70%)}

/* faint static stars for the dark part (no-JS and reduced motion keep the sky) */
.epic-dark:before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.55;
  background-image:radial-gradient(1px 1px at 12% 18%,#fff 50%,transparent 51%),radial-gradient(1px 1px at 38% 72%,#fff 50%,transparent 51%),
  radial-gradient(1.5px 1.5px at 66% 34%,#fff 50%,transparent 51%),radial-gradient(1px 1px at 84% 82%,#fff 50%,transparent 51%),
  radial-gradient(1px 1px at 22% 52%,#cfd9ff 50%,transparent 51%),radial-gradient(1.5px 1.5px at 91% 12%,#fff 50%,transparent 51%),
  radial-gradient(1px 1px at 54% 8%,#fff 50%,transparent 51%),radial-gradient(1px 1px at 5% 90%,#cfd9ff 50%,transparent 51%);
  background-size:420px 420px}
html.epic-gl .epic-dark:before{opacity:.18}

/* text */
.epic-text{position:relative;z-index:2;max-width:580px}
.epic-left .epic-text{margin-right:auto}
.epic-right .epic-text{margin-left:auto}
.epic-center{max-width:900px;margin:0 auto;text-align:center}
.ch-epic .epic-text p{font-size:19px;line-height:1.75;font-weight:400;padding:0;margin:0 0 18px}
.ch-epic .epic-dark .epic-text p,.ch-epic .epic-dawn .epic-text p{color:#f4f6ff;text-shadow:0 1px 18px rgba(0,0,0,.45)}
.ch-epic .epic-light .epic-text p{color:#23232d}
.epic-ch--hive .epic-text{background:rgba(53,9,19,.72);border-radius:14px;padding:28px 28px 12px}
.ch-epic .section-title h2{color:#fff;font-size:56px;font-weight:300;letter-spacing:.06em;line-height:1.15;margin-bottom:28px}
.ch-epic .section-title p.para{font-size:20px;line-height:1.8;max-width:760px;margin-top:34px}
.epic-num{display:block;font-family:'Raleway',sans-serif;font-weight:300;font-size:13px;letter-spacing:.42em;color:#c0000e;margin:0 0 18px}
.epic-dark .epic-num,.epic-dawn .epic-num{color:rgba(255,255,255,.55)}
.epic-ch--radiance .epic-num{color:#ff6b6b}
.ch-epic .epic-finale{font-family:'Raleway',sans-serif;font-size:34px !important;line-height:1.45 !important;font-weight:300 !important;color:#12212f !important;letter-spacing:.005em}

/* the site's back-to-top button would sit on the text cards: hidden while the story is on screen */
html.epic-in-story #back-to-top{opacity:0 !important;visibility:hidden !important;pointer-events:none !important;transition:opacity .3s}

@media (min-width:992px){.epic-ch--tech .epic-text{max-width:500px}}

/* static logo: shown without WebGL (no JS, reduced motion, old devices) */
.epic-fig{position:relative;z-index:2;margin:0 0 30px}
.epic-fig svg{display:block;width:180px;height:auto;filter:drop-shadow(0 0 40px rgba(192,0,14,.55))}
.epic-right .epic-fig{position:absolute;left:8%;top:50%;transform:translateY(-50%)}
html.epic-gl .epic-fig{visibility:hidden}
@media (min-width:992px){html.epic-gl .epic-fig{display:none}}

/* reveal (only when JS runs and motion is fine) */
html.epic-anim .epic-text{opacity:0;transform:translate3d(0,30px,0);filter:blur(10px);will-change:transform,opacity,filter;
  transition:opacity 2.4s cubic-bezier(.25,.1,.25,1),transform 3s cubic-bezier(.19,1,.22,1),filter 2.2s cubic-bezier(.25,.1,.25,1)}
html.epic-anim .epic-text.is-in{opacity:1;transform:none;filter:none}

@media (max-width:991px){
  .epic-right .epic-fig{position:static;transform:none}
  .ch-epic .section-title h2{font-size:44px}
}
@media (max-width:767px){
  .epic-ch{min-height:0;display:block;padding:56vh 0 10vh}
  .epic-ch--intro{min-height:0;padding:18vh 0 70vh}
  .epic-ch--hive{padding-bottom:40vh}
  .epic-ch--finale{padding:44vh 0 14vh}
  .epic-text,.epic-left .epic-text,.epic-right .epic-text{max-width:none;margin:0}
  .epic-dark .epic-text:not(.epic-center),.epic-dawn .epic-text{background:rgba(7,10,34,.62);border-radius:14px;padding:24px 20px 8px}
  .epic-dawn .epic-text{background:rgba(53,9,19,.72)}
  .epic-light .epic-text:not(.epic-center){background:rgba(255,255,255,.84);border-radius:14px;padding:24px 20px 8px}
  .ch-epic .epic-text p{font-size:17px;line-height:1.7}
  .ch-epic .section-title h2{font-size:34px;letter-spacing:.04em}
  .ch-epic .section-title p.para{font-size:17.5px;margin-top:26px}
  .ch-epic .epic-finale{font-size:24px !important}
  .epic-fig svg{width:120px;margin:0 auto}
  .epic-fig{margin:0 0 24px}
  .epic-cue{bottom:18px;height:48px}
}

@media (prefers-reduced-motion:reduce){
  .epic-cue:after{animation:none;top:35%}
  html.epic-anim .epic-text{opacity:1;transform:none;transition:none}
  .epic-stage{display:none}
}

/* ---------- the rest of the page: one journey (owner pick A, "One hive, one dust") ---------- */
/* thin hex dividers between sections: line, hexagon, line (static, also without JS) */
#what-we-do:before,#our-products:before,#partners:before{content:"";display:block;width:560px;max-width:78%;height:24px;margin:0 auto 38px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 24'%3E%3Cdefs%3E%3ClinearGradient id='l' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23c0000e' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23c0000e' stop-opacity='.6'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23c0000e' stop-opacity='.6'/%3E%3Cstop offset='1' stop-color='%23c0000e' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 12H262' stroke='url(%23l)' stroke-width='1'/%3E%3Cpath d='M298 12H560' stroke='url(%23r)' stroke-width='1'/%3E%3Cpath d='M280 2.5l8.2 4.75v9.5L280 21.5l-8.2-4.75v-9.5z' fill='none' stroke='%23c0000e' stroke-width='1.2'/%3E%3Ccircle cx='280' cy='12' r='2' fill='%23c0000e'/%3E%3C/svg%3E") center/contain no-repeat}
#what-we-do:before{margin-top:10px}

/* with the scene on, the lower sections sit above the dust and let it show through (daylight, white page) */
html.epic-gl body{background:#fff}
html.epic-gl #what-we-do,html.epic-gl #our-products{position:relative;z-index:2;background:transparent}
/* partners stay under the scene so the dotted network can link the logos on top of them */
html.epic-gl #partners{background:transparent}
/* contact keeps its layers in one stack under the scene, so the seeds fly over the button */
html.epic-gl #contact{z-index:0}
html.epic-gl .ch-prod{background:rgba(255,255,255,.42)}
html.epic-gl .ch-prod:hover,html.epic-gl .ch-prod:focus{background:rgba(255,255,255,.7)}
/* product logos: the particles draw the silhouette first, then the real logo settles in */
html.epic-dust .ch-prod-logo img{opacity:0;filter:blur(6px);transition:opacity 1.6s cubic-bezier(.25,.1,.25,1),filter 1.4s cubic-bezier(.25,.1,.25,1)}
html.epic-dust .ch-prod.is-formed .ch-prod-logo img{opacity:1;filter:none}
/* seeds reaching the contact button: a slow soft glow */
.contact-button.epic-seeded{animation:epicSeed 3.2s cubic-bezier(.37,0,.63,1) infinite}
@keyframes epicSeed{0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,0)}50%{box-shadow:0 0 28px 4px rgba(255,236,214,.55)}}

/* headings and cards below the story rise softly, like the chapter text */
html.epic-anim .epic-rise{opacity:0;transform:translate3d(0,26px,0);transition:opacity 2s cubic-bezier(.25,.1,.25,1),transform 2.6s cubic-bezier(.19,1,.22,1),filter 1.8s cubic-bezier(.25,.1,.25,1)}
html.epic-anim .epic-rise.epic-blur{filter:blur(8px)}
html.epic-anim .epic-rise.is-in{opacity:1;transform:none;filter:none}

/* bagua progress rail: 8 bars for the 8 chapters, then one per section. Broken bar = 0 (ahead), solid = 1 (seen) */
.epic-rail{position:fixed;right:18px;top:50%;z-index:900;transform:translateY(-50%);display:flex;flex-direction:column;gap:9px;opacity:0;pointer-events:none;transition:opacity .9s cubic-bezier(.25,.1,.25,1)}
.epic-rail.is-on{opacity:1;pointer-events:auto}
.epic-rail button{position:relative;display:block;width:24px;height:9px;padding:0;margin:0;border:0;background:none;cursor:pointer}
.epic-rail button:before,.epic-rail button:after{content:"";position:absolute;top:3px;height:3px;width:10px;border-radius:2px;background:rgba(35,35,45,.28);transition:width .8s cubic-bezier(.19,1,.22,1),background .8s,left .8s cubic-bezier(.19,1,.22,1)}
.epic-rail button:before{left:0}
.epic-rail button:after{left:14px}
.epic-rail button.is-seen:before{width:24px;background:#c0000e}
.epic-rail button.is-seen:after{width:0;left:24px;background:#c0000e}
.epic-rail button.is-now:before{box-shadow:0 0 10px rgba(192,0,14,.6)}
.epic-rail button:focus-visible{outline:2px solid #c0000e;outline-offset:3px}
.epic-rail .epic-rail-gap{height:8px}
.epic-rail.on-dark button:before,.epic-rail.on-dark button:after{background:rgba(255,255,255,.38)}
.epic-rail.on-dark button.is-seen:before{background:#fff}
.epic-rail.on-dark button.is-now:before{box-shadow:0 0 10px rgba(255,255,255,.7)}
@media (max-width:767px){
  .epic-rail{right:3px;gap:5px}
  .epic-rail.is-on{pointer-events:none;opacity:.75}
  .epic-rail button{width:8px;height:5px}
  .epic-rail button:before,.epic-rail button:after{top:2px;height:2px;width:3px}
  .epic-rail button:after{left:5px}
  .epic-rail button.is-seen:before{width:8px}
  .epic-rail button.is-seen:after{left:8px}
  .epic-rail button.is-now:before{box-shadow:none}
  .epic-rail .epic-rail-gap{height:4px}
}
@media (prefers-reduced-motion:reduce){
  .epic-rail,.epic-rail button:before,.epic-rail button:after{transition:none}
  .contact-button.epic-seeded{animation:none}
}
/* phone: back-to-top only once the contact/footer is reached, never over the content cards */
@media (max-width:767px){
  html:not(.epic-btt-ok) #back-to-top{opacity:0 !important;visibility:hidden !important;pointer-events:none !important}
  /* partners: compact 2-column grid (49 logos), short network links */
  #partners{padding:56px 0 48px}
  #partners .partners-section-area{padding:30px 0 20px}
  #partners .partners-content-section{padding:8px 4px 0}
  #partners .partners-content-section .row{display:flex;flex-wrap:wrap;margin:0 -6px}
  #partners .partners-content-section .row>.col-xs-12{width:50%;float:none;padding:0 6px}
  #partners .single-partners .featured-images{margin:0 0 12px;border-width:3px}
}
