/* ===== Tokens ===== */
:root {
  --ground: #0B0C10;
  --surface: #15171D;
  --surface-raised: #101217;
  --line: #262A33;
  --line-soft: #343944;
  --text: #F2F0EA;
  --text-secondary: #C9CCD3;
  --text-muted: #A3A8B3;
  --orange: #FF7A1A;
  --cyan: #4FD1E8;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: clamp(28px, 4vw, 44px); }
p { color: var(--text-secondary); }
a { color: var(--text); }
.accent { color: var(--orange); }

.mono-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--text-muted);
}

.placeholder {
  color: var(--cyan);
  border: 1px dashed var(--cyan);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* layer-line texture */
.layer-lines, .tilt-card, .ghost-word, .print-word {
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 4px);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary { background: var(--orange); color: var(--ground); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,122,26,0.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-soft); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ===== Loader ===== */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--ground);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease;
}
#loader.hidden { opacity: 0; pointer-events: none; }
#loaderInfinity { stroke-dasharray: 400; stroke-dashoffset: 400; animation: drawLoader 1.1s ease forwards; }
@keyframes drawLoader { to { stroke-dashoffset: 0; } }

/* ===== Scroll progress ===== */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--orange); z-index: 9000;
  box-shadow: 0 0 8px rgba(255,122,26,0.6);
}

/* ===== Custom cursor ===== */
#cursorDot, #cursorRing { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 8000; border-radius: 50%; transform: translate(-50%,-50%); display: none; }
#cursorDot { width: 6px; height: 6px; background: var(--orange); }
#cursorRing { width: 32px; height: 32px; border: 1px solid var(--orange); transition: width 0.2s, height 0.2s, opacity 0.2s; }
body.has-cursor #cursorDot, body.has-cursor #cursorRing { display: block; }
#cursorRing.is-active { width: 54px; height: 54px; opacity: 0.6; }

/* ===== Demo pill ===== */
.demo-pill {
  position: fixed; top: 14px; right: 14px; z-index: 7000;
  background: rgba(21,23,29,0.9); border: 1px solid var(--line-soft);
  color: var(--text-secondary); font-family: var(--font-mono); font-size: 11px;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  display: flex; align-items: center; gap: 8px; backdrop-filter: blur(6px);
}
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: 0.4; transform: scale(1.4);} }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(11,12,16,0.72); backdrop-filter: blur(14px); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; font-size: 16px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--orange); }
.nav-cta { margin-left: 16px; }
.nav-toggle { display: none; background: none; border: none; flex-direction: column; gap: 5px; cursor: pointer; width: 44px; height: 44px; align-items: center; justify-content: center; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.is-open {
    display: flex; flex-direction: column; position: fixed; inset: 0; top: 0;
    background: var(--ground); align-items: center; justify-content: center; gap: 28px; z-index: 600;
  }
  .nav-links.is-open a { font-size: 24px; opacity: 0; transform: translateY(10px); animation: navIn 0.4s ease forwards; }
  .nav-links.is-open a:nth-child(1){animation-delay:.05s} .nav-links.is-open a:nth-child(2){animation-delay:.1s}
  .nav-links.is-open a:nth-child(3){animation-delay:.15s} .nav-links.is-open a:nth-child(4){animation-delay:.2s}
  .nav-links.is-open a:nth-child(5){animation-delay:.25s} .nav-links.is-open a:nth-child(6){animation-delay:.3s}
}
@keyframes navIn { to { opacity: 1; transform: translateY(0); } }

