/* =========================================================
   Biradar CNC Solutions — main stylesheet
   ========================================================= */
:root {
  --bg: #0b0d10;
  --bg-2: #111419;
  --panel: #161a20;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9edf2;
  --muted: #9aa4b1;
  --accent: #ff6a1a;
  --accent-2: #ff9447;
  --radius: 14px;
  --container: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: 20px; }

.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .9em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.4em; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #140800; box-shadow: 0 8px 30px -8px rgba(255, 106, 26, .6); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border-color: rgba(255, 255, 255, .22); color: var(--text); background: rgba(255, 255, 255, .03); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: .6em 1.1em; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(11, 13, 16, .82); backdrop-filter: blur(12px); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.05rem; white-space: nowrap; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #c43d00); color: #fff; font-weight: 700;
}
.brand-text b { font-weight: 600; color: var(--muted); }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: .92rem; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; margin-left: auto; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 7px 8px; transition: transform .3s; }
.nav.open .nav-toggle span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav.open .nav-toggle span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Scrolly 3D section ---------- */
.scrolly { position: relative; height: 700vh; }
.sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 65% 55%, #1d232c 0%, rgba(11, 13, 16, 0) 60%),
    linear-gradient(180deg, #0d1014 0%, #0b0d10 100%);
}
.sticky::before { /* engineering grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 60% 55%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 55%, #000 20%, transparent 75%);
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 62% 88%, rgba(255, 106, 26, .10), transparent 70%);
}

.stage {
  position: absolute; left: clamp(20px, 6vw, 90px); top: 50%;
  width: min(480px, 40vw);
  transform: translateY(-50%);
  opacity: 0; pointer-events: none;
  will-change: opacity, transform;
}
.stage.active { pointer-events: auto; }
.stage h1 span, .stage h2 span { color: var(--accent); }
.stage p:not(.eyebrow) { color: #c3cbd5; font-size: 1.05rem; }
.stage .lead { font-size: 1.15rem; }
.stage-final { left: 50%; top: auto; bottom: 9vh; transform: translateX(-50%); text-align: center; width: min(640px, 90vw); }
.stage-final .btn-row { justify-content: center; }

.progress { position: absolute; right: clamp(14px, 3vw, 36px); top: 50%; transform: translateY(-50%); width: 3px; height: 34vh; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress span { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); transition: opacity .4s; }
.scroll-hint .mouse { width: 22px; height: 34px; border: 2px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-hint .mouse::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; background: var(--accent); border-radius: 2px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(10px); } }

.loader { position: absolute; right: 24px; bottom: 24px; display: flex; gap: 10px; align-items: center; font-size: .85rem; color: var(--muted); transition: opacity .5s; }
.loader.hide { opacity: 0; pointer-events: none; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(70px, 10vw, 130px); position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 50px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: border-color .3s, transform .3s;
}
.card:hover { border-color: rgba(255, 106, 26, .45); transform: translateY(-4px); }
.card p { color: var(--muted); margin: 0; font-size: .95rem; }
.icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 106, 26, .1); margin-bottom: 18px; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Machines */
.machine { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s, border-color .3s; }
.machine:hover { transform: translateY(-4px); border-color: rgba(255, 106, 26, .45); }
.machine-visual { aspect-ratio: 16 / 9; max-width: 100%; position: relative; background: linear-gradient(160deg, #1e242c, #12161b); overflow: hidden; }
.machine-visual::before, .machine-visual::after { content: ""; position: absolute; }
/* simple CSS illustrations — replace with real photos: <img src="assets/..."> */
.v-vmc::before { left: 30%; right: 30%; top: 16%; bottom: 14%; border-radius: 8px; background: linear-gradient(180deg, #cfd5dc, #9aa3ad); box-shadow: inset 0 -18px 0 #2a2f36; }
.v-vmc::after { left: 38%; right: 38%; top: 28%; height: 34%; border-radius: 4px; background: rgba(120, 170, 210, .35); border: 3px solid #2a2f36; }
.v-lathe::before { left: 18%; right: 18%; top: 30%; bottom: 20%; border-radius: 8px; background: linear-gradient(180deg, #cfd5dc, #9aa3ad); box-shadow: inset 0 -14px 0 #2a2f36; }
.v-lathe::after { left: 26%; width: 30%; top: 40%; height: 26%; border-radius: 4px; background: rgba(120, 170, 210, .35); border: 3px solid #2a2f36; }
.v-hmc::before { left: 22%; right: 22%; top: 20%; bottom: 14%; border-radius: 10px; background: linear-gradient(180deg, #d4d9df, #8d96a0); box-shadow: inset 0 -16px 0 #2a2f36; }
.v-hmc::after { left: 42%; width: 16%; top: 34%; height: 16%; border-radius: 50%; border: 6px solid var(--accent); }
.v-used::before { left: 30%; right: 30%; top: 16%; bottom: 14%; border-radius: 8px; background: linear-gradient(180deg, #b5bcc4, #7d8690); box-shadow: inset 0 -18px 0 #2a2f36; }
.v-used::after { right: 16%; top: 14%; padding: 4px 10px; content: "REFURB"; font: 600 .7rem var(--display); letter-spacing: .1em; color: #140800; background: var(--accent); border-radius: 999px; }
.v-spares::before { left: 28%; top: 28%; width: 22%; aspect-ratio: 1; border-radius: 50%; border: 10px dashed #9aa3ad; }
.v-spares::after { right: 22%; top: 44%; width: 30%; height: 10px; background: linear-gradient(90deg, #cfd5dc, #7d8690); border-radius: 5px; box-shadow: 0 -22px 0 -2px #9aa3ad; }
.v-tooling::before { left: 44%; top: 14%; width: 12%; height: 50%; background: linear-gradient(90deg, #7d8690, #e0e5ea, #7d8690); clip-path: polygon(0 0, 100% 0, 100% 55%, 70% 100%, 30% 100%, 0 55%); }
.v-tooling::after { left: 47%; top: 62%; width: 6%; height: 24%; background: repeating-linear-gradient(160deg, #cfd5dc 0 4px, #6b737c 4px 8px); }
.machine-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.machine-body p { color: var(--muted); font-size: .95rem; flex: 1; }
.tag { align-self: flex-start; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); border: 1px solid rgba(255, 106, 26, .35); padding: 2px 10px; border-radius: 999px; margin-bottom: 12px; }
.link { color: var(--accent); font-weight: 600; font-size: .92rem; }

/* Brands */
.brands { padding-block: 56px; text-align: center; overflow: hidden; }
.brands-title { color: var(--muted); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; padding-inline: 16px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee-track span { font-family: var(--display); font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 600; color: #58616c; padding: 10px 34px; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
.brands-note { font-size: .75rem; color: #5c6570; margin-top: 16px; padding-inline: 16px; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.steps li { border-top: 2px solid var(--line); padding-top: 22px; position: relative; }
.steps li::before { content: ""; position: absolute; top: -2px; left: 0; width: 44px; height: 2px; background: var(--accent); }
.steps span { font-family: var(--display); color: var(--accent); font-weight: 700; font-size: .9rem; }
.steps h3 { margin-top: 8px; }
.steps p { color: var(--muted); font-size: .95rem; }

/* Why */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 18px 56px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 20px; top: 21px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23140800' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat; }
.checks b { display: block; font-family: var(--display); }
.checks span { color: var(--muted); font-size: .92rem; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; }
.info-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 16px; }
.info-list li { display: grid; grid-template-columns: 100px 1fr; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.info-list span { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.info-list p { margin: 0; }
.info-list a:hover { color: var(--accent); }
.form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 34px); display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: .75em .9em; transition: border-color .2s;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: .92rem; min-height: 1.4em; }
.form-status.ok { color: #52d48a; }
.form-status.err { color: #ff6b6b; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; }
.footer-inner p { margin: 0; }
.footer-inner .small { margin-left: auto; }

/* WhatsApp */
.whatsapp { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 10px 30px -6px rgba(37, 211, 102, .55); transition: transform .2s; }
.whatsapp:hover { transform: scale(1.08); }
.whatsapp svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- Products (from admin) ---------- */
.brand-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.machine-visual.has-img { background: #1a1f26; }
.machine-visual img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.machine:hover .machine-visual img { transform: scale(1.04); }
.badge { position: absolute; top: 12px; left: 12px; background: var(--accent); color: #140800; font: 600 .72rem var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.badge-sold { background: #e5484d; color: #fff; }
.product[hidden] { display: none; }
.product h3 a:hover { color: var(--accent); }
.machine-body .meta { color: var(--text); font-size: .85rem; flex: 0; margin-bottom: .5em; opacity: .75; }
.product-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.price { font-family: var(--display); font-weight: 600; color: var(--text); }
.price-lg { font-size: 1.6rem; color: var(--accent); margin: .4em 0 .8em; }
.products-block { margin-top: 70px; }
.products-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.h2-sm { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0 0 .6em; }
.products-head .h2-sm { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 .88rem var(--font); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .45em 1em; cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, .25); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #140800; }
.social { display: flex; gap: 16px; margin: 0; }
.social a { color: var(--muted); font-size: .9rem; }
.social a:hover { color: var(--accent); }

/* Product page */
.page-top { padding-top: 110px; }
.back-link { display: inline-block; color: var(--muted); margin-bottom: 24px; font-size: .92rem; }
.back-link:hover { color: var(--accent); }
.product-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 50px; align-items: start; }
.gallery-main { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.gallery-main img { object-fit: contain; background: #0f1216; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.active { border-color: var(--accent); }
.product-info .h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.kv { display: grid; gap: 0; margin: 0; }
.kv div { display: grid; grid-template-columns: 120px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; }
.product-more { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 70px; }
.prose { color: #c3cbd5; }
.specs-wrap { overflow-x: auto; }
.specs { width: 100%; border-collapse: collapse; font-size: .95rem; }
.specs th, .specs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { color: var(--muted); font-weight: 500; width: 42%; }
.specs tr:nth-child(odd) { background: rgba(255, 255, 255, .02); }
.product-contact { margin-top: 90px; padding-top: 60px; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .why, .contact, .product-detail, .product-more { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 820px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; padding: 10px 20px 20px;
    background: rgba(11, 13, 16, .96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform .35s; margin: 0;
  }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav.open .nav-links { transform: none; }
  .nav.open { background: rgba(11, 13, 16, .96); }
  .nav-toggle { display: block; }
  .nav-cta { display: none; }

  .stage, .stage-final {
    left: 16px; right: 16px; width: auto; top: auto; bottom: 7vh; transform: none; text-align: left;
    background: rgba(11, 13, 16, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  }
  .stage-final .btn-row { justify-content: flex-start; }
  .stage h1 { font-size: 2.1rem; }
  .stage h2 { font-size: 1.6rem; }
  .stage p:not(.eyebrow), .stage .lead { font-size: .95rem; }
  .progress { display: none; }
  .scroll-hint { display: none; }
  .loader { top: 80px; bottom: auto; right: 16px; }
}
@media (max-width: 600px) {
  .grid-3, .steps { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .info-list li { grid-template-columns: 1fr; gap: 2px; }
  .footer-inner .small { margin-left: 0; }
  .brand-text b { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
}
