/* =========================
   Header and navigation
========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  background:
    linear-gradient(135deg, rgba(36, 115, 244, 0.9) 0%, rgba(33, 98, 206, 0.84) 58%, rgba(29, 88, 186, 0.78) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(12, 35, 77, 0.22);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.72rem 0;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.98);
  transition: opacity 140ms ease-out;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand__logo {
  max-width: none;
  height: auto;
}

.brand__logo--mobile {
  display: none;
}

.brand__name {
  display: none;
  color: rgba(255, 255, 255, 0.98);
  font-weight: 650;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.site-nav a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.9);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  opacity: 0.9;
}

.site-nav-social {
  display: none;
}

.menu-backdrop {
  display: none;
}

.site-nav a:hover {
  text-decoration: none;
  opacity: 1;
}

/* =========================
   Menu toggle
========================= */
.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.98);
  border-radius: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  position: relative;
  opacity: 0.92;
  transition: opacity 180ms ease-out;
}

.menu-toggle:hover {
  opacity: 1;
}

.nav-toggle-input:focus-visible + .brand + .menu-toggle,
.menu-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
  border-radius: 8px;
}

.menu-toggle__line {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
  transform-origin: center;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}

#nav-toggle:checked ~ .menu-toggle .menu-toggle__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#nav-toggle:checked ~ .menu-toggle .menu-toggle__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.2);
}

#nav-toggle:checked ~ .menu-toggle .menu-toggle__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   Buttons
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.56rem 0.95rem;
  border-radius: var(--radius-button);
  font-size: var(--text-sm);
  font-weight: 650;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-brand);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-primary:hover {
  text-decoration: none;
  background: #1d63d1;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(11, 18, 32, 0.18);
  color: rgba(11, 18, 32, 0.88);
}

.btn-ghost:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
}

.header-contact {
  background: #ffffff;
  color: #0b1220;
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-button);
}

.header-contact:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* =========================
   Section heading
========================= */
.section-heading {
  display: block;
  margin-bottom: var(--space-4);
}

.section-heading h2 {
  margin-bottom: 0;
}

/* =========================
   Shared components
========================= */
.card {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--gradient-card);
  box-shadow: 0 4px 16px rgba(11, 18, 32, 0.05);
  padding: var(--space-8);
}

/* Minimal accordion block for services */
.service-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: visible;
  align-self: start;
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
}

.service-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.4;
  color: rgba(11, 18, 32, 0.9);
  justify-content: flex-start;
  gap: 12px;
  border-radius: 0;
  margin: 0;
}

.service-item summary::-webkit-details-marker {
  display: none;
}

.service-item summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.6px solid rgba(11, 18, 32, 0.47);
  border-bottom: 1.6px solid rgba(11, 18, 32, 0.47);
  margin-left: auto;
  transform: translateX(0) rotate(-45deg);
  transition: transform 180ms ease-out;
  flex: 0 0 auto;
}

.service-item[open] summary::after {
  transform: translateX(0) rotate(45deg);
}

.service-item[open] summary {
  border-bottom: 0;
  border-radius: 0;
  margin-bottom: 0;
  background: transparent;
}

.service-item .content {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px 0;
  opacity: 0;
  transition: max-height 180ms ease-out, opacity 180ms ease-out, padding 180ms ease-out;
}

.service-item .content p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  transform: translateY(-1px);
  transition: transform 180ms ease-out;
}

.service-item[open] .content {
  max-height: 7rem;
  padding: 0 16px 14px;
  opacity: 1;
}

.service-item[open] .content p {
  margin-top: 6px;
  transform: translateY(0);
}

.service-item:hover summary {
  background: rgba(0, 0, 0, 0.02);
}

.service-item summary:focus-visible {
  outline: 2px solid rgba(36, 115, 244, 0.52);
  outline-offset: -2px;
  box-shadow: none;
  border-radius: var(--radius-small);
  background: rgba(0, 0, 0, 0.02);
}

.service-item:hover summary::after,
.service-item summary:focus-visible::after {
  transform: translateX(3px) rotate(-45deg);
  border-color: rgba(36, 115, 244, 0.68);
}

.service-item[open]:hover summary::after,
.service-item[open] summary:focus-visible::after {
  transform: translateX(3px) rotate(45deg);
}

.project-one-liner {
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.project-grid .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  opacity: 1;
  filter: blur(0);
}

.projects.is-reveal-pending .project-grid .card {
  opacity: 0.9;
  filter: blur(4px);
}

