/* ---------- Reset & Variables ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-alt: #121212;
  --fg: #f5f5f5;
  --fg-muted: #9a9a9a;
  --fg-faint: #6b6b6b;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.28);
  --white: #ffffff;
  --font-head: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
  --container: 1180px;
  --radius: 2px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.center { text-align: center; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.6rem; text-transform: none; }

.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow.center { justify-content: center; }
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--fg-faint);
}
.eyebrow.center::before { display: none; }

.section-lead {
  max-width: 600px;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
}
.section-lead.center { margin-left: auto; margin-right: auto; }

/* subtle grain overlay for texture */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* recurring cable-curl motif, echoes the mark in the logo */
.cable-divider {
  display: flex;
  justify-content: center;
  color: var(--fg-faint);
  opacity: 0.55;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}
.cable-divider svg { width: 130px; height: 30px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.9rem 2.1rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--white);
  border-radius: var(--radius);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary {
  background: var(--white);
  color: #0a0a0a;
}
.btn-primary:hover {
  background: transparent;
  color: var(--white);
  box-shadow: 0 0 24px rgba(255,255,255,0.25);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--white);
  box-shadow: 0 0 24px rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10,10,10,0.92);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand-cable {
  height: 30px;
  width: auto;
  transform: rotate(-6deg);
  transition: transform 0.4s ease;
}
.brand:hover .brand-cable { transform: rotate(4deg); }
.brand-name {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 1rem;
  text-transform: uppercase;
}
.main-nav ul {
  display: flex;
  gap: 2rem;
}
.main-nav a {
  font-family: var(--font-head);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--white); }
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--white);
  transition: width 0.25s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 1.25rem; }

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  display: flex;
  gap: 0.35rem;
  border-radius: var(--radius);
}
.lang-toggle span { transition: color 0.2s ease; }
.lang-toggle .active { color: var(--white); font-weight: 600; }
.lang-sep { color: var(--fg-faint); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 900px;
  height: 900px;
  margin-left: -450px;
  background: radial-gradient(circle, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0) 65%);
  pointer-events: none;
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 76px;
}
.hero-logo {
  width: 340px;
  max-width: 62vw;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fade-up 0.9s ease forwards;
}
.hero-kicker {
  font-family: var(--font-head);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fade-up 0.8s ease forwards 0.15s;
}
.hero-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  max-width: 900px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fade-up 0.8s ease forwards 0.3s;
}
.hero-subtitle {
  max-width: 560px;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  opacity: 0;
  animation: fade-up 0.8s ease forwards 0.45s;
}
.hero-actions {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  opacity: 0;
  animation: fade-up 0.8s ease forwards 0.6s;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  background: var(--white);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollcue 1.6s ease infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 8px; }
  70% { opacity: 0; top: 22px; }
  100% { opacity: 0; top: 22px; }
}

/* ---------- Sections ---------- */
.section {
  padding: 7rem 0;
  position: relative;
}
.section-alt { background: var(--bg-alt); }
.page-hero { padding-top: 10rem; padding-bottom: 3rem; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* staggered cascade for grids so items settle in one after another */
.cards-grid.reveal.visible .card,
.gallery-grid.reveal.visible .gallery-item,
.references-grid.reveal.visible .reference-item {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.6s ease forwards;
}
.cards-grid .card:nth-child(1), .gallery-grid .gallery-item:nth-child(1), .references-grid .reference-item:nth-child(1) { animation-delay: 0.05s; }
.cards-grid .card:nth-child(2), .gallery-grid .gallery-item:nth-child(2), .references-grid .reference-item:nth-child(2) { animation-delay: 0.13s; }
.cards-grid .card:nth-child(3), .gallery-grid .gallery-item:nth-child(3), .references-grid .reference-item:nth-child(3) { animation-delay: 0.21s; }
.cards-grid .card:nth-child(4), .gallery-grid .gallery-item:nth-child(4), .references-grid .reference-item:nth-child(4) { animation-delay: 0.29s; }
.gallery-grid .gallery-item:nth-child(5) { animation-delay: 0.37s; }
.gallery-grid .gallery-item:nth-child(6) { animation-delay: 0.45s; }
.gallery-grid .gallery-item:nth-child(7) { animation-delay: 0.53s; }
.gallery-grid .gallery-item:nth-child(8) { animation-delay: 0.61s; }
.gallery-grid .gallery-item:nth-child(9) { animation-delay: 0.69s; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4rem;
  align-items: center;
}
.img-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #151515;
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.img-frame:hover img:not(.img-error) { transform: scale(1.04); }

.fallback-img.img-error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #161616, #0c0c0c);
}

