:root {
  --bg: #f6f9fa;
  --surface: #ffffff;
  --ink: #12232e;
  --muted: #485966;          /* 7.2:1 on white, AA on every light surface */
  --teal: #0b5f6b;
  --teal-2: #0e7480;         /* text-safe: white on it = 5.4:1 */
  --accent: #14919b;         /* decorative only (dots, rings, markers, spine) – 3.8:1 non-text */
  --mint: #7fd1c7;
  --navy: #1b2a5a;
  --soft: #e6f4f3;
  --hair: rgba(11, 95, 107, .1);
  --radius: 20px;
  --shadow: 0 20px 50px -20px rgba(11, 95, 107, 0.25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --section-y: clamp(4.5rem, 10vw, 8rem);
  --max: 1280px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: hidden; overflow-x: clip; }
main { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; font-optical-sizing: auto; }
h3 { line-height: 1.28; }
p, li { text-wrap: pretty; }
svg { flex-shrink: 0; }

/* ---------- Keyboard focus ---------- */
:where(a, button):focus-visible { outline: 2.5px solid var(--teal); outline-offset: 3px; border-radius: 8px; }
.contact-card a:focus-visible { outline-color: #c9f5ef; outline-offset: 4px; }
.nav-links a:focus-visible, .to-top:focus-visible { color: var(--ink); }
.nav-links a:not(.nav-cta):focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, var(--teal), var(--mint));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 1.1rem var(--pad);
  transition: padding .4s var(--ease), box-shadow .4s, transform .4s var(--ease);
}
.nav.scrolled { padding: .7rem var(--pad); }
/* blur lives on a pseudo-element so it doesn't trap the fixed mobile menu */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(246, 249, 250, .92);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid rgba(11, 95, 107, .08);
  opacity: 0; transition: opacity .4s;
}
.nav.scrolled::before { opacity: 1; }
.nav.hidden { transform: translateY(-100%); }
.brand {
  position: relative; z-index: 60; display: flex; align-items: center; gap: .6rem; min-width: 0;
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff;
  font-family: var(--font-display); font-size: .9rem; letter-spacing: .02em;
}
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav-links a {
  position: relative; text-decoration: none; font-size: .93rem; color: var(--muted);
  transition: color .3s;
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--teal); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { padding: .5rem 1.1rem; border-radius: 999px; background: var(--ink); color: #fff !important; transition: background .3s; }
.nav-cta:hover { background: var(--teal); }
.menu-btn { display: none; }

/* ---------- Language toggle (EN / PT) ---------- */
.nav-end { display: flex; align-items: center; gap: clamp(.75rem, 1.5vw, 1.6rem); flex-shrink: 0; }
.nav-end .nav-links { order: -1; }
.lang-toggle {
  position: relative; z-index: 60; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid rgba(11, 95, 107, .18); border-radius: 999px;
  background: rgba(230, 244, 243, .85); cursor: pointer;
  font: 600 .72rem/1 var(--font-sans); letter-spacing: .06em;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .3s, box-shadow .3s;
}
.lang-toggle::after { content: ""; position: absolute; inset: -6px -2px; } /* ≥44px touch target */
.lang-toggle:hover { border-color: rgba(11, 95, 107, .4); box-shadow: 0 6px 16px -10px rgba(11, 95, 107, .6); }
.lang-toggle:focus-visible { border-radius: 999px; }
.lang-opt {
  display: grid; place-items: center; min-width: 2.1rem; padding: .42rem .55rem;
  border-radius: 999px; color: var(--teal);
  transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.lang-opt.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff;
  box-shadow: 0 4px 10px -4px rgba(11, 95, 107, .6);
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.actions.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1.5px solid transparent;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s, color .3s, border-color .3s;
}
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn.primary { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; box-shadow: var(--shadow); }
.btn.primary:hover { box-shadow: 0 25px 50px -15px rgba(11, 95, 107, .5); }
.btn.ghost { border-color: rgba(18, 35, 46, .15); background: rgba(255, 255, 255, .6); backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn.light { background: #fff; color: var(--teal); }
.btn.light:hover { box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .45); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(6rem, 12vh, 7rem) var(--pad) clamp(3.5rem, 8vh, 5rem); max-width: var(--max); margin: 0 auto;
}
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: -1; animation: drift 24s ease-in-out infinite alternate; }
.b1 { width: 480px; height: 480px; background: var(--mint); top: -120px; right: -80px; }
.b2 { width: 380px; height: 380px; background: #bfe3ff; bottom: -60px; left: -120px; animation-delay: -8s; }
.b3 { width: 260px; height: 260px; background: #ffd9cf; top: 40%; left: 40%; opacity: .3; animation-delay: -16s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 20px) scale(.97); }
}

.pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .45rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: rgba(255, 255, 255, .75); border: 1px solid rgba(11, 95, 107, .15); color: var(--teal);
  backdrop-filter: blur(6px);
}
.dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #10b981; position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #10b981; animation: ping 2.8s var(--ease) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

.hero h1 {
  font-size: clamp(2rem, 1.05rem + 3vw, 3.45rem); line-height: 1.1; letter-spacing: -0.025em;
  margin: clamp(1rem, 3vw, 1.4rem) 0 1.2rem; overflow-wrap: break-word;
}
.grad {
  background: linear-gradient(100deg, var(--teal) 0%, var(--teal-2) 55%, #117a86 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--muted); max-width: 34rem; margin: 0; }
.lead strong { color: var(--ink); font-weight: 600; }

/* Load-in animation */
.load { opacity: 0; transform: translateY(24px); animation: rise 1s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

.hero-photo { position: relative; justify-self: center; width: min(420px, 100%); aspect-ratio: 1; }
.hero-photo img {
  position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; border: 5px solid rgba(255, 255, 255, .92);
  box-shadow: 0 32px 70px -26px rgba(11, 95, 107, .42), 0 0 0 1px rgba(11, 95, 107, .1);
  transition: transform .6s var(--ease);
}
.ring {
  position: absolute; inset: -14px; z-index: 1; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--mint), transparent 30%, var(--accent) 60%, transparent 80%, var(--mint));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 1.5px));
  opacity: .8;
}

