:root {
  --color-primary: #a81b35;
  --color-secondary: #d34a60;
  --color-dark: #2a313c;
  --color-light: #f1f4f8;
  --color-gray: #aeb7c3;
  --color-border: #7f8ca0;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* make descriptive text easier to read by slightly enlarging paragraphs */
p {
  font-size: 1.1rem;
}

.lead {
  font-size: 1.2rem;
}

/* ensure standard text remains light on dark backgrounds */
h1,h2,h3,h4,h5,h6,p,li,span,a,button {
  color: var(--color-light);
}

body {
  font-family: "Rajdhani", Arial, sans-serif;
  color: var(--color-light);
  background: linear-gradient(180deg, #2f343d 0%, #383f49 100%);
  line-height: 1.5;
}

main {
  background: linear-gradient(180deg, #3a424d 0%, #434c58 50%, #4a5563 100%);
}

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

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

a:hover {
  color: var(--color-primary);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  color: var(--color-light);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.top-marquee {
  background: #2c3139;
  color: var(--color-light);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.top-marquee__track {
  display: inline-flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  /* width will be determined by content; duplicated via JS */
  /* slower scrolling for readability */
  animation: marquee 60s linear infinite;
  will-change: transform;
}

.top-marquee__item {
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--marquee-distance, 50%))); /* precise distance set in JS */
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(44, 50, 60, 0.95) 0%, rgba(52, 59, 71, 0.92) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
}
.site-nav a {
  color: var(--color-light);
}
.site-nav a:hover {
  color: var(--color-secondary);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 0.7rem;
  background: #ffffff;
  border: 1px solid var(--color-dark);
}

/* ensure brand text is visible on white */
.brand span {
  color: var(--color-dark);
}

.brand img {
  width: 136px;
  filter: brightness(1.2) contrast(1.12) drop-shadow(0 2px 6px rgba(13, 17, 24, 0.45));
}

.brand span {
  font-size: 1.24rem;
  letter-spacing: 0.03em;
}

.menu-toggle {
  border: 1px solid var(--color-border);
  background: var(--color-light);
  color: var(--color-dark);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
}

.menu-toggle__line {
  width: 22px;
  height: 2px;
  display: block;
  background: var(--color-dark);
  margin: 4px 0;
}

.menu {
  position: absolute;
  inset: 100% 0 auto 0;
  background: #3b4451;
  border-bottom: 1px solid var(--color-border);
  display: none;
  flex-direction: column;
}

.menu.is-open {
  display: flex;
}

.menu a {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--color-light);
}

.menu a.active {
  color: var(--color-primary);
}

/* submenu dropdown styles */
.menu-item {
  position: relative;
}
.menu-item > a {
  display: inline-flex;
  align-items: center;
}
.menu-item > a::after {
  content: '▾';
  font-size: 0.6rem;
  margin-left: 0.3rem;
  transition: transform 0.2s;
}
.menu-item.has-dropdown.open > a::after {
  transform: rotate(180deg);
}
.menu-item .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #444f5f;
  border: 1px solid var(--color-border);
  display: none;
  flex-direction: column;
  min-width: 160px;
  z-index: 30;
}
.menu-item:hover .dropdown {
  display: flex;
}
.menu-item.open .dropdown {
  display: flex;
}
.menu-item .dropdown a {
  border-top: none;
  padding: 0.7rem 1rem;
}
@media (max-width: 900px) {
  .menu-item .dropdown {
    position: static;
    border: none;
  }
}

.hero {
  padding: 4rem 0 2rem;
  background: transparent;
}

.hero__grid {
  display: grid;
  gap: 1.5rem;
}
.hero p {
  color: var(--color-light);
}

.hero h1 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  line-height: 1.1;
  color: var(--color-light);
  /* slightly smaller than before for service pages */
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
}

.lead {
  font-size: 1.1rem;
  color: var(--color-light);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-light);
}
.btn--primary:hover {
  background: var(--color-secondary);
}

