/* ============================================================
   Korevra Motion Layer — homepage only, loads after main.css
   Kinetic type · scroll-driven motion · canvas hero · cursor
   Everything degrades gracefully under prefers-reduced-motion.
   ============================================================ */

:root {
  --m-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --m-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --m-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scrollbar-color: rgba(232,115,44,0.5) #0B121C; }

body.m-home {
  background: #090E15;
  overflow-x: clip;
}

/* ---------- Noise + glow atmosphere ---------- */
.m-noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
.m-glow {
  position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
  filter: blur(120px); opacity: 0.5; will-change: transform;
}
.m-glow-1 { width: 55vw; height: 55vw; top: -20vw; right: -15vw; background: radial-gradient(circle, rgba(232,115,44,0.22), transparent 65%); }
.m-glow-2 { width: 45vw; height: 45vw; bottom: -10vw; left: -18vw; background: radial-gradient(circle, rgba(244,164,96,0.10), transparent 65%); }

/* ---------- Scroll progress ---------- */
.m-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 300;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #E8732C, #F4A460, #E8732C);
  background-size: 200% 100%;
  animation: m-gradient-x 4s linear infinite;
}
@keyframes m-gradient-x { to { background-position: 200% 0; } }

/* ---------- Preloader ---------- */
.m-loader {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: #090E15; transition: clip-path 0.7s var(--m-ease-out) 0.15s, visibility 0s 0.9s;
  clip-path: inset(0 0 0 0);
}
.m-loader.done { clip-path: inset(0 0 100% 0); visibility: hidden; }
.m-loader-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.m-loader-squares { display: grid; grid-template-columns: repeat(2, 26px); grid-template-rows: repeat(2, 26px); gap: 5px; }
.m-loader-squares i {
  border-radius: 5px; opacity: 0; transform: scale(0.2) rotate(45deg);
  animation: m-sq-in 0.5s var(--m-ease-spring) forwards;
}
.m-loader-squares i:nth-child(1) { background: #E8732C; animation-delay: 0.05s; }
.m-loader-squares i:nth-child(2) { background: #F09468; animation-delay: 0.15s; }
.m-loader-squares i:nth-child(3) { background: #F2B49A; animation-delay: 0.25s; }
.m-loader-squares i:nth-child(4) { background: #F8E1D3; animation-delay: 0.35s; }
@keyframes m-sq-in { to { opacity: 1; transform: scale(1) rotate(0deg); } }
.m-loader-word {
  font-weight: 900; letter-spacing: 0.34em; font-size: 13px; color: #C0D0E0;
  text-transform: uppercase; opacity: 0; animation: m-fade-up 0.5s var(--m-ease-out) 0.5s forwards;
}
@keyframes m-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Custom cursor (fine pointers only) ---------- */
.m-cursor-dot, .m-cursor-ring { display: none; }
@media (hover: hover) and (pointer: fine) {
  body.m-cursor-on { cursor: none; }
  body.m-cursor-on a, body.m-cursor-on button { cursor: none; }
  .m-cursor-dot {
    display: block; position: fixed; z-index: 900; width: 7px; height: 7px;
    background: #E8732C; border-radius: 50%; pointer-events: none;
    transform: translate(-50%, -50%); transition: opacity 0.2s;
  }
  .m-cursor-ring {
    display: grid; place-items: center; position: fixed; z-index: 899;
    width: 38px; height: 38px; border: 1.5px solid rgba(232,115,44,0.55);
    border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%);
    transition: width 0.25s var(--m-ease-out), height 0.25s var(--m-ease-out),
                background 0.25s, border-color 0.25s;
    font-size: 0; color: #fff; font-weight: 700; letter-spacing: 0.06em;
  }
  .m-cursor-ring.hot {
    width: 64px; height: 64px; background: rgba(232,115,44,0.14);
    border-color: rgba(232,115,44,0.9); backdrop-filter: blur(2px);
  }
  .m-cursor-ring.label { width: 74px; height: 74px; font-size: 10px; background: rgba(9,14,21,0.72); }
}

/* ---------- Kinetic display type ---------- */
.m-hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 140px 0 80px; overflow: clip;
}
#mHeroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.m-hero .container { position: relative; z-index: 2; }
.m-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: #94A7B8;
  border: 1px solid rgba(232,115,44,0.35); padding: 9px 18px; border-radius: 100px;
  background: rgba(232,115,44,0.07); backdrop-filter: blur(6px);
}
.m-hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #E8732C; animation: m-pulse 2s infinite; }
@keyframes m-pulse { 50% { box-shadow: 0 0 0 7px rgba(232,115,44,0.12); } }

.m-display {
  font-family: var(--m-display);
  font-weight: 900; text-transform: uppercase;
  font-size: clamp(3rem, 9.5vw, 8.2rem);
  line-height: 0.94; letter-spacing: -0.02em;
  margin: 28px 0 0; color: #fff;
}
.m-display .m-line { display: block; overflow: clip; }
.m-display .m-word { display: inline-block; transform: translateY(115%) rotate(4deg); transform-origin: 0 100%; }
.m-in .m-word { animation: m-word-in 0.9s var(--m-ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes m-word-in { to { transform: translateY(0) rotate(0); } }
.m-grad-text {
  background: linear-gradient(90deg, #E8732C 0%, #F4A460 30%, #FFD9B8 50%, #F4A460 70%, #E8732C 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: m-gradient-x 5s linear infinite;
}
.m-outline-text {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255,255,255,0.34);
}
.m-hero-sub {
  max-width: 560px; margin-top: 30px; color: #C0D0E0; font-size: 1.06rem; line-height: 1.75;
}
.m-hero-ctas { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }

/* Magnetic buttons */
.m-btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 17px 34px; border-radius: 100px; font-weight: 700; font-size: 15px;
  text-decoration: none; transition: transform 0.3s var(--m-ease-out), box-shadow 0.3s;
  will-change: transform; overflow: hidden; isolation: isolate;
}
.m-btn-fill { background: linear-gradient(135deg, #E8732C, #D4641F); color: #fff; box-shadow: 0 10px 34px rgba(232,115,44,0.35); }
.m-btn-fill::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, #F4A460, #E8732C);
  opacity: 0; transition: opacity 0.35s;
}
.m-btn-fill:hover::after { opacity: 1; }
.m-btn-line { border: 1.5px solid rgba(255,255,255,0.22); color: #fff; background: rgba(255,255,255,0.03); backdrop-filter: blur(6px); }
.m-btn-line:hover { border-color: rgba(232,115,44,0.7); background: rgba(232,115,44,0.08); }

.m-hero-stats { display: flex; gap: 44px; margin-top: 54px; flex-wrap: wrap; }
.m-hero-stat strong {
  display: block; font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 900; color: #fff;
  font-variant-numeric: tabular-nums;
}
.m-hero-stat span { font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #5E7489; }

.m-scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #5E7489; font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase;
}
.m-scroll-cue i {
  width: 1.5px; height: 44px; background: linear-gradient(#E8732C, transparent);
  animation: m-cue 1.8s var(--m-ease-out) infinite;
}
@keyframes m-cue { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Hero dashboard — 3D tilt card */
.m-tilt { transform-style: preserve-3d; will-change: transform; transition: transform 0.35s var(--m-ease-out); }
.m-tilt .m-tilt-glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,0.10), transparent 45%);
  opacity: 0; transition: opacity 0.3s;
}
.m-tilt:hover .m-tilt-glare { opacity: 1; }

/* ---------- Oversized outline marquees ---------- */
.m-marquee-band { padding: 60px 0 20px; overflow: clip; position: relative; z-index: 2; }
.m-marquee { display: flex; overflow: clip; user-select: none; gap: 0; }
.m-marquee-track {
  display: flex; flex-shrink: 0; align-items: center; gap: 0;
  animation: m-marquee-x var(--speed, 38s) linear infinite;
}
.m-marquee[data-dir="rtl"] .m-marquee-track { animation-direction: reverse; }
.m-marquee:hover .m-marquee-track { animation-play-state: paused; }
@keyframes m-marquee-x { to { transform: translateX(-100%); } }
.m-marquee-item {
  font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 900; text-transform: uppercase;
  letter-spacing: -0.01em; white-space: nowrap; padding: 0 28px;
  color: transparent; -webkit-text-stroke: 1.3px rgba(255,255,255,0.22);
  transition: color 0.3s, -webkit-text-stroke-color 0.3s;
}
.m-marquee-item:hover { color: #E8732C; -webkit-text-stroke-color: #E8732C; }
.m-marquee-sep { color: #E8732C; -webkit-text-stroke: 0; font-size: clamp(1.4rem, 3vw, 2.4rem); padding: 0 6px; align-self: center; }

/* ---------- Section headers with split reveal ---------- */
.m-section { position: relative; z-index: 2; padding: 110px 0; }
.m-kicker {
  display: inline-flex; align-items: center; gap: 10px; font-size: 12px;
  letter-spacing: 0.3em; text-transform: uppercase; color: #E8732C; font-weight: 700;
}
.m-kicker::before { content: ''; width: 34px; height: 1.5px; background: #E8732C; }
.m-h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 900; letter-spacing: -0.02em;
  line-height: 1.05; color: #fff; margin: 18px 0 0; text-wrap: balance;
}
.m-h2 .m-word { display: inline-block; transform: translateY(30px); opacity: 0; }
.m-in.m-h2 .m-word, .m-in .m-h2 .m-word { animation: m-word-up 0.7s var(--m-ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes m-word-up { to { transform: none; opacity: 1; } }
.m-sub { max-width: 640px; color: #94A7B8; font-size: 1.02rem; line-height: 1.75; margin-top: 18px; }

/* Generic rise-in for cards */
.m-rise { opacity: 0; transform: translateY(46px); transition: opacity 0.8s var(--m-ease-out) var(--d, 0s), transform 0.8s var(--m-ease-out) var(--d, 0s); }
.m-rise.m-in { opacity: 1; transform: none; }

/* ---------- Pillars (about) ---------- */
.m-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.m-pillar {
  position: relative; border: 1px solid #1E3044; border-radius: 20px; padding: 34px 26px;
  background: linear-gradient(180deg, rgba(20,33,48,0.65), rgba(13,21,32,0.5));
  overflow: hidden; transition: transform 0.4s var(--m-ease-out), border-color 0.4s;
}
.m-pillar:hover { transform: translateY(-8px); border-color: rgba(232,115,44,0.5); }
.m-pillar::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; opacity: 0; z-index: 0;
  background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 0%), rgba(232,115,44,0.14), transparent 60%);
  transition: opacity 0.35s;
}
.m-pillar:hover::before { opacity: 1; }
.m-pillar > * { position: relative; z-index: 1; }
.m-pillar .num {
  font-size: 13px; font-weight: 900; color: #E8732C; letter-spacing: 0.2em;
}
.m-pillar h3 { color: #fff; font-size: 1.2rem; margin: 14px 0 10px; font-weight: 800; }
.m-pillar p { color: #94A7B8; font-size: 0.92rem; line-height: 1.7; }
.m-pillar .ic { font-size: 30px; margin-top: 18px; display: block; transition: transform 0.4s var(--m-ease-spring); }
.m-pillar:hover .ic { transform: translateY(-4px) scale(1.15) rotate(-6deg); }

/* ---------- Horizontal platforms rail ---------- */
.m-rail-section { position: relative; z-index: 2; height: 380vh; }
.m-rail-sticky { position: sticky; top: 0; height: 100vh; overflow: clip; display: flex; flex-direction: column; justify-content: center; }
.m-rail-head { padding-bottom: 34px; }
.m-rail-track {
  display: flex; gap: 26px; will-change: transform; padding: 0 max(24px, calc((100vw - 1200px) / 2));
}
.m-rail-card {
  position: relative; flex: 0 0 clamp(320px, 38vw, 480px); border-radius: 26px;
  border: 1px solid #1E3044; padding: 40px 36px; min-height: 420px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(500px 300px at 90% -10%, color-mix(in srgb, var(--pc, #E8732C) 16%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(20,33,48,0.72), rgba(11,18,28,0.85));
  text-decoration: none; overflow: hidden;
  transition: transform 0.45s var(--m-ease-out), border-color 0.45s;
}
.m-rail-card:hover { transform: translateY(-10px); border-color: color-mix(in srgb, var(--pc, #E8732C) 60%, transparent); }
.m-rail-num {
  position: absolute; top: 18px; right: 26px; font-size: clamp(4rem, 7vw, 6rem);
  font-weight: 900; line-height: 1; color: transparent;
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--pc, #E8732C) 45%, transparent);
}
.m-rail-tag { font-size: 11.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--pc, #E8732C); font-weight: 800; }
.m-rail-card h3 { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 900; margin: 14px 0 12px; letter-spacing: -0.01em; }
.m-rail-card p { color: #94A7B8; font-size: 0.98rem; line-height: 1.7; max-width: 34ch; }
.m-rail-cta { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 0.95rem; margin-top: 26px; }
.m-rail-cta i { display: inline-block; transition: transform 0.3s var(--m-ease-out); font-style: normal; color: var(--pc, #E8732C); }
.m-rail-card:hover .m-rail-cta i { transform: translateX(6px); }
.m-rail-progress { display: flex; gap: 8px; margin-top: 34px; }
.m-rail-progress i { height: 3px; flex: 1; background: #1E3044; border-radius: 3px; overflow: hidden; position: relative; }
.m-rail-progress i::after {
  content: ''; position: absolute; inset: 0; background: #E8732C; border-radius: inherit;
  transform: scaleX(var(--p, 0)); transform-origin: 0 50%;
}

/* ---------- Industry grid ---------- */
.m-ind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 54px; }
.m-ind {
  position: relative; display: flex; gap: 18px; align-items: flex-start;
  border: 1px solid #1E3044; border-radius: 18px; padding: 26px 24px;
  background: rgba(20,33,48,0.4); overflow: hidden;
  transition: transform 0.4s var(--m-ease-out), border-color 0.4s, background 0.4s;
}
.m-ind:hover { transform: translateY(-6px) scale(1.01); border-color: color-mix(in srgb, var(--ic, #E8732C) 55%, transparent); background: rgba(20,33,48,0.75); }
.m-ind .ibox {
  flex: 0 0 52px; height: 52px; display: grid; place-items: center; font-size: 24px;
  border-radius: 14px; background: color-mix(in srgb, var(--ic, #E8732C) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ic, #E8732C) 30%, transparent);
  transition: transform 0.45s var(--m-ease-spring);
}
.m-ind:hover .ibox { transform: rotate(-8deg) scale(1.12); }
.m-ind h4 { color: #fff; font-size: 1.04rem; font-weight: 800; }
.m-ind p { color: #94A7B8; font-size: 0.88rem; line-height: 1.65; margin-top: 6px; }
.m-ind .metric {
  display: inline-block; margin-top: 12px; font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.06em; color: var(--ic, #E8732C);
  border: 1px solid color-mix(in srgb, var(--ic, #E8732C) 35%, transparent);
  border-radius: 100px; padding: 4px 12px;
}

/* ---------- Stats band ---------- */
.m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.m-stat {
  border: 1px solid #1E3044; border-radius: 22px; padding: 42px 30px; text-align: left;
  background: linear-gradient(180deg, rgba(20,33,48,0.55), rgba(11,18,28,0.65));
  position: relative; overflow: hidden;
}
.m-stat::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px;
  background: linear-gradient(90deg, #E8732C, #F4A460); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.9s var(--m-ease-out) 0.25s;
}
.m-stat.m-in::after { transform: scaleX(1); }
.m-stat b {
  display: block; font-size: clamp(2.6rem, 4.6vw, 3.8rem); font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, #fff 30%, #F4A460); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.m-stat span { display: block; color: #94A7B8; font-size: 0.92rem; margin-top: 12px; line-height: 1.6; }

/* ---------- CTA band ---------- */
.m-cta {
  position: relative; border-radius: 30px; padding: clamp(56px, 8vw, 96px) 32px; text-align: center;
  overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(232,115,44,0.16), rgba(13,21,32,0.6) 55%);
  border: 1px solid rgba(232,115,44,0.35);
}
.m-cta::before {
  content: ''; position: absolute; inset: -2px; z-index: -2; border-radius: inherit;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, rgba(232,115,44,0.8) 82%, transparent 94%);
  animation: m-spin 6s linear infinite;
}
@property --a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes m-spin { to { --a: 360deg; } }
.m-cta::after { content: ''; position: absolute; inset: 1.5px; z-index: -1; border-radius: 28px; background: #0C141F; }
.m-cta .m-h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.m-cta .m-sub { margin-inline: auto; }
.m-cta .m-hero-ctas { justify-content: center; }

/* ---------- Footer watermark ---------- */
.m-watermark {
  position: relative; z-index: 1; overflow: clip; pointer-events: none;
  margin-top: -30px; height: clamp(120px, 18vw, 260px); display: flex; align-items: flex-end; justify-content: center;
}
.m-watermark span {
  font-size: clamp(7rem, 19vw, 19rem); font-weight: 900; letter-spacing: 0.02em; line-height: 0.78;
  color: transparent; -webkit-text-stroke: 1.5px rgba(232,115,44,0.16);
  will-change: transform; white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .m-pillars { grid-template-columns: repeat(2, 1fr); }
  .m-ind-grid { grid-template-columns: repeat(2, 1fr); }
  .m-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .m-display { font-size: clamp(2.6rem, 13vw, 4rem); }
  .m-pillars, .m-ind-grid, .m-stats { grid-template-columns: 1fr; }
  .m-rail-section { height: auto; }
  .m-rail-sticky { position: static; height: auto; }
  .m-rail-track { flex-direction: column; padding: 0 24px; transform: none !important; }
  .m-rail-card { flex-basis: auto; min-height: 0; }
  .m-rail-progress { display: none; }
  .m-hero { padding-top: 120px; }
  .m-scroll-cue { display: none; }
}

/* ---------- Reduced motion: calm everything ---------- */
@media (prefers-reduced-motion: reduce) {
  .m-progress, .m-noise { display: none; }
  .m-loader { display: none !important; }
  .m-display .m-word, .m-h2 .m-word { transform: none !important; opacity: 1 !important; animation: none !important; }
  .m-rise { opacity: 1; transform: none; transition: none; }
  .m-marquee-track { animation: none; flex-wrap: wrap; }
  .m-grad-text { animation: none; }
  .m-cta::before { animation: none; }
  .m-rail-section { height: auto; }
  .m-rail-sticky { position: static; height: auto; }
  .m-rail-track { flex-wrap: wrap; transform: none !important; }
  .m-scroll-cue i { animation: none; }
  #mHeroCanvas { display: none; }
}
