/* ===================== tokens ===================== */
:root {
  --mat: #24453b;        /* tapete de corte */
  --mat-line: #3a6355;   /* grelha do tapete */
  --mat-ink: #efe6c4;    /* marcações amarelas do tapete */
  --paper: #f3f5f2;      /* papel frio */
  --paper-2: #e6eae5;
  --ink: #17201c;
  --graphite: #56625c;
  --orange: #e2560b;     /* laranja de segurança: ações e medidas */
  --rule: #c9d0ca;
  --maxw: 1180px;
  --gut: clamp(16px, 4vw, 48px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: "Archivo", system-ui, sans-serif;
       font-variation-settings: "wdth" 100; font-size: 17px; line-height: 1.55; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ph { background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(226,86,11,.16) 6px 8px); border-radius: 2px; }

h1, h2, h3 { font-weight: 700; line-height: 1.05; letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-variation-settings: "wdth" 112; margin-bottom: .4em; }
h3 { font-size: 1.35rem; font-variation-settings: "wdth" 105; }
.lede { font-size: 1.2rem; color: var(--graphite); max-width: 58ch; }
.lede a { text-decoration-color: var(--orange); text-underline-offset: 3px; }
.body { color: var(--graphite); max-width: 58ch; margin-top: 1em; }
.note { font-variation-settings: "wdth" 75; color: var(--graphite); font-size: .92rem; }
section { padding: clamp(72px, 11vw, 140px) 0; }

/* ===================== nav ===================== */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; transition: background .3s; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav a { text-decoration: none; }
.brand { font-weight: 800; font-variation-settings: "wdth" 120; letter-spacing: -0.02em; color: var(--mat-ink); }
.nav ul { display: flex; gap: clamp(12px, 2.2vw, 28px); list-style: none; font-variation-settings: "wdth" 85; color: var(--mat-ink); }
.nav.solid { background: rgba(243,245,242,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.nav.solid .brand, .nav.solid ul { color: var(--ink); }
.nav ul a:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { .nav ul li:not(:last-child) { display: none; } }

/* ===================== hero ===================== */
.hero { background: var(--mat); color: var(--mat-ink); min-height: 100svh; position: relative; overflow: hidden;
        display: flex; align-items: flex-end; padding: 120px 0 72px; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--mat-line) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line) 1px, transparent 1px),
    linear-gradient(rgba(58,99,85,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(58,99,85,.45) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px; background-position: 24px 24px; }
.ruler { position: absolute; pointer-events: none; color: var(--mat-ink); opacity: .75; }
.ruler.top { top: 0; left: 24px; right: 0; height: 22px;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 6.4px) bottom/100% 7px no-repeat,
              repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 32px) bottom/100% 14px no-repeat; }
.ruler.left { left: 0; top: 24px; bottom: 0; width: 22px;
  background: repeating-linear-gradient(currentColor 0 1px, transparent 1px 6.4px) right/7px 100% no-repeat,
              repeating-linear-gradient(currentColor 0 1px, transparent 1px 32px) right/14px 100% no-repeat; }
.hero .wrap { position: relative; width: 100%; }
.hero-name { font-size: clamp(2.5rem, 9vw, 8rem); font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -0.04em; line-height: .95; }
.hero-name .w { white-space: nowrap; }
.hero-name .x { display: inline-block; overflow: hidden; white-space: pre; vertical-align: bottom; max-width: 0; opacity: 0;
           padding-bottom: .14em; margin-bottom: -.14em; }
