:root {
  --ink: #102026;
  --muted: #5d6b70;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --surface-warm: #fbf7ef;
  --line: #dbe4df;
  --teal: #007c89;
  --green: #4f8f5b;
  --amber: #d49a36;
  --night: #0d242b;
  --shadow: 0 18px 45px rgba(16, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--surface);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: clamp(168px, 20vw, 260px);
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: #26383e;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--teal);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-toggle span:nth-child(1) {
  transform: translateY(-7px);
}

.nav-toggle span:nth-child(3) {
  transform: translateY(7px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg);
}

.hero {
  position: relative;
  min-height: 84vh;
  display: grid;
  align-items: end;
  background-image: url("../Images/Overview image.jpg");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(6, 22, 27, 0.64);
}

.hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 118px 0 72px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #b8e6df;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

.hero h1 {
  max-width: 820px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  letter-spacing: 0;
}

.hero-copy {
  max-width: 710px;
  margin: 22px 0 0;
  color: #e6eeee;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.hero-actions,
.section-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.button:hover {
  background: #00646f;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.button.light {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.button.light:hover {
  background: var(--surface-soft);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(820px, 100%);
  margin-top: 52px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.metric {
  padding: 18px;
  background: rgba(8, 24, 29, 0.42);
}

.metric strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: #d8e6e5;
  font-size: 0.94rem;
}

.section {
  padding: 82px 0;
}

.section.alt {
  background: var(--surface-soft);
}

.section.warm {
  background: var(--surface-warm);
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.6fr);
  gap: 36px;
  align-items: end;
  margin-bottom: 34px;
}

.section-head h2,
.page-title h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.section-head p,
.page-title p,
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.service-card {
  min-height: 260px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(16, 32, 38, 0.06);
}

.service-card .label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f3ef;
  color: #2b6d54;
  font-size: 0.78rem;
  font-weight: 800;
}

.service-card h3 {
  margin-top: 24px;
  font-size: 1.32rem;
}

.service-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.feature-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 42px;
  align-items: center;
}

.feature-media {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature-media img {
  width: 100%;
  height: min(58vw, 520px);
  object-fit: cover;
}

.check-list {
  display: grid;
  gap: 14px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: #33464c;
}

.check-list li::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 0 0 4px #dfeee4;
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.gallery-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  counter-reset: steps;
}

.process-step {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  counter-increment: steps;
}

.process-step::before {
  content: counter(steps, decimal-leading-zero);
  display: block;
  margin-bottom: 28px;
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 900;
}

.process-step h3 {
  font-size: 1.1rem;
}

.process-step p {
  margin: 10px 0 0;
  color: var(--muted);
}

.page-hero {
  position: relative;
  min-height: 52vh;
  display: grid;
  align-items: end;
  color: #ffffff;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(8, 26, 31, 0.68);
}

.page-hero.gallery {
  background-image: url("../Images/Gallery/ECJO6520.JPG");
}

.page-hero.about {
  background-image: url("../Images/domotica-e-iot.jpg");
}

.page-hero.contact {
  background-image: url("../Images/Artificial-Intelligence-and-Internet-of-Things.jpg");
}

.page-title {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 110px 0 56px;
}

.page-title p {
  max-width: 720px;
  margin-top: 18px;
  color: #dce8e7;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 0.48fr);
  gap: 42px;
  align-items: start;
}

.story-copy p {
  margin: 0 0 18px;
  color: #3f5156;
}

.facts {
  display: grid;
  gap: 12px;
}

