:root {
  --ink: #1f2b2a;
  --paper: #fffdf7;
  --splash1: #ffbe0b;
  --splash2: #3a86ff;
  --splash3: #00b894;
  --line: #d7e4e2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 5% 10%, #ffe6a3 0%, transparent 24%),
    radial-gradient(circle at 92% 88%, #cde4ff 0%, transparent 29%),
    var(--paper);
}

.hero-wrap {
  width: min(1150px, 92vw);
  margin: 16px auto 0;
}

nav {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.logo-group img {
  width: min(30vw, 360px);
  height: auto;
  max-height: 122px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: #1054af;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}

.nav-links a:not(.nav-cta) {
  padding: 6px 0;
}

.nav-cta {
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #1b69f8, #00a6fb);
  padding: 14px 24px;
  border-radius: 16px;
}

.hero {
  margin-top: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
}

.hero > div,
.hero-carousel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
}

.hero > div {
  position: relative;
  overflow: hidden;
}

.hero > div::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -110px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(58, 134, 255, 0.2), rgba(58, 134, 255, 0));
}

h1 {
  font-family: "Fraunces", serif;
  margin: 12px 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.02;
}

.sub { max-width: 60ch; }

.actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-points {
  margin: 14px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
}

.btn {
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  text-align: center;
}

.btn.fill {
  background: linear-gradient(90deg, var(--splash1), #ff8f00);
  color: #452400;
}

.btn.line {
  border: 2px solid #1b69f8;
  color: #1b69f8;
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  height: auto;
  min-height: 100%;
  display: block;
  padding: 0;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 22px;
  overflow: hidden;
}

.slide {
  margin: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide img.slide-domotica {
  object-fit: cover;
  object-position: center 38%;
}

.slide figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(15, 42, 85, 0.78);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f4a98;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 3;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 64px;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 3;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.dot.active {
  width: 22px;
  border-radius: 999px;
  background: #fff;
}

.quick-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-stats article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.quick-stats strong {
  display: block;
  font-size: 1.8rem;
  color: #0c56b8;
  font-family: "Fraunces", serif;
}

.quick-stats span {
  font-size: 0.92rem;
  opacity: 0.8;
}

main {
  width: min(1150px, 92vw);
  margin: 14px auto;
  padding-bottom: 48px;
}

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.services article {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 6px solid var(--splash3);
  border-radius: 16px;
  padding: 16px;
}

.services article:nth-child(2) { border-top-color: var(--splash2); }
.services article:nth-child(3) { border-top-color: var(--splash1); }

.services h2 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
}

.visuals,
.cases,
.contact,
.faq {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

.cases {
  margin-top: 4px;
}

.visuals h2,
.cases h2,
.contact h2,
.faq h2 {
  margin-top: 0;
  font-family: "Fraunces", serif;
}

.contact-intro {
  margin-top: -4px;
  margin-bottom: 12px;
  color: #2f4140;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.visual-grid figure {
  margin: 0;
  background: #f8fbff;
  border: 1px solid #d7e7f5;
  border-radius: 12px;
  overflow: hidden;
}

.visual-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.28s ease;
}

.visual-grid img:hover {
  transform: scale(1.04);
}

.visual-grid figcaption {
  padding: 10px;
  font-weight: 700;
}

.gallery-note {
  margin-bottom: 0;
  font-size: 0.92rem;
  opacity: 0.75;
}

.story {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
}

.story > div,
.story aside {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.story h2,
.story h3 {
  margin-top: 0;
  font-family: "Fraunces", serif;
}

.story h2 {
  margin-bottom: 12px;
}

.gallery-preview-card {
  display: grid;
  gap: 10px;
}

.preview-copy {
  margin: 0;
  color: #2f4140;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  cursor: pointer;
}

.preview-grid figure {
  margin: 0;
  border: 1px solid #d9e8f8;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fbff;
}

.preview-grid img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  display: block;
}

.preview-grid figcaption {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 8px;
  color: #0f478d;
}

.open-gallery-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #1b69f8, #00a6fb);
  cursor: pointer;
}

.story ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  line-height: 1.5;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-grid article {
  border: 1px solid #d9e8e6;
  border-radius: 12px;
  padding: 12px;
  background: #fbfffe;
}

.case-grid h3 {
  margin: 0 0 7px;
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
}

.faq details {
  border: 1px solid #d7e7f5;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fbfdff;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.contact-panel {
  display: grid;
  gap: 8px;
}

.contact-fields {
  display: grid;
  gap: 8px;
}

.field-row {
  border: 1px solid #d4e4f5;
  background: #f8fbff;
  border-radius: 10px;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a637d;
}

