/* ============================================================
   CV Altro Service · Tactile Brutalism stylesheet
   Pairs with Tailwind utilities defined in index.html.
   ============================================================ */

:root {
  --ink:    #0B0D10;
  --ink2:   #0F1216;
  --line:   #273140;
  --line2:  #1A2028;
  --mute:   #7A8694;
  --bone:   #E6EAF0;
  --brand:  #ED1C24;
  --brand2: #FF3A42;
  --flux:   #29B6E5;
}

html, body {
  background: var(--ink);
  color: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Lenis hooks */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Tech grid backdrop ----------------------------------------- */
.tech-grid {
  background-image:
    linear-gradient(to right, rgba(39,49,64,0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(39,49,64,0.35) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  opacity: 0.55;
}

/* Corner ticks (used inside framed canvases) ----------------- */
.corner-tick {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--brand);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}

/* Pulsing online indicator ----------------------------------- */
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.pulse-dot { animation: pulseDot 1.6s ease-in-out infinite; }
.corner-tick.top-2.left-2     { top: 8px;    left: 8px;    border-top-width: 1px; border-left-width: 1px; }
.corner-tick.top-2.right-2    { top: 8px;    right: 8px;   border-top-width: 1px; border-right-width: 1px; }
.corner-tick.bottom-2.left-2  { bottom: 8px; left: 8px;    border-bottom-width: 1px; border-left-width: 1px; }
.corner-tick.bottom-2.right-2 { bottom: 8px; right: 8px;   border-bottom-width: 1px; border-right-width: 1px; }

/* SVG part labels -------------------------------------------- */
.part-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--mute);
}
.part-label-cyan { fill: var(--flux); }

/* Pinned sections ------------------------------------------ */
.pinned-section { position: relative; }
.pin-shell      { width: 100%; }

/* The pin-spacer that ScrollTrigger injects must not introduce a
   horizontal scroll on narrow viewports. */
.gsap-pin-spacer { max-width: 100%; }

/* Exploded view -------------------------------------------- */
.exploded-canvas {
  /* w/h fully fluid; aspect-ratio + max-width controlled in HTML */
}
.exploded-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}
.exploded-canvas [data-part] {
  transform: translate(0, 0);
  transition: filter 0.4s ease;
}

/* Part list rows — tightened so 5 rows fit a pinned 100vh layout */
.part-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.25rem;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
@media (min-width: 1024px) {
  .part-item { padding: 0.9rem 0.25rem; column-gap: 1.25rem; }
}
.part-item:last-child { border-bottom: 1px solid var(--line); }
.part-item.is-active  {
  background: linear-gradient(90deg, rgba(237,28,36,0.08), transparent 60%);
  border-color: var(--brand);
}
.part-item.is-active .part-num { color: var(--brand); border-color: var(--brand); }
.part-item.is-active .part-name { color: var(--bone); }
.part-num {
  display: inline-grid;
  place-items: center;
  width: 1.75rem; height: 1.75rem;
  border: 1px solid var(--line);
  color: var(--mute);
  font-size: 10px;
  letter-spacing: 0.04em;
}
@media (min-width: 1024px) {
  .part-num { width: 2rem; height: 2rem; font-size: 11px; }
}
.part-name { font-size: 13px; color: var(--mute); margin-bottom: 2px; transition: color 0.25s ease; }
.part-desc { font-size: 11.5px; color: var(--mute); line-height: 1.5; }
@media (min-width: 1024px) {
  .part-name { font-size: 14px; }
  .part-desc { font-size: 12px; line-height: 1.55; }
}

/* Magnetic flux lines --------------------------------------- */
.flux-lines path {
  /* Each path's pathLength is normalized to 1 in JS; we animate
     stroke-dashoffset 1 → 0 to mimic GSAP's DrawSVG without
     requiring the paid plugin. */
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  pathLength: 1;
}

/* Gauge needles --------------------------------------------- */
[data-needle] {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

/* Service cards --------------------------------------------- */
.service-card {
  position: relative;
  padding: 2rem 1.75rem 2.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, transform 0.25s ease;
  background: var(--ink);
}
.service-card:hover { background: var(--ink2); }
.service-card:nth-child(3n) { border-right: 0; }
@media (max-width: 1023px) {
  .service-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .service-card:nth-child(2n) { border-right: 0; }
}
@media (max-width: 767px) {
  .service-card { border-right: 0 !important; }
}
.service-num {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 1.5rem;
}
.service-title {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.service-desc {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.6;
}

/* Reveal-state utility for hero text split lines ------------ */
[data-split] {
  overflow: hidden;
}
[data-split] > span {
  display: inline-block;
  will-change: transform;
}

/* prefers-reduced-motion: skip transitions/animations -------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .flux-lines path { stroke-dashoffset: 0 !important; }
  [data-needle] { transform: rotate(0deg) !important; }
}

/* Print-safe: hide animated decorative chrome ---------------- */
@media print {
  .tech-grid, .corner-tick { display: none; }
  body { background: white; color: black; }
}
