/* =====================================================================
   Alyssom Fernandes — Portfólio
   Conceito: "da planilha ao sistema". A página se comporta como uma
   planilha: barra de fórmulas no topo, colunas A–L, linhas numeradas à
   esquerda e abas de navegação no rodapé.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --row: 32px;                  /* altura de uma "linha" da planilha */
  --top-h: 40px;                /* barra de fórmulas */
  --col-h: 24px;                /* cabeçalho de colunas */
  --header-h: 64px;             /* top + col = exatamente 2 linhas */
  --status-h: 48px;
  --gutter: 0px;                /* coluna de números de linha (desktop) */
  --gap: 16px;
  --pad: 16px;
  --wrap: 1320px;

  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --ease: cubic-bezier(.2, .7, .1, 1);

  color-scheme: light;
  --bg: #F4F3EE;
  --bg-2: #EAE9E2;
  --surface: #FBFAF7;
  --ink: #111210;
  --ink-2: #3D3E39;
  --ink-3: #64655D;
  --line: rgba(17, 18, 16, .065);
  --line-2: rgba(17, 18, 16, .13);
  --line-3: rgba(17, 18, 16, .28);
  --accent: #087544;
  --accent-2: #14B25F;
  --accent-soft: rgba(20, 178, 95, .12);
  --accent-faint: rgba(20, 178, 95, .045);
  --on-accent: #FFFFFF;
  --warn: #9A6400;
  --warn-soft: #FFF0B8;
  --err: #BE3228;
  --err-soft: #FBE3DF;
  --shadow: 0 1px 0 rgba(17, 18, 16, .04), 0 18px 40px -20px rgba(17, 18, 16, .25);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0F0D;
  --bg-2: #161916;
  --surface: #121512;
  --ink: #ECEDE6;
  --ink-2: #BDBFB6;
  --ink-3: #8E9087;
  --line: rgba(236, 237, 230, .055);
  --line-2: rgba(236, 237, 230, .12);
  --line-3: rgba(236, 237, 230, .26);
  --accent: #4BE393;
  --accent-2: #3DDC84;
  --accent-soft: rgba(61, 220, 132, .13);
  --accent-faint: rgba(61, 220, 132, .04);
  --on-accent: #04130A;
  --warn: #E8B44A;
  --warn-soft: rgba(232, 180, 74, .16);
  --err: #FF8479;
  --err-soft: rgba(255, 132, 121, .14);
  --shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 18px 44px -18px rgba(0, 0, 0, .7);
}

@media (min-width: 600px)  { :root { --pad: 24px; } }
@media (min-width: 900px)  { :root { --pad: 32px; --gap: 24px; --status-h: 36px; } }
@media (min-width: 1180px) { :root { --pad: 40px; --gutter: 44px; } }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  overflow-x: clip;
}
html.i18n-pending body { visibility: hidden; }

