/* Layout: área de trabalho verde-azulada com janelas empilhadas no centro,
   ícones de atalho à esquerda em telas largas e barra de tarefas fixa embaixo.
   Visual único (sem tema escuro): é a cara de um sistema dos anos 90 repaginado. */
:root {
  --desk: #0b7a75;
  --desk-dot: #0a6e69;
  --face: #c6c6c2;
  --face-2: #d9d9d4;
  --hi: #ffffff;
  --lo: #84847f;
  --dark: #121214;
  --paper: #ffffff;
  --ink: #141418;
  --muted: #4e4e57;
  --title-a: #0a2470;
  --title-b: #2f74c9;
  --sel: #0a2470;
  --sel-ink: #ffffff;

  --f-display: "IBM Plex Sans Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --bar-h: 46px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--desk);
  background-image: radial-gradient(var(--desk-dot) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--title-a); }
:focus-visible { outline: 2px dotted var(--ink); outline-offset: 2px; }
::selection { background: var(--sel); color: var(--sel-ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--paper); padding: 8px 12px; }
.skip:focus { top: 12px; }

/* ---------- bordas chanfradas ---------- */
.win, .btn, .taskbar, .startmenu, .viewer {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px var(--face-2);
}
.inset {
  background: var(--paper);
  box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi), inset 2px 2px var(--dark), inset -2px -2px var(--face-2);
  border: 0;
}

/* ---------- área de trabalho ---------- */
.desktop {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 24px 32px;
}
@media (min-width: 960px) {
  .desktop { grid-template-columns: 96px minmax(0, 1fr); padding-inline: 24px; padding-block: 32px 40px; }
  .desktop-single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
}
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }
.stack > *, .explorer > *, .about > *, .cv > *, .contact > *, .detail > * { min-width: 0; }
body { overflow-wrap: break-word; }

.desk-icons { display: none; }
@media (min-width: 960px) {
  .desk-icons { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px; align-self: start; }
}
.desk-icon {
  display: grid; justify-items: center; gap: 6px; text-decoration: none;
  color: var(--hi); font: 400 13px/1.2 var(--f-body); text-align: center; padding: 6px 4px;
}
.desk-icon span { padding: 1px 4px; text-shadow: 1px 1px 0 var(--dark); }
.desk-icon:hover span, .desk-icon.is-on span { background: var(--sel); text-shadow: none; outline: 1px dotted var(--hi); }
.desk-icon.is-on .ico { filter: brightness(.7) sepia(1) hue-rotate(190deg) saturate(3); }

/* ---------- janelas ---------- */
.win { padding: 3px; min-width: 0; }
.titlebar {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  color: var(--hi); padding: 4px 4px 4px 6px; min-height: 30px;
  font: 700 14px/1 var(--f-body); letter-spacing: .01em;
}
.titlebar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-btns { display: flex; gap: 2px; }
.tb-btn {
  width: 22px; height: 20px; display: grid; place-items: center;
  background: var(--face); color: var(--ink); font: 700 14px/1 var(--f-mono); border: 0; padding: 0;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--lo);
}
.tb-close, .tb-min { cursor: pointer; }
.tb-close { font-size: 18px; }
.tb-min { font-size: 13px; }
.tb-close:focus-visible, .tb-min:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }
.win.is-min .titlebar { background: linear-gradient(90deg, var(--lo), #b4b4ae); }
.win.is-min .titlebar { cursor: default; }
.task.is-min { color: var(--muted); }
.tb-close:active, .tb-min:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hi); }
.win-body { padding: 20px; }
.win-body[hidden] { display: none; }
@media (max-width: 520px) { .win-body { padding: 14px; } }

