/* ==========================================================================
   Bruno Carneiro Leão — portfólio
   1. Tokens  2. Base  3. Barra superior  4. Hero  5. Seções  6. Componentes
   7. Configurações  8. Lente  9. Responsivo  10. Impressão
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */
:root {
  --font-sans: "Bricolage Grotesque", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --accent-l: #D9480B;
  --accent-d: #FF6A2B;

  --bg: #FFFFFF;
  --bg-2: #F5F6F9;
  --ink: #0B0E17;
  --ink-2: #3A4258;
  --muted: #5F6779;
  --line: #E4E7EE;
  --line-2: #CBD1DD;
  --field-dot: #0B0E17;
  --on-accent: #FFFFFF;
  --accent: var(--accent-l);
  --accent-ink: color-mix(in oklab, var(--accent) 85%, black);
  --accent-soft: color-mix(in oklab, var(--accent) 11%, transparent);
  --shadow: 0 24px 60px -28px rgb(11 14 23 / .28);

  --radius: 14px;
  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1180px;
  --top-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-accent="cobalt"]  { --accent-l: #1F5EE8; --accent-d: #4C84FF; }
:root[data-accent="emerald"] { --accent-l: #0A7D54; --accent-d: #2BD095; }
:root[data-accent="violet"]  { --accent-l: #6D4AE8; --accent-d: #A78BFF; }
:root[data-accent="rose"]    { --accent-l: #D11A56; --accent-d: #FF5C8A; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0E17;
    --bg-2: #111627;
    --ink: #EEF0F6;
    --ink-2: #C2C7D6;
    --muted: #8B93A7;
    --line: #1E2436;
    --line-2: #2B3349;
    --field-dot: #EEF0F6;
    --on-accent: #0B0E17;
    --accent: var(--accent-d);
    --accent-ink: color-mix(in oklab, var(--accent) 85%, white);
    --shadow: 0 30px 80px -30px rgb(0 0 0 / .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0E17;
  --bg-2: #111627;
  --ink: #EEF0F6;
  --ink-2: #C2C7D6;
  --muted: #8B93A7;
  --line: #1E2436;
  --line-2: #2B3349;
  --field-dot: #EEF0F6;
  --on-accent: #0B0E17;
  --accent: var(--accent-d);
  --accent-ink: color-mix(in oklab, var(--accent) 85%, white);
  --shadow: 0 30px 80px -30px rgb(0 0 0 / .65);
  color-scheme: dark;
}

:root[data-size="s"] { font-size: 15px; }
:root[data-size="l"] { font-size: 18px; }

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
html[data-motion="off"] { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 3000;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500;
  transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; }
.noscript { padding: 120px var(--gutter); text-align: center; color: var(--muted); }

/* View Transitions (troca de tema) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* 3. Barra superior ------------------------------------------------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--top-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.topbar.scrolled {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: var(--line);
}
.brand {
  margin-right: auto;
  font-weight: 600; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.topnav { display: flex; gap: 2px; }
.topnav a {
  padding: 8px 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .92rem;
  transition: color .2s, background-color .2s;
}
.topnav a:hover { color: var(--ink); }
.topnav a.active { color: var(--ink); background: var(--accent-soft); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.langswitch {
  display: inline-flex; padding: 2px;
  border: 1px solid var(--line-2); border-radius: 999px;
}
.langswitch button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 9px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--muted);
  transition: background-color .2s, color .2s;
}
.langswitch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.iconbtn:hover { border-color: var(--ink); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 18px; height: 18px; }
html[data-theme-effective="dark"] .icon-moon { display: none; }
html:not([data-theme-effective="dark"]) .icon-sun { display: none; }

/* 4. Hero ----------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: grid; align-items: center;
  overflow: hidden;
}
.hero__field {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}
html[data-field="off"] .hero__field { display: none; }
.hero__inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: calc(var(--top-h) + 56px) var(--gutter) 128px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero__text { min-width: 0; }
.hero__intro { font-size: 1.05rem; color: var(--muted); margin-bottom: 14px; }
.hero__name {
  font-size: min(10.5vw, 9.5rem);
  line-height: .88; font-weight: 640; letter-spacing: -.04em;
  font-variation-settings: "opsz" 96;
  margin: 0 0 34px -.04em;
  transform: translate(calc(var(--px, 0) * 4px), calc(var(--py, 0) * 3px));
  transition: transform .7s var(--ease);
}
.hero__line { display: block; white-space: nowrap; }
.hero__name .ch {
  display: inline-block; opacity: 0;
  transform: translateY(.4em) rotate(3deg); transform-origin: left bottom;
  animation: riseCh .9s var(--ease) forwards;
  animation-delay: calc(.15s + var(--i) * .032s);
}
.hero__role {
  font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 500; letter-spacing: -.01em;
  line-height: 1.35; max-width: 34ch; color: var(--ink);
}
.hero__statement { margin-top: 16px; max-width: 54ch; font-size: 1.05rem; color: var(--ink-2); }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin-top: 22px; font-size: .92rem; color: var(--muted);
}
.hero__meta li { display: flex; align-items: center; gap: 8px; }
.hero__meta li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__photo {
  position: relative;
  width: clamp(150px, 18vw, 250px); aspect-ratio: 4 / 5;
  margin: 0 14px 14px 0; border-radius: 26px;
}
.hero__photo img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
  background: var(--bg-2);
  transform: translate(calc(var(--px, 0) * -7px), calc(var(--py, 0) * -7px));
  transition: transform .7s var(--ease);
}
.hero__frame {
  position: absolute; inset: 0; border-radius: inherit;
  border: 1.5px solid var(--accent);
  animation: frameOut 1s var(--ease) 1.1s forwards;
}
.hero__scroll {
  position: absolute; left: var(--gutter); bottom: 30px; z-index: 1;
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: .85rem; text-decoration: none;
  opacity: 0; animation: rise .8s var(--ease) 1.7s forwards;
}
.hero__scroll-line { position: relative; overflow: hidden; width: 44px; height: 1px; background: var(--line-2); }
.hero__scroll-line::after {
  content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
  background: var(--accent); animation: slideX 1.8s var(--ease) infinite;
}
[data-rise] {
  opacity: 0; transform: translateY(16px);
  animation: rise .9s var(--ease) forwards;
  animation-delay: calc(.35s + var(--d, 0) * .11s);
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes riseCh { to { opacity: 1; transform: none; } }
@keyframes frameOut { to { transform: translate(14px, 14px); } }
@keyframes slideX { from { transform: translateX(-120%); } to { transform: translateX(300%); } }

.settled [data-rise], .settled .hero__name .ch, .settled .hero__scroll,
html[data-motion="off"] [data-rise], html[data-motion="off"] .hero__name .ch, html[data-motion="off"] .hero__scroll {
  animation: none; opacity: 1; transform: none;
}
.settled .hero__frame, html[data-motion="off"] .hero__frame { animation: none; transform: translate(14px, 14px); }
html[data-motion="off"] .hero__scroll-line::after { animation: none; }

/* 5. Seções --------------------------------------------------------------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  column-gap: clamp(32px, 6vw, 96px);
  border-top: 1px solid var(--line);
}
.section__label { position: sticky; top: calc(var(--top-h) + 28px); align-self: start; }
.section__label h2 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.section__body { min-width: 0; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; margin-bottom: 28px; }
.prose p { max-width: 62ch; font-size: 1.05rem; color: var(--ink-2); }
.prose p + p { margin-top: 16px; }
.subhead { font-size: 1rem; font-weight: 600; margin: 44px 0 14px; }

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
html[data-motion="off"] [data-reveal] { opacity: 1; transform: none; transition: none; }

/* 6. Componentes ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font-weight: 500; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { border-color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0) scale(.98); }

/* Fatos */
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px;
  margin-top: 40px; border-top: 1px solid var(--line);
}
.fact { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.fact__value {
  display: block; font-size: 2.2rem; font-weight: 600; letter-spacing: -.03em; line-height: 1;
  font-variation-settings: "opsz" 48; color: var(--ink);
}
.fact__label { display: block; margin-top: 8px; font-size: .92rem; color: var(--muted); max-width: 24ch; }

/* Linha do tempo */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.timeline__progress {
  position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: var(--accent); border-radius: 2px;
  transform-origin: top; transform: scaleY(0);
  transition: transform 1.4s var(--ease) .15s;
}
.timeline.in .timeline__progress { transform: scaleY(1); }
.job {
  position: relative; padding-bottom: 52px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: calc(.25s + var(--d, 0) * .3s);
}
.job:last-child { padding-bottom: 0; }
.timeline.in .job { opacity: 1; transform: none; }
.job::before {
  content: ""; position: absolute; left: -34px; top: 7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.job--current::before { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px color-mix(in oklab, var(--accent) 0%, transparent); }
}
html[data-motion="off"] .job--current::before { animation: none; }
.job__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: baseline; }
.job__role { font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; }
.job__company { grid-column: 1; margin-top: 2px; color: var(--ink-2); }
.job__place { color: var(--muted); margin-left: 8px; }
.job__period { grid-column: 2; grid-row: 1 / span 2; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.job--current .job__period { color: var(--accent-ink); font-weight: 500; }
.job__bullets { display: grid; gap: 8px; margin-top: 14px; max-width: 64ch; color: var(--ink-2); }
.job__bullets li, .certs li { position: relative; padding-left: 18px; }
.job__bullets li::before, .certs li::before {
  content: ""; position: absolute; left: 0; top: .75em; width: 8px; height: 1.5px; background: var(--line-2);
}

/* Habilidades */
.skillgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
.sgroup__name {
  font-size: .95rem; font-weight: 600; color: var(--ink-2);
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.sgroup__list { display: flex; flex-wrap: wrap; gap: 8px; }
.sgroup__list:has(.skill) { display: block; }
.skill {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; row-gap: 1px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.skill:last-child { border-bottom: 0; }
.skill__name { font-weight: 500; }
.skill__lvl { display: inline-flex; gap: 4px; align-self: center; }
.skill__lvl i {
  width: 16px; height: 5px; border-radius: 3px; background: var(--line-2);
  transition: background-color .5s var(--ease);
  transition-delay: calc(.2s + var(--d, 0) * .08s);
}
.in .skill__lvl[data-level="1"] i:nth-child(1),
.in .skill__lvl[data-level="2"] i:nth-child(-n+2),
.in .skill__lvl[data-level="3"] i { background: var(--accent); }
.skill__note { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.chip-item {
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px;
  font-size: .92rem; color: var(--ink);
}
.chip-item__note { color: var(--muted); margin-left: 6px; }

/* Consulta SQL */
.console {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden;
}
.console__presets { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
.chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font-size: .9rem; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.console__sql {
  margin: 0; padding: 22px 20px 18px; min-height: 6.4em;
  font-family: var(--font-mono); font-size: .95rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; color: var(--ink);
}
.console__sql b { font-weight: 500; color: var(--accent-ink); }
.console__sql i { font-style: normal; color: var(--ink-2); }
.caret {
  display: none; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -.18em;
  background: var(--accent); animation: blink 1s steps(2) infinite;
}
.console__sql.typing .caret { display: inline-block; }
@keyframes blink { 50% { opacity: 0; } }
.console__out { padding: 8px 20px 16px; min-height: 120px; border-top: 1px dashed var(--line-2); background: var(--bg); }
.console__empty { padding: 20px 0; color: var(--muted); }
.console__out table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.console__out th {
  text-align: left; font-weight: 500; font-size: .85rem; color: var(--muted);
  padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line);
}
.console__out td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.console__out tbody tr {
  opacity: 0; transform: translateX(-6px);
  animation: rowIn .45s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 70ms);
}
@keyframes rowIn { to { opacity: 1; transform: none; } }
html[data-motion="off"] .console__out tbody tr { animation: none; opacity: 1; transform: none; }
.console__meta { margin: 10px 0 0; font-family: var(--font-mono); font-size: .78rem; color: var(--muted); min-height: 1.2em; }

/* Projetos */
.plist { border-top: 1px solid var(--line); }
.prow { border-bottom: 1px solid var(--line); }
.prow__link {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 22px;
  gap: 8px 24px; align-items: start;
  padding: 22px 14px; margin: 0 -14px;
  color: inherit; text-decoration: none; border-radius: 12px;
  transition: background-color .25s;
}
.prow__link:hover { background: var(--accent-soft); }
.prow__name { display: block; font-size: 1.2rem; font-weight: 600; letter-spacing: -.012em; }
.prow__desc { display: block; margin-top: 4px; color: var(--muted); max-width: 52ch; }
.prow__stack { display: flex; flex-wrap: wrap; gap: 6px 10px; padding-top: 6px; font-size: .88rem; color: var(--ink-2); }
.prow__icon { width: 22px; height: 22px; margin-top: 4px; color: var(--muted); transition: transform .3s var(--ease), color .3s; }
.prow__link:hover .prow__icon { transform: translate(3px, -3px); color: var(--accent-ink); }

/* Formação */
.edu { margin-bottom: 8px; }
.edu__item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.edu__item:first-child { border-top: 1px solid var(--line); }
.edu__school { font-size: 1.1rem; font-weight: 600; }
.edu__degree { grid-column: 1; color: var(--ink-2); }
.edu__period { grid-column: 2; grid-row: 1 / span 2; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.certs { display: grid; gap: 10px; max-width: 66ch; color: var(--ink-2); }

/* Contato */
.contact__heading {
  font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 600; letter-spacing: -.035em; line-height: 1;
  font-variation-settings: "opsz" 96; margin-bottom: 22px;
}
.contact__email {
  display: inline-block; margin: 20px 0 30px;
  font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 500; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-size: 0% 2px; background-position: 0 100%;
  transition: background-size .4s var(--ease);
  padding-bottom: 4px;
}
.contact__email:hover { background-size: 100% 2px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Rodapé */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 32px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--muted);
}
.footer a { color: var(--ink); text-decoration: none; }
.footer a:hover { color: var(--accent-ink); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: .9rem;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action {
  display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px; border-radius: 16px; line-height: 1.35; text-align: left;
}
.toast.show.has-action { pointer-events: auto; }
.toast__btn {
  flex: none; border: 0; border-radius: 999px; padding: 8px 14px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: .88rem; cursor: pointer;
}

/* 7. Configurações -------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 1000; }
.sheet[hidden] { display: none; }
.sheet__backdrop {
  position: absolute; inset: 0; background: rgb(0 0 0 / .38);
  opacity: 0; transition: opacity .3s;
}
.sheet__panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(400px, 100%);
  display: flex; flex-direction: column; gap: 26px;
  padding: 18px 24px 32px; overflow-y: auto;
  background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .4s var(--ease);
}
.sheet.open .sheet__backdrop { opacity: 1; }
.sheet.open .sheet__panel { transform: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet__head h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.setting h3 { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.seg button {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-size: .9rem; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.swatches { display: flex; gap: 12px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; background: var(--sw);
  transition: transform .2s var(--ease), border-color .2s;
}
html:not([data-theme-effective="dark"]) .swatch { background: var(--swl); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--bg); }
.switchrow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.switchrow:last-child { border-bottom: 0; }
.switchrow__label { display: block; font-weight: 500; }
.switchrow__hint { display: block; font-size: .85rem; color: var(--muted); }
.toggle {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px;
  border: 0; background: var(--line-2); cursor: pointer; transition: background-color .25s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .35);
  transition: transform .25s var(--ease);
}
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); }
.toggle[disabled] { opacity: .45; cursor: not-allowed; }
.sheet__foot { margin-top: auto; display: grid; gap: 12px; padding-top: 10px; }
.hint { font-size: .85rem; color: var(--muted); }

/* 8. Lente (cursor) ------------------------------------------------------- */
.lens { position: fixed; inset: 0; z-index: 2000; pointer-events: none; display: none; transition: opacity .25s; }
html[data-lens="on"] .lens { display: block; }
html[data-lens="on"], html[data-lens="on"] * { cursor: none !important; }
.lens.hidden { opacity: 0; }
.lens__dot {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); will-change: transform;
}
.lens__ring {
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 999px;
  border: 1.5px solid var(--accent); will-change: transform, width, height;
  transition: width .32s var(--ease), height .32s var(--ease), border-radius .32s var(--ease),
              background-color .3s, border-color .3s, transform .09s linear;
}
.lens__ring.lock { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }

/* Troca de idioma */
#main { transition: opacity .19s ease, filter .19s ease, transform .19s ease; }
#main.swap { opacity: 0; filter: blur(6px); transform: translateY(6px); }

/* 9. Responsivo ----------------------------------------------------------- */
@media (max-width: 1000px) {
  .topnav { display: none; }
  .hero__inner { grid-template-columns: 1fr; align-items: start; padding-top: calc(var(--top-h) + 36px); padding-bottom: 104px; }
  .hero__name { font-size: clamp(3rem, 15.5vw, 7.5rem); }
  .hero__photo { order: -1; width: clamp(120px, 28vw, 170px); margin: 0 0 36px; }
  .section { grid-template-columns: 1fr; row-gap: 22px; }
  .section__label { position: static; }
  .section__label h2 { font-size: 1.5rem; letter-spacing: -.02em; }
  .skillgrid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
  .job__head { grid-template-columns: 1fr; }
  .job__period { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .prow__link { grid-template-columns: minmax(0, 1fr) 20px; }
  .prow__stack { grid-column: 1 / -1; }
  .edu__item { grid-template-columns: 1fr; }
  .edu__period { grid-column: 1; grid-row: auto; }
  .sheet__panel {
    top: auto; bottom: 0; height: auto; max-height: 92svh; width: 100%;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .swatches { flex-wrap: wrap; }
}

/* 10. Impressão ----------------------------------------------------------- */
@media print {
  .topbar, .lens, .sheet, .toast, .hero__field, .hero__scroll, .skip { display: none !important; }
  .hero { min-height: 0; }
  [data-reveal], [data-rise], .hero__name .ch, .job { opacity: 1 !important; transform: none !important; animation: none !important; }
  .section { break-inside: avoid; }
}