body {
  position: relative;
  margin: 0;
  padding: var(--header-h) 0 var(--status-h) var(--gutter);
  background-color: var(--bg);
  /* linhas horizontais da planilha, alinhadas aos números da coluna de linhas */
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% var(--row);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
em { font-style: normal; }
::selection { background: var(--accent-2); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed;
  z-index: 100;
  left: 12px; top: -60px;
  padding: 10px 14px;
  background: var(--ink); color: var(--bg);
  font: 500 14px var(--f-mono);
  text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 12px; }

.print-only { display: none; }

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

/* ---------- 4. Moldura da planilha ---------- */

/* Guias verticais das colunas A–L (decorativo) */
.sheet-bg {
  position: fixed;
  z-index: 0;
  inset: var(--header-h) 0 var(--status-h) var(--gutter);
  pointer-events: none;
}
.sheet-bg .grid12 { height: 100%; }
.sheet-bg span {
  border-left: 1px solid var(--line);
  margin-right: calc(-1 * var(--gap));
  transition: background-color .25s;
}
.sheet-bg span:last-child { margin-right: 0; border-right: 1px solid var(--line); }
.sheet-bg span.is-active { background: var(--accent-faint); }

/* Coluna de números de linha */
.row-gutter {
  display: none;
  position: absolute;
  z-index: 2;
  top: 0; bottom: 0; left: 0;
  width: var(--gutter);
  overflow: hidden;
  background: var(--bg-2);
  border-right: 1px solid var(--line-2);
  font: 500 10px/var(--row) var(--f-mono);
  color: var(--ink-3);
  text-align: center;
  user-select: none;
  pointer-events: none;
}
.row-gutter span {
  display: block;
  height: var(--row);
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.row-gutter span.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset -2px 0 0 var(--accent-2);
}
@media (min-width: 1180px) { .row-gutter { display: block; } }

main, .footer { position: relative; z-index: 1; }

/* Barra de fórmulas (topo) */
.topbar {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto 0;
  background: var(--bg);
}

.fbar {
  display: flex;
  align-items: stretch;
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
}

.fbar__brand {
  flex: none;
  display: grid;
  place-items: center;
  width: max(var(--gutter), 40px);
  background: var(--ink);
  color: var(--bg);
  font: 600 12px var(--f-mono);
  letter-spacing: .02em;
  text-decoration: none;
}
.fbar__brand:hover { background: var(--accent-2); color: var(--on-accent); }

.fbar__name {
  flex: none;
  display: flex;
  align-items: center;
  width: 64px;
  padding-inline: 10px;
  border-right: 1px solid var(--line-2);
  font: 500 12px var(--f-mono);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.fbar__fx {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  border-right: 1px solid var(--line-2);
  font: italic 400 17px var(--f-serif);
  color: var(--ink-3);
}

.fbar__formula {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 12px;
  font: 400 12.5px var(--f-mono);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.fbar__text { overflow: hidden; text-overflow: ellipsis; }
.fbar__caret {
  flex: none;
  width: 1px; height: 15px;
  margin-left: -10px;
  background: var(--ink);
  animation: blink 1.1s steps(1) infinite;
}
.fbar__result {
  flex: none;
  margin-left: auto;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.fbar__result:empty { display: none; }

.fbar__tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-inline: 8px;
  border-left: 1px solid var(--line-2);
}

.lang { display: flex; border: 1px solid var(--line-2); }
.lang button {
  min-width: 34px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  font: 500 11.5px var(--f-mono);
  color: var(--ink-3);
}
.lang button + button { border-left: 1px solid var(--line-2); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 28px;
  padding: 0;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-3); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.fbar .fbar__cv { display: none; }   /* .fbar na frente: vence o display do .btn */

@media (max-width: 599px) {
  .fbar__name { width: 48px; padding-inline: 8px; }
  .fbar__fx { width: 28px; }
  .fbar__formula { padding-inline: 8px; }
  .fbar__result { display: none; }
  .lang button { min-width: 30px; }
}
@media (min-width: 900px) {
  .fbar__name { width: 76px; }
  .fbar .fbar__cv { display: inline-flex; }
}

/* Cabeçalho de colunas A–L */
.colhead {
  position: relative;
  height: var(--col-h);
  padding-left: var(--gutter);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
}
.colhead__corner {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--gutter);
  border-right: 1px solid var(--line-2);
}
.colhead__corner::after {
  content: "";
  position: absolute;
  right: 4px; bottom: 4px;
  border: 5px solid transparent;
  border-right-color: var(--line-3);
  border-bottom-color: var(--line-3);
}
.colhead__cols { height: 100%; }
.colhead__cols span {
  display: grid;
  place-items: center;
  margin-right: calc(-1 * var(--gap));
  border-left: 1px solid var(--line-2);
  font: 500 10.5px var(--f-mono);
  color: var(--ink-3);
  transition: background-color .2s, color .2s;
}
.colhead__cols span:last-child { margin-right: 0; border-right: 1px solid var(--line-2); }
.colhead__cols span.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent-2);
}

/* Barra de status + abas (rodapé fixo) */
.statusbar {
  position: fixed;
  z-index: 60;
  inset: auto 0 0 0;
  display: flex;
  align-items: stretch;
  height: var(--status-h);
  background: var(--bg-2);
  border-top: 1px solid var(--line-2);
  font: 400 12px var(--f-mono);
  color: var(--ink-2);
}

.statusbar__ready {
  display: none;
  align-items: center;
  gap: 8px;
  padding-inline: 14px;
  border-right: 1px solid var(--line-2);
  white-space: nowrap;
}

.tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs li { flex: none; }
.tabs a, .tabs__add {
  display: flex;
  align-items: center;
  height: 100%;
  padding-inline: 16px;
  border: 0;
  border-right: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font: 500 13px var(--f-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.tabs a:hover { background: var(--surface); color: var(--ink); }
.tabs a[aria-current="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent-2);
  font-weight: 600;
}
.tabs__add { font: 400 18px var(--f-sans); color: var(--ink-3); padding-inline: 14px; }
.tabs__add:hover { color: var(--accent); background: var(--surface); }

.statusbar__zoom {
  display: none;
  align-items: center;
  gap: 8px;
  padding-inline: 14px;
  border-left: 1px solid var(--line-2);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.zoom { position: relative; width: 96px; height: 1px; background: var(--line-3); }
.zoom::before { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 7px; background: var(--line-3); }
.zoom__thumb {
  position: absolute;
  top: -5px; left: 0;
  width: 4px; height: 11px;
  margin-left: -2px;
  background: var(--ink);
}
.zoom__pct { min-width: 36px; text-align: right; }

@media (min-width: 900px) {
  .statusbar__ready, .statusbar__zoom { display: flex; }
  .tabs a { padding-inline: 14px; font-size: 12.5px; }
}
@media (min-width: 1180px) { .statusbar__ready { min-width: 220px; } }

/* ---------- 5. Componentes ---------- */
.i {
  width: 16px; height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono-label {
  font: 500 11.5px/1.4 var(--f-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono-label--formula { text-transform: none; letter-spacing: 0; }

.cellref {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink-2);
  font: 500 11px var(--f-mono);
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}

.dot {
  flex: none;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2.4s var(--ease) infinite;
}

.pill {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font: 400 12.5px var(--f-mono);
  color: var(--ink-2);
}
.pill .dot { margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  font: 500 15px var(--f-sans);
  letter-spacing: -.005em;
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-3); }
.btn--ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn--sm { min-height: 28px; padding: 3px 10px; gap: 6px; font: 500 11.5px var(--f-mono); }
.btn--sm svg { width: 13px; height: 13px; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-3);
  font: 500 10.5px/1.3 var(--f-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.tag--live { color: var(--accent); border-color: currentColor; }
.tag--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  font: 400 12px var(--f-mono);
  color: var(--ink-2);
}

/* Seleção de célula: borda verde + "alça de preenchimento" do Excel */
.sel { position: relative; }
.sel::after,
.sel::before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.sel::after { inset: -1px; border: 2px solid var(--accent-2); z-index: 3; }
.sel::before {
  right: -5px; bottom: -5px;
  width: 9px; height: 9px;
  background: var(--accent-2);
  border: 2px solid var(--bg);
  z-index: 4;
}
.sel:hover::after, .sel:hover::before,
.sel:focus-visible::after, .sel:focus-visible::before,
.sel.is-on::after, .sel.is-on::before { opacity: 1; }
.sel:focus-visible { outline: none; }

/* ---------- 6. Seções ---------- */
.section {
  padding-block: clamp(80px, 11vw, 152px) 0;
}

.section__head { margin-bottom: clamp(36px, 5vw, 64px); }

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(18px, 2.5vw, 28px);
  font: 500 12px var(--f-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kicker__n { color: var(--accent); }
.kicker__rule { flex: 1; height: 1px; background: var(--line-2); }
.kicker__cell { letter-spacing: 0; }
.kicker__cell:empty { display: none; }

.h2 {
  max-width: 18ch;
  font-size: clamp(2.5rem, 6.4vw, 5.5rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.h2 em, .hero__lede em, .contact__title em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -.02em;
  color: var(--accent);
}

.lead {
  max-width: 60ch;
  margin-top: 20px;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------- 7. Hero ---------- */
.hero { padding-top: clamp(28px, 5vw, 64px); }

.hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.hero__name {
  margin: clamp(28px, 5vw, 56px) 0 clamp(32px, 5vw, 64px);
  font-size: clamp(3.4rem, 16vw, 10.75rem);
  font-weight: 700;
  line-height: .86;
  letter-spacing: -.058em;
}
.hero__name .sel {
  display: inline-block;
  padding: .06em .14em .1em .06em;
  margin-left: -.06em;
}
.hero__name .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__name .word { display: inline-block; }
.hero__range {
  position: absolute;
  z-index: 5;
  left: -1px; top: -21px;
  padding: 2px 7px;
  background: var(--accent-2);
  color: var(--on-accent);
  font: 600 10.5px/1.4 var(--f-mono);
  letter-spacing: .02em;
  white-space: nowrap;
}

.hero__grid { row-gap: 40px; align-items: start; }
.hero__copy { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 24px; }
.hero__lede {
  max-width: 20ch;
  font-size: clamp(1.75rem, 3.3vw, 2.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.hero__sub { max-width: 54ch; font-size: 1.05rem; color: var(--ink-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.hero__demo { grid-column: 1 / -1; }

@media (min-width: 1000px) {
  .hero__copy { grid-column: 1 / span 5; padding-top: 8px; }
  .hero__demo { grid-column: 6 / -1; }
  /* No desktop o nome acompanha a altura da tela, para a frase-chave e os
     botões caberem na primeira dobra (1366x768 inclusive). */
  .hero { padding-top: clamp(24px, 4vh, 64px); }
  .hero__name {
    margin: clamp(20px, 3.5vh, 56px) 0 clamp(24px, 4vh, 64px);
    font-size: clamp(4.5rem, min(16vw, 13vh), 10.75rem);
  }
  .hero__lede { max-width: 22ch; font-size: clamp(1.75rem, min(3.3vw, 4.8vh), 2.75rem); }
  .hero__copy { gap: clamp(16px, 2.6vh, 24px); }
}
@media (min-width: 1180px) {
  .hero__copy { grid-column: 1 / span 5; }
  .hero__demo { grid-column: 7 / -1; }
}

/* Métricas: uma "linha" de células */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 176px;
  padding: 16px 16px 18px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  cursor: default;
}
.metric__ref { font: 500 10.5px var(--f-mono); color: var(--ink-3); }
.metric__val {
  margin-top: auto;
  font-size: clamp(2.6rem, 5.6vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.metric:first-child .metric__val { color: var(--accent); }
.metric__label { font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.metric__src { font: 400 11px var(--f-mono); color: var(--ink-3); }
/* No celular, a última métrica ocupa a linha inteira quando sobra sozinha */
.metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:last-child:nth-child(odd) { grid-column: auto; }
  .metric { min-height: 208px; padding: 18px 22px 22px; }
}

/* ---------- 8. Demo "antes / depois" do hero ---------- */
.demo {
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.demo__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding-inline: 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.demo__dots { display: flex; gap: 6px; }
.demo__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-3); }
.demo__file {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 400 12px var(--f-mono);
  color: var(--ink-2);
}
.demo__file-after { display: none; color: var(--accent); }
.demo[data-state="after"] .demo__file-before { display: none; }
.demo[data-state="after"] .demo__file-after { display: inline; }

.seg { display: flex; flex: none; border: 1px solid var(--line-3); }
.seg button {
  padding: 5px 12px;
  border: 0;
  background: transparent;
  font: 500 11.5px var(--f-mono);
  color: var(--ink-3);
}
.seg button + button { border-left: 1px solid var(--line-3); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.demo__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  container-type: inline-size;
}
.demo__before, .demo__after { position: absolute; inset: 0; }

/* Planilha caótica */
.demo__before { display: flex; flex-direction: column; pointer-events: none; }
.xl-fx, .xl-tabs {
  flex: none;
  display: flex;
  align-items: stretch;
  height: clamp(20px, 5.4cqi, 28px);
  font: 400 clamp(9px, 2cqi, 11.5px) var(--f-mono);
}
.xl-fx > *, .xl-tabs > * {
  display: flex;
  align-items: center;
  padding-inline: 8px;
  background: var(--surface);
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  overflow: hidden;
}
.xl-fx .xl-fx__name { width: 13%; color: var(--ink-2); }
.xl-fx .xl-fx__i { font: italic 400 1.25em var(--f-serif); color: var(--ink-3); }
.xl-fx .xl-fx__f { flex: 1; color: var(--err); }
.xl-tabs > * { border-bottom: 0; border-top: 1px solid var(--line-2); color: var(--ink-3); background: var(--bg-2); }
.xl-tabs .is-active { background: var(--surface); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent-2); }
.xl-tabs .xl-tabs__fill { flex: 1; }

.xl {
  flex: 1;
  display: grid;
  grid-template-columns: 7% repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(12, minmax(0, 1fr));
  font: 400 clamp(8.5px, 2.05cqi, 12px) var(--f-mono);
}
.xl .c {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding-inline: 6px;
  background: var(--surface);
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.xl .h { justify-content: center; background: var(--bg-2); color: var(--ink-3); font-size: .9em; }
.xl .th { justify-content: flex-start; font-weight: 600; background: var(--bg); }
.xl .tx { justify-content: flex-start; }
/* Cores "soft" são translúcidas no tema escuro: pintadas sobre a superfície
   para a camada do dashboard não vazar por baixo das células. */
.xl .err { color: var(--err); background-image: linear-gradient(var(--err-soft), var(--err-soft)); justify-content: flex-start; font-weight: 500; }
.xl .warn { background-image: linear-gradient(var(--warn-soft), var(--warn-soft)); color: var(--warn); justify-content: flex-start; font-weight: 600; }
.xl .neg { color: var(--err); }
.xl .tot { font-weight: 700; justify-content: flex-start; }
.xl .active { outline: 2px solid var(--accent-2); outline-offset: -2px; position: relative; z-index: 1; }

.demo__before .c,
.demo__before .xl-fx > *,
.demo__before .xl-tabs > * {
  transition: opacity .32s var(--ease), transform .45s var(--ease);
  transition-delay: var(--d, 0ms);
}
.demo[data-state="after"] .demo__before .c,
.demo[data-state="after"] .demo__before .xl-fx > *,
.demo[data-state="after"] .demo__before .xl-tabs > * {
  opacity: 0;
  transform: scale(.55);
}

/* Dashboard limpo */
.dash {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 2cqi, 12px);
  padding: clamp(10px, 3cqi, 18px);
  background: var(--surface);
  font-size: clamp(9px, 2.2cqi, 12.5px);
}
.dash__head { display: flex; align-items: center; gap: 8px; }
.dash__logo { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 1.12em; letter-spacing: -.01em; }
.dash__logo i { width: .72em; height: .72em; background: var(--accent-2); transform: rotate(45deg); }
.dash__chip {
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  font: 400 .9em var(--f-mono);
  color: var(--ink-2);
}
.dash__chip--role { margin-left: auto; color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.dash__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(6px, 1.6cqi, 10px); }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: clamp(6px, 1.6cqi, 10px) clamp(8px, 2cqi, 12px);
  border: 1px solid var(--line-2);
}
.kpi span { font: 400 .82em var(--f-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi strong { font-size: 1.75em; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi--ok strong { color: var(--accent); }

.dash__chart {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(6px, 2cqi, 12px);
  border: 1px solid var(--line-2);
}
.chart__title { display: flex; justify-content: space-between; font: 400 .85em var(--f-mono); color: var(--ink-3); }
.chart__legend { display: flex; gap: 10px; }
.chart__legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; background: var(--ink); vertical-align: 0; }
.chart__legend span + span i { background: var(--accent-2); }
.chart__bars {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7%;
  align-items: end;
  margin-top: 8px;
  padding-inline: 2%;
  border-bottom: 1px solid var(--line-3);
  background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%);
}
.chart__g { display: flex; align-items: flex-end; gap: 10%; height: 100%; }
.chart__g i {
  flex: 1;
  height: var(--h);
  background: var(--ink);
  transform-origin: bottom;
  transition: transform .6s var(--ease);
  transition-delay: calc(450ms + var(--i, 0) * 60ms);
}
.chart__g i + i { background: var(--accent-2); }
.demo[data-state="before"] .chart__g i { transform: scaleY(0); }

.dash__alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: clamp(5px, 1.5cqi, 9px) 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 500 .95em var(--f-mono);
}
.dash__alert svg { width: 1.2em; height: 1.2em; flex: none; }

.demo__caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line-2);
  font: 400 12px var(--f-mono);
  color: var(--ink-3);
}
.demo__cap-after { display: none; color: var(--accent); }
.demo[data-state="after"] .demo__cap-before { display: none; }
.demo[data-state="after"] .demo__cap-after { display: inline; }
.demo__note { margin-left: auto; white-space: nowrap; }

/* ---------- 9. Perfil ---------- */
.about { row-gap: 40px; }
.about__text { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 20px; }
.about__text p { max-width: 62ch; font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.65; color: var(--ink-2); }
.about__text p:first-child { color: var(--ink); }
.about__facts { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .about__text { grid-column: 1 / span 7; }
  .about__facts { grid-column: 8 / -1; }
}

.facts {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14.5px;
}
.facts th, .facts td { padding: 11px 14px; border: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.facts th {
  width: 34%;
  background: var(--bg-2);
  font: 500 11px/1.9 var(--f-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.facts td { color: var(--ink); line-height: 1.5; }

/* ---------- 10. Projetos ---------- */
.projects { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }

.project { background: var(--surface); border: 1px solid var(--line-2); }

.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 14px clamp(16px, 2.4vw, 28px);
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.project__idx { font: 500 12px var(--f-mono); color: var(--ink-3); }
.project__cat { font: 500 11.5px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.project__head .tag { margin-left: auto; }

.project__body { display: grid; grid-template-columns: minmax(0, 1fr); }
.project__text {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(20px, 3vw, 40px);
}
.project__name {
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.045em;
}
.project__pitch { margin-top: 12px; max-width: 48ch; font-size: 1.08rem; line-height: 1.5; color: var(--ink-2); }

.kv { display: flex; flex-direction: column; }
.kv > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding-block: 14px;
  border-top: 1px solid var(--line-2);
}
.kv dt { font: 500 11px/1.9 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.kv dd { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
@media (min-width: 600px) {
  .kv > div { grid-template-columns: 124px minmax(0, 1fr); gap: 16px; }
}

/* Flex com quebra: quando o valor é longo, o texto desce para a linha de baixo
   em vez de ser espremido numa coluna estreita. */
.result {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.result__label { flex: 0 0 100%; font: 500 11px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.result__val {
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.result__txt { flex: 1 1 18ch; min-width: 18ch; padding-bottom: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }

.project__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.project__links { display: flex; flex-wrap: wrap; gap: 8px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line-3);
  font: 500 12.5px var(--f-mono);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s, background-color .2s, color .2s;
}
.link-arrow:hover { border-color: var(--accent-2); color: var(--accent); background: var(--accent-soft); }
.link-arrow--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.link-arrow--primary:hover { background: var(--accent-2); color: var(--on-accent); border-color: var(--accent-2); }
.link-arrow svg { width: 13px; height: 13px; }

.project__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 40px) 48px;
  border-top: 1px solid var(--line-2);
  background-color: var(--bg);
  background-image: radial-gradient(var(--line-3) 1px, transparent 1.2px);
  background-size: 16px 16px;
  overflow: clip; /* clip (e não hidden) para não quebrar o sticky da ilustração */
}
.mock-note {
  position: absolute;
  right: 12px; bottom: 10px;
  font: 400 10.5px var(--f-mono);
  color: var(--ink-3);
}

@media (min-width: 1000px) {
  .project__body { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .project__text { grid-column: 1 / span 6; }
  .project__visual { grid-column: 7 / -1; border-top: 0; border-left: 1px solid var(--line-2); place-items: start center; }
  /* A ilustração acompanha a leitura do texto ao lado */
  .project__visual > .mock { position: sticky; top: calc(var(--header-h) + 48px); }
  .project:nth-child(even) .project__text { grid-column: 7 / -1; grid-row: 1; }
  .project:nth-child(even) .project__visual { grid-column: 1 / span 6; grid-row: 1; border-left: 0; border-right: 1px solid var(--line-2); }
}

/* ---- Janelas com as telas dos projetos ---- */
.mock { width: 100%; max-width: 460px; font-size: 13px; }

.mwin { border: 1px solid var(--line-3); background: var(--surface); box-shadow: var(--shadow); }
.mwin__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding-inline: 10px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
  font: 400 11px var(--f-mono);
  color: var(--ink-3);
}
.mwin__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); }
.mwin__bar span { margin-left: 8px; }

/* Tela real de cada projeto, dentro da mesma moldura de janela */
.shot { max-width: 540px; }
.shot img { display: block; width: 100%; height: auto; background: var(--bg-2); }

/* ---------- 11. Mais projetos (tabela) ---------- */
.more { margin-top: clamp(48px, 7vw, 88px); }
.more__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 16px; }
.more__head h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -.03em; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line-2); background: var(--surface); }

.repo-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
.repo-table th, .repo-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.repo-table th:last-child, .repo-table td:last-child { border-right: 0; }
.repo-table tbody tr:last-child > * { border-bottom: 0; }
.repo-table thead th { background: var(--bg-2); font: 500 11px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.repo-table tbody th { font-weight: 600; white-space: nowrap; letter-spacing: -.01em; }
.repo-table td { color: var(--ink-2); line-height: 1.5; }
.repo-table .stack { font: 400 12px/1.6 var(--f-mono); color: var(--ink-3); }
.repo-table .links { white-space: nowrap; }
.repo-table .links a { font: 500 12px var(--f-mono); color: var(--accent); text-decoration: none; }
.repo-table .links a:hover { text-decoration: underline; }
.repo-table .links a + a { margin-left: 12px; }
.repo-table tbody tr { transition: background-color .15s; }
.repo-table tbody tr:hover { background: var(--accent-faint); }

/* ---------- 12. Experiência ---------- */
.xp { border-top: 1px solid var(--line-2); margin-inline: calc(-1 * min(var(--pad), 16px)); }
.xp__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 28px min(var(--pad), 16px);
  border-bottom: 1px solid var(--line-2);
}
.xp__when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 400 12.5px var(--f-mono); color: var(--ink-3); }
.xp__period { color: var(--ink); font-weight: 500; }
.xp__who h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); font-weight: 600; line-height: 1.05; letter-spacing: -.035em; }
.xp__role { margin-top: 6px; font-weight: 500; color: var(--accent); }
.xp__note { margin-top: 2px; font: 400 12px var(--f-mono); color: var(--ink-3); }
.xp__what { display: flex; flex-direction: column; gap: 10px; }
.xp__what li {
  position: relative;
  padding-left: 18px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.xp__what li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 8px; height: 1px;
  background: var(--ink-3);
}
@media (min-width: 900px) {
  .xp__row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding-block: 36px; }
  .xp__when { grid-column: 1 / span 3; flex-direction: column; align-items: flex-start; }
  .xp__who { grid-column: 4 / span 4; }
  .xp__what { grid-column: 8 / -1; }
}

/* ---------- 13. Habilidades (tabelas dinâmicas) ---------- */
.pivots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1100px) {
  .pivots { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .pivot-block:first-child { grid-column: 1 / span 7; }
  .pivot-block:last-child { grid-column: 8 / -1; }
}
.pivot-block h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.pivot-block h3 .mono-label { font-size: 11px; }

.pivot { width: 100%; border-collapse: collapse; font-size: 14px; }
.pivot th, .pivot td { height: var(--row); padding: 0 10px; border: 1px solid var(--line-2); transition: background-color .12s; }
.pivot thead th {
  background: var(--bg-2);
  font: 500 10.5px var(--f-mono);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  white-space: nowrap;
}
.pivot thead th:first-child { text-align: left; }
.pivot thead a { color: inherit; text-decoration: none; }
.pivot thead a:hover { color: var(--accent); }
.pivot tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.pivot td { text-align: center; }
.pivot td.on { background: var(--accent-soft); }
.pivot td.on::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); vertical-align: middle; }
.pivot td.tot { position: relative; min-width: 72px; text-align: left; font: 500 12px var(--f-mono); }
.pivot td.tot .bar {
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: calc(var(--w, 0) * 100%);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent-2);
}
.pivot td.tot .n { position: relative; }
.pivot tbody tr:hover > * { background-color: var(--accent-faint); }
.pivot tbody tr:hover > td.on { background-color: var(--accent-soft); }
.pivot .is-col { background-color: var(--accent-faint); }
.pivot thead .is-col { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent-2); }