.ico { width: 24px; height: 24px; flex: none; image-rendering: pixelated; }
.ico-sm { width: 18px; height: 18px; }
.ico-md { width: 32px; height: 32px; }
.ico-lg { width: 48px; height: 48px; }
.ico-desk { width: 44px; height: 44px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border: 0; cursor: pointer;
  color: var(--ink); text-decoration: none; font: 500 15px/1.2 var(--f-body);
}
.btn:active, .btn[aria-pressed="true"], .btn[aria-expanded="true"] {
  box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--hi), inset 2px 2px var(--lo), inset -2px -2px var(--face-2);
  padding-top: 7px; padding-bottom: 5px;
}
.btn-default { outline: 1px solid var(--dark); outline-offset: 0; font-weight: 600; }
.btn small { font: 500 12px/1 var(--f-mono); color: var(--muted); }

/* ---------- sobre ---------- */
.about { display: grid; gap: 14px; }
.photo { margin: 0; display: grid; gap: 6px; justify-items: start; }
.photo-frame { padding: 4px; width: 150px; max-width: 100%; }
.photo-frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; image-rendering: auto; }
.photo figcaption { font: 400 12px/1 var(--f-mono); color: var(--muted); }
@media (min-width: 760px) {
  .about.has-photo { grid-template-columns: minmax(0, 1fr) clamp(200px, 24vw, 260px); column-gap: 28px; }
  .about.has-photo > :not(.photo) { grid-column: 1; }
  .about.has-photo .photo { grid-column: 2; grid-row: 1 / span 5; align-self: start; justify-items: stretch; }
  .about.has-photo .photo-frame { width: 100%; }
}
.eyebrow { margin: 0; font: 400 14px/1 var(--f-mono); color: var(--muted); }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.name {
  margin: 0; font: 700 clamp(38px, 8vw, 76px)/.95 var(--f-display);
  letter-spacing: -.02em; text-wrap: balance; color: var(--title-a);
  text-shadow: 3px 3px 0 var(--face-2);
}
.lede { margin: 0; max-width: 62ch; font-size: clamp(17px, 2.2vw, 19px); line-height: 1.6; }
.where { margin: 0; font: 400 14px/1.4 var(--f-mono); color: var(--muted); }
.about-actions { display: flex; flex-wrap: wrap; gap: 10px; }


/* ---------- explorador de projetos ---------- */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; min-width: 0; }
.filters {
  display: flex; gap: 6px; min-width: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 4px;
}
.filter { white-space: nowrap; flex: none; }
.search { flex: 1 1 220px; max-width: 320px; }
.search input { width: 100%; min-height: 36px; padding: 6px 10px; font: 400 15px/1.2 var(--f-body); color: var(--ink); }
@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { flex-wrap: wrap; overflow: visible; }
  .filter { min-height: 34px; padding-inline: 10px; font-size: 14px; }
  .search { max-width: none; flex-basis: auto; }
}
.addr { display: flex; align-items: center; gap: 8px; font: 400 13px/1 var(--f-mono); min-width: 0; }
.addr output { flex: 1; min-width: 0; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .addr > span { display: none; } }