.dim { display: flex; align-items: center; gap: 10px; margin: 18px 0 26px; font-variation-settings: "wdth" 70; font-size: .85rem; opacity: .85; max-width: var(--dimw, 100%); transition: max-width .2s; }
.dim::before, .dim::after { content: ""; height: 1px; flex: 1; background: currentColor; }
.typed { font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-variation-settings: "wdth" 90; font-weight: 500; min-height: 1.3em; }
.typed b { font-weight: 700; color: #fff; }
.caret { display: inline-block; width: .55em; height: .09em; background: var(--orange); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .sub { margin-top: 20px; max-width: 48ch; color: #cfd8c9; font-size: 1.08rem; }

/* ===================== arcade ===================== */
.arcade { background: #101614; color: #e7ece8; padding: 0; }
.arcade .head { padding-top: clamp(72px, 10vw, 120px); }
.arcade .lede { color: #9fb0a8; }
.scrolly { height: 420vh; position: relative; }
.stage { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; }
.stage canvas { width: min(100%, 88svh); aspect-ratio: 1; justify-self: center; }
.caps { position: relative; height: 50svh; }
.cap { position: absolute; top: 0; bottom: 0; left: 0; right: var(--gut); display: flex; flex-direction: column; justify-content: center; opacity: 0; transition: opacity .45s; }
.cap.on { opacity: 1; }
.cap h3 { font-size: clamp(1.5rem, 3vw, 2.3rem); margin-bottom: .5em; }
.cap p { color: #9fb0a8; max-width: 36ch; }
.cap .step { font-variation-settings: "wdth" 70; color: var(--orange); margin-bottom: .6em; }
.bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--orange); width: 0; }
@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 56svh auto; }
  .stage canvas { width: min(100%, 56svh); }
  .caps { height: 34svh; }
  .cap { justify-content: flex-start; left: var(--gut); }
}

/* ===================== work ===================== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 40px; }
.filters button { font: inherit; font-variation-settings: "wdth" 85; border: 1.5px solid var(--ink); background: none; color: var(--ink); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filters .count { opacity: .6; margin-left: 6px; }
[data-cat][hidden] { display: none !important; }
.proj { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(20px, 4vw, 56px); padding: 40px 0; border-top: 1px solid var(--rule); align-items: center; }
.proj:last-child { border-bottom: 1px solid var(--rule); }
.scope { display: inline-block; color: var(--orange); font-weight: 600; font-variation-settings: "wdth" 82; margin: 6px 0 12px; }
.proj p { color: var(--graphite); max-width: 52ch; }
.more { display: inline-block; margin-top: 18px; font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--orange); padding-bottom: 2px; }
.more:hover { color: var(--orange); }
.proj .img { aspect-ratio: 4/3; background: var(--paper-2); border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.proj .img.dark { background: #101614; }
.proj .img img { width: 100%; height: 100%; object-fit: contain; }
.imgph { color: var(--graphite); font-variation-settings: "wdth" 72; font-size: .9rem; text-align: center; padding: 20px; border: 1.5px dashed var(--rule); border-radius: 4px; width: calc(100% - 28px); height: calc(100% - 28px); display: grid; place-items: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-variation-settings: "wdth" 75; font-size: .88rem; color: var(--graphite); list-style: none; }
.tags li::before { content: "+ "; color: var(--orange); }
@media (max-width: 760px) { .proj { grid-template-columns: 1fr; } }
.smallgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; padding: 40px 0; border-top: 1px solid var(--rule); }
.small .img { aspect-ratio: 1; background: var(--paper-2); border-radius: 4px; display: grid; place-items: center; margin-bottom: 12px; overflow: hidden; }
.small .img img { width: 100%; height: 100%; object-fit: cover; }
.small h3 { font-size: 1.1rem; }
.small .scope { font-size: .9rem; margin: 4px 0 4px; }
.small p { color: var(--graphite); font-size: .95rem; }
.drawer-note { margin-top: 8px; }

/* ===================== about + map ===================== */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; margin-top: 24px; }
.spec { border: 1.5px solid var(--ink); border-collapse: collapse; font-size: .97rem; margin-top: 36px; width: 100%; max-width: 560px; }
.spec caption { text-align: left; padding: 8px 12px; border: 1.5px solid var(--ink); border-bottom: 0; font-variation-settings: "wdth" 75; background: var(--ink); color: var(--paper); }
.spec th, .spec td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: top; text-align: left; }
.spec th { font-weight: 600; font-variation-settings: "wdth" 80; width: 7.5em; }
.spec td { color: var(--graphite); }
.map svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.map .land { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.map .pinmark circle { fill: var(--orange); }
.map .pinmark text { fill: #fff; font: 700 13px "Archivo", sans-serif; text-anchor: middle; }
.map .pinmark .halo { fill: none; stroke: var(--orange); stroke-width: 1.5; opacity: .4; }
.pins { list-style: none; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-variation-settings: "wdth" 85; }
.pin { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; font-size: .85rem; margin-right: 6px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ===================== path (Venn) ===================== */
.path { background: var(--paper-2); }
.path .grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 5vw, 72px); align-items: center; margin-top: 32px; }
.steps { list-style: none; display: grid; gap: 4px; }
.steps button { all: unset; cursor: pointer; display: grid; grid-template-columns: 2.2em 1fr; gap: 6px 10px; padding: 16px 14px; border-radius: 4px; width: 100%; box-sizing: border-box; }
.steps button:focus-visible { outline: 3px solid var(--orange); }
.steps .n { font-weight: 800; font-variation-settings: "wdth" 120; color: var(--graphite); }
.steps .t { font-weight: 700; }
.steps .d { grid-column: 2; color: var(--graphite); display: none; font-size: .97rem; }
.steps button[aria-selected="true"] { background: var(--paper); }
.steps button[aria-selected="true"] .n { color: var(--orange); }
.steps button[aria-selected="true"] .d { display: block; }
.venn svg { width: 100%; height: auto; }
.venn text { font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 85; font-size: 15px; fill: var(--ink); }
.venn text.b { font-weight: 700; }
.venn text.s { font-size: 12.5px; fill: var(--graphite); }
.venn .c1 { fill: var(--orange); fill-opacity: .14; stroke: var(--ink); stroke-width: 1.5; }
.venn .c2 { fill: var(--mat); fill-opacity: .14; stroke: var(--ink); stroke-width: 1.5; }
.venn .c3 { fill: var(--graphite); fill-opacity: .12; stroke: var(--ink); stroke-width: 1.5; }
.venn .cd { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 5; }
.venn .ring { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 2 6; }
.venn .dot { fill: var(--orange); }
@media (max-width: 860px) { .path .grid { grid-template-columns: 1fr; } }

/* ===================== bridge ===================== */
.bridge .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: 40px; }
.bridge .col h3 { margin-bottom: .5em; }
.bridge .col p { color: var(--graphite); }
.bridge .diagram { margin-top: 48px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; font-variation-settings: "wdth" 85; }
.bridge .node { border: 1.5px solid var(--ink); padding: 14px; border-radius: 4px; }
.bridge .node.mid { background: var(--ink); color: var(--paper); font-weight: 700; }
.bridge .arrow { width: 48px; height: 2px; background: var(--orange); position: relative; }
.bridge .arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 8px solid var(--orange); }
@media (max-width: 860px) {
  .bridge .cols { grid-template-columns: 1fr; }
  .bridge .diagram { grid-template-columns: 1fr; }
  .bridge .arrow { width: 2px; height: 28px; justify-self: center; }
  .bridge .arrow::after { right: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top: 8px solid var(--orange); }
}

