:root {
  --ink: #111111;
  --muted: #465963;
  --paper: #f3f8fa;
  --surface: #ffffff;
  --line: #cbdbe1;
  --brand: #057b97;
  --brand-dark: #045b71;
  --brand-pale: #d9edf2;
  --shadow: 0 16px 48px rgba(17, 17, 17, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(24px, calc((100% - 1200px) / 2));
  background: var(--paper);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.hero,
.section,
.contact-band,
.site-footer {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.brand {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
}

.main-nav {
  width: auto;
  display: flex;
  gap: clamp(14px, 3vw, 30px);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
}

.main-nav a:hover {
  color: var(--brand-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding: clamp(40px, 7vw, 96px) 0;
}

.hero-copy {
  max-width: 620px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(3rem, 5.2vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 500;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.secondary:hover {
  border-color: var(--brand);
}

.button.primary {
  color: #fff;
  background: var(--brand);
}

.button.secondary {
  border-color: rgba(17, 17, 17, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.hero-actions {
  width: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.hero-media {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.hero-screens {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8%;
  margin: 5% 5% 0;
  padding: 6% 10%;
  border-radius: 12px;
  background: var(--paper);
}

.hero-screens img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.hero-media a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 16px;
  padding: 16px 20px;
  font-weight: 600;
}

.hero-media a:hover {
  color: var(--brand-dark);
}

.hero-media a:focus-visible {
  outline-offset: -4px;
}

.hero-media figcaption span {
  color: var(--muted);
  font-weight: 400;
}

.section {
  padding: 72px 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1.2fr);
  gap: clamp(24px, 5vw, 70px);
  border-top: 1px solid rgba(17, 17, 17, 0.12);
}

.intro p:last-child {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.15rem;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
}

.service-card {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.service-card p {
  max-width: 54ch;
  margin-bottom: 0;
}

.service-card p,
.timeline p,
.contact-copy p,
.site-footer {
  color: var(--muted);
}

.success-cases {
  border-top: 1px solid rgba(17, 17, 17, 0.12);
}

.cases-heading {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: clamp(22px, 5vw, 64px);
  max-width: none;
}

.cases-heading > p {
  color: var(--muted);
  font-size: 1.08rem;
}

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

.case-card {
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease-out;
}

.case-card:hover,
.case-card:focus-visible {
  border-color: var(--brand);
}

.case-visual {
  display: grid;
  place-items: center;
  min-height: 248px;
  padding: 24px;
  background: var(--brand-pale);
}

.case-visual.brainboost {
  background: #243240;
}

.case-visual img {
  width: min(320px, 82%);
  max-height: 230px;
  object-fit: contain;
}

.case-card-body {
  padding: 24px;
}

.case-app-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.case-icon,
.case-detail-icon {
  flex: 0 0 auto;
  height: 58px;
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background: var(--surface);
  object-fit: contain;
}

.case-icon.brainboost, .case-detail-icon.brainboost {
  background: #2b3a4a;
}

.case-app-line h3,
.case-app-line p {
  margin: 0;
}

.case-app-line p,
.case-card-body > p {
  color: var(--muted);
}

.case-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--brand-dark);
  font-weight: 600;
}

body.case-modal-open {
  overflow: hidden;
}

.case-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  padding: clamp(12px, 3vw, 34px);
}

.case-modal.is-open {
  display: grid;
  place-items: center;
}

.case-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 49, 57, 0.82);
}

.case-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, 100%);
  max-height: calc(100dvh - 2 * clamp(12px, 3vw, 34px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.case-dialog-scroll {
  overflow: auto;
  overscroll-behavior: contain;
}

.case-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
}

.case-detail-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.case-detail-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 500;
}

.case-close {
  margin-left: auto;
}

.case-close,
.case-gallery-controls button {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.case-gallery-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}

.case-close:focus-visible,
.case-gallery-controls button:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
}

.case-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.case-detail-grid:has(.case-gallery-panel[hidden]) {
  grid-template-columns: minmax(0, 680px);
}

.case-summary {
  padding: clamp(16px, 3vw, 28px);
}

.case-summary h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
}

.case-description {
  margin-block-start: 1.4rem;
}

.case-description,
.case-features {
  color: var(--muted);
}

.case-features {
  margin: 16px 0 0;
  padding-left: 1.25em;
}

.case-gallery-panel {
  --gallery-inset: clamp(16px, 2vw, 24px);
  padding: var(--gallery-inset) 0;
  min-width: 0;
  background: #e8f3f5;
}

.case-gallery-header,
.case-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-inline: var(--gallery-inset);
}

.case-gallery-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.case-gallery-controls {
  display: flex;
  gap: 8px;
}

.case-gallery-controls[hidden] {
  display: none;
}

