:root {
  --navy: #0e2233;
  --navy-dark: #081722;
  --teal: #1f8a8c;
  --teal-light: #4fb3ac;
  --teal-text: #146e70;
  --sand: #f4f1ea;
  --ink: #1b1f23;
  --ink-strong: #3a4149;
  --muted: #5b6570;
  --border: #e6e2d8;
  --teal-tint: rgba(31, 138, 140, 0.1);
  --max-width: 1080px;
  --max-width-wide: 1280px;
  --max-width-narrow: 720px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@font-face {
  font-family: "Roboto Bold Custom";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/roboto-bold-latin.woff2") format("woff2");
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.7;
}

strong, b {
  color: var(--ink-strong);
}

h1, h2, h3 {
  font-family: "Roboto Bold Custom", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.5em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }

a { color: var(--teal-text); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-narrow { max-width: var(--max-width-narrow); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 52px; width: auto; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--ink);
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--navy);
  display: block;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 1.2rem;
  line-height: 1;
  margin-left: 1.5rem;
}
.lang-current {
  opacity: 1;
}
.lang-link {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.lang-link:hover,
.lang-link:focus-visible {
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--teal);
  color: #fff;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
}

/* Hero */
.hero {
  background-color: var(--navy-dark);
  color: #fff;
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-bg,
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 23, 34, 0.55) 0%, rgba(8, 23, 34, 0.75) 100%);
}
.hero .wrap {
  position: relative;
  z-index: 2;
}
.hero h1 {
  color: #fff;
  max-width: 18em;
  margin: 0 auto 0.7em;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.6);
}
.hero .lead {
  font-size: 1.2rem;
  color: #cfe0e3;
  max-width: 34rem;
  margin: 0 auto 1.5rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hero-proof {
  font-size: 0.9rem;
  color: #b9ccd0;
  max-width: 38rem;
  margin: 1.1rem auto 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.6);
}

@media (max-width: 640px) {
  .hero { padding: 4rem 0; }
  .hero .wrap { padding: 0 1rem; }
  .hero h1 { font-size: 1.9rem; }
  .hero .lead { font-size: 1.05rem; margin-bottom: 1.25rem; }
  .hero-proof { margin-top: 0.9rem; }
}

.btn {
  display: inline-block;
  background: var(--teal-text);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover {
  background: var(--teal-light);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--teal-text);
  box-shadow: inset 0 0 0 1px var(--teal-text);
}
.btn-outline:hover {
  background: var(--teal-tint);
  color: var(--teal-text);
}

/* Services */
.services { padding: 5rem 0; background: var(--sand); }
.services .wrap { max-width: var(--max-width-wide); }
.services-group-title {
  font-size: 1.4rem;
  margin: 2rem 0 0;
}
.services-intro {
  margin: 1rem 0 0;
  color: var(--muted);
}
.services-intro p { margin: 0 0 0.75rem; }
.services-intro p:last-child { margin-bottom: 0; }
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-top: 2rem;
}
@media (min-width: 560px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}
.card,
.project-card {
  background: #fff;
  padding: 1.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.card h3,
.card h4 {
  font-size: 1.15rem;
  text-align: center;
  line-height: 1.3;
  min-height: calc(1.3em * 2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card p { color: var(--muted); margin: 0; }
.card-situation,
.card-description { text-align: justify; }
.card-situation { margin-bottom: 0.75rem; }
.card-situation strong { color: var(--ink-strong); }
.leadership-block { margin-top: 3.5rem; }
.leadership-heading {
  font-size: 1.4rem;
  margin: 0 0 1rem;
}
.leadership-card { text-align: left; }
.leadership-card .card-icon { margin: 0 auto 1.25rem; }
.leadership-card .card-description p { margin: 0 0 0.75rem; }
.leadership-card .card-description p:last-child { margin-bottom: 0; }
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal);
}

/* Projects */
.projects { padding: 5rem 0; }
.project-list { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.project-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.project-card-header h3 { margin: 0; }
.project-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-text);
}
.project-card p { color: var(--muted); margin: 0; }
.project-description p:not(:last-child) { margin-bottom: 0.75rem; }
.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 1rem 0 0;
}
.project-tags li {
  font-size: 0.8rem;
  color: var(--teal-text);
  background: var(--teal-tint);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}