.grid {
  list-style: none; margin: 0; padding: 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px;
}
.card-wrap[hidden] { display: none; }
.card {
  height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px;
  color: var(--ink); text-decoration: none; border: 1px solid transparent;
}
.card:hover { border: 1px dotted var(--sel); background: #eef2fb; }
.card:focus-visible { outline: 2px dotted var(--sel); outline-offset: -2px; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-when { font: 400 13px/1 var(--f-mono); color: var(--muted); }
.card-title { font: 700 20px/1.15 var(--f-display); text-wrap: balance; }
.card:hover .card-title { color: var(--sel); }
.card-sum { font-size: 15px; line-height: 1.5; color: var(--ink); flex: 1; }
.card-cats { font: 400 12px/1.4 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.empty { margin: 0; padding: 20px; text-align: center; font: 400 14px/1.5 var(--f-mono); }
.statusbar { display: flex; gap: 4px; font: 400 13px/1 var(--f-mono); }
.statusbar span { padding: 6px 10px; background: var(--face); }
.statusbar span:first-child { flex: 0 0 auto; min-width: 140px; }
.statusbar span:last-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- currículo ---------- */
.cv { display: grid; gap: 12px; }
.h3 { margin: 10px 0 0; font: 700 19px/1.1 var(--f-display); }
.list { list-style: none; margin: 0; padding: 3px; }
.list li + li { border-top: 1px solid var(--face-2); }
.row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 220px); gap: 4px 16px; align-items: center;
  padding: 10px 12px; color: var(--ink); text-decoration: none;
}
a.row:hover, a.row:focus-visible { background: var(--sel); color: var(--sel-ink); outline: none; }
a.row:hover .row-when, a.row:focus-visible .row-when, a.row:hover .row-where, a.row:focus-visible .row-where { color: var(--face-2); }
.row-when { font: 400 13px/1.3 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.row-what { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.row-where { color: var(--muted); }
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .row-when { order: 3; }
}
.row-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.row-link span { flex: 1; min-width: 0; font-weight: 500; }
.row-link small { flex: none; font: 400 12px/1.2 var(--f-mono); color: var(--muted); }
.row-link:hover, .row-link:focus-visible { background: var(--sel); color: var(--sel-ink); outline: none; }
.row-link:hover small, .row-link:focus-visible small { color: var(--face-2); }
@media (max-width: 520px) { .row-link { flex-wrap: wrap; } .row-link small { flex-basis: 100%; padding-left: 28px; } }
.skills { margin: 0; display: grid; gap: 10px; }
.skills > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 16px; padding: 0 12px; }
.skills dt { font: 500 12px/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.skills dd { margin: 0; max-width: 70ch; }
@media (max-width: 640px) { .skills > div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- contato ---------- */
.recado { display: grid; gap: 12px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--lo); box-shadow: 0 -1px 0 var(--hi); max-width: 640px; }
.recado .h3 { margin: 0; }
.hint { margin: 0; color: var(--muted); font-size: 15px; }
.form-row { display: grid; gap: 6px; min-width: 0; }
.form-row label { font: 500 13px/1.2 var(--f-mono); }
.form-row input, .form-row textarea { width: 100%; min-width: 0; padding: 8px 10px; font: 400 16px/1.4 var(--f-body); color: var(--ink); resize: vertical; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#r-status { font: 400 14px/1.4 var(--f-mono); }
#r-status.is-err { color: #a1121b; }
.contact { display: grid; gap: 16px; }
.h2 { margin: 0; font: 700 26px/1.1 var(--f-display); }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mail-label { font: 500 14px/1 var(--f-mono); }
.mail { flex: 1 1 240px; min-width: 0; min-height: 36px; padding: 6px 10px; font: 400 15px/1 var(--f-mono); color: var(--ink); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- detalhe do projeto ---------- */
.detail { display: grid; gap: 18px; }
.detail-head { display: flex; gap: 14px; align-items: flex-start; }
.detail-title { margin: 0; font: 700 clamp(26px, 4.5vw, 38px)/1.05 var(--f-display); text-wrap: balance; color: var(--title-a); }
.detail-sum { margin: 8px 0 0; font-size: 17px; max-width: 62ch; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.stats > div { display: flex; flex-direction: column-reverse; gap: 4px; padding: 12px 14px; background: var(--paper); box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi), inset 2px 2px var(--dark), inset -2px -2px var(--face-2); }
.stats dd { margin: 0; font: 700 30px/1 var(--f-display); color: var(--title-a); font-variant-numeric: tabular-nums; }
.stats dt { font: 400 13px/1.3 var(--f-mono); color: var(--muted); }
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .stats > div { flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 10px; padding: 10px 12px; }
  .stats dd { font-size: 24px; white-space: nowrap; }
}
.card-stat { font: 400 13px/1.3 var(--f-mono); color: var(--muted); }
.card-stat b { font: 700 16px/1 var(--f-display); color: var(--title-a); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.facts > div { padding: 10px 12px; background: var(--face-2); border: 1px solid var(--lo); min-width: 0; }
.facts dt { font: 500 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 15px; }
.prose { max-width: 66ch; }
.prose p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; }
.sub { font: 500 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 6px; }
h3.sub { margin: 4px 0 -8px; }
.tools { margin: 0; font-size: 15px; }
.videos { display: grid; gap: 12px; }
.videos-v { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.video-v { aspect-ratio: auto; height: 620px; max-width: 420px; width: 100%; }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; padding: 3px; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--dark); }
.site-prev { margin: 0; display: grid; gap: 6px; }
.prev-bar { display: flex; align-items: center; gap: 8px; font: 400 13px/1 var(--f-mono); min-width: 0; }
.prev-bar output { flex: 1; min-width: 0; padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev-bar .btn { min-height: 32px; font-size: 14px; flex: none; }
@media (max-width: 520px) { .prev-bar > span { display: none; } }
.prev-view { position: relative; aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; padding: 0; background: var(--paper); }
.prev-view iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; background: var(--paper); }
@media (max-width: 640px) { .prev-view { aspect-ratio: 9 / 14; } .prev-view iframe { width: 390px; height: 607px; } }
.site-prev figcaption { font: 400 13px/1.45 var(--f-mono); color: var(--muted); }
.shots-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shots-grid .shot figcaption { font-size: 12px; }
.shots-grid img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; object-position: top; }
.shot { margin: 0; display: grid; gap: 6px; }
.shot-frame { display: block; width: fit-content; max-width: 100%; padding: 3px; }
.shot-frame img { display: block; max-width: 100%; height: auto; }
.shots-grid .shot-frame { width: auto; }
.shot figcaption { font: 400 13px/1.45 var(--f-mono); color: var(--muted); }

.crumb { margin: 0; }

/* ---------- visualizador (janela modal) ---------- */
.viewer {
  padding: 3px; border: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  color: var(--ink);
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(10, 20, 30, .45); }
.viewer-body { overflow: auto; flex: 1; min-height: 0; background: var(--face); }
.viewer-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--lo); }
@media (max-width: 640px) {
  .viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .viewer-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .viewer-foot .btn { flex: 1; }
}