.case-gallery {
  --slide-width: 41%;
  --slide-gap: 14px;
  position: relative;
  display: flex;
  gap: var(--slide-gap);
  margin: 16px 0 12px var(--gallery-inset);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

/* Leave enough room for the last capture to snap to the same position. */
.case-gallery:has(figure:nth-child(2))::after {
  content: "";
  flex: 0 0 calc(100% - var(--slide-width) - var(--slide-gap));
}

.case-gallery figure {
  flex: 0 0 var(--slide-width);
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}

.case-gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.case-gallery-trigger:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: -3px;
}

.case-gallery img {
  width: 100%;
  aspect-ratio: 10 / 21;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.case-gallery figcaption,
.case-gallery-footer {
  color: var(--muted);
  font-size: 0.86rem;
}

.case-gallery figcaption {
  margin-top: 8px;
  text-align: center;
}

#caseGalleryPosition {
  margin-left: auto;
}

.case-video {
  padding: clamp(16px, 3vw, 28px);
}

.case-video video,
.case-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: clamp(12px, 3vw, 34px);
  min-height: 100dvh;
}

.image-lightbox.is-open {
  display: grid;
  place-items: center;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: blur(12px);
}

.image-lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
  width: min(1180px, 100%);
  max-height: calc(100vh - 24px);
}

.image-lightbox-figure {
  display: grid;
  justify-items: center;
  min-width: 0;
  margin: 0;
}

.image-lightbox-image {
  width: auto;
  max-width: 100%;
  max-height: min(760px, calc(100vh - 140px));
  border-radius: 8px;
  background: var(--paper);
  object-fit: contain;
  box-shadow: var(--shadow);
}

.image-lightbox-caption {
  min-height: 28px;
  margin-top: 12px;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 600;
  text-align: center;
}

.image-lightbox-close,
.image-lightbox-nav {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible,
.image-lightbox-nav:hover,
.image-lightbox-nav:focus-visible,
.case-gallery-trigger:focus-visible img {
  border-color: rgba(255, 255, 255, 0.74);
  outline: none;
}

.image-lightbox-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.method {
  border-top: 1px solid rgba(17, 17, 17, 0.12);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;

}

.timeline li {
  position: relative;
  padding: 48px 16px 0 0;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.timeline li::before {
  content: counter(step);
  position: absolute;
  top: 8px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  color: var(--brand-dark);
  justify-items: start;
  font-size: 0.82rem;
  font-weight: 600;
}

.timeline span {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 6vw, 76px);
  align-items: start;
  margin-bottom: 80px;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
}

.contact-copy p {
  color: rgba(255, 255, 255, 0.72);
}

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

.form-row {
  display: grid;
  gap: 8px;
}

.form-row.full,
.form-button,
.form-status {
  grid-column: 1 / -1;
}

label {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
}

select option {
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-pale);
  outline: 2px solid var(--brand-pale);
  outline-offset: 2px;
}

.form-button {
  width: 100%;
  margin-top: 4px;
  border: 0;
  cursor: pointer;
}

.form-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--brand-pale);
  font-weight: 600;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 40px;
  border-top: 1px solid rgba(17, 17, 17, 0.12);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 600;
}

@media (max-width: 920px) {
  .hero,
  .intro,
  .cases-heading,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-media {
    width: min(680px, 100%);
  }

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

  .timeline {
    row-gap: 34px;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 145px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
    padding-bottom: 48px;
  }

  h1 {
    font-size: clamp(2.25rem, 9vw, 3.25rem);
    line-height: 0.98;
  }

  .service-grid,
  .cases-grid,
  .case-stats,
  .timeline,
  .contact-form {
    grid-template-columns: 1fr;
  }

  .case-visual {
    min-height: 208px;
  }

  .case-modal {
    padding: 8px;
  }

  .case-dialog {
    max-height: calc(100dvh - 16px);
  }

  .case-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-gallery {
    --slide-width: 67%;
  }

  .image-lightbox {
    padding: 10px;
  }

  .image-lightbox-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100dvh - 20px);
    max-height: none;
  }

  .image-lightbox-figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 54px 0 18px;
  }

  .image-lightbox-image {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    justify-self: center;
  }

  .image-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    background: rgba(17, 17, 17, 0.58);
    transform: translateY(-50%);
  }

  .image-lightbox-nav.previous {
    left: 4px;
  }

  .image-lightbox-nav.next {
    right: 4px;
  }

  .image-lightbox-close {
    top: 4px;
    right: 4px;
    background: rgba(17, 17, 17, 0.58);
  }

  .image-lightbox-caption {
    margin-top: 10px;
    padding: 0 46px;
    font-size: 0.86rem;
  }

  .section {
    padding: 48px 0;
  }

  .contact-band {
    width: min(1120px, calc(100% - 24px));
    padding: 24px;
  }

  .site-footer {
    flex-direction: column;
  }

}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.contact-band :focus-visible {
  outline-color: var(--brand-pale);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .case-card {
    transition: none;
  }
}