.project-card > .link-more { display: inline-block; margin-top: 1rem; }
.projects .wrap { position: relative; }
.projects-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.project-list .project-card:nth-child(n+4) { display: none; }
.project-list:has(~ .projects-toggle-input:checked) .project-card:nth-child(n+4) { display: block; }
.projects-toggle-label {
  display: block;
  width: fit-content;
  margin: 2rem auto 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-text);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--teal-text);
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
}
.projects-toggle-label:hover { background: var(--teal-tint); }
.projects-toggle-label .label-less { display: none; }
.projects-toggle-input:checked ~ .projects-toggle-label .label-more { display: none; }
.projects-toggle-input:checked ~ .projects-toggle-label .label-less { display: inline; }
.project-quote {
  margin: 1.25rem 0 0;
  padding: 0.9rem 0 0.9rem 1.1rem;
  border-left: 3px solid var(--teal);
}
.project-quote p {
  margin: 0;
  font-style: italic;
  color: var(--muted);
}
.project-quote footer {
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

/* About */
.about { padding: 2.5rem 0 5rem; }
.about-body { display: flex; gap: 2.5rem; align-items: flex-start; }
.about-content { max-width: 42rem; color: var(--muted); }
.profile-photo { flex-shrink: 0; order: 1; }
.profile-photo img {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
}
@media (min-width: 768px) {
  .profile-photo img { width: 200px; height: 200px; }
}
@media (max-width: 640px) {
  .about-body { flex-direction: column; align-items: center; text-align: center; }
  .profile-photo { order: 0; margin-top: 1.5rem; }
  .about-content { order: 1; }
}

/* Blog teaser & list */
.blog-teaser { padding: 5rem 0; background: var(--sand); }
.blog-list { padding: 4rem 0; }
.post-list { list-style: none; padding: 0; margin: 2rem 0; }
.post-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list a.post-list-title { display: block; font-size: 1.1rem; font-weight: 600; color: var(--navy); }
.blog-list .post-list li {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}
.post-list-thumb { flex: 0 0 auto; line-height: 0; }
.post-list-body { min-width: 0; }
.post-list-meta { display: flex; flex-wrap: wrap; align-items: center; row-gap: 0.35rem; margin: 0.5rem 0 1rem; }
.post-list p { color: var(--muted); margin: 0.4rem 0 0; }
.link-more { font-weight: 600; }
.post-teaser {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.post-teaser:hover { text-decoration: none; }
.post-thumb {
  flex: 0 0 auto;
  line-height: 0;
}
.post-thumb img {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.post-thumb--fallback {
  width: 160px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.post-thumb--fallback img {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  opacity: 0.55;
}
.post-teaser-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
}
.post-teaser:hover .post-teaser-title { text-decoration: underline; }
@media (max-width: 640px) {
  .post-teaser { gap: 1rem; }
  .post-thumb img { width: 100px; height: 62px; }
  .post-thumb--fallback { width: 100px; height: 62px; }
  .post-thumb--fallback img { width: 30px; height: 30px; }
  .blog-teaser .post-list time { display: block; margin-top: 0.25rem; }
  .blog-list .post-list li { gap: 1rem; }
}

/* Post */
.post { padding: 4rem 0; }
.post-header time,
.post-list-meta time,
.post-teaser time { color: var(--muted); font-size: 0.9rem; }
.post-author-line { display: inline-flex; align-items: center; gap: 0.5rem; vertical-align: middle; }
.author-avatar img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.post-header .post-author,
.post-list-meta .post-author { color: var(--muted); font-size: 0.9rem; }
.post-meta-line { display: inline; }
.post-header .reading-time,
.post-list-meta .reading-time { color: var(--muted); font-size: 0.9rem; margin-left: 0.5rem; }
.post-header .reading-time::before,
.post-list-meta .reading-time::before { content: "\00b7"; margin-right: 0.5rem; }
.post-header.has-meta time,
.post-list-meta time { margin-left: 0.5rem; }
.post-header.has-meta time::before,
.post-list-meta time::before { content: "\00b7"; margin-right: 0.5rem; }
@media (max-width: 640px) {
  .post-header.has-meta { display: flex; flex-wrap: wrap; }
  .post-header.has-meta h1 { flex-basis: 100%; text-align: center; }
  .post-header.has-meta .post-author-line { flex-basis: 100%; justify-content: center; }
  .post-header.has-meta .post-meta-line { flex-basis: 100%; margin-top: 0.25rem; text-align: center; }
  .post-header.has-meta .reading-time { margin-left: 0; }
  .post-header.has-meta .reading-time::before { content: none; }
  .post-header.has-meta time { margin-left: 0; }
  .post-header.has-meta time::before { content: "\00b7"; margin-right: 0.5rem; }
  .post-list-meta .post-meta-line { display: block; flex-basis: 100%; margin-top: 0.25rem; }
  .post-list-meta .reading-time { margin-left: 0; }
  .post-list-meta .reading-time::before { content: none; }
  .post-list-meta time { margin-left: 0; }
  .post-list-meta time::before { content: "\00b7"; margin-right: 0.5rem; }
}
.more-to-read { margin: 3rem 0 0; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.more-to-read h2 { font-size: 1.3rem; margin: 0 0 0.5rem; }
.post-cta { text-align: center; margin: 2.5rem 0 0; }
.post-tip,
.post-warning {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border: 1px solid;
}
.post-tip p,
.post-warning p { margin: 0; }
.post-tip {
  background: #eaf3fb;
  border-color: #bcd9f0;
  border-left: 4px solid var(--teal);
}
.post-content .post-tip code { background: #d3e6f5; }
.post-warning {
  background: #fbeee0;
  border-color: #f0cfa8;
  border-left: 4px solid #d9822b;
}
.post-content .post-warning code { background: #f5ddba; }
.about-cabestan {
  max-width: 42rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.about-cabestan h3 { margin-bottom: 1rem; }
.about-cabestan-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--muted);
}
.about-cabestan-image {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 6px;
}
@media (max-width: 480px) {
  .about-cabestan-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .about-cabestan-image { margin-top: 1.5rem; }
}
.code-block {
  margin: 1.5rem 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--navy-dark);
  border: 1px solid #4a5259;
  box-shadow: 0 2px 8px rgba(74, 82, 89, 0.35);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  background: var(--sand);
  border-bottom: 1px solid rgba(27, 31, 35, 0.1);
}
.code-block-lang {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-strong);
}
.code-block-copy {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--ink-strong);
  background: transparent;
  border: 1px solid rgba(27, 31, 35, 0.2);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.code-block-copy:hover { background: rgba(27, 31, 35, 0.06); }
.code-block-copy.copied {
  color: var(--navy-dark);
  background: var(--teal-light);
  border-color: var(--teal-light);
}
.post-content pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  margin: 0;
  background: var(--navy-dark);
  -webkit-overflow-scrolling: touch;
}
.post-content pre code {
  padding: 0;
  background: none;
  color: #f4f1ea;
}
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--sand);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.post-content { margin-top: 2rem; }
.post-content img { max-width: 100%; height: auto; display: block; margin: 1.5rem auto; border-radius: 6px; }
.post-content figure { margin: 1.5rem 0; }
.post-content figure img { margin-bottom: 0.5rem; }
.post-content figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.post-content h2 { margin-top: 2rem; }
.post-content .heading-anchor-target { scroll-margin-top: 1.5rem; }
.post-content .heading-anchor {
  margin-left: 0.5rem;
  opacity: 0;
  text-decoration: none;
  color: var(--teal-text);
  font-weight: 400;
  transition: opacity 0.15s ease;
}
.post-content .heading-anchor-target:hover .heading-anchor,
.post-content .heading-anchor:focus {
  opacity: 1;
}
.post-content p { margin: 1em 0; }
.post-content a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.2em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f8a8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: middle;
}

/* Contact */
.contact {
  padding: 5rem 0;
  text-align: center;
}
.contact p { color: var(--muted); max-width: 32rem; margin: 0 auto 2rem; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--teal);
  vertical-align: middle;
}
.social-link:hover { color: var(--teal-light); }
.social-link--logo {
  width: auto;
  height: 2.5rem;
  border-radius: 0;
  padding: 0 0.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.site-footer p { margin: 0.25rem 0; }

/* Responsive nav */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .main-nav ul.open { display: flex; }
  .lang-switch { margin-left: auto; margin-right: 0.5rem; }
}