.float-card {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1rem .65rem .65rem; border-radius: 16px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px);
  border: 1px solid var(--hair);
  box-shadow: 0 15px 35px -12px rgba(18, 35, 46, .22);
  animation: bob 6.5s ease-in-out infinite;
  transition: translate .5s var(--ease);
}
.float-card b { display: block; font-size: .9rem; line-height: 1.3; }
.float-card small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.float-card .ico {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--soft); color: var(--teal); flex-shrink: 0;
}
.fc1 { top: 8%; left: -14%; }
.fc2 { bottom: 14%; right: -12%; animation-delay: -2.2s; }
.fc3 { bottom: -4%; left: 4%; animation-delay: -4.3s; }
@keyframes bob { 50% { transform: translateY(-4px); } }

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(11, 95, 107, .5); border-radius: 20px;
}
.scroll-hint::before { content: ""; position: absolute; inset: -8px -10px; }
.scroll-hint:focus-visible { border-radius: 20px; }
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 4px; background: var(--teal); animation: wheel 2.2s var(--ease) infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; color: #fff; padding: 1.1rem 0;
  background: linear-gradient(90deg, var(--ink), #0d3b46 50%, var(--navy));
}
.track { display: flex; gap: clamp(1.5rem, 4vw, 2.5rem); width: max-content; animation: scroll-x 40s linear infinite; font-family: var(--font-display); font-size: clamp(1.05rem, .9rem + .8vw, 1.35rem); white-space: nowrap; }
.track span:nth-child(even) { color: var(--mint); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: var(--section-y) var(--pad); max-width: var(--max); margin: 0 auto; }
.section.alt { max-width: none; background: linear-gradient(180deg, var(--soft), var(--bg)); }
.section.alt > * { max-width: calc(var(--max) - 2 * var(--pad)); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: clamp(2.2rem, 5vw, 3.5rem); }
.kicker { display: inline-block; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--teal); margin-bottom: .8rem; }
.kicker.light { color: #c9f5ef; }
.section h2 { font-size: clamp(1.75rem, 1.1rem + 2.8vw, 3.2rem); max-width: 24ch; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-text p { font-size: 1.08rem; color: var(--muted); margin: 0 0 1.2rem; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.7rem, 2vw, 1rem); }
.stat {
  padding: clamp(1.2rem, 3vw, 1.8rem) clamp(1rem, 2.5vw, 1.4rem); border-radius: var(--radius); background: var(--surface);
  border: 1px solid rgba(11, 95, 107, .09);
  box-shadow: 0 1px 0 rgba(18, 35, 46, .04), 0 10px 30px -18px rgba(18, 35, 46, .2);
  transition: opacity .9s var(--ease), transform .6s var(--ease), box-shadow .4s;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.num { display: block; font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); font-weight: 600; color: var(--teal); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.label { display: block; margin-top: .6rem; font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: clamp(1rem, 2vw, 1.4rem); }
.card, .edu {
  position: relative; padding: clamp(1.5rem, 3vw, 2rem) clamp(1.3rem, 2.5vw, 1.7rem); border-radius: var(--radius); background: var(--surface);
  border: 1px solid rgba(11, 95, 107, .08); overflow: hidden;
  transition: opacity .9s var(--ease), transform .6s var(--ease), box-shadow .4s, border-color .4s;
}
.card::before, .edu::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(127, 209, 199, .18), transparent 45%);
}
.card > *, .edu > * { position: relative; }
.card:hover, .edu:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(11, 95, 107, .2); }
.card:hover::before, .edu:hover::before { opacity: 1; }
.card-ico {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px;
  background: var(--soft); color: var(--teal); border: 1px solid var(--hair);
  margin-bottom: 1.3rem; transition: transform .5s var(--ease);
}
.card:hover .card-ico { transform: translateY(-2px) scale(1.05); }
.card h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.card p { color: var(--muted); font-size: .95rem; line-height: 1.58; margin: 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.tl-line { position: absolute; left: 50%; top: 1.6rem; bottom: 1.6rem; width: 2px; margin-left: -1px; background: rgba(11, 95, 107, .12); border-radius: 2px; }
.tl-fill { position: absolute; inset: 0; background: linear-gradient(var(--accent), var(--teal)); transform-origin: top; transform: scaleY(var(--fill, 0)); border-radius: 2px; }
.tl-item { position: relative; width: 50%; padding: 0 3.25rem 2.2rem 0; }
.tl-item:nth-child(odd) { margin-left: 50%; padding: 0 0 2.2rem 3.25rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item.reveal { transform: translateX(-40px); }
.tl-item.reveal:nth-child(odd) { transform: translateX(40px); }
.tl-item.reveal.in { transform: none; }
.tl-dot {
  position: absolute; top: 1.6rem; right: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent); z-index: 2;
  transition: background .4s, transform .4s var(--ease);
}
.tl-item:nth-child(odd) .tl-dot { right: auto; left: -9px; }
.tl-item.in .tl-dot { background: var(--accent); transform: scale(1.1); box-shadow: 0 0 0 6px rgba(20, 145, 155, .14); }
.tl-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start;
  padding: clamp(1.25rem, 3vw, 1.7rem) clamp(1.2rem, 3vw, 1.8rem); border-radius: var(--radius); background: var(--surface);
  border: 1px solid rgba(11, 95, 107, .08);
  box-shadow: 0 10px 30px -20px rgba(18, 35, 46, .25);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.tl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tl-date { display: inline-block; font-size: .78rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; background: var(--soft); color: var(--teal); border: 1px solid rgba(11, 95, 107, .12); line-height: 1.5; }
.tl-card h3 { font-size: 1.2rem; text-wrap: pretty; }
.tl-card p { color: var(--muted); margin: 0; font-size: .95rem; line-height: 1.58; }
.tl-card .tl-org { color: var(--teal); font-weight: 600; font-size: .9rem; line-height: 1.4; margin: .3rem 0 .75rem; }
.tl-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .93rem; }
.tl-card li { line-height: 1.5; margin-bottom: .45rem; }
.tl-card li:last-child { margin-bottom: 0; }
.tl-card li::marker { color: var(--accent); }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(1rem, 2vw, 1.4rem); }
.edu { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; }
.edu-tag {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .05em; line-height: 1.5;
  padding: .25rem .7rem; border-radius: 999px;
  background: var(--soft); color: var(--teal); border: 1px solid rgba(11, 95, 107, .12);
}
.edu:first-child { border-color: rgba(14, 116, 128, .28); }
.edu:first-child .edu-tag { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; border-color: transparent; }
.edu h3 { font-size: 1.08rem; margin-bottom: .5rem; }
.edu p { color: var(--muted); margin: 0; font-size: .93rem; line-height: 1.58; }

