/* ==========================================================
   Wilson Sedze — portfolio
   Palette and type match the CV: teal on a soft mineral tint,
   Plus Jakarta Sans throughout. Signature: the circuit chip.
   ========================================================== */

:root {
  --bg: #f4f8f7;
  --bg-tint: #eaf3f1;
  --surface: #ffffff;
  --ink: #16202b;
  --ink-2: #334150;
  --muted: #5b6775;
  --teal: #2f7d74;
  --teal-strong: #215e57;
  --teal-glow: #3fb8a6;
  --rule: #d9e5e2;
  --chip-border: #cfe0dc;
  --shadow: 0 1px 2px rgba(22, 32, 43, 0.05), 0 8px 24px -12px rgba(22, 32, 43, 0.18);
  --shadow-lift: 0 2px 4px rgba(22, 32, 43, 0.06), 0 18px 40px -16px rgba(22, 32, 43, 0.28);
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1100px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1517;
    --bg-tint: #122024;
    --surface: #152327;
    --ink: #e7efed;
    --ink-2: #c3d0cd;
    --muted: #93a3a6;
    --teal: #4fc1ae;
    --teal-strong: #7dd6c6;
    --teal-glow: #6be3cd;
    --rule: #22363a;
    --chip-border: #2a4246;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.35), 0 22px 44px -18px rgba(0, 0, 0, 0.7);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }

/* ---------- Header / tabs ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
  view-transition-name: site-header;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand:hover .chip-core { fill: var(--teal-strong); }

.tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-tint);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.tab {
  position: relative;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  isolation: isolate;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: #fff; }
.tab .pill {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: var(--teal);
  view-transition-name: tab-pill;
}
@media (prefers-color-scheme: dark) { .tab[aria-current="page"] { color: #0d1517; } }

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-menu {
  position: fixed;
  inset: 68px 0 0 0;
  z-index: 49;
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; transform: none; }
.mobile-menu a {
  font-size: 28px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 4px;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.mobile-menu.open a { opacity: 1; transform: none; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.04s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.08s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.12s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.16s; }
.mobile-menu.open a:nth-child(6) { transition-delay: 0.2s; }
.mobile-menu a[aria-current="page"] { color: var(--teal); }

@media (max-width: 860px) {
  .tabs { display: none; }
  .menu-btn { display: inline-flex; }
}

/* ---------- Page shell ---------- */
main { flex: 1; view-transition-name: page; }
.page-head { padding: 64px 0 28px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; }
.page-head p { margin-top: 12px; color: var(--muted); font-size: 18px; max-width: 640px; }

section { padding: 28px 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 20px -10px var(--teal); }
.btn-primary:hover { background: var(--teal-strong); }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #0d1517; } }
.btn-ghost { background: var(--surface); border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); }
.btn-sm { padding: 8px 13px; font-size: 13.5px; border-radius: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Home hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding: 72px 0 40px;
  min-height: calc(100vh - 68px - 120px);
}
.hero h1 {
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .line > span { display: inline-block; animation: rise 0.9s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.08s; color: var(--teal); }
.hero .role {
  margin-top: 18px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-2);
  min-height: 1.6em;
}
.hero .role .typed { color: var(--teal); }
.hero .role .caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--teal);
  vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
