/* =========================================================
   Metal Inženering Stankovski — shared site styles
   ========================================================= */
:root {
  --bg: #0a0b0c;
  --bg-2: #101214;
  --surface: #15181b;
  --surface-2: #1b1f23;
  --ink: #f3f4f1;
  --muted: rgba(243, 244, 241, 0.68);
  --dim: rgba(243, 244, 241, 0.45);
  --faint: rgba(243, 244, 241, 0.14);
  --line: rgba(243, 244, 241, 0.1);
  --accent: #ffc531; /* safety yellow */
  --accent-2: #ffd25e;
  --accent-ink: #141414;
  --spark: #ff8a1f;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --sans: "Barlow", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --max: 1320px;
  --nav-h: 84px;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; font-weight: 600;
  transition: top 0.2s;
}
.skip:focus { top: 16px; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
.h-xl, .h-lg, .h-md {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.h-xl { font-size: clamp(56px, 9vw, 148px); }
.h-lg { font-size: clamp(44px, 6.4vw, 104px); }
.h-md { font-size: clamp(32px, 3.6vw, 56px); line-height: 0.98; }
.h-xl em, .h-lg em, .h-md em { font-style: normal; color: var(--accent); }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.lead { font-size: clamp(18px, 1.5vw, 21px); color: var(--muted); max-width: 56ch; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  --bx: 0px; --by: 0px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 14px 24px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--accent); color: var(--accent-ink);
  border: 0; cursor: pointer; overflow: hidden; isolation: isolate;
  transform: translate(var(--bx), var(--by));
  transition: transform 0.35s var(--ease-out), color 0.3s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
}
.btn:hover::before { transform: none; }
.btn svg { width: 16px; height: 16px; transition: transform 0.35s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--faint); }
.btn.ghost::before { background: var(--accent); }
.btn.ghost:hover { color: var(--accent-ink); }
.btn.small { min-height: 44px; padding: 10px 18px; font-size: 14px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); padding: 6px 0;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease-out), color 0.3s;
}
.link-arrow:hover { background-size: 100% 1px; color: var(--accent); }
.link-arrow svg { width: 14px; height: 14px; }

/* =========================================================
   Navbar — transparent over heroes, glass once scrolled
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s, transform 0.5s var(--ease-out);
}
.nav::before { /* soft top shade so links stay legible on bright video frames */
  content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 7, 0.55), rgba(5, 6, 7, 0));
  transition: opacity 0.4s;
}
.nav.is-solid {
  background: rgba(10, 11, 12, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav.is-solid::before { opacity: 0; }
.nav.is-hidden { transform: translateY(-100%); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: none; }
.nav-logo { display: block; flex: none; }
.nav-logo img { height: 60px; width: auto; transition: height 0.4s var(--ease-out); }
.nav.is-solid .nav-logo img { height: 50px; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  position: relative; display: block; padding: 10px 14px;
  font-size: 15px; font-weight: 500; letter-spacing: 0.02em; color: var(--muted);
  transition: color 0.25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-phone { font-family: var(--mono); font-size: 13px; color: var(--muted); transition: color 0.2s; }
.nav-phone:hover { color: var(--accent); }

.burger {
  display: none; width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink);
  transition: transform 0.45s var(--ease-out), opacity 0.2s, top 0.45s var(--ease-out);
}
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 23px; right: 20px; }
.burger span:nth-child(3) { top: 29px; }
.menu-open .burger span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { top: 23px; transform: rotate(-45deg); }

/* full-screen mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 32px;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease-in-out);
  visibility: hidden;
}
.menu-open .menu { clip-path: inset(0 0 0 0); visibility: visible; }
.menu ol { list-style: none; counter-reset: m; }
.menu li { overflow: hidden; border-bottom: 1px solid var(--line); }
.menu li a {
  display: flex; align-items: baseline; gap: 16px; padding: 10px 0;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(44px, 12vw, 72px); line-height: 1;
  transform: translateY(110%);
  transition: transform 0.7s var(--ease-out), color 0.2s;
}
.menu li a::before {
  counter-increment: m; content: "0" counter(m);
  font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--accent); letter-spacing: 0.1em;
}
.menu li a[aria-current="page"] { color: var(--accent); }
.menu-open .menu li a { transform: none; }
.menu-open .menu li:nth-child(1) a { transition-delay: 0.25s; }
.menu-open .menu li:nth-child(2) a { transition-delay: 0.3s; }
.menu-open .menu li:nth-child(3) a { transition-delay: 0.35s; }
.menu-open .menu li:nth-child(4) a { transition-delay: 0.4s; }
.menu-open .menu li:nth-child(5) a { transition-delay: 0.45s; }
.menu-foot { display: flex; flex-wrap: wrap; gap: 12px 28px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.menu-foot a { min-height: 44px; display: inline-flex; align-items: center; }
body.menu-open { overflow: hidden; }

/* =========================================================
   Page transition curtain
   ========================================================= */
.curtain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  display: grid; place-items: center;
  background: var(--accent);
  transform: translateY(0);
  transition: transform 0.8s var(--ease-in-out);
}
.curtain img { width: 84px; opacity: 0.9; filter: brightness(0); transition: opacity 0.3s; }
.is-loaded .curtain { transform: translateY(-100%); }
.is-leaving .curtain { transform: translateY(0); transition-duration: 0.5s; }
.is-leaving.from-bottom .curtain { animation: curtain-in 0.5s var(--ease-in-out) forwards; }
@keyframes curtain-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* =========================================================
   Scroll reveals
   ========================================================= */