/* ===================== skills ===================== */
.editlink { font-size: .9rem; font-variation-settings: "wdth" 80; color: var(--orange); }
.skills .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px clamp(32px, 6vw, 96px); margin-top: 40px; }
.skillset h3 { margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.sk { display: grid; grid-template-columns: 14em 1fr; gap: 12px; align-items: center; padding: 6px 0; }
.sk span { font-variation-settings: "wdth" 85; }
.gauge { height: 12px; position: relative; background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 10%), var(--paper-2); }
.gauge i { position: absolute; inset: 0 auto 0 0; background: var(--ink); width: calc(var(--v) * 10%); }
.gauge i::after { content: ""; position: absolute; right: -1px; top: -4px; bottom: -4px; width: 2px; background: var(--orange); }
@media (max-width: 860px) { .skills .grid { grid-template-columns: 1fr; } .sk { grid-template-columns: 1fr; gap: 4px; } }

/* línguas */
.langs { margin-top: 72px; }
.langs-h { margin-bottom: 18px; }
.lang { display: grid; grid-template-columns: 12em 1fr 10em; gap: 4px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); }
.lang.legend-row { border-top: 0; padding-bottom: 4px; }
.lang .name { font-weight: 700; }
.lang .name s { color: var(--graphite); font-weight: 500; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.lang .lvl { font-variation-settings: "wdth" 80; color: var(--graphite); text-align: right; }
.cefr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.cefr i { height: 12px; background: var(--paper-2); position: relative; overflow: hidden; }
.cefr i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--f, 0%); background: var(--ink); }
.cefr.cefr-key i { background: none; height: auto; font-style: normal; font-size: .75rem; color: var(--graphite); font-variation-settings: "wdth" 75; }
.cefr.cefr-key i::before { display: none; }
.lang .why { grid-column: 2 / 4; font-size: .9rem; color: var(--graphite); }
@media (max-width: 720px) { .lang { grid-template-columns: 1fr 7.5em; } .lang .cefr { grid-column: 1 / 3; grid-row: 2; } .lang .why { grid-column: 1 / 3; } }