.btn--ghost {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-light);
}
.btn--ghost:hover {
  background: var(--color-secondary);
}

.section {
  padding: 3rem 0;
  background: transparent;
}

.section--compact-media {
  padding: 0.35rem 0 0.45rem;
}

.section--gallery-tight {
  padding-top: 0.45rem;
}

.section h2 {
  margin-top: 0;
}

.cards {
  display: grid;
  gap: 1rem;
}

/* homepage tiles section used on index.html */
.home-tiles {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr); /* always two columns when possible */
}

/* make mobile stack the tiles vertically and allow them shrink on small screens */
@media (max-width: 600px) {
  .home-tiles {
    grid-template-columns: 1fr;
  }
  .home-tile {
    /* allow tiles to shrink on phones, maintain reasonable minimum */
    min-height: 170px;
    /* force uniform proportions so all four tiles have same height */
    aspect-ratio: 3 / 2;
  }
}

/* make homepage tiles section bleed edge-to-edge of viewport */
#services-tiles {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
}
#services-tiles .container {
  width: 100%;
  max-width: none;
  padding: 0;
}


.home-tile {
  position: relative;
  color: var(--color-light);
  overflow: hidden;
  border-radius: 0.75rem;
  min-height: 420px;
  /* allow flexible height on small screens via aspect ratio trick */
  aspect-ratio: 3 / 2;
  /* background image applied directly via inline style */
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s;
}

/* remove pseudo-element; we no longer need it */
.home-tile::before {
  display: none;
}

.home-tile .overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 22, 31, 0.3);
  opacity: 0;
  transition: opacity 0.3s;
}

.home-tile:hover {
  transform: scale(1.03);
}

.home-tile--bend {
  background-size: cover; /* stretch to fill vertically */
}
.home-tile--bend:hover {
  background-size: cover;
}

/* project tile uses a tint/filter to differentiate and mimic style */
.home-tile--project {
  filter: hue-rotate(20deg) brightness(0.95);
}
.home-tile--project:hover {
  filter: hue-rotate(20deg) brightness(1.05);
}

.home-tile:hover .overlay {
  opacity: 1;
}

.home-tile .text {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1;
}

.home-tile .text h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem; /* slightly smaller titles on tiles */
}

.home-tile .text p {
  margin: 0;
  font-size: 0.95rem;
}

/* service card backgrounds */
.card {
  position: relative;
  overflow: hidden;
  color: var(--color-light);

  /* layout so the button can sit at bottom */
  display: flex;
  flex-direction: column;
}

/* ensure service card images share a uniform box and cropping */
.card figure {
  margin: 0;
  width: 100%;
  height: 200px; /* fixed height for all cards */
  overflow: hidden;
}
.card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* push link to bottom of card */
.card > a {
  margin-top: auto;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.card:hover::before {
  opacity: 0.5;
}

.card.card--laser::before {
  background-image: url('https://images.unsplash.com/photo-1581091870621-7157a1d278a1?auto=format&fit=crop&w=800&q=80');
}

.card.card--bend::before {
  background-image: url('https://images.unsplash.com/photo-1540269893-65dca3ffc67c?auto=format&fit=crop&w=800&q=80');
}

.card.card--weld::before {
  background-image: url('https://images.unsplash.com/photo-1582787116671-9f55dfabda8c?auto=format&fit=crop&w=800&q=80');
}

.card.card--design::before {
  background-image: url('https://images.unsplash.com/photo-1508384555496-4161bebf3f62?auto=format&fit=crop&w=800&q=80');
}

.card h2,
.card p,
.card .btn {
  position: relative;
  z-index: 1;
}

.item-row {
  border: 1px solid var(--color-border);
  padding: 0.75rem;
  margin-bottom: 0.8rem;
  border-radius: 0.6rem;
}

#add-item {
  margin-bottom: 1rem;
}

