.services-block,
.portfolio-block,
.process-block,
.contact-block {
  clear: both;
  display: block;
  width: min(var(--container-max), calc(100% - 2rem));
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

.services-block .section-heading h2 {
  max-width: 18ch;
}

.portfolio-block .section-heading h2,
.contact-block .section-heading h2 {
  max-width: 14ch;
}

.systems-intro,
.portfolio-intro {
  max-width: 72ch;
  margin: 0;
}

.video-showcase {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}

.video-stage,
.video-list {
  border-radius: var(--radius);
}

.video-stage {
  overflow: hidden;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-stage-copy {
  padding: 1.4rem 1.5rem 1.6rem;
}

.video-stage-copy h3 {
  margin-bottom: 0.7rem;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 1rem;
}

.video-card {
  display: grid;
  gap: 0.75rem;
  text-align: left;
  padding: 0.75rem;
  border-radius: 1.2rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  min-height: auto;
  cursor: pointer;
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0.95rem;
}

.video-card span {
  font-weight: 700;
  line-height: 1.35;
}

.video-card.is-active {
  border-color: rgba(201, 138, 46, 0.45);
  background: rgba(255, 248, 235, 0.92);
  box-shadow: inset 0 0 0 1px rgba(201, 138, 46, 0.16);
}

.portfolio-gallery {
  columns: 4 240px;
  column-gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-item {
  display: block;
  break-inside: avoid;
  margin: 0 0 1rem;
  border-radius: 1.4rem;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-3px);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.lightbox {
  width: min(96vw, 1320px);
  height: min(94vh, 940px);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  background: rgba(20, 20, 20, 0.92);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(6px);
}

.lightbox-toolbar,
.lightbox-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lightbox-toolbar {
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.lightbox-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(100% - 3.55rem);
  overflow: hidden;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 1rem;
  transform-origin: center center;
  transition: transform 180ms ease;
}

.lightbox-control,
.lightbox-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.lightbox-control:hover,
.lightbox-close:hover,
.lightbox-control:focus-visible,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.contact-card,
.contact-form-card,
.contact-form,
.contact-form-grid,
.contact-form label {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.text-link {
  color: var(--accent-soft);
  font-weight: 700;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.form-heading {
  display: grid;
  gap: 0.45rem;
}

.form-heading h3 {
  font-size: 1.4rem;
}

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

.contact-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(31, 35, 38, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 0.95rem 1rem;
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
  min-height: 8rem;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(201, 138, 46, 0.25);
  border-color: rgba(201, 138, 46, 0.45);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.form-note {
  margin: 0;
  font-size: 0.94rem;
  flex: 1 1 18rem;
}

.form-message {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(31, 35, 38, 0.12);
  background: #fff5df;
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 980px) {
  .video-showcase,
  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .video-list {
    grid-template-columns: 1fr;
  }

  .portfolio-gallery {
    columns: 2 180px;
  }
}

@media (max-width: 640px) {
  .portfolio-gallery {
    columns: 1;
  }

  .lightbox {
    width: 96vw;
    height: 92vh;
    padding: 0.8rem;
  }

  .lightbox-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .lightbox-toolbar-group {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