.also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; }
.also .mono-label { margin-right: 6px; }

/* ---------- 14. Formação & idiomas ---------- */
.edu { row-gap: 32px; }
.edu__card, .langs { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .edu__card { grid-column: 1 / span 6; }
  .langs { grid-column: 7 / -1; }
}
.edu__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line-2);
  background: var(--surface);
}
.edu__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.edu__check {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  background: var(--accent-2);
  color: var(--on-accent);
}
.edu__check svg { width: 22px; height: 22px; }
.edu__card h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.edu__meta { font: 400 13px var(--f-mono); color: var(--ink-2); }

.langs h3 { margin-bottom: 12px; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.cefr-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14.5px; }
.cefr-table th, .cefr-table td { height: 44px; padding: 0 10px; border: 1px solid var(--line-2); }
.cefr-table thead th { height: var(--row); background: var(--bg-2); font: 500 10.5px var(--f-mono); color: var(--ink-3); text-align: center; }
.cefr-table tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.cefr-table td.lv { padding: 0; }
.cefr-table td.lv.on { background: var(--accent-2); }
.cefr-table td.lv.on + td.lv:not(.on) { border-left-color: var(--line-3); }
.cefr-table td.lvl { font: 500 12px var(--f-mono); color: var(--ink-2); white-space: nowrap; }

