/* Site font: Helvetica stack. Helvetica Neue / Helvetica on Apple devices,
   Arial on Windows, metric-compatible Helvetica clones on Linux/Android. */
:root {
  --font-sans: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", "Liberation Sans", Arimo, sans-serif;
  --default-font-family: var(--font-sans);
}

/* Scroll-reveal (replaces framer-motion whileInView) */
html.js [data-reveal]:not(.is-revealed) {
  opacity: 0 !important;
  transform: var(--reveal-from) !important;
}
html.js [data-reveal].is-revealing {
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
html.js [data-reveal][data-reveal-opacity].is-revealing {
  transition-duration: 1.4s !important;
}

/* Mobile: shift the hero video crop towards the right (20% in from the right edge) */
@media (max-width: 639px) {
  [data-hero] [data-hero-video] {
    object-position: 80% center;
  }
}

/* Darken the hero video so the centred headline stays readable */
[data-hero]:has([data-hero-video])::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5; /* above the video, below the scroll overlay (z-10) */
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0, 0, 0, 0.35), transparent 75%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.7) 100%);
}

/* Hero: image/video and overlays are absolute background layers; the text is
   normal (relative) content, vertically centred by the hero. Top padding keeps it clear
   of the fixed header; the hero grows if the text is taller than min-height. */
[data-hero] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 96px;
  padding-bottom: 64px;
}
/* Hero text is left-aligned on the same edge as the page content below
   (max-w-7xl = 80rem inside the section padding of 24 / 32 / 48px). */
[data-hero-text] {
  width: 100%;
  max-width: calc(80rem + 48px);
  margin-inline: auto;
}
@media (min-width: 640px) {
  [data-hero-text] { max-width: calc(80rem + 64px); }
}
@media (min-width: 1024px) {
  [data-hero-text] { max-width: calc(80rem + 96px); }
}
[data-hero-text] h1 {
  margin-inline: 0;
}

/* Slanted bottom edge: the hero is cut diagonally and the next section slides
   up underneath it, so the cut-off corner shows that section's own background.
   The transparent border keeps the next section's content where it was. */
[data-hero] {
  z-index: 1; /* stay above the next section even when that one is positioned */
  --hero-slant: clamp(40px, 6vw, 96px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--hero-slant)), 0 100%);
  padding-bottom: calc(64px + var(--hero-slant));
}
[data-hero] + section {
  margin-top: calc(-1 * clamp(40px, 6vw, 96px));
  border-top: clamp(40px, 6vw, 96px) solid transparent;
}

/* Hover effects (were framer-motion whileHover) */
.relative.h-48.overflow-hidden > img {
  transition: transform 0.7s ease-out;
}
.relative.h-48.overflow-hidden > img:hover {
  transform: scale(1.06);
}
[data-hover-lift] {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}
[data-hover-lift]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

[data-href] {
  cursor: pointer;
}

/* Larger icons in the "industrial capabilities" stats */
.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
}
@media (min-width: 640px) {
  .stat-icon {
    width: 3rem;
    height: 3rem;
  }
}

/* More space between the menu links and the language switcher on desktop */
@media (min-width: 992px) {
  nav .lang-switch {
    margin-left: 28px;
  }
}

/* Clickable buttons (Tailwind resets buttons to the default cursor) */
.faq-toggle,
form button[type="submit"]:not(:disabled),
button[aria-label="Clear"],
button.new-request {
  cursor: pointer;
}

/* Pages without a hero: keep content clear of the fixed header */
body[data-nav-solid] {
  padding-top: 64px;
}

/* Desktop menu: no underline. Links get a translucent white pill on hover,
   a stronger one on the current page. Negative margins cancel the padding so
   the menu spacing stays the same. */
nav .header-links a {
  border-radius: 999px;
  padding: 8px 14px;
  margin: -8px -14px;
  transition: color 0.2s, background-color 0.2s;
}
nav .header-links a::after {
  display: none;
}
nav .header-links a:hover {
  background: rgba(255, 255, 255, 0.08);
}
nav .header-links a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* Hero height: 85% of the screen (was 100%) */
.min-h-\[85svh\] {
  min-height: 85svh;
}
@media (min-width: 640px) {
  .sm\:min-h-\[85svh\] {
    min-height: 85svh;
  }
}

/* Page transitions, same as v1 (cross-document View Transitions; browsers
   without support just navigate). The header stays put; the old page sinks
   back and dims while the new page wipes up over it. */
@view-transition {
  navigation: auto;
}

nav.site-header {
  view-transition-name: site-header;
}

::view-transition-group(root) {
  background: #000;
}

::view-transition-old(root) {
  animation: page-out 0.5s cubic-bezier(0.65, 0, 0.35, 1) both;
}

