:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #5b6470;
  --line: #e4e1dc;
  --accent: #1f6f5c;
  --accent-soft: #e5f1ed;
  --on-accent: #ffffff;
  --radius: 12px;
  --max: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416;
    --surface: #181c1f;
    --text: #e8eaec;
    --muted: #9aa3ad;
    --line: #2a3035;
    --accent: #5cc2a5;
    --accent-soft: #1b2c27;
    --on-accent: #0d1513;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* Language switch: only the active language is shown */
html[data-lang="en"] [lang="pt"],
html[data-lang="pt"] [lang="en"] { display: none !important; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: 6px 12px; }

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

/* Header */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
nav.links { display: flex; gap: 18px; margin-left: auto; }
nav.links a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav.links a:hover { color: var(--text); }
.lang-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
@media (max-width: 680px) { nav.links { display: none; } .lang-toggle { margin-left: auto; } }

/* Sections */
section { padding: 72px 0; border-bottom: 1px solid var(--line); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(36px, 6vw, 54px); letter-spacing: -1px; }
h2 { font-size: 28px; letter-spacing: -.4px; }
h3 { font-size: 19px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; font-weight: 600;
  color: var(--accent); margin: 0 0 10px;
}
.lead { font-size: 20px; color: var(--muted); max-width: 700px; margin: 0; }
.muted { color: var(--muted); }

/* Hero */
.hero { padding: 96px 0 72px; }
.hero-id { display: flex; align-items: center; gap: 22px; margin-bottom: 4px; }
.hero-id h1 { margin: 0; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--line); }
@media (max-width: 480px) { .avatar { width: 72px; height: 72px; } .hero-id { gap: 16px; } }
.hero .role { font-size: 22px; font-weight: 500; margin: 14px 0 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); color: var(--text); background: var(--surface);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:hover { border-color: var(--accent); }

/* Project */
.project-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.project-head img { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.project-head h2 { margin: 0; }
.impact { font-size: 19px; max-width: 760px; }

.video { margin: 28px 0 0; }
.video figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px;
  color: var(--muted); font-size: 15px;
}
.player.ready { border: 0; padding: 0; background: #000; cursor: pointer; }
.player.ready img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.player.ready .play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border-radius: 12px;
  background: rgba(0, 0, 0, .7); border: 0; cursor: pointer;
}
.player.ready .play::after {
  content: ""; position: absolute; left: 27px; top: 14px;
  border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff;
}
.player iframe { width: 100%; height: 100%; border: 0; }

.links-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.demo-box {
  background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; font-size: 15px; margin-top: 16px;
}
.demo-box code { font-size: 14px; word-break: break-all; }

.block { margin-top: 48px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card h3 { margin-bottom: 6px; }
.card ul { margin: 8px 0 0; padding-left: 18px; }
.card li { margin: 5px 0; font-size: 15.5px; }

.arch { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow-x: auto; }
.arch svg { width: 100%; min-width: 620px; height: auto; display: block; }
.arch svg text { font-family: system-ui, sans-serif; fill: var(--text); font-size: 14px; }
.arch svg .box { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.arch svg .core { fill: var(--accent-soft); stroke: var(--accent); }
.arch svg .edge { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.arch svg .small { font-size: 12px; fill: var(--muted); }
.arch svg .bold { font-weight: 600; }

.decisions { margin: 12px 0 0; padding-left: 20px; max-width: 800px; }
.decisions li { margin: 12px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chips li { font-size: 13.5px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }

/* Experience */
.job { display: grid; grid-template-columns: 170px 1fr; gap: 20px; margin-top: 32px; }
@media (max-width: 640px) { .job { grid-template-columns: 1fr; gap: 2px; } }
.job .when { color: var(--muted); font-size: 15px; padding-top: 2px; }
.job h3 { margin-bottom: 4px; }
.job ul { margin: 8px 0 0; padding-left: 18px; }
.job li { margin: 6px 0; }
.job .chips { margin-top: 10px; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.skills .card p { margin: 0; font-size: 15.5px; }

#contact { border-bottom: 0; }
footer { padding: 32px 0 56px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
