/* ══════════════════════════════════════════════════════════════════════
   Rail Solutions — Premium Engineering CSS
   Palette: Deep navy + brand orange + offwhite
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --navy-950: #050E1F;
  --navy-900: #0A1932;
  --navy-800: #102545;
  --navy-700: #00239C;  /* Logo brand blue (TAČNO) */
  --navy-600: #2E4A7A;
  --navy-500: #4A6294;
  --orange: #FE4D32;     /* Logo brand orange (TAČNO) */
  --orange-light: #FF7558;
  --orange-dark: #D8341A;
  --offwhite: #F4F3F0;
  --offwhite-100: #EDEBE6;
  --silver: #B8C0CC;
  --ink-900: #0A1932;
  --ink-700: #2C3E50;
  --ink-500: #5A6878;
  --ink-300: #95A0AE;
  --border: rgba(10, 25, 50, 0.08);
  --border-strong: rgba(10, 25, 50, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--offwhite);
  overflow-x: hidden;
}

.mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 500;
  letter-spacing: 0;
}

h1, h2, h3, h4 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  line-height: 1.1;
}

a { color: inherit; }

/* ════════ Layout ════════ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* Decorative orange topline */
.topline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-light) 100%);
  z-index: 200;
}

/* ════════ NAV ════════ */

.nav {
  position: sticky;
  top: 3px;
  z-index: 100;
  background: rgba(244, 243, 240, 0.9);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}

.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-500);
  font-size: 15px;
  font-weight: 500;
  transition: color 120ms ease;
}

.nav-link:hover { color: var(--navy-700); }

.lang-switch {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--border-strong);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
}

.lang-switch a {
  color: var(--ink-300);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 3px;
  transition: all 120ms ease;
}

.lang-switch a:hover {
  color: var(--navy-700);
  background: rgba(0, 35, 156, 0.08);
}

.lang-current {
  color: var(--orange);
  padding: 4px 6px;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-700);
  /* Android touch fix: 48×48px min tap target (Material Design) */
  width: 48px;
  height: 48px;
  padding: 12px;
  margin: -12px;
  align-items: center;
  justify-content: center;
  /* Ukloni iOS Safari highlight + osigura touch reaktivnost */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  /* Garantuj da je button iznad bilo čega što bi moglo biti u njegovom putu */
  position: relative;
  z-index: 110;
}

.nav-toggle:active {
  opacity: 0.6;
}

/* SVG unutar buttona NE smije primati click eventove — proslijedi parent button-u */
.nav-toggle svg {
  pointer-events: none;
  display: block;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease;
}

.nav-mobile.open {
  max-height: 400px;
  padding: 16px 32px 24px;
}

.nav-mobile a {
  text-decoration: none;
  color: var(--ink-700);
  font-size: 16px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.nav-mobile-langs {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.nav-mobile-langs a {
  border: none;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile { display: flex; }
}

/* ════════ HERO ════════ */

.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
  background: var(--navy-900);
  color: var(--offwhite);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 30%, rgba(254, 77, 50, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(0, 35, 156, 0.4) 0%, transparent 50%),
    var(--navy-900);
  pointer-events: none;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
}

.hero .container { position: relative; z-index: 2; }

.hero-content {
  max-width: 760px;
  animation: fadeUp 700ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(254, 77, 50, 0.1);
  border: 1px solid rgba(254, 77, 50, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--orange-light);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(254, 77, 50, 0.25);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(254, 77, 50, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(254, 77, 50, 0.05); }
}

.hero-title {
  font-size: clamp(44px, 6.5vw, 86px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
  color: var(--offwhite);
}

.hero-title .accent {
  color: var(--orange);
  position: relative;
  display: inline-block;
}

.hero-title .accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 4px;
  background: var(--orange);
}

.hero-sub {
  font-size: 19px;
  color: var(--silver);
  max-width: 620px;
  margin-bottom: 40px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 180ms cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--orange);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(254, 77, 50, 0.4);
}

.btn-primary:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(254, 77, 50, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--offwhite);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-arrow {
  width: 14px; height: 14px;
  transition: transform 180ms ease;
}

.btn:hover .btn-arrow { transform: translateX(3px); }

/* ════════ STATS ════════ */