/* Card headers: [pill] ……… [logo] on one centreline, content gets the full width below */
.tl-card > .tl-date, .edu > .edu-tag { grid-column: 1; grid-row: 1; justify-self: start; align-self: center; margin-bottom: .9rem; }
.tl-card > .org-logo, .tl-card > .org-logos, .edu > .org-logo { grid-column: 2; grid-row: 1; align-self: center; margin: 0 0 .9rem .75rem; }
.tl-card > :nth-child(n+3) { grid-column: 1 / -1; }
.edu > h3 { grid-column: 1 / -1; grid-row: 2; }
.edu > p { grid-column: 1 / -1; grid-row: 3; align-self: end; padding-top: .35rem; }

/* ---------- Organisation logos ---------- */
.org-logos { display: flex; }
.org-logo {
  width: 46px; height: 46px; border-radius: 13px; padding: 7px;
  background: #fff; display: grid; place-items: center;
  border: 1px solid rgba(11, 95, 107, .12);
  box-shadow: 0 8px 20px -12px rgba(11, 95, 107, .45);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), margin .4s var(--ease);
}
.org-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.org-logo img[src*="fpp.png"] { filter: drop-shadow(0 0 .6px rgba(18, 35, 46, .35)) contrast(1.08); }
.org-logo.wide { width: 68px; padding: 6px 8px; }
.org-logos .org-logo { width: 42px; height: 42px; padding: 6px; }
.org-logos .org-logo + .org-logo { margin-left: -10px; }
.org-logos:hover .org-logo + .org-logo { margin-left: 4px; }
.tl-card:hover .org-logo, .edu:hover .org-logo { transform: translateY(-2px); box-shadow: 0 14px 26px -12px rgba(11, 95, 107, .5); }
.tl-card:hover .org-logos .org-logo:nth-child(2) { transition-delay: .05s; }
.tl-card:hover .org-logos .org-logo:nth-child(3) { transition-delay: .1s; }

