/* Ermes Logic — immersive 3D home (FIX 01)
   Dark space theme around the brand blue #009CFF. The 3D canvas is fixed behind the page;
   every section stays readable and usable without it. */

:root {
  --bg: #040a15;
  --bg-2: #071327;
  --primary: #009cff;
  --primary-2: #38bdff;
  --primary-strong: #006fd6;   /* fills with white text (5:1) */
  --primary-deep: #0050b8;
  --cyan: #5ee7ff;
  --guard: #ff5a6e;
  --text: #e8f1fb;
  --text-soft: #a9bdd3;
  --muted: #7d93ad;
  --line: rgba(130, 190, 255, .16);
  --glass: rgba(9, 20, 38, .58);
  --glass-strong: rgba(9, 20, 38, .78);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --font-head: "Sora", "Open Sans", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-2); text-decoration: none; transition: color .2s; }
a:hover { color: var(--cyan); }
h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.18; margin: 0 0 .6em; color: #fff; letter-spacing: -.01em; }
h1, h2, h3, h4, h5 { text-wrap: balance; }
p, li { text-wrap: pretty; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary-strong); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus, .skip-link:hover { top: 12px; color: #fff; }

/* ---------- 3D stage ---------- */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#scene3d { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s var(--ease-out); }
body.scene-ready #scene3d { opacity: 1; }
.stage-fallback {
  position: absolute; inset: 0; z-index: -1;
  /* plain night background when WebGL is not available: no fake spotlight */
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}
.stage-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(2, 6, 14, .75) 100%);
}
body > *:not(.stage) { position: relative; z-index: 1; }

