/* Styles for the home page (index.twig) only. Shared site styles are in assets/site.css,
   which loads first; rules here win where both set the same thing.

   Sections are <section class="act">; the fixed canvas behind them draws the light
   ribbons, and --p (0..1, set by the script) is how far down the page the visitor is. */
:root {
  --bg: #04070b;
  --ink: #eef5ff;
  --muted: #8fa1b3;
  --teal: #1ee6c8;
  --yellow: #ffd23f;
  --orange: #ff7a2f;
  --blue: #4aa8ff;
  --green: #6dff8f;
  --glow: var(--teal);
  --p: 0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

#ribbons { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(2,4,7,.85) 100%);
}


/* ── Acts ── */
.act {
  position: relative; z-index: 1;
  display: grid; align-items: center;
  padding: clamp(48px, 7vh, 88px) clamp(18px, 6vw, 90px);
}
.wrap { width: min(1280px, 100%); margin: 0 auto; }
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 5vw, 80px); align-items: center; }
.split.flip > .copy { order: 2; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } .split.flip > .copy { order: 0; } }

.eyebrow { font-size: 16px; letter-spacing: .32em; text-transform: uppercase; color: var(--glow); margin: 0 0 14px; }
h1, h2 { margin: 0 0 18px; line-height: 1.04; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(42px, 7.2vw, 104px); }
h2 { font-size: clamp(34px, 4.6vw, 64px); }
.shine {
  background: linear-gradient(100deg, #fff 10%, var(--glow) 45%, #fff 70%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5.8s linear infinite;
}
/* One cycle moves the gradient exactly one tile (220% of the text's width), so the loop
   joins seamlessly. With background-size 220%, a position of p moves it (100% - 220%) x p,
   so one tile is 220 / 120 = 183.333%. */
@keyframes shine { to { background-position: -183.333% 0; } }
.lead { font-size: clamp(17px, 1.5vw, 21px); color: #c5d2e0; max-width: 34em; margin: 0 0 22px; }
.facts { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.facts li { padding-left: 26px; position: relative; color: #c5d2e0; }
.facts li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 14px; height: 2px;
  background: var(--glow); box-shadow: 0 0 10px var(--glow);
}
.facts b { color: var(--ink); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--glow); box-shadow: 0 8px 30px -10px var(--glow); }
.btn.go { background: var(--glow); color: #03110f; border-color: transparent; box-shadow: 0 0 34px -8px var(--glow); }

/* Things that rise into place as their act arrives */
.rise { opacity: 0; transform: translateY(46px) scale(.97); filter: blur(6px); transition: opacity .9s, transform 1.1s cubic-bezier(.2,.8,.2,1), filter .9s; }
.in .rise { opacity: 1; transform: none; filter: none; }
.in .rise.d1 { transition-delay: .12s; } .in .rise.d2 { transition-delay: .24s; } .in .rise.d3 { transition-delay: .36s; }

/* ── Act 1: the curved screen with the V31 in front (the sketch) ── */
#top { text-align: center; padding-top: clamp(96px, 13vh, 150px); }
#top .lead { margin-inline: auto; }
#top .cta { justify-content: center; }
.stagebox { position: relative; margin: clamp(26px, 5vh, 56px) auto 0; width: min(1120px, 100%); perspective: 1800px; }
.screen {
  position: relative; border-radius: clamp(18px, 3vw, 44px); overflow: hidden;
  /* Lies back a little and stands up flat as the page scrolls. It stops at flat: it
     must never turn past edge-on, or the visitor sees the picture's mirrored back. */
  transform: rotateX(calc(16deg - var(--p) * 16deg)) translateY(calc(var(--p) * -60px));
  transform-origin: 50% 100%;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 0 0 1px rgba(30,230,200,.25), 0 40px 120px -30px rgba(30,230,200,.45), 0 0 160px -40px rgba(74,168,255,.5);
}
.screen img { width: 100%; height: auto; }
.screen::after { /* a sheen across the glass: one band, every 11 s */
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 75%; pointer-events: none;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.13) 50%, transparent);
  transform: translateX(-100%);
  animation: sheen 11s linear infinite;
}
/* The band starts just past the left edge (-100% of its own width) and ends just past the
   right edge (the screen's full width = 100% / 75% of its own). It crosses at a steady
   speed in 1 s (9% of 11 s), then waits off the picture for the rest of the cycle. */
@keyframes sheen { 0% { transform: translateX(-100%); } 9%, 100% { transform: translateX(133.334%); } }
.v31float {
  position: absolute; right: -7%; bottom: -14%; width: 38%;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.8)) drop-shadow(0 0 34px rgba(109,255,143,.28));
  transform: translateY(calc(var(--p) * -260px)) rotate(calc(-4deg + var(--p) * 30deg));
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 50% { translate: 0 -12px; } }
.scrollcue { margin-top: clamp(60px, 12vh, 120px); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.scrollcue::after { content: ""; display: block; width: 1px; height: 46px; margin: 12px auto 0; background: linear-gradient(var(--teal), transparent); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 60% { transform: scaleY(1); transform-origin: top; } 100% { opacity: 0; } }

/* ── The curved wall of screens ── */
.wall { --r: clamp(380px, 62vw, 900px); perspective: 1500px; height: clamp(260px, 44vw, 560px); position: relative; }
.wall .ring { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 50% calc(-1 * var(--r)); transform: rotateY(var(--turn, 0deg)); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.wall figure {
  position: absolute; left: 50%; top: 50%; margin: 0; width: min(78%, 760px);
  transform: translate(-50%, -50%) rotateY(calc(var(--i) * 34deg));
  transform-origin: 50% 50% calc(-1 * var(--r));
  border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 30px 80px -30px #000, 0 0 60px -20px var(--glow);
  transition: opacity .6s, filter .6s; opacity: .28; filter: saturate(.6) brightness(.7);
  cursor: pointer; backface-visibility: hidden;
}
.wall figure.front { opacity: 1; filter: none; }
.wall figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 18px 12px; font-size: 14px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.wallnav { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.wallnav button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.04); color: var(--ink); font-size: 20px; cursor: pointer;
}
.wallnav button:hover { border-color: var(--glow); box-shadow: 0 0 18px -4px var(--glow); }

/* ── Product pictures ── */
/* A picture that links to the same place as its section's main button. It lifts on hover
   like the buttons do; `translate` is used so it never fights the picture's own transform
   (rise-in, tilt, bob). Left out of the tab order: the button is the keyboard route. */
.piclink { display: block; text-decoration: none; transition: translate .2s; }
.piclink:hover { translate: 0 -2px; }
.shot { border-radius: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 90px -30px #000, 0 0 90px -30px var(--glow); }
.tilt { transform: perspective(1400px) rotateY(-9deg) rotateX(3deg); }
.flip .tilt { transform: perspective(1400px) rotateY(9deg) rotateX(3deg); }
.plate { background: radial-gradient(circle at 50% 40%, #fff 55%, #dfe7ee 100%); border-radius: 50% / 42%; padding: clamp(18px, 4vw, 50px); box-shadow: 0 0 0 1px rgba(255,255,255,.3), 0 0 110px -20px var(--glow); }
.plate img { mix-blend-mode: multiply; margin: 0 auto; }
.cut { filter: drop-shadow(0 34px 40px rgba(0,0,0,.85)) drop-shadow(0 0 46px color-mix(in srgb, var(--glow) 35%, transparent)); animation: bob 7s ease-in-out infinite; }
.halo { position: relative; }
.halo::before { /* rotating ring of light behind a product */
  content: ""; position: absolute; inset: -8%; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--glow) 32%, transparent 44% 70%, color-mix(in srgb, var(--glow) 60%, #fff) 80%, transparent 92%);
  -webkit-mask: radial-gradient(closest-side, transparent 78%, #000 79% 81%, transparent 82%);
          mask: radial-gradient(closest-side, transparent 78%, #000 79% 81%, transparent 82%);
  animation: spin 14s linear infinite; opacity: .9;
}
@keyframes spin { to { rotate: 360deg; } }

/* ── The bridge between the CNC acts and the conveyor acts ── */
.bridge { text-align: center; }
.bridge h2 { font-size: clamp(36px, 6vw, 84px); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2.4vw, 30px); margin-top: 40px; text-align: left; }
@media (max-width: 900px) { .trio { grid-template-columns: 1fr; } }
/* Each card sits in a "rise" wrapper: the wrapper does the staggered rise-in, so the
   card's own hover is never held back by the stagger delay */
.trio > .rise > .card { height: 100%; }
.card {
  position: relative; border-radius: 26px; padding: 22px; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-8px); border-color: var(--glow); box-shadow: 0 30px 70px -30px var(--glow); }
.card .pic { border-radius: 16px; overflow: hidden; background: #fff; aspect-ratio: 16 / 10; display: grid; place-items: center; margin-bottom: 16px; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; }
.card .pic.fill img { object-fit: cover; }
.card h3 { margin: 0 0 6px; font-size: 24px; }
.card p { margin: 0 0 12px; color: #c5d2e0; font-size: 15px; }
.card a { color: var(--glow); text-decoration: none; font-weight: 600; font-size: 14px; }

/* ── Last act ── */
.final { text-align: center; }
.final .cta { justify-content: center; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise { opacity: 1; transform: none; filter: none; }
  .screen, .v31float { transform: none; }
}
/* ── The two product lines: a tab bar under the header picks which acts show ── */
.tabs {
  position: sticky; z-index: 25; top: 64px; width: max-content; max-width: calc(100% - 32px);
  margin: 78px auto -64px; display: flex; gap: 4px; padding: 5px;
  border-radius: 999px; background: rgba(8,13,19,.82); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 20px 50px -20px #000;
}
.tabs button {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); background: none; border: 0;
  border-radius: 999px; padding: 9px 22px; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: #03110f; background: var(--glow); box-shadow: 0 0 26px -6px var(--glow); }
@media (max-width: 520px) { .tabs button { padding: 8px 14px; font-size: 14px; } }
body[data-view="cnc"] .act[data-view="wh"], body[data-view="wh"] .act[data-view="cnc"] { display: none; }
#top, #wtop { text-align: center; padding-top: clamp(120px, 16vh, 170px); }
#wtop .lead { margin-inline: auto; }
#wtop .cta { justify-content: center; }
/* ── The VitalCNC startup banner ── */
.splashbox { margin: 0 auto clamp(30px, 5vh, 56px); width: min(1100px, 100%); border-radius: clamp(14px, 2vw, 26px); overflow: hidden;
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 40px 100px -40px #000, 0 0 80px -40px rgba(255,214,140,.35); background: #000; }
#splash { display: block; width: 100%; aspect-ratio: 16 / 5; }