[data-reveal] {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal].in { opacity: 1; transform: none; }

/* headline lines slide up from a mask */
.split .ln { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .ln > span {
  display: block; transform: translateY(110%) rotate(2deg); transform-origin: left top;
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0s) + var(--i) * 90ms);
}
.split.in .ln > span { transform: none; }

/* image wipe reveal */
.wipe { position: relative; overflow: hidden; clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease-in-out); transition-delay: var(--d, 0s); }
.wipe.in { clip-path: inset(0 0 0 0); }
.wipe img, .wipe video { transform: scale(1.25); transition: transform 1.8s var(--ease-out); transition-delay: var(--d, 0s); }
.wipe.in img, .wipe.in video { transform: scale(1); }

/* scroll-highlighted statement (words light up as you scroll) */
.statement { font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(34px, 4.6vw, 72px); line-height: 1.02; }
.statement .w { color: rgba(243, 244, 241, 0.16); transition: color 0.3s; }
.statement .w.on { color: var(--ink); }
.statement .w.hl.on { color: var(--accent); }

/* =========================================================
   Sections
   ========================================================= */
.section { position: relative; padding: clamp(88px, 13vw, 180px) 0; }
.section.tight { padding: clamp(64px, 8vw, 112px) 0; }
.section.alt { background: var(--bg-2); }
.sec-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px; margin-bottom: clamp(48px, 6vw, 88px); }
.sec-head .h-lg { margin-top: 20px; }
.sec-num {
  font-family: var(--display); font-weight: 700; font-size: clamp(72px, 10vw, 160px); line-height: 0.8;
  color: transparent; -webkit-text-stroke: 1px var(--faint);
}