/* ---------- Contact ---------- */
.contact-card {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 5vw, 2rem); border-radius: clamp(22px, 4vw, 32px);
  background: radial-gradient(circle at 20% 0%, var(--teal-2), transparent 50%), linear-gradient(135deg, var(--navy), var(--teal));
}
.contact-card::after {
  content: ""; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: var(--mint); filter: blur(120px); opacity: .22; bottom: -300px; right: -150px;
  animation: drift 20s ease-in-out infinite alternate;
}
.contact-card > * { position: relative; z-index: 1; }
.contact-card h2 { margin: 0 auto 1rem; }
.contact-card p { color: rgba(255, 255, 255, .88); font-size: 1.1rem; margin: 0 auto; max-width: 32rem; text-wrap: balance; }
.contact-card .btn { max-width: 100%; justify-content: center; }
.email-btn { white-space: nowrap; font-size: clamp(.82rem, .7rem + .9vw, 1rem); }
.mail-ico { display: inline-grid; place-items: center; }
.mail-ico svg { display: block; }

footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem;
  position: relative; padding: 2rem var(--pad) 3rem; max-width: var(--max); margin: 0 auto;
  color: var(--muted); font-size: .88rem;
}
footer::before { content: ""; position: absolute; top: 0; left: var(--pad); right: var(--pad); height: 1px; background: rgba(11, 95, 107, .1); }
footer p { margin: 0; }
footer p [data-i18n] { white-space: nowrap; }
.to-top { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: .25rem .4rem; margin-right: -.4rem; }
.to-top:hover { color: var(--teal); }

