:root {
  --bg: 0 0% 4%;
  --surface: 0 0% 8%;
  --text: 0 0% 96%;
  --muted: 0 0% 53%;
  --stroke: 0 0% 12%;
  --accent: 0 0% 96%;
}

* { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body { background: hsl(var(--bg)); color: hsl(var(--text)); font-family: "Inter", sans-serif; min-width: 320px;}

/* The base template (head.html) sets main{background:url(bg-round.png)…} for other pages.
   The home page manages its own backgrounds (starfield canvas, hero video, section decos). */
main { background: none; }

/* Kanit main-title face — carries its weight (no 400 loaded), so set a solid default */
.font-title { font-weight: 600; }

::selection { background: #3FAEDC; color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: hsl(var(--bg)); }
::-webkit-scrollbar-thumb { background: hsl(var(--stroke)); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: hsl(0 0% 20%); }

.accent-gradient { background: linear-gradient(90deg, #8AD0E8 0%, #3FAEDC 100%); }
.accent-text {
  background: linear-gradient(90deg, #8AD0E8 0%, #3FAEDC 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Scrolling hero*/
.scroll-down span {
  display: block;
  width: 20px;
  height: 20px;
  border-bottom: 1px solid #fff;
  border-right: 1px solid #fff;
  transform: rotate(45deg);
  margin: -10px;
  animation: scroll 2s infinite;
}
.scroll-down span:nth-child(1) {
  animation-delay: 0.2s;
}
.scroll-down span:nth-child(2) {
  animation-delay: 0.4s;
}
@keyframes scroll {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* reusable pills */
.chip {
  display: inline-block; font-size: 12px; line-height: 1.2;
  color: hsl(var(--text) / 0.82); border: 1px solid hsl(var(--stroke));
  border-radius: 99px; padding: 0.32rem 0.72rem; background: hsl(var(--surface) / 0.5);
  white-space: nowrap;
}
.tag {
  display: inline-block; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: hsl(var(--muted)); border: 1px solid hsl(var(--stroke));
  border-radius: 99px; padding: 0.28rem 0.65rem; white-space: nowrap;
}

/* Hero eyebrow — the tagline is long ("Data Analyst · AI Solutions Consultant" /
   "Data Analyst · Consultant en solutions IA"), so its size + tracking scale down
   on narrow screens to stay on a single line at phone widths instead of wrapping
   to an orphaned second line; caps at the text-xs size (0.75rem) on wider screens.
   text-balance on the element keeps any forced wrap (very small screens) even. */
.hero-kicker {
  font-size: clamp(0.6rem, 2.9vw, 0.75rem);
  line-height: 1.4;
  letter-spacing: 0.2em;
}
@media (min-width: 640px) { .hero-kicker { letter-spacing: 0.3em; } }

/* ---- keyframes ---- */
@keyframes scroll-down {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}
.animate-scroll-down { animation: scroll-down 1.5s ease-in-out infinite; }

@keyframes role-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-role-fade-in { animation: role-fade-in 0.4s ease-out; }

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-marquee { animation: marquee 40s linear infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63,174,220,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(63,174,220,0); }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

/* animated gradient border (for hover labels) */
.grad-border {
  background: linear-gradient(90deg, #8AD0E8, #3FAEDC, #8AD0E8);
  background-size: 200% 100%;
  animation: gradient-shift 6s ease infinite;
}

/* striped visual panels */
.ph {
  position: relative; overflow: hidden;
  background-color: hsl(0 0% 10%);
  background-image: repeating-linear-gradient(135deg, hsl(0 0% 13%) 0 2px, transparent 2px 13px);
}
.ph::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 30% 20%, hsl(0 0% 14%) 0%, hsl(0 0% 6%) 80%);
  mix-blend-mode: multiply;
}
.ph-label {
  position: absolute; left: 18px; bottom: 16px; z-index: 2;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; letter-spacing: 0.05em; text-transform: lowercase;
  color: hsl(0 0% 60%);
}
.ph-label::before { content: "↳ "; color: hsl(0 0% 40%); }

/* halftone overlay */
.halftone {
  background-image: radial-gradient(circle, #000 1px, transparent 1px);
  background-size: 4px 4px;
}

/* entrance helpers (set by JS) — fired when <body> gets .anim-entrance */
.pre-anim { opacity: 0; }

/* hero entrance — replaces the former GSAP timeline (power3.out ≈ this bezier) */
@keyframes name-reveal-in { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blur-in-rise { from { opacity: 0; filter: blur(10px); transform: translateY(20px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }

.anim-entrance .name-reveal { animation: name-reveal-in 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1s both; }
.anim-entrance .blur-in { animation: blur-in-rise 1s cubic-bezier(0.215, 0.61, 0.355, 1) var(--enter-delay, 0.3s) both; }

@media (prefers-reduced-motion: reduce) {
  .anim-entrance .name-reveal, .anim-entrance .blur-in { animation: none; opacity: 1; filter: none; transform: none; }
}

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s cubic-bezier(.25,.1,.25,1), transform 1s cubic-bezier(.25,.1,.25,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* hover spotlight — cyan light that follows the cursor, behind content, clipped inside the box */
.glow-card { position: relative; isolation: isolate; }
.glow-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(circle 18rem at var(--mx, 50%) var(--my, 50%), rgba(63,174,220,0.16), transparent 70%);
  opacity: 0; transition: opacity .45s ease; pointer-events: none;
}
.glow-card:hover::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .glow-card::before { transition: none; } }

/* floating decorative objects (IMG/bg-*.png) on the section sides */
@keyframes deco-float-1 { 0%, 100% { transform: translate(var(--px, 0px), var(--py, 0px)); } 50% { transform: translate(var(--px, 0px), calc(var(--py, 0px) - 20px)); } }
@keyframes deco-float-2 { 0%, 100% { transform: translate(var(--px, 0px), var(--py, 0px)); } 50% { transform: translate(var(--px, 0px), calc(var(--py, 0px) + 16px)); } }
.float-1 { animation: deco-float-1 7s ease-in-out infinite; }
.float-2 { animation: deco-float-2 9s ease-in-out infinite; }
/* parallax target moved via --px/--py (set from JS); falls back to plain float if no JS */
@media (prefers-reduced-motion: reduce) { .float-1, .float-2 { animation: none; } }

.no-scroll { overflow: hidden; height: 100vh; }

/* ===========================================================
   Hero "Decision System" mini dashboard
   Pure CSS/SVG animations; play once .hdv-animate is set on load.
   =========================================================== */
.hero-dashboard-visual {
  /* no panel background — the inner cards float directly over the hero */
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}
/* status: pulsing dot */
.hdv-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #5fd39a; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(95,211,154,0.5);
  animation: hdv-status-pulse 2s ease-in-out infinite;
}
@keyframes hdv-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95,211,154,0.45); }
  50% { box-shadow: 0 0 0 6px rgba(95,211,154,0); }
}

/* line chart: draw via stroke-dashoffset (pathLength normalised to 1) */
.hdv-chart { height: 76px; display: block; overflow: hidden; }
/* on desktop the chart fills the height freed by the stretched panel */
@media (min-width: 1024px) { .hdv-chart { height: auto; } }
.hdv-line {
  fill: none; stroke: url(#hdv-line-grad); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.hdv-line-glow {
  fill: none; stroke: #3FAEDC; stroke-width: 5; opacity: 0; filter: blur(4px);
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.hdv-area { fill: url(#hdv-area-grad); opacity: 0; }

.hdv-animate .hdv-line { animation: hdv-draw 1.6s 0.2s ease-out forwards; }
.hdv-animate .hdv-line-glow { animation: hdv-draw 1.6s 0.2s ease-out forwards, hdv-glow-pulse 3.4s 2s ease-in-out infinite; }
.hdv-animate .hdv-area { animation: hdv-fade-in 0.9s 1.2s ease forwards; }
@keyframes hdv-draw { to { stroke-dashoffset: 0; } }
@keyframes hdv-fade-in { to { opacity: 1; } }
@keyframes hdv-glow-pulse { 0%, 100% { opacity: 0.16; } 50% { opacity: 0.4; } }

/* KPI live values: brief glow flash when a value updates (toggled by JS) */
.hdv-kpi { transition: opacity 0.45s ease, text-shadow 0.45s ease; }
.hdv-kpi.hdv-flash { text-shadow: 0 0 12px currentColor; opacity: 0.85; }

/* status: tiny loading shimmer */
.hdv-shimmer {
  position: relative; width: 14px; height: 3px; border-radius: 99px; overflow: hidden;
  background: rgba(255,255,255,0.12); flex-shrink: 0;
}
.hdv-shimmer::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(63,174,220,0.9), transparent);
  animation: hdv-shimmer-move 1.6s ease-in-out infinite;
}
@keyframes hdv-shimmer-move { to { transform: translateX(100%); } }

/* bar chart: grow from 0 on load, then JS jumps height often (CSS-eased) */
.hdv-bar {
  transform: scaleY(0); transform-origin: bottom; border-radius: 3px 3px 1px 1px;
  /* same downward fade as the area under the Forecast curve (#hdv-area-grad) */
  background: linear-gradient(180deg, rgba(63,174,220,0.42) 0%, rgba(63,174,220,0) 100%);
  transition: height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.hdv-animate .hdv-bar { animation: hdv-bar-grow 0.9s cubic-bezier(0.22,1,0.36,1) forwards; }
@keyframes hdv-bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* workflow steps: glow as the data particle passes through each one */
.hdv-step { transition: color 0.4s ease; }
.hdv-animate .hdv-step { animation: hdv-step-glow 3.6s linear infinite; }
@keyframes hdv-step-glow {
  0%, 14%, 100% { color: rgba(255,255,255,0.72); text-shadow: none; filter: none; }
  5% { color: #fff; text-shadow: 0 0 10px rgba(63,174,220,0.55); filter: drop-shadow(0 0 6px rgba(63,174,220,0.5)); }
}

/* workflow strip: dots travelling left → right along a baseline */
.hdv-flow-track {
  position: relative; height: 2px; margin-top: 8px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  overflow: hidden;
}
.hdv-flow-dot {
  position: absolute; top: 50%; left: 0; width: 5px; height: 5px; border-radius: 50%;
  background: #3FAEDC; box-shadow: 0 0 6px rgba(63,174,220,0.8);
  transform: translate(-50%, -50%); opacity: 0;
  animation: hdv-flow-move 3.6s linear infinite;
}
@keyframes hdv-flow-move {
  0% { left: 0; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hdv-status-dot, .hdv-shimmer::after,
  .hdv-animate .hdv-line, .hdv-animate .hdv-line-glow, .hdv-animate .hdv-area,
  .hdv-animate .hdv-bar, .hdv-animate .hdv-step,
  .hdv-flow-dot { animation: none !important; }
  .hdv-line, .hdv-line-glow { stroke-dashoffset: 0; }
  .hdv-line-glow { opacity: 0.2; }
  .hdv-area { opacity: 1; }
  .hdv-bar { transform: scaleY(1); }
  .hdv-kpi { transition: none; }
  .hdv-step { color: rgba(255,255,255,0.72); }
  .hdv-flow-dot, .hdv-shimmer { display: none; }
}

/* ---- scroll-to-top button ---- */
#app-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid hsl(var(--stroke));
  background: hsl(var(--surface) / 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: transparent;
  font-size: 0;
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
#app-top::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #8AD0E8 0%, #3FAEDC 100%);
  opacity: 0.12;
  transition: opacity 0.25s ease;
}
#app-top::before {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid #8AD0E8;
  border-right: 1.5px solid #8AD0E8;
  transform: translate(-50%, -25%) rotate(-45deg);
}
#app-top:hover {
  border-color: rgba(63,174,220,0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(63,174,220,0.25), 0 2px 8px rgba(0,0,0,0.4);
}
#app-top:hover::after { opacity: 0.22; }
#app-top.dn { display: none; }

.dn { display: none !important; }

.mnp { position: fixed; top: 16px; left: 16px; z-index: 9999; pointer-events: none; }
.nt {
  position: relative;
  pointer-events: auto;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 38px 16px 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: hsl(var(--surface) / 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.nt.dn { display: none; }
.nt.active { opacity: 1; transform: translateY(0); }
.ntc { display: flex; align-items: flex-start; gap: 10px; }
.ntc img { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; filter: invert(1); opacity: 0.85; }
#app-notif { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt1 { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: hsl(var(--muted)); }
.nt2 { font-size: 13.5px; line-height: 1.4; color: hsl(var(--text) / 0.92); word-break: break-word; }
.nt2.red { color: #FF6B6B; }
.nt2.green { color: #4ADE80; }
.nt2.blue { color: #3FAEDC; }
.nt2.yellow { color: #FBBF24; }
.nt2.purple { color: #C084FC; }
.nt2.orange { color: #FB923C; }
.nt2.black { color: #111111; }
.nt2.white { color: #FFFFFF; }
.nc {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: hsl(var(--muted));
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.nc:hover { color: hsl(var(--text)); background: hsl(var(--stroke)); }
.np {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, #8AD0E8 0%, #3FAEDC 100%);
  transform-origin: left;
  transform: scaleX(0);
}
/* Fixed 7s to match FRONTEND.notif()'s default timerInMs; JS never sets a custom duration on .np. */
.np.active { animation: notif-progress 7s linear forwards; }
@keyframes notif-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