/* ---------- 15. Contato ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.contact__title {
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-weight: 600;
  line-height: .9;
  letter-spacing: -.055em;
}
.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: clamp(32px, 5vw, 56px);
}
.contact__email {
  font-size: clamp(1.45rem, 4.6vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -.035em;
  text-decoration: none;
  background-image: linear-gradient(var(--accent-2), var(--accent-2));
  background-size: 100% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .3s var(--ease), color .2s;
  overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--accent); background-size: 100% 6px; }

.contact__links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
}
@media (min-width: 600px) { .contact__links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .contact__links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.link-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 116px;
  height: 100%;
  padding: 18px 20px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  text-decoration: none;
}
.link-cell strong { margin-top: auto; font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; }
.link-cell .arrow { position: absolute; top: 16px; right: 18px; color: var(--ink-3); transition: transform .25s var(--ease), color .2s; }
.link-cell:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }

/* ---------- 16. Rodapé e toast ---------- */
.footer {
  padding-block: 28px;
  border-top: 1px solid var(--line-2);
  background: var(--bg-2);
  font: 400 12px/1.6 var(--f-mono);
  color: var(--ink-3);
}
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer a { color: var(--ink-2); }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--status-h) + 16px);
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg);
  font: 500 13px/1.4 var(--f-mono);
  box-shadow: var(--shadow);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .35s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 17. Movimento ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes pulse-err {
  0%, 100% { box-shadow: 0 0 0 1px var(--err); }
  50% { box-shadow: 0 0 0 6px var(--err-soft); }
}
@keyframes ants { to { stroke-dashoffset: -16; } }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Entrada do nome no hero */
.js .hero__name .word { transform: translateY(105%); transition: transform 1s var(--ease); }
.js .hero__name .line:nth-child(2) .word { transition-delay: .09s; }
.js .hero__name .sel::after, .js .hero__name .sel::before, .js .hero__range { opacity: 0; transition: opacity .3s .75s; }
.is-ready .hero__name .word { transform: none; }
.is-ready .hero__name .sel::after, .is-ready .hero__name .sel::before, .is-ready .hero__range { opacity: 1; }