/* ---------- Top bar + nav ---------- */
.site-topbar { padding-inline: 16px; font-size: .84rem; color: var(--text-soft); border-bottom: 1px solid var(--line); background: rgba(4, 10, 21, .55); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.topbar-group { display: flex; gap: 22px; align-items: center; }
.topbar-group a { color: var(--text-soft); }
.topbar-group a:hover { color: #fff; }
.topbar-group i { margin-right: 7px; }

.site-navbar {
  position: sticky !important; top: 0; z-index: 50 !important;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s, box-shadow .35s, backdrop-filter .35s;
}
.site-navbar.scrolled {
  background: rgba(4, 10, 21, .78);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.navbar-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; flex-shrink: 0; white-space: nowrap; }
.navbar-brand img { width: 46px; height: auto; border-radius: 8px; }
.navbar-brand:hover { color: #fff; }
.navbar-collapse { display: flex; align-items: center; }
.navbar-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--text-soft); font-weight: 600; font-size: .92rem;
  padding: 8px 11px; border-radius: 10px; background: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(0, 156, 255, .12); }
.nav-link.active { background: rgba(0, 156, 255, .18); }
.nav-dropdown { position: relative; }
.dropdown-toggle .bi { font-size: .7rem; transition: transform .25s; }
.nav-dropdown.open .dropdown-toggle .bi { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius-sm);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: 6px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s var(--ease-out), visibility .2s;
}
.nav-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-item { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-soft); font-size: .92rem; }
.dropdown-item:hover { background: rgba(0, 156, 255, .15); color: #fff; }
.nav-cta { margin-left: 10px; }
.navbar-toggler { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 40px; padding: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.navbar-toggler span { width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .3s, opacity .3s; }
.navbar-toggler[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navbar-toggler[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* language switcher injected by js/i18n.js */
.site-navbar .ermes-lang { margin-left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s, background .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-sm { padding: 8px 16px; font-size: .86rem; }
.btn-glow { background: linear-gradient(135deg, var(--primary-strong), var(--primary-deep)); color: #fff; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-glow:hover { color: #fff; box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .18); backdrop-filter: blur(8px); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .32); }
.btn-outline { background: transparent; color: var(--primary-2); border-color: rgba(0, 156, 255, .5); }
.btn-outline:hover { background: rgba(0, 156, 255, .14); color: #fff; }
.btn-light { background: #fff; color: #0759b8; }
.btn-light:hover { color: #003f8a; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .55); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-ghost-light:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row.center { justify-content: center; margin-top: 2rem; }
.hero-card .btn-row.center { margin-top: 1.2rem; }

/* ---------- Shared bits ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.list-check { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: .7rem; }
.list-check li { position: relative; padding-left: 30px; color: var(--text-soft); }
.list-check li::before {
  content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: .8rem; color: #fff; background: var(--primary-strong);
}

/* ---------- Sections ---------- */
.scene-section { padding: clamp(80px, 12vh, 140px) 0; min-height: 92vh; display: flex; align-items: center; }
.scene-section > .container { width: min(1200px, 100% - 40px); }
.section-head { max-width: 760px; margin: 0 auto 3rem; }
.section-head h2, .split-copy h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.section-lead { color: var(--text-soft); font-size: 1.1rem; }

/* Hero */
.hero { min-height: calc(100vh - var(--nav-h)); padding-top: 40px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .85fr; gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.9rem); font-weight: 700; margin-bottom: 1.2rem;
  color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
  text-wrap: balance;
}
.hero .lead { font-size: 1.12rem; color: var(--text-soft); max-width: 640px; margin-bottom: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 2rem; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; color: #dcecff;
  background: rgba(0, 156, 255, .1); border: 1px solid rgba(0, 156, 255, .3);
}
.chip i { color: var(--cyan); }
.note { display: flex; gap: 10px; align-items: flex-start; margin-top: 1.8rem; font-size: .92rem; color: var(--muted); max-width: 600px; }
.note i { color: var(--primary-2); margin-top: 2px; }

.hero-card { padding: 34px 30px 30px; text-align: center; }
.hero-card .app-icon { margin: 0 auto 18px; border-radius: 24px; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 18px 40px -14px rgba(0, 0, 0, .8); }
.hero-card h2 { font-size: 1.35rem; margin-bottom: 1.1rem; }
.hero-card .list-check { text-align: left; font-size: .95rem; margin-bottom: .4rem; }

.scroll-cue { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.35); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: cue 1.8s var(--ease-out) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Grids + cards */
.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 1000px; margin-inline: auto; }
.grid-2.stretch { max-width: none; align-items: stretch; }
.card { padding: 28px 26px; display: flex; flex-direction: column; align-items: flex-start; transition: border-color .3s, box-shadow .3s; }
.card.center { align-items: center; text-align: center; }
.card:hover { border-color: rgba(0, 156, 255, .5); }
.card h3 { font-size: 1.25rem; }
.card p { color: var(--text-soft); flex: 1; }
.card .btn { margin-top: .4rem; }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: .9rem; }
.card.center .card-head { justify-content: center; }
.card-head h3 { margin: 0; }
.card-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.15rem; color: var(--cyan);
  background: rgba(0, 156, 255, .14); border: 1px solid rgba(0, 156, 255, .32);
}
.link-arrow { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow::after { content: "\2192"; transition: transform .25s var(--ease-out); }
.link-arrow:hover::after { transform: translateX(4px); }

/* tilt (JS adds the transform) */
.tilt { transform-style: preserve-3d; will-change: transform; transition: transform .5s var(--ease-out), border-color .3s, box-shadow .3s; }
.tilt.tilting { transition: transform .08s linear, border-color .3s, box-shadow .3s; }

/* Split sections */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }
.split.reverse > .split-copy { order: 2; }
.stack { display: grid; gap: 22px; }
.offer {
  border: 1px solid rgba(255, 200, 87, .35); background: rgba(255, 200, 87, .09); color: #ffe3a3;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 1.6rem; font-size: .95rem;
}
/* kept narrow so the 3D shield closes around it */
.product-shot { margin: 0; padding: 10px; overflow: hidden; width: min(400px, 100%); justify-self: center; background: rgba(9, 20, 38, .7); }
.product-shot img { border-radius: 12px; width: 100%; }
.product-shot figcaption { padding: 14px 6px 4px; }
.tag { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ff8a98; }

/* Panels */
.panel { padding: 38px 36px; border-radius: var(--radius); height: 100%; }
.panel h3 { font-size: 1.6rem; }
.panel-cta {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  background: linear-gradient(135deg, #0063c7 0%, #004fae 55%, #003a8c 100%);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255,255,255,.2);
  position: relative; overflow: hidden;
}
.panel-cta::after { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%); pointer-events: none; }
.panel-cta p { color: rgba(255, 255, 255, .85); }

.seo-internal-links { padding-bottom: 90px; }
.seo-internal-links h2 { font-size: 1.5rem; }
.seo-internal-links p { color: var(--text-soft); }
.link-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.link-cloud a { display: inline-block; padding: 7px 14px; border-radius: 999px; font-size: .9rem; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text-soft); }
.link-cloud a:hover { color: #fff; border-color: rgba(0,156,255,.5); background: rgba(0,156,255,.12); }

/* Footer */
.footer-modern { background: linear-gradient(180deg, rgba(4,10,21,.6), #02060d 40%); border-top: 1px solid var(--line); padding: 70px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr .8fr 1fr; gap: 40px; }
.footer-modern h4 { font-size: 1.6rem; }
.footer-modern h5 { font-size: 1.25rem; margin-bottom: 1rem; }
.footer-modern a:not(.social a) { display: block; color: var(--text-soft); padding: 3px 0; font-size: .93rem; }
.footer-modern a:not(.social a):hover { color: #fff; }
.footer-modern p.muted { font-size: .93rem; margin-bottom: .5rem; }
.footer-modern p.muted i { margin-right: 6px; }
.social { display: flex; gap: 10px; }
.social a { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,.25); transition: background .25s, border-color .25s, transform .25s var(--ease-out); }
.social a:hover { background: var(--primary-strong); border-color: var(--primary-strong); transform: translateY(-3px); color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

.back-to-top {
  position: fixed !important; right: 24px; bottom: 24px; z-index: 40 !important;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-strong); color: #fff; font-size: 1.2rem; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .7);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s, transform .3s var(--ease-out), visibility .3s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: #fff; }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .08s; }
.js .reveal[data-delay="2"] { transition-delay: .16s; }
.js .reveal[data-delay="3"] { transition-delay: .24s; }
.js .reveal[data-delay="4"] { transition-delay: .32s; }
/* hero: entrance on load, not tied to the scroll observer */
.hero .reveal { opacity: 1; transform: none; transition: none; animation: rise 1.1s var(--ease-out) both; }
.hero .reveal[data-delay="2"] { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1299.98px) {
  .nav-link { padding: 8px 8px; font-size: .88rem; }
  .nav-link i { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar-brand span { display: none; }
  .nav-cta { margin-left: 4px; }
}
@media (max-width: 991.98px) {
  .site-topbar { display: none; }
  .navbar-toggler { display: inline-flex; }
  .site-navbar { background: rgba(4, 10, 21, .8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .navbar-collapse {
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    background: rgba(4, 10, 21, .96); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .45s var(--ease-out);
  }
  .navbar-collapse.open { max-height: 80vh; overflow-y: auto; }
  .navbar-nav { flex-direction: column; align-items: stretch; padding: 12px 20px 22px; gap: 2px; }
  .nav-link { padding: 12px 10px; font-size: 1rem; }
  .nav-link i { display: inline; }
  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; background: rgba(255,255,255,.03); margin: 4px 0 8px; }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .nav-cta { margin: 12px 0 0; }
  .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
  .split.reverse > .split-copy { order: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .scene-section { min-height: auto; }
  .hero { min-height: calc(100svh - var(--nav-h)); }
  .hero-copy { padding-top: 18vh; }
  /* text over the 3D planet */
  .scene-section p, .scene-section li, .scene-section h1, .scene-section h2 { text-shadow: 0 1px 14px rgba(2, 6, 14, .95); }
}
@media (max-width: 575.98px) {
  body { font-size: 15.5px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn-lg { padding: 13px 22px; font-size: .98rem; }
  .btn-row .btn { flex: 1 1 auto; }
  .panel { padding: 28px 22px; }
  .hero-copy { padding-top: 22vh; }
  .scroll-cue { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .js .reveal { transform: none; transition: opacity .6s linear; }
  .tilt, .btn { transition: none; transform: none !important; }
}

/* FIX 03: themed 3D scenes sit behind every section, keep headings readable over them */
.section-head h2, .section-head p, .split-copy h2, .split-copy > p { text-shadow: 0 2px 18px rgba(2, 6, 14, .85); }