/* ===== Hero ===== */
.hero { position: relative; padding: 60px 28px 80px; min-height: 90vh; display: flex; align-items: center; overflow: hidden; }
#filamentField { position: absolute; inset: 0; z-index: 0; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; max-width: 1200px; margin: 0 auto; align-items: center; width: 100%; }
.eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.hero-h1 { font-size: clamp(40px, 6.5vw, 84px); line-height: 1.02; }
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: inline-block; transform: translateY(110%); animation: lineUp 0.7s cubic-bezier(.2,.8,.2,1) forwards; }
.reveal-line:nth-child(1) > span { animation-delay: 0.15s; }
.reveal-line:nth-child(2) > span { animation-delay: 0.32s; }
@keyframes lineUp { to { transform: translateY(0); } }
.hero-sub { max-width: 46ch; font-size: 17px; }
.hero-actions { display: flex; gap: 14px; margin: 26px 0; flex-wrap: wrap; }
.trust-row { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; }
.hero-visual { display: flex; justify-content: center; }
.hero-plate { width: 100%; max-width: 420px; }
#heroInfinityPath { stroke-dasharray: 440; stroke-dashoffset: 440; animation: drawInfinity 3.2s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(255,122,26,0.6)); }
@keyframes drawInfinity { 0% { stroke-dashoffset: 440; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -440; } }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