.projects.is-revealed .project-grid .card {
  animation: project-card-reveal 240ms ease-out both;
}

.projects.is-revealed .project-grid .card:nth-child(2) {
  animation-delay: 80ms;
}

@keyframes project-card-reveal {
  from {
    opacity: 0.9;
    filter: blur(4px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

.project-grid .card .project-link {
  margin-top: auto;
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: var(--space-3);
}

.project-logo {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: transparent;
  overflow: visible;
  color: #71717a;
  top: 1px;
}

.project-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 140ms ease-out;
}

.project-logo__mono {
  opacity: 0.48;
}

.project-logo__color {
  opacity: 0;
}

.project-grid .card:hover .project-logo__mono,
.project-grid .card:focus-within .project-logo__mono {
  opacity: 0;
}

.project-grid .card:hover .project-logo__color,
.project-grid .card:focus-within .project-logo__color {
  opacity: 1;
}

.project-grid h3 {
  font-weight: 620;
  margin-bottom: var(--space-3);
}

.project-card-header h3 {
  margin: 0;
}

.project-grid .muted {
  line-height: 1.42;
}

.project-subheading {
  margin: 1.25rem 0 0.75rem;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-aspects {
  margin: 0 0 var(--space-4);
  padding-left: 1.1rem;
  color: var(--color-muted);
  list-style: disc;
}

.project-aspects li + li {
  margin-top: 0.22rem;
}

.project-aspects li::marker {
  color: rgba(107, 114, 128, 0.68);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: rgba(11, 18, 32, 0.9);
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
}

@media (min-width: 48rem) {
  .project-logo {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }

  .project-logo__mono {
    opacity: 0.5;
  }

  .project-subheading {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projects.is-reveal-pending .project-grid .card {
    opacity: 1;
    filter: none;
  }

  .projects.is-revealed .project-grid .card {
    animation: none;
  }

  .project-logo img {
    transition: none;
  }
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, var(--text-lg));
  color: var(--color-muted);
  max-width: 62ch;
}

.lead-sm {
  font-size: var(--text-md);
  color: var(--color-muted);
  max-width: 62ch;
}

.muted {
  color: var(--color-muted);
  font-weight: 400;
}

.contact-address {
  margin: 0;
  font-style: normal;
}

.contact-address p {
  margin: 0 0 0.52rem;
}

.contact-address p:last-child {
  margin-bottom: 0;
}

.site-footer {
  padding: 1.75rem 0;
  border-top: 1px solid rgba(11, 18, 32, 0.06);
  background: #f7f9fc;
}

.site-footer small {
  color: rgba(11, 18, 32, 0.55);
  font-size: 1.03rem;
  line-height: 1.4;
}

.social-links a {
  display: inline-flex;
  width: 24px;
  height: 24px;
  color: rgba(11, 18, 32, 0.6);
  opacity: 0.6;
  transition: opacity 140ms ease-out;
}

.social-links a:hover {
  opacity: 1;
  text-decoration: none;
}

.social-links a:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(11, 18, 32, 0.45);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.social-links svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* =========================
   Mobile menu behavior
========================= */
@media (max-width: 47.99rem) {
  main,
  .site-footer {
    transition: filter 190ms ease-out, opacity 190ms ease-out;
  }

  .header-contact {
    display: none;
  }

  .brand__logo--desktop {
    display: none;
  }

  .brand__logo--mobile {
    display: block;
  }

  .brand__name {
    display: inline;
  }

  .site-nav {
    width: 100%;
    margin-top: var(--space-4);
  }

  .site-nav ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: calc(var(--space-6) * -1);
    right: calc(var(--space-6) * -1);
    width: auto;
    margin-top: 0;
    border: 0;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 20px rgba(11, 18, 32, 0.09);
    padding: 0.45rem 0 0.55rem;
    height: auto;
    max-height: none;
    overflow: hidden;
    z-index: 70;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transform-origin: top center;
    transition: opacity 190ms ease-out, transform 190ms ease-out, visibility 0s linear 190ms;
  }

  .menu-backdrop {
    display: block;
    position: absolute;
    top: 100%;
    left: calc(var(--space-6) * -1);
    right: calc(var(--space-6) * -1);
    height: 100dvh;
    background: transparent;
    z-index: 65;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 190ms ease-out, visibility 0s linear 190ms;
  }

  body:has(.nav-toggle-input:checked) .site-header {
    border-bottom-color: transparent;
  }

  #nav-toggle:checked ~ .site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 190ms ease-out, transform 190ms ease-out;
  }

  #nav-toggle:checked ~ .menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 190ms ease-out;
  }

  .site-nav ul {
    width: min(var(--container), calc(100% - 2 * var(--space-6)));
    margin: 0 auto;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    gap: 10px;
  }

  .site-nav li {
    width: 100%;
  }

  .site-nav a {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 16px 17px;
    border-radius: 0;
    color: rgba(11, 18, 32, 0.92);
    font-weight: 600;
    line-height: 1.25;
    box-shadow: inset 2px 0 0 transparent;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
  }

  .site-nav a:hover,
  .site-nav a:active,
  .site-nav a:focus-visible {
    background: rgba(36, 115, 244, 0.035);
    box-shadow: inset 2px 0 0 rgba(36, 115, 244, 0.38);
  }

  .site-nav a[aria-current="page"],
  .site-nav a.is-active {
    background: rgba(36, 115, 244, 0.04);
    box-shadow: inset 2px 0 0 rgba(36, 115, 244, 0.44);
  }

  .site-nav .nav-item-contact a {
    font-weight: 650;
    color: rgba(11, 18, 32, 0.96);
  }

  .site-nav-social {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(var(--container), calc(100% - 2 * var(--space-6)));
    justify-content: flex-end;
    margin: 0.56rem auto 0;
    padding-top: 0;
    border-top: 0;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 150ms ease-out, transform 150ms ease-out;
  }

  #nav-toggle:checked ~ .site-nav .site-nav-social {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 140ms;
  }

  .site-nav .site-nav-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    padding: 0;
    line-height: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(11, 18, 32, 0.58);
    opacity: 0.62;
    transition: opacity 140ms ease-out;
    text-decoration: none;
  }

  .site-nav .site-nav-social a:hover,
  .site-nav .site-nav-social a:active {
    opacity: 1;
    background: transparent;
  }

  .site-nav .site-nav-social a:focus-visible {
    opacity: 1;
    outline: 2px solid rgba(11, 18, 32, 0.35);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  .site-nav .site-nav-social svg {
    display: block;
    width: 20px;
    height: 20px;
    max-width: none;
    fill: currentColor;
    flex: 0 0 auto;
  }

  body:has(.nav-toggle-input:checked) main,
  body:has(.nav-toggle-input:checked) .site-footer {
    filter: blur(4px) saturate(0.96);
    opacity: 0.65;
    pointer-events: none;
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-nav {
      background: rgba(248, 251, 255, 0.94);
    }
  }

  /* Extra bottom space helps #contact anchor align under sticky header on short mobile viewports */
  .site-footer {
    padding-bottom: calc(var(--space-16) + env(safe-area-inset-bottom));
  }
}