.hero .lede { margin-top: 16px; color: var(--muted); font-size: 17px; max-width: 540px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero .cta, .hero .role, .hero .lede { animation: fade-up 0.8s var(--ease) both; }
.hero .role { animation-delay: 0.2s; }
.hero .lede { animation-delay: 0.3s; }
.hero .cta { animation-delay: 0.4s; }

.circuit { width: 100%; max-width: 480px; margin-inline: auto; color: var(--teal); }
.circuit .trace { fill: none; stroke: var(--rule); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.4s var(--ease) forwards; }
.circuit .pad { fill: var(--surface); stroke: var(--chip-border); stroke-width: 2.4; opacity: 0; animation: pop 0.4s var(--ease) forwards; }
.circuit .pulse { fill: none; stroke: var(--teal-glow); stroke-width: 3.6; stroke-linecap: round;
  stroke-dasharray: 12 88; stroke-dashoffset: 100; opacity: 0;
  animation: pulse-run 3.2s linear infinite; filter: drop-shadow(0 0 4px var(--teal-glow)); }
.circuit .chip-body { fill: var(--teal); }
.circuit .chip-pin { fill: var(--teal); }
.circuit .chip-label { fill: #fff; font: 800 30px "Plus Jakarta Sans", Arial, sans-serif; letter-spacing: 1px; }
@media (prefers-color-scheme: dark) { .circuit .chip-label { fill: #0d1517; } }
.circuit .chip-led { fill: #fff; animation: led 2.4s ease-in-out infinite; }
.circuit-chip { transform-origin: 240px 200px; animation: chip-in 0.7s 0.5s var(--ease) both; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; min-height: 0; gap: 28px; }
  .circuit { max-width: 360px; order: -1; }
}

/* ---------- International stage ---------- */
.stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stage-card { padding: 22px 22px 20px; position: relative; overflow: hidden; }
.stage-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
}
.stage-card .country { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stage-card .year { color: var(--teal); font-weight: 700; margin-top: 2px; }
.stage-card .school { color: var(--muted); font-size: 14px; margin-top: 8px; }
.stage-card .route { position: absolute; right: 14px; top: 16px; width: 64px; height: 30px; color: var(--chip-border); }
.stage-card .route path { stroke-dasharray: 4 5; animation: dash 1.6s linear infinite; }
.stage-note { color: var(--muted); margin: -8px 0 18px; }
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; } }

/* ---------- Feature teaser (home) ---------- */
.teasers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.teaser { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px; text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s; }
.teaser:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--chip-border); }
.teaser img { width: 140px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); }
.teaser h3 { font-size: 17px; margin-top: 4px; }
.teaser p { color: var(--muted); font-size: 14px; margin-top: 4px; }
@media (max-width: 760px) { .teasers { grid-template-columns: 1fr; } .teaser { grid-template-columns: 110px 1fr; } .teaser img { width: 110px; height: 80px; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: start; }
.portrait { position: relative; }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 6px solid var(--surface); box-shadow: var(--shadow); }
.portrait .ring { position: absolute; inset: -14px; border-radius: 50%; border: 1.5px dashed var(--chip-border); animation: spin 40s linear infinite; }
.portrait .ring::after { content: ""; position: absolute; top: 12%; right: 6%; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px color-mix(in srgb, var(--teal) 22%, transparent); }
.bio p { font-size: 17.5px; color: var(--ink-2); margin-bottom: 16px; }
.bio p:first-child { font-size: 21px; color: var(--ink); font-weight: 600; line-height: 1.5; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.fact { padding: 14px 16px; }
.fact b { display: block; font-size: 15px; }
.fact span { color: var(--muted); font-size: 13.5px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .portrait { max-width: 220px; margin: 10px auto 0; } .facts { grid-template-columns: 1fr; } }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.tl-item { position: relative; padding: 20px 22px; margin-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -30px; top: 26px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--teal); }
.tl-item.past::before { border-color: var(--chip-border); }
.tl-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.tl-head h3 { font-size: 19px; }
.tl-date { color: var(--teal); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tl-org { color: var(--muted); font-size: 15px; margin: 2px 0 10px; }
.tl-item ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.tl-item li { margin-bottom: 6px; }
.tl-item li::marker { color: var(--teal); }
.tl-item .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 22px; }
.project { display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.project:nth-child(even) .project-media { order: 2; }
.project-media { position: relative; overflow: hidden; background: var(--bg-tint); min-height: 260px; }
.project-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.project:hover .project-media img { transform: scale(1.04); }
.project-body { padding: 28px 30px; display: flex; flex-direction: column; gap: 12px; }
.project-kicker { color: var(--teal); font-weight: 700; font-size: 14px; }
.project-body h2 { font-size: 26px; font-weight: 800; }
.project-body p { color: var(--ink-2); }
.project-body .actions { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-media { order: 0; }
  .project-media { min-height: 0; aspect-ratio: 16 / 9; }
  .project-body { padding: 22px; }
}
.more-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.more { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.more h3 { font-size: 17px; }
.more p { color: var(--muted); font-size: 14.5px; }
.more .actions { display: flex; gap: 8px; margin-top: 4px; }
@media (max-width: 760px) { .more-list { grid-template-columns: 1fr; } }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill-group { padding: 22px; }
.skill-group h2 { font-size: 18px; margin-bottom: 4px; }
.skill-group > p { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 10px; border-radius: 12px;
  background: var(--bg-tint); border: 1px solid transparent; font-size: 12.5px; font-weight: 600; text-align: center;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s; }
.tile:hover { transform: translateY(-3px); border-color: var(--chip-border); background: var(--surface); }
.tile img { width: 34px; height: 34px; object-fit: contain; }
.tile .glyph { width: 34px; height: 34px; display: grid; place-items: center; font-size: 22px; color: var(--teal); }
@media (prefers-color-scheme: dark) { .tile img.invert-dark { filter: invert(1) hue-rotate(180deg); } }
@media (max-width: 760px) { .skill-groups { grid-template-columns: 1fr; } }

/* ---------- Education / certs ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 700; vertical-align: 3px; margin-left: 6px; }
@media (prefers-color-scheme: dark) { .badge { color: #0d1517; } }
.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cert { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.cert .issuer { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cert .issuer i { color: var(--teal); font-size: 16px; }
.cert h3 { font-size: 16.5px; }
.cert .date { font-size: 13.5px; color: var(--muted); }
.cert .actions { margin-top: auto; padding-top: 8px; }
@media (max-width: 860px) { .certs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .certs { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 22px; align-items: start; }
.contact-list { padding: 10px; }
.contact-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; text-decoration: none; transition: background 0.2s; }
a.contact-row:hover { background: var(--bg-tint); }
.contact-row .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-tint); color: var(--teal); font-size: 18px; flex: none; }
.contact-row small { display: block; color: var(--muted); font-size: 12.5px; }
.contact-row span { font-weight: 600; word-break: break-word; }
.form { padding: 26px; display: grid; gap: 14px; }
.form label { font-size: 14px; font-weight: 600; display: grid; gap: 6px; }
.form input, .form textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--rule);
  border-radius: 10px; padding: 11px 13px; transition: border-color 0.2s, box-shadow 0.2s; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 18%, transparent); }
.form textarea { min-height: 140px; resize: vertical; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .note { font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } .form .row2 { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--rule); background: var(--bg-tint); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 26px 0; flex-wrap: wrap; }
.site-footer p { color: var(--muted); font-size: 14px; }
.socials { display: flex; gap: 8px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-2); text-decoration: none; font-size: 17px; transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s; }
.socials a:hover { transform: translateY(-3px); color: var(--teal); border-color: var(--teal); }

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

/* ---------- Page transitions ----------
   Chrome/Edge animate between pages natively; the header stays put
   and the active tab pill slides to its new tab. Other browsers get
   a soft fade-in on load instead. */
@view-transition { navigation: auto; }
::view-transition-old(page) { animation: page-out 0.18s ease both; }
::view-transition-new(page) { animation: page-in 0.42s var(--ease) both; }
::view-transition-group(tab-pill) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.3, 0.85, 0.3, 1); }
html:not(.vt) main { animation: page-in 0.5s var(--ease) both; }

/* ---------- Keyframes ---------- */
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes pulse-run { 0% { stroke-dashoffset: 100; opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes chip-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes led { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -18; } }

.circuit .pad { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; scroll-behavior: auto !important; }
  .circuit .pulse { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
