:root {
  --bg: #f7f8f7;
  --paper: #ffffff;
  --text: #162426;
  --muted: #5f6b6d;
  --teal: #008783;
  --teal-dark: #005e60;
  --deep: #062c31;
  --border: #dce4e3;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

img {
  max-width: 100%;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  width: 235px;
  height: auto;
  display: block;
}

.menu-toggle {
  display: none;
}

.header-tools {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: clamp(10px, 1.25vw, 20px);
  margin-right: auto;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: clamp(0.76rem, 0.86vw, 0.92rem);
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--teal);
}

.language-toggle {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 10px 14px;
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal-dark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.language-toggle:hover {
  background: var(--teal);
  color: white;
}

.header-contact-button {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: white;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-contact-button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.language-toggle:focus-visible,
.nav a:focus-visible,
.header-contact-button:focus-visible,
.button:focus-visible,
.institutional-card a:focus-visible,
.map-button:focus-visible,
.contact-list a:focus-visible {
  outline: 3px solid #42d3cc;
  outline-offset: 3px;
}

.hero {
  color: white;
  background:
    linear-gradient(90deg, rgba(3,38,43,0.96), rgba(3,38,43,0.72), rgba(3,38,43,0.2)),
    url("escritorio-gabinete.jpg") center/cover;
  padding: 92px 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero .eyebrow {
  color: #42d3cc;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-weight: 500;
}

h1 {
  font-size: clamp(2.65rem, 5.4vw, 5rem);
  line-height: 1.03;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.12;
  margin-bottom: 24px;
}

h3 {
  font-size: 1.28rem;
  margin-bottom: 12px;
}

.lead {
  max-width: 720px;
  color: #edf5f4;
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-block;
  padding: 14px 24px;
  border: 1px solid var(--teal);
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.88rem;
}

.button.primary {
  background: var(--teal);
  color: white;
}

.button.secondary {
  color: white;
  border-color: rgba(255,255,255,0.65);
}

.hero-panel {
  display: flex;
  justify-content: flex-end;
}

.hero-panel img {
  width: min(460px, 100%);
  height: 560px;
  object-fit: cover;
  object-position: center top;
  display: block;
  box-shadow: 0 24px 70px rgba(0,0,0,0.32);
}

.quick-contacts {
  background: white;
  border-bottom: 1px solid var(--border);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.45fr 0.85fr 1fr 0.7fr;
  gap: 22px;
  padding: 24px 0;
}

.quick-grid div {
  border-right: 1px solid var(--border);
  padding-right: 18px;
}

.quick-grid div:last-child {
  border-right: 0;
}

.quick-grid strong {
  display: block;
  color: var(--teal-dark);
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.quick-grid span,
.quick-grid a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.section {
  padding: 86px 0;
}

.muted {
  background: #eef4f3;
}

.split,
.profile-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 58px;
  align-items: center;
}

.text-block {
  font-size: 1.04rem;
  color: var(--muted);
}

.values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.values span {
  border: 1px solid var(--border);
  background: white;
  padding: 9px 14px;
  color: var(--teal-dark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

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

.section-lead {
  color: var(--muted);
  font-size: 1.04rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 30px;
  min-height: 210px;
  box-shadow: 0 12px 35px rgba(0,70,72,0.05);
}

.card h3 {
  color: var(--teal-dark);
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

.portrait-card {
  background: white;
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: 0 20px 55px rgba(0,70,72,0.08);
}

.portrait-card img {
  width: 100%;
  height: 580px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.gallery figure {
  margin: 0;
  background: white;
  border: 1px solid var(--border);
}

.gallery figure:last-child {
  grid-column: 1 / -1;
  width: calc(50% - 9px);
  justify-self: center;
}

.gallery img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.gallery figcaption {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.95rem;
  font-family: Arial, Helvetica, sans-serif;
}

.contact-section {
  background: var(--deep);
  color: white;
}

.contact-section h2 {
  color: white;
}

.contact-address {
  font-size: 1.05rem;
  color: #e6f0ef;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin: 26px 0;
}

.contact-list a,
.contact-list span {
  color: white;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.16);
  padding-bottom: 8px;
}

.contact-list a:hover {
  color: #42d3cc;
}

.small {
  color: #c7d8d7;
  font-size: 0.92rem;
}

.contact-qr {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 30px;
  text-align: center;
}

.contact-qr .eyebrow {
  margin-bottom: 8px;
}

.contact-qr h3 {
  color: var(--teal-dark);
  font-size: 1.7rem;
}

.contact-qr img {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin: 22px auto;
  image-rendering: pixelated;
}

.contact-qr p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-map {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.55fr 0.45fr;
  min-height: 360px;
  margin-top: 18px;
  background: white;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.28);
}

.contact-map iframe {
  width: 100%;
  min-height: 360px;
  height: 100%;
  border: 0;
  display: block;
}

.map-details {
  padding: 38px;
  align-self: center;
}

.map-details h3 {
  color: var(--teal-dark);
  font-size: 1.65rem;
}

.map-details p:not(.eyebrow) {
  color: var(--muted);
}

.map-button {
  display: inline-block;
  margin-top: 12px;
  padding: 13px 18px;
  background: var(--teal);
  color: white;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-button:hover {
  background: var(--teal-dark);
}

.footer {
  background: #032126;
  color: #d5e4e3;
  padding: 26px 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.credentials-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: start;
}

.credentials-card,
.languages-card {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 34px;
  box-shadow: 0 14px 38px rgba(0,70,72,0.05);
}

.credentials-card h3,
.languages-card h3 {
  color: var(--teal-dark);
  font-size: 1.55rem;
}

.credentials-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.credentials-list li {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.credentials-list li:last-child {
  border-bottom: 0;
}

.credentials-list span {
  color: var(--teal-dark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.languages-card {
  margin-top: 24px;
}

.languages-card p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 1160px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .header-tools {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .header-tools {
    width: 100%;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .hero-grid,
  .split,
  .profile-grid,
  .contact-grid,
  .cards,
  .gallery,
  .quick-grid,
  .credentials-grid,
  .contact-map {
    grid-template-columns: 1fr;
  }

  .quick-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
  }

  .quick-grid div:last-child {
    border-bottom: 0;
  }

  .hero {
    padding: 72px 0;
  }

  .hero-panel {
    justify-content: flex-start;
  }

  .hero-panel img,
  .portrait-card img,
  .gallery img {
    height: auto;
  }

  .gallery figure:last-child {
    width: 100%;
  }

  .logo {
    width: 230px;
  }

  .credentials-list li {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: sticky;
  }

  .header-inner {
    min-height: 66px;
    padding: 4px 0;
    flex-direction: row;
    align-items: center;
    position: relative;
  }

  .brand {
    display: block;
    width: 218px;
    height: 58px;
    overflow: hidden;
  }

  .logo {
    width: 218px;
    max-width: none;
    transform: translateY(-151px);
  }

  .menu-toggle {
    width: 46px;
    height: 42px;
    margin-left: auto;
    padding: 9px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    border: 1px solid var(--teal);
    background: white;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--teal-dark);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .site-header.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .header-tools {
    display: none;
    position: absolute;
    top: 100%;
    left: -4.35%;
    right: -4.35%;
    width: auto;
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    padding: 18px 4.35% 22px;
    background: white;
    border-top: 1px solid var(--border);
    box-shadow: 0 16px 28px rgba(6, 44, 49, 0.14);
    align-items: stretch;
    flex-direction: column;
  }

  .site-header.menu-open .header-tools {
    display: flex;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin-right: 0;
  }

  .nav a {
    font-size: 0.78rem;
  }

  .header-contact-button,
  .language-toggle {
    align-self: flex-start;
  }

  .hero {
    padding-top: 58px;
  }
}


.institutional-section {
  background: #ffffff;
}

.institutional-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 34px;
}

.institutional-card {
  border: 1px solid var(--border);
  background: #f8fbfb;
  padding: 34px;
  box-shadow: 0 16px 40px rgba(0,70,72,0.06);
}

.institutional-label {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--teal);
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.institutional-card h3 {
  color: var(--teal-dark);
  font-size: 1.55rem;
  line-height: 1.2;
}

.institutional-card p {
  color: var(--muted);
}

.institutional-card a {
  display: inline-block;
  margin-top: 16px;
  color: var(--teal-dark);
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  border-bottom: 1px solid var(--teal);
}

.institutional-card a:hover {
  color: var(--teal);
}

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


/* FIX CONTACT SECTION OVERFLOW */
.quick-grid {
  overflow: hidden;
}

.quick-grid div {
  overflow: hidden;
}

.cards {
  clear: both;
}

/* force layout separation */
.section {
  display: block;
  clear: both;
}
