:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #eef2f0;
  --text: #17201d;
  --muted: #64706b;
  --line: #dbe2df;
  --accent: #0b766c;
  --accent-soft: #dcefeb;
  --dark: #14201c;
  --max: 1180px;
  --radius: 18px;
  --shadow: 0 18px 55px rgba(23, 32, 29, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.container { width: min(calc(100% - 44px), var(--max)); margin: 0 auto; }
.section { padding: 104px 0; }
.section-muted { background: var(--surface-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skip-link { position: fixed; top: -80px; left: 14px; z-index: 200; background: var(--dark); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 14px; }

.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(219,226,223,.9); background: rgba(245,247,246,.92); backdrop-filter: blur(14px); }
.header-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--dark); color: #fff; font-size: 12px; font-weight: 850; letter-spacing: -.02em; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 13px; }
.brand-copy small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .11em; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { color: #43504b; font-size: 12px; font-weight: 720; text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav .nav-cta { padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.menu-toggle { display: none; background: transparent; border: 0; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--text); }

.hero { padding: 120px 0 108px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(315px, .66fr); gap: 78px; align-items: center; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .17em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 28px; max-width: 850px; font-size: clamp(48px, 6.4vw, 82px); line-height: .99; letter-spacing: -.055em; font-weight: 760; }
h1 span, h2 span { color: var(--accent); }
.hero-lead { max-width: 760px; color: var(--muted); font-size: 18px; line-height: 1.72; margin-bottom: 32px; }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 780; text-decoration: none; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--dark); color: #fff; box-shadow: 0 10px 25px rgba(23,32,29,.12); }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.button-secondary:hover { border-color: #bcc8c3; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }
.hero-pills span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.68); color: #5b6762; font-size: 10px; font-weight: 720; }