/* decorative blueprint grid */
.bp-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.06;
  background-image: linear-gradient(var(--ink) 1px, transparent 1px), linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative; overflow: hidden; white-space: nowrap;
  border-block: 1px solid var(--line);
  padding: 22px 0; background: var(--bg);
}
.marquee.yellow { background: var(--accent); color: var(--accent-ink); border: 0; transform: rotate(-2deg) scale(1.04); margin: 40px 0; }
.marquee-track { display: inline-flex; animation: marquee 38s linear infinite; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
.marquee span {
  display: inline-flex; align-items: center; gap: 36px; padding-right: 36px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(28px, 4vw, 56px); line-height: 1;
}
.marquee span.o { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.marquee.yellow span.o { -webkit-text-stroke-color: var(--accent-ink); }
.marquee svg { width: clamp(20px, 2.4vw, 34px); height: auto; color: var(--accent); flex: none; }
.marquee.yellow svg { color: var(--accent-ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- About split ---------- */
.about-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; margin-top: clamp(64px, 8vw, 120px); }
.about-media { position: relative; aspect-ratio: 4 / 5; }
.about-media .wipe { position: absolute; inset: 0; }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-media .tag {
  position: absolute; z-index: 2; left: -1px; bottom: 32px;
  background: var(--accent); color: var(--accent-ink);
  padding: 16px 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.gear {
  position: absolute; right: -60px; top: -60px; width: 200px; z-index: 2; color: var(--accent);
  opacity: 0.9; will-change: transform;
}
.about-copy p + p { margin-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 40px; }
.stat { padding: 28px 20px 0 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(48px, 5vw, 80px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat b sup { font-size: 0.45em; color: var(--accent); vertical-align: top; margin-left: 2px; }
.stat > span { display: block; margin-top: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Service cards ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 20px;
  min-height: 520px; padding: clamp(28px, 3vw, 44px);
  background: var(--bg);
  transition: background 0.4s;
}
.card::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 197, 49, 0.14), transparent 60%);
  transition: opacity 0.4s;
}
.card:hover::before { opacity: 1; }
.card-bg { position: absolute; inset: 0; z-index: -2; opacity: 0.35; transition: opacity 0.6s, transform 1.2s var(--ease-out); transform: scale(1.1); }
.card-bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4) brightness(0.32); }
.card:hover .card-bg { opacity: 1; transform: scale(1); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-num { font-family: var(--mono); font-size: 13px; color: var(--dim); letter-spacing: 0.1em; }
.card-icon { width: 64px; height: 64px; color: var(--accent); }
.card-icon path, .card-icon circle, .card-icon rect, .card-icon line, .card-icon polyline { stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.6s var(--ease-out); }
.in .card-icon path, .in .card-icon circle, .in .card-icon rect, .in .card-icon line, .in .card-icon polyline,
.card-icon.in path, .card-icon.in circle, .card-icon.in rect, .card-icon.in line, .card-icon.in polyline { stroke-dashoffset: 0; }
.card h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(34px, 3vw, 46px); line-height: 0.95; margin-top: auto; }
.card p { color: var(--muted); }
.card ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.card li { font-family: var(--mono); font-size: 12px; padding: 6px 12px; border: 1px solid var(--faint); background: rgba(10, 11, 12, 0.4); }

/* ---------- Horizontal machinery rail ---------- */
.hscroll { position: relative; }
.hscroll-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 4vh, 40px); padding-top: calc(var(--nav-h) * 0.6); }
.hscroll-track { display: flex; gap: 24px; padding: 0 var(--gutter); will-change: transform; }
.mcard {
  position: relative; flex: none; height: min(56vh, 540px); aspect-ratio: 4 / 5;
  overflow: hidden; background: var(--surface);
}
.mcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), filter 0.6s; filter: grayscale(0.25); }
.mcard.light { background: #eceae4; }
.mcard.light img { object-fit: contain; padding: 40px 40px 120px; filter: none; }
.mcard:hover img { transform: scale(1.06); filter: none; }
.mcard figcaption {
  position: absolute; inset: auto 0 0; padding: 28px;
  background: linear-gradient(0deg, rgba(10, 11, 12, 0.92), rgba(10, 11, 12, 0));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.mcard h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 34px; line-height: 0.95; }
.mcard .idx { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.hscroll-bar { margin: 0 var(--gutter); height: 2px; background: var(--faint); position: relative; }
.hscroll-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- Process ---------- */
.process { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.process-line { position: absolute; left: 0; right: 0; top: 27px; height: 2px; background: var(--faint); }
.process-line i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
.step { position: relative; }
.step-dot {
  width: 56px; height: 56px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--faint);
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  transition: background 0.5s, color 0.5s, border-color 0.5s;
}
.step.on .step-dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 30px; line-height: 1; margin: 28px 0 12px; }
.step p { color: var(--muted); font-size: 16px; }

/* ---------- Project tiles ---------- */
.projects { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.project { position: relative; display: block; overflow: hidden; background: var(--surface); }
.project:nth-child(1) { grid-column: span 7; aspect-ratio: 4 / 3; }
.project:nth-child(2) { grid-column: span 5; aspect-ratio: 4 / 5; margin-top: 120px; }
.project:nth-child(3) { grid-column: 3 / span 8; aspect-ratio: 16 / 9; }
.project .wipe { position: absolute; inset: 0; }
.project img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.project:hover img { transform: scale(1.06); }
.project-info {
  position: absolute; inset: auto 0 0; z-index: 2; padding: clamp(20px, 3vw, 36px);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  background: linear-gradient(0deg, rgba(10, 11, 12, 0.9), rgba(10, 11, 12, 0));
}
.project-info small { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.project-info h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(26px, 2.6vw, 40px); line-height: 0.98; }
.project-go {
  flex: none; width: 56px; height: 56px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  transform: scale(0) rotate(-45deg); transition: transform 0.5s var(--ease-out);
}
.project-go svg { width: 20px; height: 20px; }
.project:hover .project-go, .project:focus-visible .project-go { transform: none; }

/* ---------- CTA band with sparks ---------- */
.cta { position: relative; overflow: hidden; padding: clamp(120px, 16vw, 220px) 0; text-align: center; background: #060707; }
.cta canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cta .wrap { position: relative; }
.cta .h-xl { margin: 24px auto 28px; max-width: 12ch; }
.cta .lead { margin: 0 auto 40px; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.glow { /* molten glow behind the CTA headline */
  position: absolute; left: 50%; top: 55%; width: 70vmin; height: 70vmin; translate: -50% -50%;
  background: radial-gradient(circle, rgba(255, 138, 31, 0.28), rgba(255, 197, 49, 0.08) 40%, transparent 70%);
  filter: blur(20px); animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.15); opacity: 0.7; } }

/* =========================================================
   Interior page hero
   ========================================================= */
.page-hero {
  position: relative; overflow: hidden;
  min-height: 88vh; min-height: 88svh;
  display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 80px) 0 clamp(56px, 8vw, 96px);
  background: #060707;
}
.page-hero .ph-media { position: absolute; inset: -10% 0; z-index: 0; will-change: transform; }
.page-hero .ph-media img, .page-hero .ph-media video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.3) brightness(0.42); }
.page-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 7, 7, 0.65) 0%, rgba(6, 7, 7, 0) 30%),
    linear-gradient(0deg, rgba(10, 11, 12, 1) 0%, rgba(10, 11, 12, 0) 55%),
    linear-gradient(90deg, rgba(6, 7, 7, 0.75) 0%, rgba(6, 7, 7, 0) 70%);
}
.page-hero .bp-grid { z-index: 1; opacity: 0.08; animation: grid-pan 30s linear infinite; }
@keyframes grid-pan { to { background-position: 80px 80px, 80px 80px; } }
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero .h-xl { margin: 22px 0 26px; }
.crumbs { display: flex; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-top: 32px; }
.crumbs a:hover { color: var(--accent); }
.ph-bigword {
  position: absolute; right: -2vw; bottom: -3vw; z-index: 1;
  font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: 0.8;
  font-size: clamp(120px, 24vw, 420px);
  color: transparent; -webkit-text-stroke: 1px rgba(243, 244, 241, 0.09);
  pointer-events: none; user-select: none; white-space: nowrap;
}
.scroll-cue {
  position: absolute; right: var(--gutter); bottom: clamp(56px, 8vw, 96px); z-index: 2;
  width: 112px; height: 112px;
}
.scroll-cue svg { width: 100%; height: 100%; animation: spin 16s linear infinite; }
.scroll-cue text { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.32em; fill: var(--muted); text-transform: uppercase; }
.scroll-cue .arrow { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); }
.scroll-cue .arrow svg { width: 22px; height: 22px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* ---------- Values (about page) ---------- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.value { padding: 36px 32px 40px; border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.value::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease-out); }
.value:hover::after { transform: scaleX(1); }
.value .card-icon { width: 52px; height: 52px; margin-bottom: 28px; }
.value h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 34px; line-height: 1; margin-bottom: 12px; }
.value p { color: var(--muted); }