/* ===================== patentese → patents ===================== */
.patents { }
.patentese { position: sticky; top: 64px; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); border-top: 1px solid var(--rule); padding: 0; display: block; }
.patentese .pt-inner { display: grid; grid-template-columns: 12em 1fr 10em; gap: 4px 16px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.patentese .cefr i::before { background: var(--orange); transition: width .25s; }
.patentese .lvl { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) { .patentese .pt-inner { grid-template-columns: 1fr 9em; } .patentese .cefr { grid-column: 1 / 3; grid-row: 2; } .patentese .why { grid-column: 1 / 3; } }
.pt-lede { margin: 56px 0 24px; }
.plist { list-style: none; }
.plist li { display: grid; grid-template-columns: 6em 1fr; gap: 20px; padding: 36px 0; border-top: 1px solid var(--rule); }
.plist .y { font-weight: 800; font-variation-settings: "wdth" 120; color: var(--graphite); }
.pt-title { font-variation-settings: "wdth" 68; font-size: 1.05rem; color: var(--graphite); max-width: 70ch; }
.tr { font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 600; font-variation-settings: "wdth" 108; line-height: 1.2; margin: 10px 0 8px; }
.tr b { color: var(--orange); font-weight: 600; font-size: .6em; font-variation-settings: "wdth" 80; display: block; margin-bottom: 2px; }
.plist .meta { font-size: .88rem; color: var(--graphite); font-variation-settings: "wdth" 80; }
@media (max-width: 720px) { .plist li { grid-template-columns: 1fr; gap: 4px; } }

/* ===================== awards ===================== */
.awards .lede { margin-bottom: 36px; }
.award { display: grid; grid-template-columns: 6em 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--rule); }
.award .y { font-weight: 800; font-variation-settings: "wdth" 120; color: var(--graphite); }
.award .what { color: var(--orange); font-weight: 600; font-variation-settings: "wdth" 85; }
.award p { color: var(--graphite); max-width: 60ch; }