.remove-item {
  margin-top: 0.5rem;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-panel {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 0.25rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.split {
  display: grid;
  gap: 1.4rem;
  align-items: center;
}

.mini-list {
  padding-left: 1rem;
  margin: 0;
}

.mini-list li {
  margin-bottom: 0.45rem;
}

.form {
  display: grid;
  gap: 0.85rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

label {
  display: block;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.7rem;
  margin-top: 0.35rem;
  color: #1f2736;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checkbox-row input {
  width: auto;
  margin-top: 0.2rem;
}

.file-upload-field {
  display: grid;
  gap: 0.35rem;
  grid-column: 1 / -1;
}

.file-upload-field span {
  font-weight: 600;
}

.file-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);
  gap: 0.6rem;
  align-items: stretch;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-upload-name {
  margin-top: 0;
}

.file-upload-btn {
  margin-top: 0;
  width: 100%;
  padding-inline: 1rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .file-upload-row {
    grid-template-columns: 1fr;
  }
}

.contact-map {
  margin-top: 1rem;
}

.contact-map iframe {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
}

.error {
  color: var(--color-primary);
  font-size: 0.95rem;
}

.notice {
  font-size: 0.95rem;
  color: var(--color-light);
}

.gallery {
  display: grid;
  gap: 0.9rem;
}

.realization-video {
  width: min(100%, 620px);
  margin-inline: auto;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.realization-video__media {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  background: #000;
  transition: opacity 0.3s ease;
}

.realization-video__media.is-soft-looping {
  opacity: 0.84;
}

.realization-video__caption {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  color: var(--color-light);
  font-size: 0.98rem;
}

.gallery__item {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  /* ensure all tiles same shape */
  width: 100%;
}

.gallery__item a {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* lightbox overlay for gallery images */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 60;
}

.lightbox-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 1200px);
  max-height: calc(100vh - 2.5rem);
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 0 12px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: -0.75rem;
  right: -0.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 20, 28, 0.82);
  color: var(--color-light);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(15, 20, 28, 0.95);
}

@media (max-width: 700px) {
  .lightbox-overlay {
    padding: 0.75rem;
  }

  .lightbox-panel {
    max-height: calc(100vh - 1.5rem);
  }

  .lightbox-image {
    max-height: calc(100vh - 3.5rem);
  }

  .lightbox-close {
    top: 0.25rem;
    right: 0.25rem;
  }
}

.gallery__caption {
  padding: 0.7rem;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: #343d49;
  color: var(--color-light);
  padding: 2rem 0;
  margin-top: 2rem;
}

.site-footer a {
  color: var(--color-light);
}

.site-footer a:hover {
  color: var(--color-secondary);
}

.footer-grid {
  display: grid;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* credit line below footer content */
.site-credit {
  font-size: 0.8rem;
  color: var(--color-light);
  margin-top: 0.5rem;
}

.site-credit a {
  color: var(--color-light);
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 40;
  border: 1px solid var(--color-border);
  background: var(--color-light);
  color: var(--color-dark);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.cookie-banner p,
.cookie-banner strong,
.cookie-banner a,
.cookie-banner label {
  color: var(--color-dark);
}

.cookie-banner .btn--ghost {
  color: var(--color-dark);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

/* overlay shown during form submission */
.form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 50;
}

.form-overlay p {
  color: var(--color-dark);
}

.form-overlay .spinner {
  width: 3rem;
  height: 3rem;
  border: 0.4rem solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 901px) {
  .menu-toggle {
    display: none;
  }

  .menu {
    position: static;
    display: flex;
    flex-direction: row;
    border: 0;
    gap: 0.4rem;
    background: transparent;
  }

  .menu a {
    border-top: 0;
    border-radius: 0.55rem;
    padding: 0.55rem 0.95rem;
    font-size: 1.18rem;
    font-weight: 700;
  }

  .menu a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-secondary);
  }

  .menu-item .dropdown {
    background: rgba(65, 76, 92, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.65rem;
    overflow: hidden;
  }

  .hero__grid,
  .split {
    grid-template-columns: 1.2fr 1fr;
  }

  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr;
  }
}