/* Quem pede menos movimento no sistema vê tudo já no lugar: sem revelações,
   sem cursor piscando e sem pulsos. O JS também pula a digitação da fórmula,
   os contadores e a planilha que se desfaz. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .js .hero__name .word { transform: none; }
  .js .hero__name .sel::after, .js .hero__name .sel::before, .js .hero__range { opacity: 1; }
}

/* ---------- 18. Impressão / PDF do currículo ---------- */
@page { size: A4; margin: 13mm 14mm 14mm; }

@media print {
  :root, [data-theme="dark"] {
    color-scheme: light;
    --bg: #fff; --bg-2: #fff; --surface: #fff;
    --ink: #111; --ink-2: #333; --ink-3: #666;
    --line: #ddd; --line-2: #ddd; --line-3: #bbb;
    --accent: #0A6B3D; --accent-2: #0A6B3D; --accent-soft: transparent; --accent-faint: transparent;
    --gutter: 0px; --pad: 0px; --header-h: 0px; --status-h: 0px;
  }
  html, body { background: #fff !important; }
  body { padding: 0; font-size: 9.6pt; line-height: 1.45; }

  .topbar, .statusbar, .sheet-bg, .row-gutter, .skip, .toast, .footer,
  .hero__top, .hero__name, .hero__copy, .hero__demo,
  .kicker__rule, .kicker__cell, .kicker__n, .h2, .lead,
  .project__visual, .project__links, .project__pitch, .project__idx,
  .pivots, .pivot-block, .also, .more__head .mono-label, #contato, .edu__check,
  .metric__ref, .metric__src, .xp__note { display: none !important; }
  .print-only { display: block !important; }

  .js .reveal { opacity: 1 !important; transform: none !important; }
  .sel::after, .sel::before { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  a { text-decoration: none; }

  .print-head { padding-bottom: 8pt; margin-bottom: 10pt; border-bottom: 1.5pt solid #111; }
  .print-head h1 { font-size: 24pt; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
  .print-head .ph-role { margin-top: 3pt; font-size: 11pt; font-weight: 500; color: var(--accent); }
  .print-head .ph-contact { margin-top: 4pt; font: 400 8.8pt/1.45 var(--f-sans); color: #333; }

  /* No PDF, ordem clássica de currículo: experiência antes dos projetos */
  main { display: flex; flex-direction: column; }
  #inicio { order: 1; }
  #perfil { order: 2; }
  #experiencia { order: 3; }
  #projetos { order: 4; }
  #habilidades { order: 5; }
  #formacao { order: 6; }

  .section { padding: 0; margin-top: 8pt; }
  .hero { padding: 0; }
  .section__head { margin: 0 0 5pt; }
  .kicker {
    margin: 0;
    padding-bottom: 3pt;
    border-bottom: .75pt solid #bbb;
    font: 600 8.6pt var(--f-mono);
    letter-spacing: .08em;
    color: #111;
  }

  .metrics { grid-template-columns: repeat(3, 1fr); margin: 0; border: 0; gap: 6pt; }
  .metric:last-child:nth-child(odd) { grid-column: auto; }
  .metric { min-height: 0; padding: 4pt 7pt; border: .75pt solid #ccc; gap: 1pt; }
  .metric__val { font-size: 13pt; margin: 0; }
  .metric__label { font-size: 8pt; line-height: 1.3; }
  .metric__src { font-size: 7pt; }

  .about__text, .about__facts { grid-column: 1 / -1; }
  .about__facts { display: none; }
  .about__text { gap: 4pt; }
  .about__text p { max-width: none; font-size: 9.6pt; line-height: 1.5; color: #222; }

  .projects { gap: 7pt; }
  .project { border: 0; }
  /* O projeto pode continuar na página seguinte, mas cada linha fica inteira */
  .project__body, .project__text { display: contents; }
  .project__head, .project__text > div:first-child { break-after: avoid; }
  .kv > div, .result, .project__foot { break-inside: avoid; }
  .project__head { padding: 0; border: 0; background: none; gap: 2pt 8pt; }
  .project__head .tag { margin-left: 0; padding: 0 4pt; font-size: 6.8pt; }
  .project__cat { font-size: 7.4pt; }
  .project__body { display: block; }
  .project__text { padding: 2pt 0 0; gap: 3pt; }
  .project__name { font-size: 11pt; letter-spacing: -.01em; }
  .kv > div { grid-template-columns: 62pt 1fr; gap: 6pt; padding: 1pt 0; border: 0; }
  .kv dt { font-size: 7pt; line-height: 1.6; }
  .kv dd { font-size: 8.6pt; line-height: 1.34; color: #222; }
  .result { display: flex; align-items: baseline; gap: 6pt; padding: 0; border: 0; }
  .result__label { width: 62pt; flex: none; font-size: 7pt; }
  .result__val { font-size: 10pt; letter-spacing: 0; }
  .result__txt { padding: 0; font-size: 8.8pt; }
  .project__foot { gap: 0; }
  .chips { gap: 0 4pt; }
  .chips li { padding: 0; border: 0; background: none; font-size: 7.6pt; color: #555; }
  .chips li + li::before { content: "· "; }
  .project__demo-url { display: inline !important; font: 400 7.6pt var(--f-mono); color: var(--accent); }

  .more { margin-top: 8pt; break-inside: avoid; }
  .more__head { margin-bottom: 3pt; }
  .more__head h3 { font-size: 10pt; }
  .table-scroll { border: 0; overflow: visible; }
  /* No PDF a tabela vira uma lista corrida: "Nome — descrição (stack)" */
  .repo-table, .repo-table tbody { display: block; min-width: 0; }
  .repo-table thead, .repo-table td.links { display: none; }
  .repo-table tr { display: block; padding: 1.2pt 0; font-size: 8.6pt; line-height: 1.38; break-inside: avoid; }
  .repo-table th, .repo-table td { display: inline; padding: 0; border: 0; font-size: 8.6pt; line-height: 1.38; color: #222; }
  .repo-table tbody th::after { content: " — "; font-weight: 400; }
  .repo-table td.stack { font-size: 7.4pt; color: #555; }
  .repo-table td.stack::before { content: " ("; }
  .repo-table td.stack::after { content: ")"; }

  .xp { margin: 0; border: 0; }
  .xp__row { display: grid; grid-template-columns: 92pt 1fr; gap: 1pt 12pt; padding: 5pt 0; border-bottom: .5pt solid #ddd; break-inside: avoid; }
  .xp__when { grid-column: 1; grid-row: 1 / span 2; display: block; font-size: 7.8pt; }
  .xp__when .tag { display: none; }
  .xp__dur { display: block; }
  .xp__who h3 { font-size: 10.5pt; letter-spacing: -.01em; }
  .xp__role { margin: 0; font-size: 9pt; }
  .xp__what { gap: 1pt; }
  .xp__what li { font-size: 8.6pt; line-height: 1.38; padding-left: 9pt; color: #222; }
  .xp__what li::before { top: .7em; width: 4pt; }

  .print-skills p { margin-top: 2pt; font-size: 8.8pt; line-height: 1.45; }
  .print-skills b { font-weight: 600; }

  .edu { display: grid; grid-template-columns: 1fr 1fr; gap: 12pt; align-items: start; }
  .edu__card, .langs { grid-column: auto; }
  .edu__card { padding: 0; border: 0; gap: 2pt; }
  .edu__card h3 { font-size: 10pt; letter-spacing: -.01em; }
  .edu__meta { font-size: 8pt; }
  .edu__top .mono-label { display: none; }
  /* Idiomas em texto corrido: "Português — Nativo · Inglês — B1 ..." */
  .langs h3 { display: block; margin: 0 0 2pt; font-size: 10pt; letter-spacing: -.01em; }
  .cefr-table, .cefr-table tbody { display: block; }
  .cefr-table thead, .cefr-table td.lv { display: none; }
  .cefr-table tr { display: inline; }
  .cefr-table th, .cefr-table td { display: inline; height: auto; padding: 0; border: 0; font: 400 8.6pt var(--f-sans); color: #222; }
  .cefr-table tbody th { font-weight: 600; }
  .cefr-table td.lvl { font: 400 8.6pt var(--f-sans); color: #222; }
  .cefr-table tbody th::after { content: " — "; font-weight: 400; }
  .cefr-table tr + tr::before { content: " · "; }
}