.cap-list { list-style: none; border-top: 1px solid var(--line); }
.cap-list li {
  position: relative; display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--line); overflow: hidden;
}
.cap-list li::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateY(101%); transition: transform 0.5s var(--ease-out); }
.cap-list li:hover::before { transform: none; }
.cap-list li:hover { color: var(--accent-ink); }
.cap-list li:hover span, .cap-list li:hover small { color: var(--accent-ink); }
.cap-list span { font-family: var(--mono); font-size: 13px; color: var(--accent); transition: color 0.3s; }
.cap-list h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(30px, 3.4vw, 52px); line-height: 1; }
.cap-list small { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.3s; text-align: right; }
.cap-wrap { isolation: isolate; }

/* ---------- Machinery rows ---------- */
.mrow { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: clamp(56px, 7vw, 100px) 0; border-top: 1px solid var(--line); }
.mrow:nth-child(even) .mrow-media { order: 2; }
.mrow-media { position: relative; aspect-ratio: 5 / 4; }
.mrow-media .wipe { position: absolute; inset: 0; }
.mrow-media img { width: 100%; height: 100%; object-fit: cover; }
.mrow-media.light .wipe { background: #eceae4; }
.mrow-media.light img { object-fit: contain; padding: 24px; }
.mrow-media .badge {
  position: absolute; z-index: 2; top: 0; left: 0;
  background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1;
  padding: 14px 18px;
}
.mrow .h-md { margin: 18px 0 20px; }
.mrow ul { list-style: none; margin-top: 28px; border-top: 1px solid var(--line); }
.mrow li { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.mrow li::before { content: ""; width: 6px; height: 6px; background: var(--accent); flex: none; transform: translateY(-3px); }

/* ---------- Reference case studies ---------- */
.case { padding: clamp(64px, 8vw, 120px) 0; border-top: 1px solid var(--line); }
.case-head { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(20px, 4vw, 64px); align-items: end; margin-bottom: 48px; }
.case-no { font-family: var(--display); font-weight: 700; font-size: clamp(80px, 10vw, 150px); line-height: 0.8; color: var(--accent); }
.case-meta { display: grid; gap: 6px; text-align: right; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.case-meta b { color: var(--ink); font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.gallery .g { position: relative; overflow: hidden; background: var(--surface); cursor: zoom-in; border: 0; padding: 0; }
.gallery .g .wipe { position: absolute; inset: 0; }
.gallery .g img, .gallery .g video { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.gallery .g:hover img { transform: scale(1.05); }
.gallery .g::after {
  content: "+"; position: absolute; right: 16px; top: 16px; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 24px; font-weight: 500;
  transform: scale(0); transition: transform 0.4s var(--ease-out);
}
.gallery .g:hover::after, .gallery .g:focus-visible::after { transform: none; }
.gallery .g.video { cursor: default; }
.gallery .g.video::after { content: none; }
.g.w2 { grid-column: span 2; } .g.w3 { grid-column: span 3; } .g.w4 { grid-column: span 4; } .g.w6 { grid-column: span 6; }
.g.r1 { aspect-ratio: 4 / 3; } .g.tall { aspect-ratio: 3 / 4; } .g.wide { aspect-ratio: 16 / 9; } .g.pano { aspect-ratio: 21 / 9; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90; width: 100%; height: 100%; max-width: none; max-height: none;
  border: 0; padding: clamp(16px, 4vw, 56px); background: rgba(6, 7, 7, 0.94);
  display: none; place-items: center;
}
.lightbox[open] { display: grid; animation: fade 0.35s ease; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: 86vh; object-fit: contain; animation: zoom-in 0.5s var(--ease-out); }
.lightbox button {
  position: absolute; top: 20px; right: 20px; width: 52px; height: 52px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: 28px; line-height: 1;
}
@keyframes fade { from { opacity: 0; } }
@keyframes zoom-in { from { transform: scale(0.92); opacity: 0; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(40px, 6vw, 96px); }
.cinfo { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); align-self: start; }
.cinfo a, .cinfo div {
  display: grid; grid-template-columns: 48px 1fr; gap: 20px; align-items: center;
  padding: 28px; background: var(--bg); transition: background 0.3s;
}
.cinfo a:hover { background: var(--surface); }
.cinfo svg { width: 48px; height: 48px; padding: 12px; background: var(--accent); color: var(--accent-ink); }
.cinfo small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.cinfo b { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2vw, 28px); letter-spacing: 0.01em; word-break: break-word; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
.field { position: relative; display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field label i { color: var(--accent); font-style: normal; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 0; font: inherit; font-size: 18px; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--faint); border-radius: 0;
  /* accent underline that grows from the left on focus */
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat transparent;
  transition: border-color 0.3s, background-size 0.5s var(--ease-out);
}
.field select { appearance: none; cursor: pointer; }
.field select option { background: var(--surface); }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; background-size: 100% 2px; }
.field .bar { display: none; }
.field .err { font-size: 14px; color: #ff7a6b; min-height: 0; }
.field.invalid input, .field.invalid textarea { border-color: #ff7a6b; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.form-foot p { font-size: 14px; color: var(--dim); max-width: 40ch; }
.form-status { grid-column: 1 / -1; font-family: var(--mono); font-size: 13px; color: var(--accent); min-height: 1em; }
.map { position: relative; margin-top: clamp(64px, 8vw, 120px); aspect-ratio: 21 / 8; border: 1px solid var(--line); overflow: hidden; }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(0.92) contrast(0.9); }
.map .pin {
  position: absolute; left: 50%; top: 50%; translate: -50% -100%; z-index: 2; pointer-events: none;
  width: 22px; height: 22px; background: var(--accent); border-radius: 50% 50% 50% 0; rotate: -45deg;
}
.map .pin::after { content: ""; position: absolute; inset: -14px; border: 2px solid var(--accent); border-radius: 50%; animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(0.4); opacity: 1; } to { transform: scale(2); opacity: 0; } }

/* =========================================================
   Footer
   ========================================================= */
.footer { position: relative; overflow: hidden; background: var(--bg); border-top: 1px solid var(--line); padding-top: clamp(72px, 9vw, 128px); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 72px; }
.footer-logo img { height: 56px; width: auto; }
.footer-top p { color: var(--muted); margin-top: 24px; max-width: 36ch; font-size: 16px; }
.footer h4 { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.footer ul { list-style: none; display: grid; gap: 4px; }
.footer ul a { display: inline-flex; min-height: 36px; align-items: center; color: var(--muted); transition: color 0.2s, transform 0.3s var(--ease-out); }
.footer ul a:hover { color: var(--ink); transform: translateX(6px); }
.footer-word {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: 0.78;
  font-size: clamp(64px, 17.6vw, 300px); letter-spacing: -0.01em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(243, 244, 241, 0.16);
  text-align: center; user-select: none; margin-bottom: -0.06em;
  background: linear-gradient(90deg, var(--accent), var(--accent)) 0 100% / var(--fill, 0%) 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
}
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--dim); }
.to-top { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: none; border: 0; color: var(--muted); font: inherit; min-height: 44px; }
.to-top:hover { color: var(--accent); }
.to-top svg { width: 14px; height: 14px; }

/* scroll progress line at the very top */
.progress { position: fixed; left: 0; top: 0; z-index: 70; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); pointer-events: none; }

/* custom cursor dot (pointer devices only) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none;
  width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--accent); mix-blend-mode: difference;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), opacity 0.3s;
  opacity: 0;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Key clients (references page) ---------- */
.clients { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.client { position: relative; overflow: hidden; background: var(--surface); grid-column: span 4; aspect-ratio: 4 / 5; }
.client:nth-child(1) { grid-column: span 7; aspect-ratio: 16 / 11; }
.client:nth-child(2) { grid-column: span 5; aspect-ratio: auto; }
.client:nth-child(6) { grid-column: span 12; aspect-ratio: 21 / 8; }
.client:nth-child(6) img { object-position: center 35%; }
.client .wipe { position: absolute; inset: 0; }
.client img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.35) brightness(0.72); transition: transform 1.2s var(--ease-out), filter 0.6s; }
.client:hover img { transform: scale(1.06); filter: none; }
.client-no { position: absolute; z-index: 2; left: 24px; top: 20px; font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--accent); }
.client figcaption {
  position: absolute; inset: auto 0 0; z-index: 2; padding: clamp(20px, 3vw, 36px);
  background: linear-gradient(0deg, rgba(10, 11, 12, 0.94), rgba(10, 11, 12, 0));
}
.client h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(32px, 3.4vw, 56px); line-height: 0.92; }
.client:nth-child(1) h3 { font-size: clamp(40px, 5vw, 80px); }
.client-meta { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.credit {
  position: absolute; z-index: 3; right: 12px; top: 12px; max-width: calc(100% - 100px);
  padding: 4px 8px; background: rgba(6, 7, 7, 0.6); color: rgba(243, 244, 241, 0.72);
  font-family: var(--mono); font-size: 10px; line-height: 1.4; text-align: right;
}
.credit a { text-decoration: underline; text-underline-offset: 2px; }
.credit a:hover { color: var(--accent); }

/* ---------- Key clients list (home) with cursor-following preview ---------- */
.clist { list-style: none; border-top: 1px solid var(--line); }
.clist a {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 64px 1fr auto 44px; align-items: center; gap: 24px;
  padding: clamp(20px, 2.6vw, 34px) 0; border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease-out), color 0.3s;
}
.clist a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateY(101%); transition: transform 0.5s var(--ease-out); }
.clist a:hover, .clist a:focus-visible { color: var(--accent-ink); padding-inline: 24px; }
.clist a:hover::before, .clist a:focus-visible::before { transform: none; }
.cl-no { font-family: var(--mono); font-size: 13px; color: var(--accent); transition: color 0.3s; }
.cl-name { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(40px, 6vw, 96px); line-height: 0.9; }
.cl-meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: right; transition: color 0.3s; }
.cl-go { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--faint); transition: transform 0.5s var(--ease-out), border-color 0.3s; }
.cl-go svg { width: 18px; height: 18px; }
.clist a:hover .cl-no, .clist a:hover .cl-meta { color: var(--accent-ink); }
.clist a:hover .cl-go { transform: rotate(-45deg); border-color: var(--accent-ink); }
.cl-preview {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: 360px; aspect-ratio: 4 / 3; overflow: hidden;
  opacity: 0; scale: 0.7; transition: opacity 0.3s, scale 0.5s var(--ease-out);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.cl-preview.on { opacity: 1; scale: 1; }
.cl-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none), (pointer: coarse) { .cl-preview { display: none; } }