/* ---------- barra de tarefas ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  min-height: var(--bar-h);
  box-shadow: inset 0 1px var(--face-2), inset 0 2px var(--hi);
}
.start { font: 700 15px/1 var(--f-body); padding-inline: 10px; flex: none; }
.tasks { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tasks::-webkit-scrollbar { display: none; }
.task { justify-content: flex-start; min-width: 0; flex: 0 1 150px; font-size: 14px; white-space: nowrap; }
.task span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .task span { display: none; } .task { flex: none; padding-inline: 10px; } }
.tray { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--face); font: 500 14px/1 var(--f-mono); flex: none; }
.tray .lang { color: var(--ink); font-weight: 600; text-decoration: none; padding: 2px 4px; border: 1px solid var(--lo); }
.tray .lang:hover { background: var(--sel); color: var(--sel-ink); }

.startmenu {
  position: fixed; left: 4px; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) - 2px); z-index: 45;
  display: flex; padding: 3px; width: min(300px, calc(100vw - 8px));
}
.startmenu[hidden] { display: none; }
.startmenu-band {
  width: 32px; flex: none; background: linear-gradient(0deg, var(--title-a), var(--title-b));
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
}
.startmenu-band span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: var(--face-2); font: 700 20px/1 var(--f-display); letter-spacing: .01em;
}
.startmenu-band b { color: var(--hi); }
.startmenu ul { list-style: none; margin: 0; padding: 4px 0; flex: 1; min-width: 0; }
.startmenu li a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  color: var(--ink); text-decoration: none; font-size: 15px;
}
.startmenu li a:hover, .startmenu li a:focus-visible { background: var(--sel); color: var(--sel-ink); outline: none; }
.startmenu .sep { height: 0; margin: 4px 6px; border-top: 1px solid var(--lo); border-bottom: 1px solid var(--hi); }

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .viewer[open] { animation: pop .14s steps(3); }
  @keyframes pop { from { transform: scale(.94); opacity: .4; } }
}