/* ---------- Responsive ---------- */

/* Notched phones: keep content clear of safe areas */
@supports (padding: max(0px)) {
  .nav, .section, .hero, footer {
    padding-left: max(var(--pad), env(safe-area-inset-left));
    padding-right: max(var(--pad), env(safe-area-inset-right));
  }
  footer { padding-bottom: max(3rem, env(safe-area-inset-bottom)); }
}

/* Big desktops / TVs: scale everything up gently */
@media (min-width: 1600px) { html { font-size: 106.25%; } :root { --max: 1400px; } }
@media (min-width: 2200px) { html { font-size: 118.75%; } :root { --max: 1600px; } }

/* Desktop timeline: interlocking two-column stagger (each card spans two rows, offset by one) */
@media (min-width: 961px) {
  .timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-item, .tl-item:nth-child(odd) { width: auto; margin-left: 0; }
  .tl-item { grid-column: 1; }
  .tl-item:nth-child(odd) { grid-column: 2; }
  .tl-item:nth-child(2) { grid-row: 1 / span 2; }
  .tl-item:nth-child(3) { grid-row: 2 / span 2; }
  .tl-item:nth-child(4) { grid-row: 3 / span 2; }
  .tl-item:nth-child(5) { grid-row: 4 / span 2; }
  .tl-item:nth-child(6) { grid-row: 5 / span 2; }
  .tl-item:nth-child(7) { grid-row: 6 / span 2; }
  .tl-item::before {
    content: ""; position: absolute; top: calc(1.6rem + 8px); right: 9px;
    width: calc(3.25rem - 9px); height: 1.5px; background: rgba(14, 116, 128, .22);
  }
  .tl-item:nth-child(odd)::before { right: auto; left: 9px; }
}

/* Small laptops / large tablets */
@media (max-width: 1100px) {
  .fc1 { left: -6%; }
  .fc2 { right: -6%; }
}

/* Tablets & phones: stack hero, single-column timeline, mobile menu */
@media (max-width: 960px) {
  html { scroll-padding-top: 70px; }
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; min-height: auto; }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .hero-photo { order: -1; width: min(320px, 68vw); margin-bottom: .5rem; }
  .lead { margin: 0 auto; }
  .actions { justify-content: center; }
  .fc1 { top: 4%; left: -12%; }
  .fc2 { bottom: auto; top: 50%; right: -14%; }
  .fc3 { bottom: -5%; left: 0; right: 0; width: max-content; margin-inline: auto; }
  .scroll-hint { display: none; }
  .blob { filter: blur(50px); }
  .b1 { width: 320px; height: 320px; }
  .b2 { width: 260px; height: 260px; }

  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .tl-line { left: 9px; }
  .tl-item, .tl-item:nth-child(odd) { width: 100%; margin-left: 0; padding: 0 0 clamp(1.4rem, 4vw, 2.2rem) 2.4rem; }
  .tl-item:last-child { padding-bottom: 0; }
  .tl-item .tl-dot, .tl-item:nth-child(odd) .tl-dot { left: 0; right: auto; }
  .tl-item.reveal, .tl-item.reveal:nth-child(odd) { transform: translateY(30px); }
  .tl-item.reveal.in { transform: none; }

  .menu-btn {
    display: grid; gap: 6px; place-content: center; width: 44px; height: 44px; margin-right: -10px;
    border: none; background: transparent; cursor: pointer; z-index: 60; -webkit-tap-highlight-color: transparent;
  }
  .menu-btn:focus-visible { border-radius: 12px; }
  .menu-btn span { display: block; width: 24px; height: 2px; background: var(--ink); transition: transform .4s var(--ease); }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav-links {
    position: fixed; inset: 0; height: 100vh; height: 100dvh;
    flex-direction: column; justify-content: center; gap: clamp(1.2rem, 4vh, 2rem);
    background: radial-gradient(circle at 85% 12%, rgba(127, 209, 199, .18), transparent 45%), var(--bg);
    clip-path: circle(0 at calc(100% - 40px) 36px); visibility: hidden;
    transition: clip-path .7s var(--ease), visibility 0s .7s;
  }
  .nav-links.open { clip-path: circle(150% at calc(100% - 40px) 36px); visibility: visible; transition: clip-path .7s var(--ease); }
  .nav-links a { font-size: clamp(1.3rem, 5vw, 1.6rem); color: var(--ink); }
  .nav-cta { padding: .6rem 1.6rem; }
  .nav-end { gap: .5rem; }
  .lang-opt { min-width: 1.9rem; padding: .4rem .45rem; }
}

