/* ==========================================================================
   Eduardo França — CV
   Bilingual content is switched purely in CSS via html[lang]; no JS needed
   for the content swap itself.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
  --bg:            #f6f4f0;
  --bg-grad:       radial-gradient(1200px 500px at 15% -10%, #ffffff 0%, rgba(255,255,255,0) 60%),
                   radial-gradient(900px 400px at 95% 0%, #eef4f8 0%, rgba(238,244,248,0) 55%);
  --surface:       #ffffff;
  --surface-2:     #fbfaf8;
  --surface-3:     #f0ede7;
  --ink:           #16191f;
  --ink-2:         #414955;
  --ink-3:         #6e7683;
  --line:          #e5e1d9;
  --line-2:        #efece6;
  --accent:        #175d8c;
  --accent-soft:   #e8f1f7;
  --accent-line:   #bcd6e6;
  --shadow-sm:     0 1px 2px rgba(20, 25, 32, .05);
  --shadow-md:     0 6px 24px -10px rgba(20, 25, 32, .22), 0 1px 2px rgba(20,25,32,.04);
  --radius:        14px;
  --radius-sm:     9px;
  --wrap:          1180px;
  --sans:          "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif:         "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --mono:          ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0d1116;
    --bg-grad:     radial-gradient(1200px 500px at 12% -10%, #17212b 0%, rgba(23,33,43,0) 60%),
                   radial-gradient(900px 400px at 95% 0%, #141b22 0%, rgba(20,27,34,0) 55%);
    --surface:     #141a21;
    --surface-2:   #19202a;
    --surface-3:   #202834;
    --ink:         #e8edf3;
    --ink-2:       #b3bdc9;
    --ink-3:       #8892a0;
    --line:        #262f3a;
    --line-2:      #1e2630;
    --accent:      #6cb6e8;
    --accent-soft: #16232e;
    --accent-line: #2c4a5f;
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md:   0 8px 28px -12px rgba(0, 0, 0, .7), 0 1px 2px rgba(0,0,0,.35);
  }
}

/* ---------- 2. Reset / base --------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.18; letter-spacing: -0.012em; }
p { margin: 0 0 0.85rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
ul { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .35em; border-radius: 5px; }
sup { font-size: .62em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- 3. Language switching (the whole feature, in CSS) ----------- */

/* Every translatable fragment is a <span lang="…">. Only the active one shows. */
span[lang="en"], span[lang="pt"] { display: none; }
html[lang="en"] span[lang="en"],
html[lang="pt"] span[lang="pt"] { display: revert; }

/* ---------- 4. Top bar --------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: var(--shadow-sm);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.18; }
.brand__text strong { font-size: .95rem; letter-spacing: -0.01em; }
.brand__text small { font-size: .74rem; color: var(--ink-3); }

.topnav {
  display: flex;
  gap: .15rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: .4rem .68rem;
  border-radius: 999px;
  font-size: .855rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.topnav a:hover { background: var(--surface-3); color: var(--ink); }
.topnav a.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---- the toggle ---- */

.langswitch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  isolation: isolate;
}

.langswitch__track {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(0);
  transition: transform .32s cubic-bezier(.34, 1.3, .5, 1);
}
html[lang="pt"] .langswitch__track { transform: translateX(0); }
html[lang="en"] .langswitch__track { transform: translateX(100%); }

.langswitch__btn {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  margin: 0;
  padding: .3rem .78rem;
  min-width: 46px;
  border-radius: 999px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .2s;
}
.langswitch__btn:hover { color: var(--ink); }
html[lang="pt"] .langswitch__btn[data-set-lang="pt"],
html[lang="en"] .langswitch__btn[data-set-lang="en"] { color: #fff; }
@media (prefers-color-scheme: dark) {
  html[lang="pt"] .langswitch__btn[data-set-lang="pt"],
  html[lang="en"] .langswitch__btn[data-set-lang="en"] { color: #0d1116; }
}

/* ---------- 5. Hero ------------------------------------------------------ */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3.25rem 1.25rem 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 2.5rem;
  align-items: start;
}

.hero__eyebrow {
  margin: 0 0 .5rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero__eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 2px;
  margin-right: .6rem;
  vertical-align: middle;
  background: currentColor;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 8vw, 4.1rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 .8rem;
}
.hero__surname { color: var(--ink-3); font-style: italic; }

.hero__role {
  max-width: 58ch;
  font-size: 1.06rem;
  color: var(--ink-2);
  margin-bottom: 1.4rem;
}

.hero__contact {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.4rem;
  margin-bottom: 1.6rem;
  font-size: .92rem;
}
.hero__contact li { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); }
.hero__contact a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.hero__contact a:hover { color: var(--accent); border-color: var(--accent); }
.ico {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .2s, border-color .2s, background-color .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--accent-line); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn--primary { color: #0d1116; }
}

.factbox {
  margin: 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.factbox > div + div {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--line);
}
.factbox dt {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .1rem;
}
.factbox dd { margin: 0; font-size: .92rem; font-weight: 500; }

/* ---------- 6. Layout ---------------------------------------------------- */

.layout {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 2.5rem;
  align-items: start;
}