/* developer credit */
.dev-credit a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; transition: color 0.2s, text-decoration-color 0.2s; }
.dev-credit a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .nav-links, .nav-phone { display: none; }
  .burger { display: block; }
  .services { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card h3 { margin-top: 24px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: 1fr 1fr; row-gap: 56px; }
  .process-line { display: none; }
}
@media (max-width: 860px) {
  :root { --nav-h: 72px; }
  body { font-size: 16px; }
  .nav-logo img, .nav.is-solid .nav-logo img { height: 44px; }
  .nav-right .btn { display: none; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-num { display: none; }
  .about-grid, .contact-grid, .mrow { grid-template-columns: 1fr; }
  .mrow:nth-child(even) .mrow-media { order: 0; }
  .about-media { aspect-ratio: 4 / 3; }
  .gear { width: 120px; right: -10px; top: -50px; }
  .values { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .clients { grid-template-columns: 1fr; gap: 12px; }
  .client:nth-child(n) { grid-column: auto; aspect-ratio: 4 / 3; }
  .clist a { grid-template-columns: 1fr 44px; gap: 6px 16px; }
  .cl-no { display: none; }
  .cl-meta { grid-row: 2; text-align: left; }
  .cl-go { grid-row: 1 / span 2; grid-column: 2; }
  .project:nth-child(n) { grid-column: auto; aspect-ratio: 4 / 3; margin-top: 0; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g.w2, .g.w3 { grid-column: span 1; } .g.w4, .g.w6 { grid-column: span 2; }
  .g.pano { aspect-ratio: 16 / 10; }
  .case-head { grid-template-columns: 1fr; }
  .case-meta { text-align: left; }
  .form { grid-template-columns: 1fr; }
  .map { aspect-ratio: 4 / 3; }
  .cap-list li { grid-template-columns: 44px 1fr; }
  .cap-list small { display: none; }
  .scroll-cue { display: none; }
  /* machinery rail becomes a native swipe carousel */
  .hscroll { height: auto !important; }
  .hscroll-pin { position: static; height: auto; padding: 0; gap: 28px; }
  .hscroll-track { overflow-x: auto; scroll-snap-type: x mandatory; transform: none !important; padding-bottom: 8px; scrollbar-width: none; }
  .hscroll-track::-webkit-scrollbar { display: none; }
  .mcard { width: min(440px, 78vw); height: auto; scroll-snap-align: start; scroll-margin-left: var(--gutter); }
  .hscroll-bar { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .stat + .stat { padding-left: 12px; }
  .stat { padding-right: 8px; }
  .process { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .cinfo a, .cinfo div { padding: 20px; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  [data-reveal], .split .ln > span, .wipe, .wipe img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .marquee-track { animation: none; }
  .statement .w { color: var(--ink); }
}