/* ===== Ticker ===== */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); padding: 14px 0; overflow: hidden; }
.ticker-row { overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ticker-track em { color: var(--orange); font-style: normal; }
.ticker-row-a .ticker-track { animation: scrollLeft 28s linear infinite; }
.ticker-row-b .ticker-track { animation: scrollRight 34s linear infinite; }
.ticker-row-b { margin-top: 6px; }
@keyframes scrollLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes scrollRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* ===== Generic section ===== */
section { padding: 90px 28px; max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 46px; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===== Live build ===== */
.live-build { text-align: center; }
.live-build-stage { position: relative; height: clamp(160px, 20vw, 300px); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ghost-word, .print-word {
  position: absolute; font-family: var(--font-display); font-weight: 800; font-size: 14vw; line-height: 1;
  color: var(--orange); -webkit-text-stroke: 1px var(--line-soft);
}
.ghost-word { color: transparent; -webkit-text-stroke: 1px var(--line-soft); opacity: 0.5; }
.print-word { clip-path: inset(100% 0 0 0); transition: clip-path 0.1s linear; }
.gantry { position: absolute; left: 0; right: 0; height: 3px; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); bottom: 100%; transition: bottom 0.1s linear; }
.mono-readout { font-family: var(--font-mono); color: var(--cyan); margin-top: 18px; letter-spacing: 0.1em; }
.live-build-caption { max-width: 60ch; margin: 18px auto 4px; }
.decorative-note { opacity: 0.7; }

/* ===== Watch it print ===== */
.print3d-wrap { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 30px; align-items: start; }
.print3d-canvas-wrap { position: relative; aspect-ratio: 4/3; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
#printCanvas { width: 100%; height: 100%; display: block; cursor: grab; }
.print3d-fallback, .print3d-fallback-note { width: 100%; height: 100%; object-fit: cover; }
.print3d-controls { display: flex; flex-direction: column; gap: 22px; }
.control-group { display: flex; flex-direction: column; gap: 10px; }
.chip-btn {
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--text-secondary);
  border-radius: 999px; padding: 10px 18px; font-family: var(--font-body); font-weight: 600; cursor: pointer; min-height: 44px;
}
.chip-btn.is-active { border-color: var(--orange); color: var(--orange); }
@media (max-width: 860px) { .print3d-wrap { grid-template-columns: 1fr; } }

/* ===== Services ===== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tilt-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  transform-style: preserve-3d; position: relative; overflow: hidden;
}
.tilt-card:hover { border-color: var(--orange); box-shadow: 0 14px 36px rgba(0,0,0,0.4); }
.card-icon { margin-bottom: 14px; }
@media (max-width: 860px) { .card-grid { grid-template-columns: 1fr; } }

/* ===== Materials ===== */
.materials-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 50px; align-items: center; margin-bottom: 40px; }
.cube-stage { perspective: 900px; display: flex; justify-content: center; }
.cube { position: relative; width: 160px; height: 160px; transform-style: preserve-3d; animation: spinCube 14s linear infinite; }
.cube.is-paused { animation-play-state: paused; }
.cube-face {
  position: absolute; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; border: 1px solid var(--line-soft);
  background: var(--surface);
}
.cube-front { transform: translateZ(80px); color: var(--orange); }
.cube-back { transform: rotateY(180deg) translateZ(80px); color: var(--cyan); }
.cube-right { transform: rotateY(90deg) translateZ(80px); color: var(--orange); }
.cube-left { transform: rotateY(-90deg) translateZ(80px); color: var(--orange); }
.cube-top { transform: rotateX(90deg) translateZ(80px); background: var(--orange); color: var(--ground); }
.cube-bottom { transform: rotateX(-90deg) translateZ(80px); color: var(--orange); }
@keyframes spinCube { from { transform: rotateY(0) rotateX(-8deg); } to { transform: rotateY(360deg) rotateX(-8deg); } }

.pill-toggle { display: inline-flex; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px; flex-wrap: wrap; }
.pill-toggle.wrap { border-radius: 16px; }
.pill-btn {
  background: transparent; border: none; color: var(--text-secondary); font-family: var(--font-body); font-weight: 700;
  border-radius: 999px; padding: 10px 20px; cursor: pointer; min-height: 44px;
}
.pill-btn.is-active { background: var(--orange); color: var(--ground); }
.material-detail { margin: 24px 0; }
.best-for { color: var(--text-muted); font-size: 14px; }
.link-arrow { color: var(--orange); text-decoration: none; font-weight: 700; }

.compare-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.compare-row { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.compare-row:last-child { border-bottom: none; }
.compare-head { background: var(--surface); font-family: var(--font-mono); text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; color: var(--text-muted); }
.compare-row[data-stronger="pla"] span:nth-child(2) { color: var(--orange); position: relative; }
.compare-row[data-stronger="petg"] span:nth-child(3) { color: var(--orange); }
.compare-row[data-stronger] span:nth-child(2)::before, .compare-row[data-stronger] span:nth-child(3)::before { content: ''; }
.compare-row[data-stronger="pla"] span:nth-child(2)::marker {}
.compare-row span:nth-child(2), .compare-row span:nth-child(3) { padding-left: 16px; position: relative; }
.compare-row[data-stronger="pla"] span:nth-child(2)::before { content:'●'; position:absolute; left:0; color:var(--orange); text-shadow:0 0 6px var(--orange); font-size:10px; top:4px; }
.compare-row[data-stronger="petg"] span:nth-child(3)::before { content:'●'; position:absolute; left:0; color:var(--orange); text-shadow:0 0 6px var(--orange); font-size:10px; top:4px; }

.spool-row { display: flex; gap: 16px; justify-content: center; margin-top: 40px; }
.spool { width: 46px; height: 46px; border-radius: 50%; border: 8px solid var(--spool-color); background: var(--surface-raised); display: inline-block; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spool-caption { text-align: center; margin-top: 10px; }

@media (max-width: 860px) { .materials-grid { grid-template-columns: 1fr; } }

/* ===== Process ===== */
.process-steps { list-style: none; padding: 0; margin: 0; position: relative; display: grid; grid-template-columns: repeat(4,1fr); gap: 30px; }
.process-step { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.step-num {
  font-family: var(--font-mono); font-size: 20px; color: var(--text-muted); border: 1px solid var(--line-soft);
  border-radius: 50%; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.step-num.is-lit { color: var(--orange); border-color: var(--orange); box-shadow: 0 0 14px rgba(255,122,26,0.5); }
.process-line { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; margin-top: -10px; position: relative; order: -1; }
.process-line-fill { height: 100%; width: 0%; background: var(--orange); box-shadow: 0 0 10px var(--orange); transition: width 0.1s linear; }
@media (max-width: 860px) { .process-steps { grid-template-columns: 1fr; } .process-line { display: none; } }

/* ===== Gallery ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery-tile {
  position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; aspect-ratio: 4/3;
  background: var(--surface); padding: 0; cursor: pointer; display: block; text-align: left;
}
.gallery-tile img, .ba-wrap { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-tile::after {
  content: ''; position: absolute; left: 0; right: 0; top: -100%; height: 40%;
  background: linear-gradient(to bottom, transparent, rgba(79,209,232,0.25), transparent);
  transition: top 0.6s ease; pointer-events: none;
}
.gallery-tile:hover::after { top: 100%; }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; font-size: 13px; color: var(--text);
  background: linear-gradient(to top, rgba(11,12,16,0.9), transparent);
}
.gallery-cta { background: var(--orange); color: var(--ground); display: flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-display); text-decoration: none; }
.ba-wrap { position: relative; }
.ba-real, .ba-wire { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-wire { filter: grayscale(1) invert(1) brightness(1.4) contrast(1.6) hue-rotate(160deg); clip-path: inset(0 50% 0 0); }
.ba-slider { position: absolute; bottom: 44px; left: 10%; width: 80%; z-index: 2; accent-color: var(--cyan); }
@media (max-width: 860px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .gallery-grid { grid-template-columns: 1fr; } }

.lightbox {
  position: fixed; inset: 0; background: rgba(5,6,8,0.92); z-index: 9500;
  display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 86vw; max-height: 80vh; border-radius: 10px; transform: scale(0.9); transition: transform 0.25s ease; }
.lightbox.is-open img { transform: scale(1); }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; background: none; border: none; color: var(--text); font-size: 28px; cursor: pointer;
  width: 44px; height: 44px;
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ===== FAQ ===== */
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-trigger {
  width: 100%; text-align: left; background: none; border: none; color: var(--text); font-family: var(--font-display);
  font-size: 17px; padding: 20px 0; cursor: pointer; display: flex; justify-content: space-between; min-height: 44px;
}
.accordion-trigger::after { content: '+'; color: var(--orange); font-size: 22px; transition: transform 0.3s; }
.accordion-trigger[aria-expanded="true"]::after { transform: rotate(45deg); }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-panel p { padding-bottom: 20px; margin: 0; }

/* ===== Testimonials ===== */
.testimonial-track { position: relative; min-height: 140px; }
.testimonial-card {
  position: absolute; inset: 0; margin: 0; text-align: center; opacity: 0; transition: opacity 0.6s ease;
  background: var(--surface); border: 1px dashed var(--line-soft); border-radius: 16px; padding: 30px; font-size: 18px;
}
.testimonial-card.is-active { opacity: 1; position: relative; }
.testimonial-card cite { display: block; margin-top: 14px; color: var(--text-muted); font-style: normal; }

/* ===== Web dev strip ===== */
.webdev-strip { padding-top: 0; }
.webdev-card {
  border: 1px dashed var(--line-soft); border-radius: 16px; padding: 32px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}

/* ===== Quote builder ===== */
.mailto-link { color: var(--cyan); }
.quote-builder { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px; max-width: 760px; margin: 0 auto; position: relative; }
.progress-track { height: 4px; background: var(--line); border-radius: 2px; margin-bottom: 30px; }
.progress-fill { height: 100%; width: 20%; background: var(--orange); border-radius: 2px; transition: width 0.3s ease; }
.quote-step { display: none; border: none; padding: 0; margin: 0; }
.quote-step.is-active { display: block; }
.quote-step legend { font-family: var(--font-mono); text-transform: uppercase; font-size: 12px; letter-spacing: 0.1em; color: var(--text-muted); padding: 0; margin-bottom: 18px; }
.quote-step label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 14px; }
.quote-step input[type="text"], .quote-step input[type="email"], .quote-step input[type="number"], .quote-step textarea {
  width: 100%; background: var(--surface-raised); border: 1px solid var(--line-soft); border-radius: 10px; color: var(--text);
  padding: 12px 14px; font-family: var(--font-body); font-size: 15px;
}
.field-error { color: #ff6b6b; font-size: 13px; min-height: 18px; }
.quote-nav { display: flex; gap: 14px; margin-top: 26px; justify-content: flex-end; }
.quote-summary { color: var(--text-secondary); line-height: 1.8; }
.quote-confirm { text-align: center; position: relative; }
#burstCanvas { position: absolute; inset: 0; width: 100%; height: 160px; pointer-events: none; }

/* ===== Footer ===== */
.site-footer { position: relative; padding: 60px 28px 40px; text-align: center; border-top: 1px solid var(--line); overflow: hidden; }
.footer-watermark { position: absolute; font-size: 40vw; color: var(--surface); z-index: 0; top: -10%; left: 50%; transform: translateX(-50%); line-height: 1; user-select: none; }
.footer-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--orange); }

@media (max-width: 480px) { .demo-pill span, .demo-pill { font-size: 10px; padding: 6px 10px; } }
