@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --tna-paper: #faf6ee;
  --tna-ink: #102a25;
  --tna-muted: #50615b;
  --tna-line: rgba(16, 42, 37, .14);
  --tna-green: #123b34;
  --tna-green-2: #1d5b50;
  --tna-gold: #9a7920;
  --tna-white: #fffdf8;
}

.topbar,
.site-header,
.site-footer {
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color: var(--tna-ink);
  box-sizing: border-box;
}

.topbar *,
.site-header *,
.site-footer * {
  box-sizing: border-box;
}

.topbar {
  position: relative;
  z-index: 1002;
  background: rgba(250, 246, 238, .96);
  border-bottom: 1px solid var(--tna-line);
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-copy a,
.lang-switcher a,
.site-footer a {
  color: inherit;
  text-decoration: none;
}

.topbar-copy,
.topbar-copy a,
.lang-switcher {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tna-muted);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1001;
  background: rgba(250, 246, 238, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tna-line);
}

.header-row {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--tna-ink);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand::before {
  content: "";
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  background: currentColor;
  mask: url("/algoritmo/design-system/v1/assets/isobara-symbol.svg") center / contain no-repeat;
  -webkit-mask: url("/algoritmo/design-system/v1/assets/isobara-symbol.svg") center / contain no-repeat;
}

.brand-copy strong {
  display: block;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.2vw, 31px);
  margin-left: auto;
}

.nav a,
.nav button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  border: 0;
  background: none;
  color: #2f4a42;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
}

.nav a::after,
.nav button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--tna-gold);
  transition: transform .18s ease;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav button:hover,
.nav button[aria-expanded="true"] {
  color: var(--tna-ink);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after,
.nav button:hover::after,
.nav button[aria-expanded="true"]::after {
  transform: scaleX(1);
}

.nav-group {
  position: relative;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 280px;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  padding: 10px;
  background: var(--tna-white);
  border: 1px solid var(--tna-line);
  box-shadow: 0 18px 42px rgba(16, 42, 37, .14);
  transition: opacity .16s ease, transform .16s ease;
}

.nav-group:hover .nav-menu,
.nav-group.is-open .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-menu a {
  display: block;
  min-height: auto;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--tna-ink);
  font-size: 14px;
}

.nav-menu a::after {
  display: none;
}

.nav-menu a span {
  display: block;
  color: var(--tna-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--tna-line);
  background: transparent;
  color: var(--tna-ink);
  border-radius: 6px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--tna-green);
  color: var(--tna-paper);
  padding: 56px 0 42px;
}

.footer-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.7fr);
  gap: 32px;
}

.footer-row p {
  margin: 0;
  color: rgba(250, 246, 238, .82);
  font-size: 16px;
  line-height: 1.65;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 11px 24px;
}

.footer-links a {
  color: rgba(250, 246, 238, .88);
  font-weight: 700;
}

.footer-links a:hover {
  color: #d6bd70;
}

body.has-terranava-shell .tn-nav,
body.has-terranava-shell .tn-nav-drawer,
body.has-terranava-shell .tn-footer {
  display: none !important;
}

body.has-terranava-shell .map-shell {
  top: auto;
  height: calc(100dvh - 120px);
}

@media (max-width: 1180px) {
  .header-row {
    gap: 18px;
  }
  .brand-copy strong {
    font-size: 44px;
  }
  .nav {
    gap: 16px;
  }
  .nav a,
  .nav button {
    font-size: 15px;
  }
}

@media (max-width: 1020px) {
  .topbar {
    display: none;
  }
  .header-row {
    min-height: 76px;
    flex-wrap: wrap;
    padding: 10px 0;
  }
  .nav-toggle {
    display: block;
    margin-left: auto;
  }
  .nav {
    order: 3;
    width: 100%;
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
  }
  .site-header.nav-open .nav {
    display: flex;
  }
  body.has-terranava-shell .map-shell {
    top: auto;
    height: calc(100dvh - 76px);
  }
  .nav a,
  .nav button {
    width: 100%;
    justify-content: flex-start;
    border-bottom: 1px solid var(--tna-line);
  }
  .nav-menu {
    position: static;
    display: none;
    min-width: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    margin: 0 0 8px;
  }
  .nav-group.is-open .nav-menu {
    display: block;
    transform: none;
  }
  .footer-row {
    grid-template-columns: 1fr;
  }
  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 28px, 1240px);
  }
  .brand-copy strong {
    font-size: 37px;
  }
}