/* Phablets: 2×2 stats before the 4-up strip gets cramped */
@media (max-width: 740px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phones */
@media (max-width: 600px) {
  .actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; }
  .actions .btn { justify-content: center; }
  .contact-card .actions { margin-left: auto; margin-right: auto; }
  .float-card { padding: .4rem .75rem .4rem .4rem; gap: .5rem; border-radius: 12px; animation: none; }
  .float-card b { font-size: .8rem; }
  .float-card small { display: none; }
  .float-card .ico { width: 28px; height: 28px; border-radius: 8px; }
  .float-card .ico svg { width: 16px; height: 16px; }
  .fc1 { left: -8%; } .fc2 { right: -8%; }
  .ring { inset: -10px; }
  .pill { font-size: .78rem; text-align: left; }
  .tl-card ul { padding-left: 1rem; }
  footer { flex-direction: column; align-items: center; text-align: center; }
  .to-top { margin-right: 0; }
}

@media (max-width: 560px) {
  .org-logo { width: 42px; height: 42px; border-radius: 12px; padding: 6px; }
  .org-logo.wide { width: 62px; }
  .org-logos .org-logo { width: 40px; height: 40px; }
}

/* Compact phone header (iPhone 12–15, Pixel, Galaxy S) */
@media (max-width: 440px) {
  .nav { gap: .5rem; }
  .brand { font-size: clamp(.8rem, 3.55vw, .94rem); gap: .45rem; letter-spacing: -.005em; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: .8rem; }
  .nav-end { gap: .35rem; }
  .lang-opt { min-width: 1.8rem; padding: .38rem .4rem; }
}

@media (max-width: 400px) {
  .email-btn { padding: .9rem 1.1rem; gap: .4rem; }
  .email-btn .arrow { display: none; }
}

/* Very small phones (iPhone SE 1st gen, Galaxy Fold folded) */
@media (max-width: 360px) {
  .lang-toggle { font-size: .68rem; }
  .lang-opt { min-width: 1.7rem; padding: .36rem .36rem; }
  .nav-end { gap: .3rem; }
  .stat .label { font-size: .8rem; }
  .fc1, .fc2 { display: none; }
}

/* Phones in landscape / short screens: side-by-side hero */
@media (max-height: 520px) and (min-width: 560px) and (orientation: landscape) {
  .hero { grid-template-columns: auto 1fr; text-align: left; justify-items: start; min-height: auto; padding-top: 5rem; gap: 2.5rem; }
  .hero-text { align-items: flex-start; }
  .hero-photo { order: -1; width: min(240px, 34vw, 62vh); }
  .hero h1 { font-size: clamp(1.7rem, 9vh, 2.6rem); }
  .hero h1 br { display: none; }
  .lead { margin: 0; font-size: .98rem; }
  .actions { flex-direction: row; justify-content: flex-start; max-width: none; }
  .float-card, .scroll-hint { display: none; }
  .nav-links { gap: .9rem; }
  .nav-links a { font-size: 1.15rem; }
}

/* Touch devices: no sticky hover lifts */
@media (hover: none) {
  .stat:hover, .tl-card:hover, .card:hover, .edu:hover { transform: none; }
  .card:hover::before, .edu:hover::before { opacity: 0; }
  .card:hover .card-ico, .tl-card:hover .org-logo, .edu:hover .org-logo { transform: none; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .load { opacity: 1 !important; transform: none !important; }
  .nav.hidden { transform: none; }
  html { scroll-behavior: auto; }
}