.about-content p { color: var(--fg-muted); margin-bottom: 1.1rem; }
.about-content h2 { color: var(--white); }
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.about-tags span {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  color: var(--fg-muted);
  border-radius: var(--radius);
}

/* ---------- Services ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
.card {
  border: 1px solid var(--border);
  padding: 2.2rem 1.6rem;
  border-radius: var(--radius);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.card p { color: var(--fg-muted); font-size: 0.92rem; }
.card-num {
  display: block;
  font-family: var(--font-head);
  font-size: 2.1rem;
  font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-strong);
  margin-bottom: 1rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 0.75rem;
}
.gallery-grid.dense { grid-template-columns: repeat(3, 1fr); }
.gallery-item {
  position: relative;
  overflow: hidden;
  background: #151515;
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item:hover img:not(.img-error) { transform: scale(1.08); }
.gallery-item:hover { transform: translateY(-4px); }
.gallery-item.span-2 { grid-column: span 2; }
.full-gallery .gallery-item { cursor: pointer; grid-row: span 1; }
.full-gallery .gallery-item[data-lightbox] { aspect-ratio: 1; height: auto; }

/* fallback state for missing images: shows subtle icon instead of broken image */
.fallback-img.img-error {
  min-height: 100%;
}
.gallery-item .fallback-img.img-error,
.img-frame .fallback-img.img-error {
  width: 100%;
  height: 100%;
  position: relative;
}
.fallback-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-faint);
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #171717, #0b0b0b);
}
.fallback-icon svg { width: 28px; height: 28px; opacity: 0.4; margin-bottom: 0.6rem; }
.fallback-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- References ---------- */
.references-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.reference-item {
  border: 1px solid var(--border);
  padding: 1.6rem 1.2rem;
  text-align: center;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--fg-muted);
  border-radius: var(--radius);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.reference-item:hover { color: var(--white); border-color: var(--border-strong); transform: translateY(-3px); }

/* ---------- Equipment ---------- */
.equipment-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4rem;
  align-items: center;
}
.equipment-content h2 { color: var(--white); }
.equipment-content p { color: var(--fg-muted); margin-bottom: 1.5rem; }
.equipment-list li {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.92rem;
}
.equipment-list li:last-child { border-bottom: 1px solid var(--border); }
.equipment-media .img-frame { aspect-ratio: 4/3; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 3rem;
  margin-top: 3rem;
}
.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-line {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.2rem;
  transition: transform 0.2s ease;
}
.contact-line:hover { transform: translateX(6px); }
.contact-label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.contact-value { font-size: 1.15rem; }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: flex; flex-direction: column; gap: 0.5rem; }
.form-row label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.form-row input, .form-row textarea {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white);
  padding: 0.8rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--white);
}
.contact-form button { align-self: flex-start; border: none; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-logo { height: 56px; width: auto; align-self: flex-start; }
.footer-brand p { color: var(--fg-faint); font-size: 0.9rem; }
.footer-nav, .footer-contact { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-nav a, .footer-contact a {
  color: var(--fg-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.footer-nav a:hover, .footer-contact a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--fg-faint);
  font-size: 0.8rem;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 3rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; border: 1px solid var(--border); }
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 2rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open {
    display: block;
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: rgba(10,10,10,0.98);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
  }
  .main-nav.open ul { flex-direction: column; align-items: center; gap: 1.5rem; }

  .about-grid, .equipment-grid, .contact-grid {
    grid-template-columns: 1fr;
  }
  .equipment-media { order: -1; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .references-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid.dense { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.span-2 { grid-column: span 2; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { align-items: center; }
  .footer-logo { align-self: center; }
  .hero-logo { width: 260px; }
}

@media (max-width: 560px) {
  .cards-grid { grid-template-columns: 1fr; }
  .references-grid { grid-template-columns: 1fr; }
  .gallery-grid, .gallery-grid.dense { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo, .hero-kicker, .hero-title, .hero-subtitle, .hero-actions,
  .cards-grid.reveal.visible .card, .gallery-grid.reveal.visible .gallery-item,
  .references-grid.reveal.visible .reference-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