/* =========================
   Desktop menu behavior
========================= */
@media (min-width: 48rem) {
  .site-header__inner {
    gap: var(--space-6);
  }

  .site-nav {
    margin-left: auto;
  }

  .site-nav ul {
    gap: var(--space-6);
  }

  .site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.56rem 0;
    border-radius: 0;
    color: rgb(255, 255, 255);
    background: transparent;
    border-bottom: 2px solid transparent;
    line-height: 1.2;
    opacity: 0.9;
    transition: opacity 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
  }

  .site-nav a:hover {
    text-decoration: none;
    background: transparent;
    opacity: 1;
    border-bottom-color: rgba(255, 255, 255, 0.75);
  }

  .site-nav a[aria-current="page"],
  .site-nav a.is-active {
    opacity: 1;
    border-bottom-color: rgba(255, 255, 255, 0.8);
  }

  .site-nav a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
    border-bottom-color: rgba(255, 255, 255, 0.75);
  }

  .site-nav .nav-item-contact {
    display: none;
  }

  .brand__logo--desktop {
    display: block;
  }

  .brand__logo--mobile,
  .brand__name {
    display: none;
  }

  .project-grid .card {
    transition: background 180ms ease-out, box-shadow 180ms ease-out, border-color 180ms ease-out;
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
    border: 1px solid rgba(11, 18, 32, 0.06);
  }

  .project-grid .card:hover,
  .project-grid .card:focus-within {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(11, 18, 32, 0.1);
    box-shadow: 0 8px 20px rgba(11, 18, 32, 0.07);
  }

  .approach-grid h3 {
    font-size: 1.34rem;
  }

  .careers .container {
    text-align: left;
  }

  .careers p {
    line-height: 1.58;
    max-width: 64ch;
  }
}

@media (min-width: 48rem) and (prefers-reduced-motion: reduce) {
  .project-grid .card {
    transition: none;
  }
}