.field-value {
  font-weight: 800;
  color: #0a4fa9;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.field-value.plain {
  color: #132a46;
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.action-card {
  text-decoration: none;
  text-align: center;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid #cfe0f4;
  background: #f8fbff;
  color: #0a4fa9;
  font-weight: 700;
}

.service-box {
  margin-top: 8px;
  border: 1px solid #d8e6f5;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
}

.service-box h3 {
  margin: 0 0 7px;
  font-family: "Fraunces", serif;
  font-size: 1rem;
}

.service-box ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.contact form {
  display: grid;
  gap: 8px;
}

.contact label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.contact input,
.contact textarea,
.contact select {
  width: 100%;
  border: 1px solid #cfe0f4;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

.contact button {
  border: 0;
  border-radius: 10px;
  padding: 11px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, #14a44d, #22c55e);
}

.map-link {
  display: inline-block;
  margin-top: 6px;
  text-decoration: none;
  font-weight: 800;
}

.contact a {
  color: #0c53ad;
  font-weight: 700;
}

footer {
  text-align: center;
  padding: 18px;
}

footer p { margin: 0; }

.to-top {
  position: fixed;
  right: 16px;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: #0f6ae7;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.25s ease;
  z-index: 998;
}

.to-top.on {
  opacity: 1;
  transform: translateY(0);
}

.wa-float {
  position: fixed;
  right: 16px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  text-decoration: none;
  background: #22c55e;
  color: #fff;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
  z-index: 999;
  border: 2px solid #ffffff;
}

dialog#lightbox {
  border: 0;
  border-radius: 14px;
  padding: 10px;
  max-width: min(92vw, 980px);
  background: #fff;
}

dialog#lightbox::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

#lightbox-image {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

#close-lightbox {
  margin-top: 8px;
  border: 0;
  border-radius: 9px;
  padding: 9px 13px;
  font-weight: 700;
  background: #edf5ff;
  cursor: pointer;
}

dialog#work-gallery {
  border: 0;
  border-radius: 16px;
  padding: 16px;
  width: min(96vw, 1080px);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
}

dialog#work-gallery::backdrop {
  background: rgba(5, 26, 49, 0.55);
}

.work-gallery-head h3 {
  margin: 0;
  font-family: "Fraunces", serif;
}

.work-gallery-head p {
  margin: 8px 0 12px;
  color: #2f4140;
}

.gallery-full-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gallery-full-grid figure,
.ba-pair figure {
  margin: 0;
  border: 1px solid #d8e7f6;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fbff;
}

.gallery-full-grid img,
.ba-pair img {
  width: 100%;
  height: 240px;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.gallery-full-grid figcaption {
  padding: 8px;
  font-weight: 700;
  font-size: 0.88rem;
}

#work-gallery h4 {
  margin: 0 0 10px;
  font-family: "Fraunces", serif;
}

.before-after-grid {
  display: grid;
  gap: 10px;
}

.ba-card {
  border: 1px solid #d9e8e6;
  border-radius: 12px;
  background: #fbfffe;
  padding: 10px;
}

.ba-card h5 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.ba-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ba-tag {
  display: inline-block;
  margin: 8px 8px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #0f4a98;
  font-size: 0.75rem;
  font-weight: 800;
}

#close-work-gallery {
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  color: #fff;
  background: #0f63d3;
  cursor: pointer;
}

@media (max-width: 920px) {
  nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px;
  }

  .logo-group {
    width: 100%;
  }

  .logo-group img {
    width: min(78vw, 320px);
    height: auto;
    max-height: 88px;
  }

  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: hidden;
  }

  .nav-links a {
    text-align: center;
    border: 1px solid #d5e3f4;
    background: #f7fbff;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
    white-space: normal;
    line-height: 1.15;
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .nav-links .nav-cta {
    color: #fff;
    border: 0;
    background: linear-gradient(90deg, #1b69f8, #00a6fb);
  }

  .hero { grid-template-columns: 1fr; }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions .btn {
    width: 100%;
  }

  .hero-carousel {
    height: 290px;
    min-height: 290px;
  }
  .slide img {
    height: 100%;
    min-height: 290px;
  }
  .carousel-dots { bottom: 56px; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .services { grid-template-columns: 1fr; }
  .visual-grid { grid-template-columns: 1fr; }
  .story { grid-template-columns: 1fr; }
  .preview-grid { grid-template-columns: 1fr 1fr; }
  .case-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-actions { grid-template-columns: 1fr; }
  .gallery-full-grid { grid-template-columns: 1fr; }
  .ba-pair { grid-template-columns: 1fr; }
}