.col-main, .col-side { min-width: 0; }
.col-side {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---------- 7. Blocks --------------------------------------------------- */

.block { margin-bottom: 2.75rem; scroll-margin-top: 6rem; }
.block:last-child { margin-bottom: 0; }

.block__title {
  font-family: var(--serif);
  font-size: 1.42rem;
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--line);
}
.block__title--sm { font-size: 1.12rem; padding-bottom: .4rem; }

.block p { max-width: 68ch; }

.orgs {
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
  margin-bottom: .6rem;
}

/* ---------- 8. Entries (work / education) ------------------------------- */

.entry {
  position: relative;
  padding: 0 0 1.5rem 1.4rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-2);
}
.entry:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.entry::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.5rem;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.entry:last-child::after { display: none; }

.entry__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .15rem .9rem;
  align-items: baseline;
  margin-bottom: .5rem;
}

.entry__role {
  font-size: 1.06rem;
  font-weight: 650;
  grid-column: 1;
}
.entry__dates {
  grid-column: 2;
  grid-row: 1;
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: .1rem .6rem;
  white-space: nowrap;
  align-self: start;
}
.entry__meta {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-size: .88rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .5rem;
}
.entry__org { font-weight: 600; color: var(--ink-2); }
.entry__org::after { content: " · "; color: var(--line); }
.entry__body p { margin-bottom: .75rem; font-size: .95rem; color: var(--ink-2); }

/* ---------- 9. Chips ----------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .1rem;
}
.chips li {
  font-size: .775rem;
  font-weight: 500;
  line-height: 1.5;
  padding: .18rem .55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.chips--tight li { font-size: .765rem; padding: .2rem .5rem; }

/* ---------- 10. Side panels --------------------------------------------- */

.block--side {
  padding: 1.15rem 1.2rem 1.3rem;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 6rem;
}
.block--side .block__title { margin-bottom: .9rem; }

.skillgroup + .skillgroup { margin-top: .95rem; }
.skillgroup h3 {
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .4rem;
}

.note {
  margin: 1.1rem 0 0;
  padding-top: .9rem;
  border-top: 1px dashed var(--line);
  font-size: .83rem;
  line-height: 1.55;
  color: var(--ink-3);
}
.note p { font-size: inherit; }

/* ---------- 11. Language levels ------------------------------------------ */

.langlist { display: flex; flex-direction: column; gap: .7rem; }
.langlist li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .1rem .5rem;
  align-items: baseline;
}
.langlist__name { font-size: .92rem; font-weight: 600; }
.langlist__level { font-size: .78rem; color: var(--ink-3); }

.meter {
  grid-column: 1 / -1;
  display: block;
  height: 4px;
  margin-top: .15rem;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: var(--v, 50%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--ink-3)));
}

/* ---------- 12. Contact panel ------------------------------------------- */

.contactlist { display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
.contactlist li { display: flex; flex-direction: column; }
.contactlist__label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contactlist a { text-decoration: none; border-bottom: 1px solid var(--line); align-self: flex-start; }
.contactlist a:hover { border-color: var(--accent); }

/* ---------- 13. Footer --------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.site-foot__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--ink-3);
}
.site-foot p { margin: 0; }
.site-foot__links { display: flex; gap: 1.1rem; }
.site-foot__links a { color: var(--ink-2); text-decoration: none; }
.site-foot__links a:hover { color: var(--accent); }

/* ---------- 14. Responsive ---------------------------------------------- */

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 1.75rem; }
  .layout { grid-template-columns: 1fr; gap: 2rem; }
  .col-side { position: static; }
  .factbox { max-width: 460px; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 4.5rem; }
  .topbar__inner { flex-wrap: wrap; gap: .6rem .8rem; padding: .55rem 1rem; }
  .brand { order: 1; }
  .langswitch { order: 2; margin-left: auto; }
  .topnav { order: 3; width: 100%; margin-left: 0; padding-bottom: .1rem; }
  .hero { padding: 2.25rem 1rem 1.75rem; }
  .layout { padding: 0 1rem 3rem; }
  .entry__head { grid-template-columns: 1fr; }
  .entry__dates { grid-column: 1; grid-row: 3; justify-self: start; }
  .entry__meta { grid-row: 2; }
  .site-foot__inner { padding: 1.15rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 15. Print ---------------------------------------------------- */

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f2f2f2;
    --ink: #000; --ink-2: #1c1c1c; --ink-3: #555;
    --line: #ccc; --line-2: #e0e0e0;
    --accent: #123f5e; --accent-soft: #f2f6f9; --accent-line: #c8d8e2;
    --shadow-sm: none; --shadow-md: none;
  }
  body { background: #fff; font-size: 10.5pt; line-height: 1.42; }
  .topbar, .site-foot, .hero__actions, .skip-link { display: none !important; }
  .hero, .layout { display: block; max-width: none; padding: 0; }
  .hero { padding: 0 0 .4rem; }
  .hero h1 { font-size: 24pt; }
  .hero__role { font-size: 10.5pt; }
  .factbox { display: none; }
  .col-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
  .block { margin-bottom: .9rem; break-inside: avoid; }
  .entry { break-inside: avoid; padding-left: 1rem; margin-bottom: .8rem; }
  .entry__dates { color: #333; background: none; border-color: #bbb; }
  .chips li { background: none; }
  .block--side { box-shadow: none; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
}