.hero-card { padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.hero-card-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.hero-card-head span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.hero-card-head strong { color: var(--accent); font-size: 12px; }
.profile-facts { margin: 0; }
.profile-facts div { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.profile-facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.profile-facts dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.profile-facts dd { margin: 0; font-size: 13px; font-weight: 690; line-height: 1.45; }

.section-heading { margin-bottom: 48px; }
.split-heading { display: grid; grid-template-columns: 1.12fr .88fr; align-items: end; gap: 70px; }
.single-heading { display: block; }
.section-heading h2, .contact-section h2 { margin-bottom: 0; max-width: 780px; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -.045em; }
.split-heading > p { margin: 0 0 4px; max-width: 510px; justify-self: end; color: var(--muted); font-size: 14px; line-height: 1.75; }

.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.focus-grid article { min-height: 205px; padding: 28px; }
.focus-grid article:nth-child(2), .focus-grid article:nth-child(3), .focus-grid article:nth-child(5), .focus-grid article:nth-child(6) { border-left: 1px solid var(--line); }
.focus-grid article:nth-child(n+4) { border-top: 1px solid var(--line); }
.focus-grid article > span { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .13em; }
.focus-grid h3 { margin: 34px 0 10px; font-size: 18px; letter-spacing: -.025em; }
.focus-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.68; }

.project-catalog { border-top: 1px solid var(--line); }
.project-item { display: grid; grid-template-columns: 70px 1fr; gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.project-item.featured { margin: 0 -24px; padding: 30px 24px; border: 1px solid #cbdcd7; border-radius: 16px; background: #eef8f5; box-shadow: 0 12px 30px rgba(11,118,108,.06); }
.project-item.featured + .project-item { border-top: 0; }
.project-index { color: #9aa5a0; font-size: 11px; font-weight: 850; letter-spacing: .08em; padding-top: 4px; }
.project-meta { margin-bottom: 9px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.project-content h3 { margin-bottom: 10px; font-size: 22px; line-height: 1.18; letter-spacing: -.03em; }
.project-content p { max-width: 860px; margin-bottom: 14px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.tech-line { color: #4b5954; font-size: 11px; font-weight: 700; line-height: 1.65; }
.tech-label { color: var(--text); font-size: 9.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.project-actions { margin-top: 14px; }
.project-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 10.5px; font-weight: 800; text-decoration: none; transition: transform .18s ease, border-color .18s ease, color .18s ease; }
.project-link:hover { transform: translateY(-1px); border-color: #aebdb7; color: var(--accent); }

.timeline { border-top: 1px solid var(--line); }
.timeline-item { display: grid; grid-template-columns: 185px 1fr; gap: 44px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.timeline-date { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; padding-top: 5px; }
.timeline-content h3 { display: inline; margin-right: 10px; font-size: 20px; letter-spacing: -.025em; }
.timeline-content > span { color: var(--accent); font-size: 11px; font-weight: 760; }
.timeline-content p { max-width: 850px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stack-grid article { min-height: 178px; padding: 28px; }
.stack-grid article:nth-child(2), .stack-grid article:nth-child(3), .stack-grid article:nth-child(5), .stack-grid article:nth-child(6) { border-left: 1px solid var(--line); }
.stack-grid article:nth-child(n+4) { border-top: 1px solid var(--line); }
.stack-grid h3 { margin-bottom: 15px; font-size: 17px; letter-spacing: -.02em; }
.stack-grid p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.85; }

.education-list { border-top: 1px solid var(--line); }
.education-list article { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.education-list span { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.education-list h3 { margin: 6px 0 0; font-size: 18px; letter-spacing: -.02em; }
.education-list strong { color: var(--muted); font-size: 12px; text-align: right; }

.contact-section { padding: 94px 0; background: var(--surface); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 80px; align-items: end; }
.contact-copy p { color: var(--muted); font-size: 14px; line-height: 1.75; margin-bottom: 22px; }

.site-footer { padding: 29px 0; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.footer-inner > div { display: grid; gap: 7px; }
.footer-inner strong { font-size: 13px; }
.footer-inner span { color: var(--muted); font-size: 10px; }
.footer-right { text-align: right; row-gap: 7px !important; }
.footer-right span, .footer-right a { display: block; }
.footer-right a { color: var(--text); font-size: 10px; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.footer-right a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 980px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-card { max-width: 680px; }
  .split-heading { grid-template-columns: 1fr; gap: 22px; }
  .split-heading > p { justify-self: start; }
  .focus-grid, .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .focus-grid article:nth-child(3), .focus-grid article:nth-child(5), .stack-grid article:nth-child(3), .stack-grid article:nth-child(5) { border-left: 0; }
  .focus-grid article:nth-child(even), .stack-grid article:nth-child(even) { border-left: 1px solid var(--line); }
  .focus-grid article:nth-child(n+3), .stack-grid article:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .section { padding: 74px 0; }
  .header-inner { height: 68px; }
  .brand-copy small { display: none; }
  .menu-toggle { display: block; }
  .nav { position: absolute; top: 68px; left: 14px; right: 14px; display: none; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .nav.is-open { display: grid; gap: 3px; }
  .nav a { padding: 11px 10px; border-radius: 8px; }
  .hero { padding: 82px 0 76px; }
  h1 { font-size: clamp(43px, 13vw, 64px); }
  .hero-lead { font-size: 16px; }
  .focus-grid, .stack-grid { grid-template-columns: 1fr; }
  .focus-grid article, .stack-grid article { border-left: 0 !important; }
  .focus-grid article:nth-child(n+2), .stack-grid article:nth-child(n+2) { border-top: 1px solid var(--line); }
  .project-item { grid-template-columns: 42px 1fr; gap: 10px; padding: 25px 0; }
  .project-item.featured { margin: 0 -10px; padding: 25px 10px; }
  .project-content h3 { font-size: 19px; }
  .timeline-item { grid-template-columns: 1fr; gap: 11px; }
  .timeline-date { padding-top: 0; }
  .timeline-content h3 { display: block; margin: 0 0 6px; }
  .education-list article { grid-template-columns: 1fr; gap: 10px; }
  .education-list strong { text-align: left; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-right { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

/* Language selector + profile photo + accessibility polish */
.lang-switch { display:flex; align-items:center; gap:4px; padding:3px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.72); }
.lang-switch a { min-width:34px; padding:7px 8px; border-radius:7px; color:var(--muted); text-align:center; font-size:10px; font-weight:850; letter-spacing:.04em; }
.lang-switch a[aria-current="page"] { background:var(--dark); color:#fff; }
.profile-top { display:flex; align-items:center; gap:18px; padding-bottom:22px; border-bottom:1px solid var(--line); }
.profile-photo { width:92px; height:92px; flex:0 0 92px; object-fit:cover; object-position:center 30%; border-radius:18px; border:1px solid var(--line); }
.hero-card-head { flex:1; padding-bottom:0; border-bottom:0; }
a:focus-visible, button:focus-visible { outline:3px solid rgba(11,118,108,.35); outline-offset:3px; }
@media (max-width:760px){ .lang-switch { margin:4px 0 6px; width:max-content; } .profile-photo{width:82px;height:82px;flex-basis:82px;} }


/* v3 — stronger recruiter scan hierarchy */
.current-focus { border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:var(--surface); }
.current-focus-inner { min-height:82px; display:grid; grid-template-columns:145px 230px 1fr; align-items:center; gap:26px; }
.current-focus-inner > span { color:var(--accent); font-size:9px; font-weight:900; letter-spacing:.16em; }
.current-focus-inner > strong { font-size:15px; letter-spacing:-.015em; }
.current-focus-inner > p { margin:0; color:var(--muted); font-size:12.5px; font-weight:650; }
.featured-projects { display:grid; gap:18px; }
.project-feature-card { display:grid; grid-template-columns:58px 1fr; gap:20px; padding:30px; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:0 10px 30px rgba(23,32,29,.035); }
.project-feature-card:hover { border-color:#bfcdc8; }
.project-feature-card .project-content h3 { font-size:24px; margin-bottom:20px; }
.project-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:26px; }
.project-detail-grid > div > span, .project-result > span { display:block; margin-bottom:7px; color:var(--text); font-size:9px; font-weight:900; letter-spacing:.11em; }
.project-detail-grid p, .project-result p { margin:0; color:var(--muted); font-size:13px; line-height:1.68; }
.project-result { margin:20px 0 16px; padding:16px 18px; border-left:3px solid var(--accent); background:#f1f8f6; border-radius:0 10px 10px 0; }
.other-projects-heading { display:grid; grid-template-columns:180px 1fr; gap:30px; align-items:start; margin:58px 0 20px; padding-top:30px; border-top:1px solid var(--line); }
.other-projects-heading .eyebrow { margin:2px 0 0; }
.other-projects-heading > p:last-child { margin:0; max-width:760px; color:var(--muted); font-size:13px; line-height:1.7; }
.other-projects-grid {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:1px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--line);
}
.other-project-card {
  grid-column:span 2;
  min-width:0;
  min-height:155px;
  padding:24px;
  border:0;
  background:var(--surface);
}
.other-project-card:nth-child(4),
.other-project-card:nth-child(5) { grid-column:span 3; }
.other-project-card h3 { margin-bottom:8px; font-size:17px; letter-spacing:-.02em; }
.other-project-card p { margin-bottom:13px; color:var(--muted); font-size:12.5px; line-height:1.65; }

/* Final stack alignment: equal columns with 1px separators. */
.stack-grid-compact {
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1px;
  border:1px solid var(--line);
  background:var(--line);
}
.stack-grid-compact article {
  min-width:0;
  min-height:160px;
  border:0 !important;
  background:var(--surface);
}

@media(max-width:980px){
  .other-projects-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .other-project-card:nth-child(n) { grid-column:auto; }
  .other-project-card:last-child { grid-column:1 / -1; }
  .stack-grid-compact { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media(max-width:760px){
  .current-focus-inner { grid-template-columns:1fr; gap:7px; padding:18px 0; }
  .project-feature-card { grid-template-columns:38px 1fr; gap:10px; padding:22px 14px; }
  .project-feature-card .project-content h3 { font-size:20px; }
  .project-detail-grid { grid-template-columns:1fr; gap:16px; }
  .other-projects-heading { grid-template-columns:1fr; gap:8px; }
  .other-projects-grid, .stack-grid-compact { grid-template-columns:1fr; }
  .other-project-card:nth-child(n), .other-project-card:last-child { grid-column:auto; }
}

/* Security section — shared across PT, EN and ES */
section[id] { scroll-margin-top: 96px; }
.security-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.security-pillar { min-width:0; padding:28px; background:var(--surface); }
.security-pillar h3 { margin:12px 0; font-size:19px; }
.security-pillar p { color:var(--muted); font-size:13px; line-height:1.7; }
.security-pillar .tech-line { margin-top:18px; }
@media(max-width:1100px) and (min-width:761px) { .nav { gap:12px; } .header-inner { gap:16px; } .brand-copy small { letter-spacing:.03em; } }
@media(max-width:980px) { .security-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) { .security-grid { grid-template-columns:1fr; } .security-pillar { padding:24px; } section[id] { scroll-margin-top:84px; } }