.stats {
  background: var(--navy-950);
  color: var(--silver);
  padding: 36px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

.stat { text-align: center; }

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  color: var(--ink-300);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* ════════ SECTION ════════ */

.section {
  padding: 120px 0;
}

@media (max-width: 768px) { .section { padding: 80px 0; } }

.section-header {
  max-width: 720px;
  margin: 0 auto 80px;
  text-align: center;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 16px;
  font-weight: 600;
}

.section-title {
  font-size: clamp(36px, 4.5vw, 56px);
  margin-bottom: 20px;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.section-desc {
  font-size: 18px;
  color: var(--ink-500);
  line-height: 1.65;
}

/* ════════ CLIENTS / PROJEKTE ════════ */

.section-clients {
  background: var(--offwhite-100);
  padding: 100px 0;
}

@media (max-width: 768px) { .section-clients { padding: 64px 0; } }

.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.client-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px 28px;
  text-align: left;
  transition: all 240ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  cursor: default;
}

.client-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 3px;
  background: var(--orange);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.client-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px rgba(10, 25, 50, 0.18);
}

.client-card:hover::before { transform: scaleY(1); }

.client-name {
  font-family: 'Barlow', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.client-name span {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-500);
  margin-top: 4px;
  letter-spacing: 0;
}

.client-tag {
  font-size: 11px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.clients-disclaimer {
  font-size: 11px;
  color: var(--ink-300);
  text-align: center;
  letter-spacing: 0.06em;
  max-width: 720px;
  margin: 32px auto 0;
  line-height: 1.7;
}

/* ════════ SERVICES ════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.service-card {
  position: relative;
  background: white;
  padding: 48px 36px;
  transition: all 240ms cubic-bezier(0.22, 1, 0.36, 1);
  cursor: default;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--orange);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover {
  background: #FAFAF7;
  transform: translateY(-2px);
}

.service-card:hover::before { width: 100%; }

.service-num {
  font-size: 13px;
  color: var(--orange);
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.service-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.service-desc {
  font-size: 15px;
  color: var(--ink-500);
  line-height: 1.65;
}

/* ════════ ABOUT ════════ */

.about {
  background: var(--navy-900);
  color: var(--offwhite);
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.about::after {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(254, 77, 50, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.about .container { position: relative; z-index: 2; }

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about { padding: 80px 0; }
}

.about-content .section-label { color: var(--orange-light); }

.about-content .section-title { color: var(--offwhite); margin-bottom: 28px; }

.about-content p {
  font-size: 17px;
  color: var(--silver);
  margin-bottom: 20px;
  line-height: 1.75;
}

.about-content strong {
  color: var(--offwhite);
  font-weight: 600;
}

.about-specs {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.spec-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--orange);
  padding: 24px 28px;
  border-radius: 4px;
}

.spec-label {
  font-size: 11px;
  color: var(--orange);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.spec-list {
  list-style: none;
  padding: 0;
}

.spec-list li {
  font-size: 15px;
  color: var(--silver);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-list li:last-child { border-bottom: none; }

.spec-list li::before {
  content: '— ';
  color: var(--orange);
  font-weight: 700;
}

/* ════════ CONTACT ════════ */

.contact {
  padding: 120px 0;
  background: var(--offwhite);
}

@media (max-width: 768px) { .contact { padding: 80px 0; } }

.contact-inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-size: clamp(36px, 5vw, 60px);
  margin-bottom: 20px;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.contact-desc {
  font-size: 18px;
  color: var(--ink-500);
  max-width: 580px;
  margin: 0 auto 56px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

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

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  text-align: left;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-card:not(.no-link):hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(254, 77, 50, 0.2);
}

.contact-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--navy-900);
  color: var(--orange);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-300);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.contact-value {
  font-size: 15px;
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.4;
}

/* ════════ FOOTER ════════ */

.footer {
  background: var(--navy-950);
  color: var(--silver);
  padding: 64px 0 32px;
  border-top: 3px solid var(--orange);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

.footer-logo {
  height: 36px;
  width: auto;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.footer-tagline {
  font-size: 14px;
  color: var(--ink-300);
  max-width: 320px;
  line-height: 1.65;
}

.footer-col-title {
  font-size: 11px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.footer-links a {
  color: var(--silver);
  text-decoration: none;
  font-size: 14px;
  transition: color 120ms ease;
}

.footer-links a:hover { color: var(--orange); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 13px;
  color: var(--ink-300);
}

.footer-meta {
  font-size: 11px;
  color: var(--ink-300);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ════════ Reduced motion ════════ */

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