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

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(100%, calc(var(--content) + (2 * var(--gutter))));
  min-height: 130px;
  padding-block: 8px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  display: block;
  width: 114px;
  height: 114px;
  object-fit: contain;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.5vw, 32px);
}

.primary-nav a,
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 180ms ease;
}

.primary-nav a:hover,
.site-footer a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: transparent;
}

.menu-toggle > span:not(.visually-hidden) {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: var(--text);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button--secondary {
  border-color: var(--border-3);
  background: transparent;
  color: var(--text);
}

.button--outline {
  border-color: var(--accent);
  color: var(--accent);
}

.button--small {
  min-height: 44px;
  padding: 10px 22px;
  font-size: 15px;
}

.header-actions {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.lang-dd {
  position: relative;
  flex: none;
}

.lang-dd__trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 180ms ease;
}

.lang-dd__trigger:hover,
.lang-dd__trigger[aria-expanded="true"] {
  border-color: #2a5c55;
  color: var(--text-muted);
}

.lang-dd__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-dd__current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.lang-dd__flag {
  display: block;
  width: 20px;
  height: 14px;
  flex: none;
  border-radius: 3px;
}

.lang-dd__chevron {
  transition: transform 180ms ease;
}

.lang-dd__trigger[aria-expanded="true"] .lang-dd__chevron {
  transform: rotate(180deg);
}

.lang-dd__menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 24px));
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border-2);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: lang-dd-in 180ms ease both;
}

.lang-dd__menu[hidden] {
  display: none;
}

@keyframes lang-dd-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.lang-dd__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: left;
}

.lang-dd__option:hover,
.lang-dd__option:focus-visible {
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

.lang-dd__option[aria-selected="true"] {
  background: var(--accent-bg);
  color: var(--accent);
}

.lang-dd__name {
  flex: 1;
}

.lang-dd__code {
  color: var(--text-faint);
  font-size: 11px;
}

.lang-dd__option[aria-selected="true"] .lang-dd__code {
  color: #2a9c8a;
}

@media (prefers-reduced-motion: reduce) {
  .lang-dd__menu,
  .lang-dd__chevron {
    animation: none;
    transition: none;
  }
}

.header-cta,
.header-back {
  flex: none;
}

.card-grid {
  display: grid;
  margin-top: 48px;
  gap: 20px;
}

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

.card-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: transform 300ms ease, border-color 300ms ease, background-color 300ms ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  background: var(--surface-hover);
}

.message {
  width: fit-content;
  max-width: 90%;
  padding: 12px 16px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.45;
}

.message--left {
  border-radius: 16px 16px 16px 4px;
}

.message--right {
  margin-left: auto;
  border-color: var(--accent-border);
  border-radius: 16px 16px 4px 16px;
  background: var(--accent-bg);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer .container {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer p,
.site-footer nav {
  color: var(--text-dim);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  gap: 24px;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.76);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 600px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border-2);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-dialog h2 {
  margin-bottom: 28px;
  font-size: 32px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 24px;
}

.contact-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-input);
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.contact-form textarea {
  min-height: 112px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}

.contact-form .consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.consent a {
  color: var(--accent);
}

.honeypot {
  position: absolute;
  left: -10000px;
}

.form-submit {
  width: 100%;
}

.form-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.form-status {
  min-height: 24px;
  color: #ff8a75;
  font-size: 14px;
}

.success-panel {
  padding-block: 24px 8px;
  text-align: center;
}

.success-panel[hidden] {
  display: none;
}

.success-panel p {
  margin: 0 auto 28px;
}

.success-check {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 28px;
}

@media (max-width: 820px) {
  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding-inline: 12px;
  }

  .brand {
    flex: 0 0 auto;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
  }

  .brand > span,
  .lang-dd,
  .menu-toggle,
  .header-back {
    flex-shrink: 0;
  }

  .lang-dd__trigger {
    min-height: 40px;
    gap: 4px;
    padding: 2px 8px 2px 2px;
  }

  .lang-dd__current {
    gap: 6px;
    padding: 6px 8px;
  }

  .lang-dd__flag {
    width: 18px;
    height: 12px;
  }

  /*
    The traced ball sits in the middle of the file. On a 114px box the
    dots start about 39px in from every side, so the word looked much
    farther from the logo than from the language switcher. The negative
    margin drops that empty area out of the row; overflow clips it.
  */
  .brand img {
    width: 114px;
    height: 114px;
    flex: none;
    max-width: none;
    min-width: 0;
    aspect-ratio: auto;
    margin-top: -34px;
    margin-right: -38px;
    margin-bottom: -34px;
    margin-left: -38px;
  }

  .header-back {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 14px;
  }

  .header-actions {
    flex: 1 1 auto;
    margin-left: 0;
    gap: 6px;
    min-width: 0;
  }

  .menu-toggle,
  .header-back {
    margin-left: auto;
  }

  .menu-toggle {
    display: block;
    flex: none;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: var(--gutter);
    left: var(--gutter);
    display: none;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    flex-direction: column;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    min-height: 44px;
    padding: 10px 12px;
  }

  .header-cta {
    display: none;
  }
}

@media (max-width: 420px) {
  .lang-dd__current {
    padding: 6px 7px;
  }
}


@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .site-footer .container {
    align-items: flex-start;
    padding-block: 24px;
    flex-direction: column;
  }
}
