/* =========================================================================
   CIVIS TECH GLOBAL — Cinematic home layer
   Deep midnight foundation, holographic silver/teal light, glassmorphism.
   ========================================================================= */

:root {
  --mid-950: #030b18;
  --mid-900: #050f21;
  --mid-850: #071530;
  --holo: #cfe6ff;
  --violet: #6f6dff;
  --glass: rgba(255, 255, 255, .045);
  --glass-line: rgba(207, 230, 255, .14);
}

body.home-cinema { background: var(--mid-950); color: #d6e3f4; }
body.home-cinema.is-loading { overflow: hidden; }

/* ---------- Preloader ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 999; background: var(--mid-950);
  display: flex; align-items: center; justify-content: center;
}
#preloader .pre-inner { text-align: center; }
#preloader .pre-mark { width: 104px; height: 104px; margin: 0 auto 26px; }
#preloader .pre-count {
  font-family: var(--font-head); font-weight: 600; font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1;
}
#preloader .pre-count small { font-size: .35em; color: #6f88ab; margin-left: 4px; }
#preloader .pre-track { width: min(300px, 60vw); height: 2px; background: rgba(255,255,255,.09); margin: 22px auto 14px; border-radius: 2px; overflow: hidden; }
#preloader #preloader-bar { height: 100%; background: linear-gradient(90deg, var(--water-soft), var(--teal), #7ee0c4); transform: scaleX(0); transform-origin: left; border-radius: 2px; }
#preloader .pre-label { font-family: var(--font-head); font-size: .68rem; letter-spacing: .34em; text-transform: uppercase; color: #4f6b90; }
@media (prefers-reduced-motion: reduce) { #preloader { display: none !important; } }

/* ---------- Header on cinema page ---------- */
body.home-cinema .site-header.scrolled {
  background: rgba(5, 15, 33, .72); backdrop-filter: saturate(150%) blur(18px);
  box-shadow: 0 1px 0 rgba(207,230,255,.08), 0 18px 50px rgba(0,0,0,.4);
}
body.home-cinema .site-header.scrolled .brand .wordmark b { color: #fff; }
body.home-cinema .site-header.scrolled .nav-links a { color: #c2d5ec; }
body.home-cinema .site-header.scrolled .nav-links a:hover,
body.home-cinema .site-header.scrolled .nav-links a.active { color: #fff; background: rgba(255,255,255,.09); }
body.home-cinema .site-header.scrolled .nav-toggle span { background: #fff; }
@media (max-width: 1020px) {
  body.home-cinema .nav-links { background: rgba(5,15,33,.97); }
  body.home-cinema .nav-links a { color: #e6eefb; }
}

/* ---------- Cinematic hero: 500vh scroll stage ---------- */
.cine-hero { position: relative; height: 500vh; }
.cine-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--mid-950); }
.cine-backdrop {
  position: absolute; inset: -4%; z-index: 0;
  background: url("/assets/img/midnight.jpg") center/cover no-repeat;
  opacity: .55; will-change: transform;
}
.cine-pin::before { /* vignette + depth */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(90% 70% at 50% 30%, transparent 30%, rgba(3, 11, 24, .72) 100%),
    linear-gradient(to top, rgba(3,11,24,.85), transparent 30%);
  pointer-events: none;
}
#cine3d { position: absolute; inset: 0; z-index: 2; }
#cine3d canvas { display: block; }
body.no-webgl #cine3d { display: none; }
body.no-webgl .cine-backdrop { opacity: .8; }

/* (kinetic outline strips removed for a calmer hero) */

/* chapter panels */
.cine-stage { position: absolute; inset: 0; z-index: 3; }
.cine-panel {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 53%;
  transform: translateY(-46%); max-width: 640px; opacity: 0; visibility: hidden;
  transition: opacity .55s ease, transform .7s cubic-bezier(.2,.6,.2,1), visibility 0s .55s;
}
.cine-panel.active { opacity: 1; visibility: visible; transform: translateY(-50%); transition: opacity .55s ease .12s, transform .7s cubic-bezier(.2,.6,.2,1) .12s; }
.cine-kicker {
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.6rem;
  padding: .55rem 1.15rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line);
  color: #d5e4f6; font-family: var(--font-head); font-size: .76rem; font-weight: 500;
  letter-spacing: .08em; backdrop-filter: blur(10px);
}
.cine-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 16px var(--teal); animation: pulseDot 2.4s infinite; }
@keyframes pulseDot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .6; } }
.cine-title {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -.035em; line-height: 1.0;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem); color: #fff; margin: 0;
}
.cine-title .row { display: block; overflow: hidden; }
.cine-line { display: inline-block; }
.cine-title .grad { background: linear-gradient(100deg, #fff 5%, #bfe0ff 45%, #7ee0c4 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cine-num {
  font-family: var(--font-head); font-weight: 600; font-size: .8rem; letter-spacing: .3em;
  text-transform: uppercase; color: #7ee0c4; display: block; margin-bottom: 1.3rem;
}
.cine-sub { color: #a9c0dd; font-size: clamp(1.02rem, 1.6vw, 1.3rem); line-height: 1.7; max-width: 46ch; margin-top: 1.6rem; }
.cine-metric { display: flex; align-items: baseline; gap: 1rem; margin-top: 2rem; }
.cine-metric b {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  background: linear-gradient(100deg, #fff, #bfe0ff 50%, #7ee0c4); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cine-metric span { color: #7f98ba; font-size: .95rem; max-width: 24ch; line-height: 1.45; }

/* progress rail */
.cine-rail { position: absolute; right: clamp(18px, 3vw, 46px); top: 50%; transform: translateY(-50%); z-index: 4; width: 2px; height: 34vh; background: rgba(255,255,255,.09); border-radius: 2px; }
.cine-rail i { display: block; width: 100%; height: 100%; transform: scaleY(0); transform-origin: top; background: linear-gradient(to bottom, var(--water-soft), var(--teal)); border-radius: 2px; }
.cine-cue { position: absolute; z-index: 4; bottom: 30px; left: 50%; transform: translateX(-50%); color: #6f88ab; font-family: var(--font-head); font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cine-cue .line { width: 1px; height: 46px; background: linear-gradient(to bottom, transparent, var(--teal)); animation: cueDrop 2.2s ease-in-out infinite; }

@media (max-width: 760px) {
  .cine-hero { height: 420vh; }
  /* calmer, more legible mobile hero: dim the particle field and
     ground the copy on a soft navy scrim */
  #cine3d { opacity: .42; }
  .cine-pin::after { content: ""; position: absolute; inset: auto 0 0 0; height: 62%;
    z-index: 2; pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(3,11,24,.55) 34%, rgba(3,11,24,.92) 100%); }
  .cine-panel { top: auto; bottom: max(9svh, 84px); transform: translateY(10px); max-width: none; }
  .cine-panel.active { transform: translateY(0); }
  .cine-title { font-size: clamp(2.05rem, 9vw, 2.8rem) !important; text-shadow: 0 2px 24px rgba(3,11,24,.85); }
  .cine-sub { font-size: 1.02rem; margin-top: 1rem; color: #cfe0f2; line-height: 1.65; text-shadow: 0 1px 14px rgba(3,11,24,.9); }
  .cine-metric b { font-size: 2.2rem; }
  .cine-kicker { margin-bottom: 1rem; background: rgba(6,24,47,.6); }
  .cine-rail { display: none; }
  .cine-cue { display: none; }
}

/* ---------- Dark sections & glassmorphism ---------- */
.cine-dark { background: linear-gradient(to bottom, var(--mid-950), var(--mid-900) 30%, var(--mid-850)); color: #d6e3f4; position: relative; }
.cine-dark h2, .cine-dark h3, .cine-dark h4 { color: #fff; }
.cine-dark p, .cine-dark .lead { color: #a9c0dd; }
.cine-dark .eyebrow { color: #7ee0c4; }

.glass-card {
  position: relative; border-radius: var(--r-xl);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px);
  padding: clamp(26px, 3.2vw, 38px);
  transition: transform .45s cubic-bezier(.2,.6,.2,1), border-color .45s, background .45s;
  overflow: hidden; height: 100%;
  will-change: transform;
}
.glass-card::before { /* holographic sheen following the cursor */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(126, 224, 196, .12), rgba(111, 109, 255, .07) 45%, transparent 70%);
  transition: opacity .4s;
}
.glass-card:hover { border-color: rgba(126, 224, 196, .35); background: rgba(255,255,255,.065); }
.glass-card:hover::before { opacity: 1; }
.glass-card h3 { margin-bottom: .55rem; }
.glass-card p { font-size: .96rem; }
.glass-card .tag { background: rgba(126,224,196,.12); color: #7ee0c4; }
.glass-card .tag.blue { background: rgba(63,116,227,.16); color: #9dbdf5; }
.glass-card .tag.carbon { background: rgba(127,182,232,.14); color: #a9cdf0; }

.glass-icon {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 1.2rem;
  background: linear-gradient(135deg, rgba(63,116,227,.25), rgba(20,184,166,.25));
  border: 1px solid var(--glass-line); color: #7ee0c4;
}
.glass-icon svg { width: 25px; height: 25px; }

/* floating bob for interactive chips */
@keyframes floatBob { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.float-1 { animation: floatBob 7s ease-in-out infinite; }
.float-2 { animation: floatBob 8.5s ease-in-out infinite 1.1s; }
.float-3 { animation: floatBob 7.8s ease-in-out infinite .5s; }
.float-4 { animation: floatBob 9s ease-in-out infinite 1.7s; }
@media (prefers-reduced-motion: reduce) { .float-1,.float-2,.float-3,.float-4 { animation: none; } }

/* big holo numbers */
.holo-num {
  font-family: var(--font-head); font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-size: clamp(3rem, 7vw, 5.6rem);
  background: linear-gradient(100deg, #fff 5%, #bfe0ff 50%, #7ee0c4 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* magnetic button base */
.btn-magnet { transition: transform .35s cubic-bezier(.2,.6,.2,1); will-change: transform; }

/* footer sits on cinema bg seamlessly */
body.home-cinema .site-footer { background: linear-gradient(to bottom, var(--mid-850), var(--mid-950)); }

/* ---------- Search overlay (all pages) ---------- */
.search-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(127,182,232,.12); color: var(--water); transition: background .3s, color .3s;
}
.search-btn svg { width: 19px; height: 19px; }
.search-btn:hover { background: var(--grad-brand); color: #fff; }
.site-header:not(.scrolled).on-dark .search-btn { background: rgba(255,255,255,.08); color: #cfe0f5; }
body.home-cinema .site-header.scrolled .search-btn { background: rgba(255,255,255,.08); color: #cfe0f5; }

#search-overlay {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(4, 13, 28, .8); backdrop-filter: blur(14px);
  padding: clamp(70px, 12vh, 140px) var(--gutter) 40px;
}
#search-overlay.open { display: block; animation: searchIn .3s cubic-bezier(.2,.6,.2,1); }
@keyframes searchIn { from { opacity: 0; } to { opacity: 1; } }
.search-panel {
  max-width: 680px; margin-inline: auto; border-radius: var(--r-xl); overflow: hidden;
  background: rgba(10, 24, 46, .92); border: 1px solid rgba(207,230,255,.16);
  box-shadow: 0 50px 130px rgba(0,0,0,.5); animation: searchPanel .35s cubic-bezier(.2,.9,.2,1);
}
@keyframes searchPanel { from { transform: translateY(26px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.search-row { display: flex; align-items: center; gap: 14px; padding: 8px 20px; border-bottom: 1px solid rgba(207,230,255,.1); }
.search-row svg { width: 20px; height: 20px; color: #7ee0c4; flex: none; }
.search-input {
  flex: 1; background: none; border: 0; outline: none; color: #fff;
  font: 500 1.15rem/1 var(--font-head); padding: 18px 0; caret-color: var(--teal);
}
.search-input::placeholder { color: #56719a; }
.search-close { background: rgba(255,255,255,.07); border: 0; color: #9db4d1; border-radius: 8px; font: 600 .7rem/1 var(--font-head); letter-spacing: .08em; padding: 7px 10px; }
.search-close:hover { color: #fff; }
.search-results { max-height: 46vh; overflow-y: auto; }
.search-hit { display: flex; gap: 14px; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(207,230,255,.06); transition: background .2s; }
.search-hit:hover { background: rgba(126,224,196,.07); }
.search-type { flex: none; font: 600 .62rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: #7ee0c4; background: rgba(126,224,196,.1); border-radius: 999px; padding: 5px 10px; min-width: 64px; text-align: center; }
.search-body { flex: 1; min-width: 0; }
.search-body b { display: block; color: #fff; font: 600 .98rem/1.3 var(--font-head); margin-bottom: 3px; }
.search-body small { display: block; color: #7f98ba; font-size: .82rem; line-height: 1.45; }
.search-body mark { background: none; color: #7ee0c4; }
.search-go { color: #56719a; }
.search-hint { padding: 18px 20px; color: #56719a; font-size: .85rem; display: flex; gap: 18px; flex-wrap: wrap; }
.search-hint b { color: #9db4d1; font-weight: 600; }
.search-none { padding: 26px 20px; color: #7f98ba; font-size: .92rem; }
body.search-open-body { overflow: hidden; }

/* ===================== v4: de-square + animated sections ===================== */
/* Glass cards — larger, organic, never boxy */
.glass-card { border-radius: 34px; }
.cine-dark .card, .cine-dark .glass-card { border-radius: 34px; }
.tag { border-radius: 999px; }

/* ---- "What TES is" — animated regenerative flow orbit ---- */
.flow-orbit { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 2.4vw, 34px); align-items: stretch; margin-top: 10px; }
.flow-track { position: absolute; left: 6%; right: 6%; top: 46px; height: 2px; z-index: 0;
  background: linear-gradient(90deg, transparent, rgba(126,224,196,.35) 12%, rgba(126,224,196,.35) 88%, transparent); border-radius: 2px; overflow: visible; }
.flow-pulse { position: absolute; top: 50%; left: 0; width: 46px; height: 3px; transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, #7ee0c4, #fff, #7ee0c4, transparent); border-radius: 3px; filter: drop-shadow(0 0 8px #2dd4bf);
  animation: flowPulse 5s cubic-bezier(.6,0,.4,1) infinite; }
@keyframes flowPulse { 0% { left: -6%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@media (max-width: 820px) { .flow-orbit { grid-template-columns: 1fr 1fr; } .flow-track { display: none; } }
@media (max-width: 520px) { .flow-orbit { grid-template-columns: 1fr; } }
.flow-step { position: relative; z-index: 1; text-align: center; padding: 8px 12px; }
.flow-orb { width: 92px; height: 92px; margin: 0 auto 1.1rem; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 30%, rgba(45,212,191,.28), rgba(10,24,46,.9) 70%);
  border: 1px solid rgba(126,224,196,.35); color: #7ee0c4; box-shadow: 0 0 0 6px rgba(45,212,191,.06), 0 18px 40px rgba(0,0,0,.4);
  transition: transform .4s, box-shadow .4s; }
.flow-step:hover .flow-orb { transform: translateY(-6px) scale(1.05); box-shadow: 0 0 0 8px rgba(45,212,191,.1), 0 26px 60px rgba(20,184,166,.28); }
.flow-orb svg { width: 34px; height: 34px; }
.flow-step b { display: block; color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; margin-bottom: .35rem; }
.flow-step small { color: #9db4d1; font-size: .9rem; line-height: 1.5; display: block; max-width: 26ch; margin: 0 auto; }

/* ---- Three deployment models — cinematic render rows, no boxes ---- */
.model-showcase { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 90px); }
.model-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.model-row.rev { grid-template-columns: 1fr 1.15fr; }
.model-row.rev .model-visual { order: 2; }
@media (max-width: 900px) { .model-row, .model-row.rev { grid-template-columns: 1fr; } .model-row.rev .model-visual { order: 0; } }
.model-visual { position: relative; border-radius: 44px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.5), inset 0 0 0 1px rgba(207,230,255,.08);
  transition: transform .6s cubic-bezier(.2,.6,.2,1); }
.model-visual::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 120%, rgba(45,212,191,.18), transparent 55%); pointer-events: none; }
.model-visual img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; transition: transform .8s cubic-bezier(.2,.6,.2,1); }
.model-row:hover .model-visual { transform: translateY(-6px); }
.model-row:hover .model-visual img { transform: scale(1.05); }
.model-num { position: absolute; top: 18px; left: 26px; z-index: 2; font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.4rem, 4vw, 3.6rem); letter-spacing: -.04em; color: rgba(255,255,255,.14); }
.model-copy h3 { margin: .7rem 0 .7rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.model-copy .tag { margin-bottom: .2rem; }