.fact {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.fact strong {
  display: block;
  font-size: 1.5rem;
}

.fact span {
  color: var(--muted);
}

.gallery-toolbar {
  position: sticky;
  top: 73px;
  z-index: 10;
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.toolbar-row {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #2b3d43;
  font-weight: 800;
  cursor: pointer;
}

.filter-button.is-active,
.filter-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.search-input {
  width: min(100%, 320px);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
}

.gallery-item {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0;
  cursor: pointer;
}

.gallery-item.is-portrait {
  grid-row: span 2;
  min-height: 372px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transition: transform 0.24s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.04);
}

.gallery-count {
  color: var(--muted);
  font-weight: 800;
}

.empty-gallery {
  display: none;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(5, 15, 18, 0.88);
}

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

.lightbox img {
  max-width: min(1120px, 96vw);
  max-height: 84vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.35rem;
  cursor: pointer;
}

.lightbox-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
}

.lightbox-nav {
  top: 50%;
  width: 48px;
  height: 64px;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 18px;
}

.lightbox-nav.next {
  right: 18px;
}

.lightbox-caption {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 14px;
  color: #e9f0ef;
  text-align: center;
  font-size: 0.94rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(320px, 0.5fr);
  gap: 42px;
  align-items: start;
}

.contact-panel {
  display: grid;
  gap: 14px;
}

.contact-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-decoration: none;
}

.contact-link img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.contact-link strong {
  display: block;
}

.contact-link span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.site-footer {
  padding: 42px 0;
  background: var(--night);
  color: #dce8e7;
}

.footer-row {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-row img {
  width: 190px;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #dce8e7;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
}

@media (max-width: 860px) {
  .nav {
    min-height: auto;
    padding: 14px 0;
    gap: 12px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
    position: relative;
    margin-left: auto;
  }

  .nav-links {
    width: 100%;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 0 2px;
  }

  .nav.is-open .nav-links {
    display: grid;
  }

  .nav-links a {
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.94rem;
    text-align: left;
    background: var(--surface-soft);
  }

  .hero {
    min-height: auto;
    background-position: 58% center;
  }

  .hero-content {
    padding: 76px 0 46px;
  }

  .hero-metrics,
  .services-grid,
  .process,
  .section-head,
  .feature-band,
  .story-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

  .gallery-toolbar {
    position: static;
  }

  .page-hero {
    min-height: 42vh;
  }

  .page-title {
    padding: 74px 0 42px;
  }

  .feature-media img {
    height: min(72vw, 420px);
  }

  .footer-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .nav {
    width: min(100% - 24px, 1180px);
    padding: 10px 0 12px;
  }

  .brand img {
    width: min(72vw, 220px);
  }

  .nav-links a {
    min-height: 40px;
    font-size: 0.86rem;
  }

  .wrap,
  .page-title,
  .hero-content,
  .toolbar-row,
  .footer-row {
    width: min(100% - 24px, 1180px);
  }

  .section {
    padding: 52px 0;
  }

  .hero-content {
    padding: 58px 0 38px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 14vw, 3.8rem);
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-actions,
  .section-actions,
  .contact-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .button {
    width: 100%;
    min-height: 50px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .metric {
    padding: 15px;
  }

  .services-grid {
    gap: 12px;
  }

  .service-card,
  .process-step,
  .fact {
    min-height: auto;
    padding: 20px;
  }

  .section-head h2,
  .page-title h1 {
    font-size: clamp(1.85rem, 10vw, 2.55rem);
  }

  .page-title {
    padding: 58px 0 36px;
  }

  .page-title p {
    font-size: 1rem;
  }

  .filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .filter-button {
    padding: 0 8px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .gallery-item {
    min-height: 138px;
  }

  .gallery-item.is-portrait {
    min-height: 284px;
  }

  .toolbar-row {
    align-items: stretch;
  }

  .search-input {
    width: 100%;
  }

  .lightbox {
    padding: 72px 12px 86px;
  }

  .lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 172px);
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 18px;
    width: 46px;
    height: 46px;
    transform: none;
  }

  .lightbox-nav.prev {
    left: calc(50% - 58px);
  }

  .lightbox-nav.next {
    right: calc(50% - 58px);
  }

  .lightbox-caption {
    bottom: 70px;
    font-size: 0.82rem;
  }
}