::view-transition-new(root) {
  animation: page-in 0.7s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes page-out {
  to {
    opacity: 0.2;
    transform: scale(0.94) translateY(-2%);
  }
}

@keyframes page-in {
  from {
    clip-path: inset(100% 0 0 0);
    transform: translateY(6%);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Hero image overlay: a fixed tint between the hero image/video and its text,
   darker at the top (nav legibility) and bottom. The scroll-driven
   [data-hero-overlay] still sits above it (z-10). Full-bleed heroes only, so the
   cut-out portrait hero on the People page is left alone. */
[data-hero].overflow-hidden::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(10, 25, 50, 0.65) 0%,
    rgba(10, 25, 50, 0.35) 35%,
    rgba(10, 25, 50, 0.35) 65%,
    rgba(10, 25, 50, 0.7) 100%
  );
}

/* "Kroz decenije preciznosti" timeline photos: keep a photo-like ratio instead
   of a fixed-height strip (which cropped them to ~2.7:1 on desktop). */
.timeline-media {
  aspect-ratio: 3 / 2;
}
@media (min-width: 768px) {
  .timeline-media {
    aspect-ratio: 16 / 10;
  }
}

/* "Konjic - između Neretve i industrije": dark band with the wave graphic
   (a nod to the Neretva) and three text columns. */
.konjic-section {
  background: #0a1932;
  color: #fff;
}
.konjic-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, #0a1932 0%, rgba(10, 25, 50, 0.25) 35%, rgba(10, 25, 50, 0.25) 65%, #0a1932 100%),
    url("../../img/hero2.webp") center / cover no-repeat;
  opacity: 0.9;
  pointer-events: none;
}
.konjic-text {
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  line-height: 1.85;
}

/* Technology page: "Neke od naših mašina" machine list */
.machines-section {
  background: var(--color-neutral-50, #fafafa);
  border-top: 1px solid var(--color-neutral-200, #e5e5e5);
  padding: 5rem 1.5rem;
}
@media (min-width: 640px) {
  .machines-section { padding: 6rem 2rem; }
}
@media (min-width: 1024px) {
  .machines-section { padding: 7rem 3rem; }
}
.machines-head {
  margin-bottom: 3.5rem;
}
.machines-intro {
  margin-top: 1.5rem;
  max-width: 42rem;
  color: var(--color-neutral-500, #737373);
  font-size: 18px;
  line-height: 1.85;
}
.machine-group + .machine-group {
  margin-top: 4rem;
}
.machine-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-neutral-200, #e5e5e5);
}
.machine-group-head h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-neutral-900, #171717);
}
.machine-group-head span {
  font-size: 0.8125rem;
  color: var(--color-neutral-500, #737373);
}
.machine-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .machine-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .machine-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.machine-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-neutral-200, #e5e5e5);
  border-radius: 14px;
  padding: 1.5rem;
}
.machine-brand {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5c96ff;
}
.machine-model {
  margin-top: 0.375rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--color-neutral-900, #171717);
}
.machine-type {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-neutral-500, #737373);
}
.machine-specs {
  margin-top: 1.25rem;
  border-top: 1px solid var(--color-neutral-100, #f5f5f5);
}
.machine-spec {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-neutral-100, #f5f5f5);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.machine-spec:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.machine-spec dt {
  color: var(--color-neutral-500, #737373);
}
.machine-spec dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  color: var(--color-neutral-900, #171717);
  font-variant-numeric: tabular-nums;
}
.machine-card {
  overflow: hidden;
  padding: 0;
}
.machine-media {
  aspect-ratio: 4 / 3;
  background: var(--color-neutral-100, #f5f5f5);
  border-bottom: 1px solid var(--color-neutral-200, #e5e5e5);
}
.machine-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.machine-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem;
}

/* Who we are: "Naš tim" photo (portrait source, cropped to landscape) */
.team-photo {
  aspect-ratio: 3 / 2;
  object-position: center 30%;
}

/* Capacities stats (home page): the number size follows the card width
   (container query), so values like "±0.02 mm" fit at every screen size.
   Number and unit always stay on one line. */
.capacity-stats > div {
  container-type: inline-size;
  padding: clamp(20px, 3.5vw, 48px);
}
.capacity-stats .tracking-tight {
  font-size: clamp(1.25rem, calc(40cqi - 16px), 4.5rem);
}
.capacity-stats .flex.items-end.gap-2 {
  flex-wrap: nowrap;
}
.capacity-stats .flex.items-end.gap-2 > span {
  white-space: nowrap;
}
@media (max-width: 639px) {
  .capacity-stats p {
    letter-spacing: 0.1em;
  }
}
/* Stack the card content from the top (the number no longer sinks to the bottom) */
.capacity-stats > div > .flex-1 {
  flex: none;
}

/* Services page, "Our core capabilities": title on the left, description on
   the right from tablet width up (stacked on phones) */
@media (min-width: 768px) {
  .capability-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 3rem;
    align-items: baseline;
  }
  .capability-row > strong {
    margin-bottom: 0;
  }
}

/* Missing from the compiled Tailwind build */
.font-light {
  font-weight: 300;
}
@media (min-width: 640px) {
  .sm\:font-light {
    font-weight: 300;
  }
}

/* Home page: the four extra figures under the capacities cards
   (1 column on phones, 2 on tablets, 4 in one row on desktop) */
.capacity-list {
  column-gap: 2.5rem;
}

/* Desktop header: logo left, menu links centred on the page, language switcher right */
@media (min-width: 992px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .site-header .header-actions {
    justify-self: end;
  }
}

/* Mobile menu open: fade the header logo out so only the menu's own logo shows */
body:has(.mobile-menu--open) .site-header .header-logo {
  opacity: 0;
}

/* Technology page: quantity next to a machine model (e.g. "2×") */
.machine-qty {
  margin-left: 0.25em;
  color: #5c96ff;
  font-size: 0.8em;
  font-weight: 500;
}

/* Mobile menu footer: language switcher left, social icons right */
.mobile-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mobile-menu-socials {
  display: flex;
  gap: 16px;
}
.mobile-menu-social {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
.mobile-menu-social:hover,
.mobile-menu-social:focus-visible {
  color: #fff;
}
.mobile-menu-social svg {
  width: 20px;
  height: 20px;
}