/* ===================== research ===================== */
.academic { background: var(--paper-2); }
.academic .grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin-top: 32px; }
.academic h3 { margin-bottom: 8px; }
.academic ul { list-style: none; }
.academic li { padding: 12px 0; border-top: 1px solid var(--rule); }
.academic li a { text-decoration: none; }
.academic li a:hover { text-decoration: underline; text-decoration-color: var(--orange); }
.academic li small { display: block; color: var(--graphite); font-variation-settings: "wdth" 80; }
.academic .links { margin-top: 18px; display: flex; gap: 20px; flex-wrap: wrap; }
.academic .links a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--orange); }
.teach { margin-top: 56px; }
.teach ul { columns: 2; column-gap: clamp(32px, 6vw, 96px); }
.teach li { break-inside: avoid; color: var(--graphite); }
.teach b { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .academic .grid { grid-template-columns: 1fr; } .teach ul { columns: 1; } }

/* ===================== beyond ===================== */
.beyond .row { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(24px, 5vw, 72px); padding: 56px 0; border-top: 1px solid var(--rule); align-items: start; }
.beyond h2 + .row { border-top: 0; }
.beyond .row h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .4em; }
.beyond .row p { color: var(--graphite); max-width: 54ch; margin-bottom: .8em; }
.beyond blockquote { font-size: clamp(1.4rem, 2.6vw, 2rem); font-variation-settings: "wdth" 110; font-weight: 600; line-height: 1.2; border-left: 3px solid var(--orange); padding-left: 20px; margin: 18px 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.imgbox { aspect-ratio: 3/4; background: var(--paper-2); border-radius: 4px; display: grid; place-items: center; }
.pipeline { list-style: none; counter-reset: p; }
.pipeline li { counter-increment: p; display: grid; grid-template-columns: 2.4em 1fr; padding: 12px 0; border-top: 1px solid var(--rule); }
.pipeline li::before { content: counter(p); font-weight: 800; font-variation-settings: "wdth" 120; color: var(--orange); }
.strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.strip img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 3px; }
.races { list-style: none; }
.races li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule); }
.races li span:last-child { font-variation-settings: "wdth" 75; color: var(--graphite); text-align: right; }
.races li.phd { font-weight: 700; }
.ext { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--orange); }
@media (max-width: 860px) { .beyond .row { grid-template-columns: 1fr; } }

/* ===================== contact ===================== */
.contact { background: var(--mat); color: var(--mat-ink); position: relative; overflow: hidden; }
.contact::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--mat-line) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 32px 32px; opacity: .55; }
.contact .wrap { position: relative; }
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.contact h2 { font-variation-settings: "wdth" 125; font-size: clamp(2.4rem, 6.5vw, 5rem); letter-spacing: -0.035em; }
.contact .lede { color: #cfd8c9; }
.contact .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.contact .links a { text-decoration: none; border: 1.5px solid var(--mat-ink); padding: 8px 16px; border-radius: 999px; font-weight: 600; }
.contact .links a:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.cform { display: grid; gap: 14px; background: rgba(16,22,20,.35); padding: 24px; border: 1px solid var(--mat-line); border-radius: 4px; }
.cform label { display: grid; gap: 6px; font-variation-settings: "wdth" 85; font-size: .92rem; }
.cform input, .cform textarea { font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 0; border-radius: 3px; padding: 10px 12px; }
.cform button { font: inherit; font-weight: 700; background: var(--mat-ink); color: var(--mat); border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; justify-self: start; }
.cform button:hover { background: var(--orange); color: #fff; }
.formnote { font-size: .9rem; min-height: 1.2em; }
.contact footer { margin-top: 96px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-variation-settings: "wdth" 75; font-size: .88rem; opacity: .75; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } .caret { animation: none; } .cap { transition: none; }
  .hero-name .x { max-width: none !important; opacity: 1 !important; }
}
.venn .scene[hidden] { display: none; }

/* ===================== v3: equipa, duo, venn, ponte, patentes ===================== */
.proj .team { font-size: .92rem; margin-top: 14px; color: var(--graphite); }
.proj .team b { color: var(--ink); font-weight: 600; }
.proj .img.duo { grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.proj .img.duo img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; min-height: 0; }
.proj .img.duo video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }

.venn text { paint-order: stroke; stroke: var(--paper-2); stroke-width: 5px; stroke-linejoin: round; }
.venn text.o { fill: var(--orange); font-size: 17px; }
.venn text.g { fill: var(--graphite); }
.venn .c4 { fill: #7d8f4e; fill-opacity: .14; stroke: var(--ink); stroke-width: 1.5; }
.venn .set { fill: var(--orange); fill-opacity: .10; stroke: var(--orange); stroke-width: 2.5; }
.venn .cd { stroke: var(--graphite); }

.bridge .diagram { align-items: start; margin: 48px 0 0; }
.bridge .bstage p { margin-top: 10px; color: var(--graphite); font-size: .95rem; }
.bridge .arrow { margin-top: 24px; }
.bridge .cols-h { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--rule); color: var(--graphite); font-weight: 600; }
.bridge .cols { margin-top: 20px; }
@media (max-width: 860px) { .bridge .arrow { margin-top: 0; } }

.langs { margin-top: 0; }
.patentese { border-bottom: 0; transition: box-shadow .2s; }
.patentese.stuck { border-bottom: 1px solid var(--rule); }
.pt-lede { margin-top: calc(18vh + 32px); }
.pgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.plist li { position: relative; transition: opacity .3s; }
.plist li::before { content: ""; position: absolute; left: -16px; top: 36px; bottom: 36px; width: 3px; background: var(--orange); transform: scaleY(0); transform-origin: top; transition: transform .35s; }
.plist li.on::before { transform: none; }
.plist li.on .y { color: var(--orange); }
.plist li.on .pt-title { color: var(--ink); }
.pfig { position: sticky; top: 180px; height: calc(100vh - 220px); display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); margin: 0; }
.pfig > * { grid-area: 1 / 1; min-height: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: translateY(14px); transition: opacity .45s, transform .45s; }
.pfig > .on { opacity: 1; transform: none; }
.pfig-ph { display: grid; place-items: center; border: 1.5px dashed var(--rule); border-radius: 4px; color: var(--graphite); text-align: center; font-variation-settings: "wdth" 75; font-size: .9rem; }
@media (max-width: 860px) {
  .pgrid { grid-template-columns: 1fr; }
  .pfig { order: -1; top: 186px; height: 28vh; z-index: 4; background: var(--paper); padding: 8px 0; }
  .plist li::before { left: -10px; }
}
@media (prefers-reduced-motion: reduce) { .pfig > * { transition: none; } }

/* ===================== v4: percurso com scroll, figura centrada, páginas com sequência ===================== */
@media (min-width: 861px) and (min-height: 620px) {
  .path.pinned { padding: 0; }
  .path.pinned > .wrap { position: sticky; padding-top: 56px; padding-bottom: 56px; }
  .path.pinned .steps button { transition: background .3s; }
}
.path .scrollhint { font-size: .85rem; color: var(--graphite); font-variation-settings: "wdth" 80; margin-top: 8px; }
.pfig { top: max(170px, 26vh); height: min(58vh, calc(100vh - 230px)); }
.plist { padding-bottom: 30vh; }

.scrollsec { background: #101614; color: #e7ece8; padding: 0; }
.scrollsec .head { padding-top: clamp(96px, 12vw, 140px); }
.scrollsec .lede { color: #9fb0a8; }
.scrollsec .stage { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; }
.scrollsec .stage canvas { width: min(100%, 88svh); aspect-ratio: 1; justify-self: center; }
.scrollsec.light { background: var(--paper-2); color: var(--ink); }
.scrollsec.light .lede, .scrollsec.light .cap p { color: var(--graphite); }
.scrollsec + .wrap { padding-top: 56px; }
@media (max-width: 860px) {
  .scrollsec .stage { grid-template-columns: 1fr; grid-template-rows: 56svh auto; }
  .scrollsec .stage canvas { width: min(100%, 56svh); }
}
.academic .note { font-size: .88rem; color: var(--graphite); margin-bottom: 10px; } .academic h4 { margin: 32px 0 6px; font-size: 1.05rem; }

/* listas com More / Less */
.collapsible > li[hidden] { display: none; }
.morebtn { margin-top: 14px; font: inherit; font-weight: 600; font-size: .95rem; color: var(--ink); background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 16px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.morebtn::before { content: "+"; color: var(--orange); font-weight: 800; }
.morebtn[aria-expanded="true"]::before { content: "2"; }
.morebtn:hover { background: var(--ink); color: var(--paper); }
.morebtn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
/* escultura */
.sculpt { margin: 12px 0 0; }
.sculpt img { width: 100%; border-radius: 4px; display: block; }
.sculpt figcaption { font-size: .85rem; color: var(--graphite); font-variation-settings: "wdth" 80; padding-top: 6px; }
.imgbox.wide { aspect-ratio: 16/9; margin-top: 12px; }
/* ampliar imagens */
img[data-zoom] { cursor: zoom-in; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 14, 12, .92); }
.lightbox img { position: absolute; inset: 0; margin: auto; max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 3px; cursor: zoom-out; }
.lightbox p { position: absolute; left: 0; right: 0; bottom: 2vh; text-align: center; color: #c9d4ce; font-size: .9rem; font-variation-settings: "wdth" 80; }
.lightbox button { position: absolute; top: 16px; right: 16px; font: inherit; font-weight: 600; color: #e7ece8; background: none; border: 1.5px solid #e7ece8; border-radius: 999px; padding: 6px 14px; cursor: pointer; }

/* ---- v5: selo "in progress", imagens-link, partes que não vão para o site publicado ---- */
.theses li.ongoing small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: #2f6b45;
       background: #e3f1e6; border-radius: 999px; padding: 2px 10px 2px 8px; }
.wip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fa35a; box-shadow: 0 0 0 0 rgba(47,163,90,.6); animation: wip 1.8s ease-out infinite; }
@keyframes wip { 0% { box-shadow: 0 0 0 0 rgba(47,163,90,.55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(47,163,90,0); } }
@media (prefers-reduced-motion: reduce) { .wip::before { animation: none; } }
a.img { text-decoration: none; cursor: pointer; transition: filter .2s; }
a.img:hover { filter: brightness(1.04) contrast(1.03); }
.proj .img.duo:has(> :only-child) { grid-template-columns: 1fr; }
/* só no mockup: assinala o que é retirado ao publicar */
.unpub { outline: 2px dashed #c0392b; outline-offset: -2px; }

/* ---- v6: folha de patente (figura + legenda), patentês em letra de máquina ---- */
.pt-title { font-family: "Courier Prime", "Courier New", monospace; font-variation-settings: normal; font-size: .98rem; line-height: 1.45; }
.psheet { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; }
.psheet img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.figno { font-family: "Courier Prime", "Courier New", monospace; font-size: .9rem; text-align: center; color: var(--graphite); }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5em, 1fr)); gap: 3px 18px; font-size: .84rem; line-height: 1.3;
          border-top: 1px solid var(--rule); padding-top: 10px; font-variation-settings: "wdth" 85; }
.legend div { display: flex; gap: 8px; align-items: baseline; }
.legend dt { font-family: "Courier Prime", "Courier New", monospace; font-weight: 700; min-width: 2.2em; color: var(--orange); }
.legend dd { margin: 0; color: var(--ink); }
@media (max-width: 860px) { .psheet .legend { display: none; } .psheet { grid-template-rows: minmax(0, 1fr) auto; } }

/* ---- v7: ligações ao doutoramento (rabisco à volta do PhD, link no passo 2) ---- */
.doodle { position: relative; isolation: isolate; color: inherit; text-decoration: none; white-space: nowrap; }
.doodle .ring { position: absolute; left: -5%; top: -45%; width: 110%; height: 190%; overflow: visible; pointer-events: none; z-index: -1; }
.doodle .ring path, .doodle .note path { fill: none; stroke: var(--orange); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .9; }
.doodle .note { position: absolute; left: 88%; bottom: 112%; font-family: "Caveat", cursive; font-weight: 600; font-size: 1.2rem; line-height: 1; color: var(--orange);
  white-space: nowrap; transform: rotate(-4deg); display: flex; flex-direction: column; align-items: flex-start; pointer-events: none; }
.doodle .note svg { width: 30px; height: 22px; margin: 1px 0 0 -6px; }
.doodle:hover .ring path { stroke-width: 2.4; }
.doodle:focus-visible { outline: 3px solid var(--orange); outline-offset: 8px; border-radius: 4px; }
@media (max-width: 760px) { .doodle { white-space: normal; border-bottom: 2px solid var(--orange); } .doodle .ring, .doodle .note { display: none; } }
.steplink { display: none; margin-top: 12px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--orange); width: fit-content; }
.steps button[aria-selected="true"] + .steplink { display: inline-block; margin: 6px 0 4px 62px; }
.races .phd a { color: inherit; font-weight: inherit; border-bottom: 2px solid var(--orange); text-decoration: none; }

/* ---- v8: palestras e divulgação ---- */
.talks { margin-top: 56px; }
.talks .note { color: var(--graphite); max-width: 60ch; margin-bottom: 14px; }
.talklist { list-style: none; max-width: 70ch; }
.talklist li { padding: 12px 0; border-top: 1px solid var(--rule); }
.talklist a { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--orange); }
.talklist small { display: block; color: var(--graphite); font-size: .85rem; margin-top: 4px; font-variation-settings: "wdth" 85; }
.talkshots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.talkshots figure { margin: 0; }
.talkshots img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; display: block; cursor: zoom-in; }
.talkshots figcaption { font-size: .85rem; color: var(--graphite); margin-top: 6px; }
@media (max-width: 760px) { .talkshots { grid-template-columns: 1fr; } }
.talkshots figure.wide { grid-column: 1 / -1; } .talkshots figure.wide img { aspect-ratio: auto; cursor: pointer; }
.talkshots figcaption a { color: var(--ink); font-weight: 600; border-bottom: 1.5px solid var(--orange); text-decoration: none; }
.talklist .t { font-weight: 600; color: var(--ink); }
/* foto no About (opção B) */
.me-row { margin-top: 36px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
.me-row .spec { margin: 0; }
.me-side { margin: 0; }
.me-side img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: 60% 30%; border-radius: 4px; display: block; cursor: zoom-in; }
.me-side figcaption { font-size: .85rem; color: var(--graphite); margin-top: 8px; }
@media (max-width: 760px) { .me-row { grid-template-columns: 1fr; } .me-side { max-width: 320px; } }

/* ===== 2026-11-16 ===== */
/* About: o mapa nunca fica mais alto do que a coluna do texto (contain: size tira-lhe a altura própria) */
@media (min-width: 861px) {
  .about-grid { align-items: stretch; }
  .about-grid > .map { contain: size; display: flex; flex-direction: column; margin: 0; min-height: 0; }
  .about-grid > .map svg { flex: 1 1 auto; min-height: 0; height: 100%; width: 100%; max-width: 300px; }
}
/* Ponte: as setas vão nos dois sentidos */
.bridge .arrow::before { content: ""; position: absolute; left: -1px; top: -4px; border: 5px solid transparent; border-right: 8px solid var(--orange); }
@media (max-width: 860px) {
  .bridge .arrow::before { left: -4px; top: -1px; border: 5px solid transparent; border-bottom: 8px solid var(--orange); }
}
/* Contacto: palavra a escrever-se */
.contact .typed2 { color: #fff; font-weight: 700; }
