*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--retro-black);
  font-family: var(--font-serif);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body {
  padding-bottom: max(36px, calc(36px + env(safe-area-inset-bottom, 0px)));
  background-color: var(--retro-gray);
}

/* Imagem de fundo do desktop (wallpaper) */
body.nuno-retro-body {
  background-image: var(--nuno-desktop-bg, none);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

img { display: block; max-width: 100%; }
button, a { cursor: pointer; }
a { color: inherit; }

/* Scrollbar estilo Windows 95 */
::-webkit-scrollbar              { width: 16px; }
::-webkit-scrollbar-track        { background: #dfdfdf; border-left: 1px solid white; }
::-webkit-scrollbar-thumb        {
  background: var(--retro-gray);
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
}
::-webkit-scrollbar-corner       { background: var(--retro-gray); }

/* -----------------------------------------------------------------
   TELA DE LOADING
   ----------------------------------------------------------------- */
#nuno-loading {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 99999;
}

.loading-logo-wrap {
  position: relative;
  display: inline-block;
  max-width: min(100%, 90vw);
}

.loading-logo-base {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 8vw, 64px);
  font-weight: bold;
  font-style: italic;
  color: rgba(200, 60, 60, 0.25);
  white-space: nowrap;
}

.loading-logo-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  overflow: hidden;
  width: 0;
  animation: loading-translate 2.5s 0s forwards cubic-bezier(0.19, 1, 0.22, 1);
}

.loading-logo-fill span {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 8vw, 64px);
  font-weight: bold;
  font-style: italic;
  color: var(--retro-red);
  white-space: nowrap;
  display: block;
}

@keyframes loading-translate {
  from { width: 0%; }
  to   { width: 100%; }
}

/* -----------------------------------------------------------------
   JANELA PRINCIPAL (RetroFrame wrapper)
   ----------------------------------------------------------------- */
#nuno-window {
  position: fixed;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  /* posição e tamanho controlados via JS */
}

/* Envoltório para animação de minimizar */
.window-minimize-wrap { transform-origin: center bottom; }

.window-minimize-wrap.window-minimizing {
  animation: minimize 450ms cubic-bezier(0.51, 0, 0.51, 1) forwards;
  pointer-events: none;
}

@keyframes minimize {
  0% {
    left: var(--minimize-start-x, 0);
    top:  var(--minimize-start-y, 0);
    transform: skew(0deg, 0deg) scale(1);
  }
  50% {
    transform: skew(1deg, 6deg) scale(0.1);
  }
  100% {
    left: calc(var(--minimize-end-center-x, 200px) - var(--minimize-window-w, 400px) / 2);
    top:  calc(var(--minimize-end-y, 100vh) - var(--minimize-window-h, 400px));
    transform: skew(0deg, 0deg) scale(0.1);
  }
}

/* -----------------------------------------------------------------
   RETRO FRAME (janela estilo Windows)
   ----------------------------------------------------------------- */
.retro-frame {
  width: 100%;
  background: var(--retro-gray);
  border: 2px solid;
  border-color: white white black black;
  padding: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Barra de Título */
.retro-titlebar {
  background: var(--retro-titlebar);
  color: white;
  padding: 2px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  user-select: none;
  margin-bottom: 4px;
  min-height: 44px;
}
@media (min-width: 768px) {
  .retro-titlebar { min-height: 24px; padding: 2px 4px; }
}
.retro-titlebar:active { cursor: grabbing; }

.retro-titlebar-title {
  font-family: var(--font-sans);
  font-weight: bold;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  margin-right: 4px;
}

/* Botões da titlebar */
.retro-titlebar-buttons {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.retro-btn {
  width: 44px; height: 44px;
  background: var(--retro-gray);
  border: 1px solid;
  border-color: white white black black;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  transition: background 0.1s;
  font-family: var(--font-sans);
  font-size: 0.75rem;
}
@media (min-width: 768px) {
  .retro-btn { width: 20px; height: 20px; }
}
.retro-btn:hover  { background: #d4d4d4; }
.retro-btn:active {
  border-color: black black white white;
  padding-top: 1px; padding-left: 1px;
}
.retro-btn svg { width: 16px; height: 16px; }
@media (min-width: 768px) {
  .retro-btn svg { width: 10px; height: 10px; }
}

/* Conteúdo da janela */
.retro-frame-content {
  border: 2px solid;
  border-color: black black white white;
  background: #fff;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Layout interno: sidebar + galeria */
.retro-inner {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
@media (max-width: 767px) {
  .retro-inner { flex-direction: column; }
}

/* Handle de redimensionamento */
.retro-resize-handle {
  position: absolute;
  bottom: 0; right: 0;
  width: 16px; height: 16px;
  cursor: nwse-resize;
  background: var(--retro-gray);
  border-top: 2px solid white;
  border-left: 2px solid white;
}

/* -----------------------------------------------------------------
   SIDEBAR
   ----------------------------------------------------------------- */
.retro-sidebar {
  width: var(--sidebar-w);
  background: white;
  color: var(--retro-red);
  font-family: var(--font-serif);
  border-right: 2px solid var(--retro-gray);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .retro-sidebar {
    /* Mobile: drawer deslizante */
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: min(72vw, 288px);
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 200ms ease-out;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
  }
  .retro-sidebar.is-open {
    transform: translateX(0);
  }
}

/* Overlay backdrop no mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,.5);
}
@media (max-width: 767px) {
  .sidebar-backdrop { display: block; opacity: 0; pointer-events: none; transition: opacity 200ms; }
  .sidebar-backdrop.is-active { opacity: 1; pointer-events: auto; }
}

/* Barra hamburger no mobile */
.sidebar-mobile-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--retro-gray);
  background: white;
  flex-shrink: 0;
}
@media (max-width: 767px) { .sidebar-mobile-bar { display: flex; } }

.sidebar-hamburger {
  background: none;
  border: none;
  color: var(--retro-red);
  padding: 8px;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-hamburger:hover { color: black; }

.sidebar-mobile-label {
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--retro-red);
}

/* Botão fechar dentro do drawer */
.sidebar-close-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(192,192,192,.5);
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}
@media (max-width: 767px) { .sidebar-close-bar { display: flex; } }

.sidebar-close-label {
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--retro-red);
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--retro-red);
  padding: 8px;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-close-btn:hover { color: black; }

/* Conteúdo da sidebar */
.sidebar-inner { padding: 1rem; }
@media (min-width: 768px) { .sidebar-inner { padding: 0; } }

.sidebar-artist-name {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: bold;
  font-style: italic;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  line-height: 1.1;
  text-shadow: 1px 1px 0 rgba(217,0,0,.15);
}

.sidebar-divider {
  height: 2px;
  background: var(--retro-red);
  margin-bottom: 1.5rem;
}
.sidebar-nav,
.sidebar-nav ul,
.sidebar-nav li {
  list-style:      decimal;
  list-style-type: decimal;
  padding:         0;
  margin:          0;
}


/* ── L0: itens de topo (Obras, Textos, Contato) ──────── */
.sidebar-nav > li {
  display:       block;
  margin-bottom: .5rem;
}

.sidebar-nav-item {
  align-items: center;
  cursor:      pointer;
  font-size:   1.0625rem;
  min-height:  44px;
  padding:     4px 0;
  user-select: none;
  transition:  color .15s;
}
@media (min-width: 768px) {
  .sidebar-nav-item { min-height: 0; padding: 2px 0; }
}
.sidebar-nav-item:hover strong {
  text-decoration:          underline;
  text-decoration-color:    var(--retro-red);
  text-decoration-thickness:2px;
  text-underline-offset:    4px;
}

.sidebar-subnav {
  display:     block;
  margin-top:  2px;
  margin-left: 18px;
}

.subnav-group {
  display:       block;
  margin-bottom: 2px;
}

.sidebar-nav-group {
  display:     flex;
  align-items: center;
  gap:         6px;
  cursor:      pointer;
  font-size:   .9375rem;
  font-weight: bold;
  font-style:  normal;
  color:       var(--retro-red);
  min-height:  44px;
  padding:     2px 0;
  user-select: none;
  transition:  color .15s;
}
@media (min-width: 768px) {
  .sidebar-nav-group { min-height: 0; padding: 2px 0; }
}
.sidebar-nav-group .arrow { font-size: .65rem; flex-shrink: 0; }

.sidebar-subnav > li:not(.subnav-group) {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   .9rem;
  cursor:      pointer;
  min-height:  44px;
  transition:  color .15s;
}
@media (min-width: 768px) {
  .sidebar-subnav > li:not(.subnav-group) { min-height: 0; padding: 2px 0; }
}
.sidebar-subnav > li:not(.subnav-group) .arrow { font-size: .6rem; flex-shrink: 0; }

.sidebar-subnav-l2 {
  display:     block;
  margin-top:  2px;
  margin-left: 16px;
}
.sidebar-subnav-l2 > li {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   .85rem;
  font-weight: normal;
  font-style:  normal;
  opacity:     .75;
  cursor:      pointer;
  min-height:  44px;
  transition:  color .15s, opacity .15s;
}
@media (min-width: 768px) {
  .sidebar-subnav-l2 > li { min-height: 0; padding: 2px 0; }
}
.sidebar-subnav-l2 > li:hover { opacity: 1; color: #111; }

/* -----------------------------------------------------------------
   ÁREA DE GALERIA / CONTEÚDO
   ----------------------------------------------------------------- */
.retro-gallery {
  flex: 1;
  background: #fff;
  padding: 2rem 1.5rem;
  font-family: var(--font-serif);
  color: black;
  overflow-y: auto;
  min-height: 400px;
  position: relative;
}
@media (max-width: 767px) {
  .retro-gallery { padding: 1rem; }
}

/* Cabeçalho dinâmico */
.gallery-header { margin-bottom: 2rem; text-align: center; }
.gallery-header h1 {
  font-size: clamp(1.25rem, 4vw, 2.25rem);
  font-weight: bold;
  letter-spacing: 0.1em;
	font-style: italic;
  margin: 0 0 8px;
}
.gallery-header-line {
  height: 2px;
  background: black;
  margin-bottom: 3px;
}

/* Grid de obras */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 767px) {
  .artwork-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.artwork-card { display: flex; flex-direction: column; align-items: center; }

.artwork-card-img-wrap {
  position: relative;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}
.artwork-card-img-wrap:hover { transform: scale(1.02); }

.artwork-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  filter: grayscale(20%) contrast(125%) sepia(10%);
  -webkit-user-drag: none;
  user-drag: none;
}

.artwork-card-info { text-align: center; margin-top: 12px; }
.artwork-card-title { font-size: 1.25rem; font-weight: bold; line-height: 1.2; }
.artwork-card-medium { font-size: 1rem; font-style: italic; color: #333; }
.artwork-card-price { font-size: 0.9rem; font-weight: bold; color: #222; margin-top: 4px; }

/* Badge VENDIDO na galeria */
.artwork-sold-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(180, 0, 0, 0.85);
  color: #fff;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: .15em;
  padding: 5px 0;
  pointer-events: none;
}
.artwork-card.is-sold .artwork-card-img-wrap img {
  filter: grayscale(80%) contrast(100%) sepia(0%);
  opacity: 0.75;
}

/* Empty state */
.gallery-empty {
  text-align: center;
  margin-top: 5rem;
  color: #666;
  font-style: italic;
}

/* Proteção de imagem */
.img-protected {
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none; user-drag: none;
}
.img-protected img, img.img-protected {
  -webkit-user-drag: none;
  pointer-events: auto;
}

/* -----------------------------------------------------------------
   LIGHTBOX MODAL (obra individual)
   ----------------------------------------------------------------- */
.artwork-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
@media (min-width: 768px) { .artwork-modal-overlay { padding: 1rem; } }

.artwork-modal {
  background: var(--retro-gray);
  border: 2px solid;
  border-color: white white black black;
  padding: 4px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  /* posição/tamanho via JS no desktop */
}
@media (max-width: 767px) {
  .artwork-modal {
    width: 100% !important;
    height: 100% !important;
    max-height: 100dvh !important;
    border: none;
    border-radius: 0;
  }
}
@media (min-width: 768px) {
  .artwork-modal {
    position: absolute;
    width: min(95vw, 900px);
    height: 85vh;
  }
}

.modal-titlebar {
  background: var(--retro-titlebar);
  color: white;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  cursor: grab;
  user-select: none;
}
@media (min-width: 768px) { .modal-titlebar { padding: 2px 8px; cursor: grab; } }
.modal-titlebar:active { cursor: grabbing; }

.modal-title {
  font-family: var(--font-sans);
  font-weight: bold;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  margin-right: 8px;
}

.modal-img-area {
  background: black;
  border: 2px solid;
  border-color: black black white white;
  padding: 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-img-area img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.modal-info-bar {
  margin-top: 8px;
  background: #fff;
  border: 2px solid var(--retro-gray);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .modal-info-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
}

.modal-artwork-title { font-weight: bold; font-size: 1rem; }
.modal-artwork-medium { font-size: 0.875rem; }
.modal-artwork-price { font-size: 0.875rem; font-weight: bold; color: #222; margin-top: 2px; }

/* Label VENDIDO no modal */
.modal-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.modal-sold-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #b40000;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: .12em;
  padding: 6px 12px;
  border: 2px solid #800000;
}
@media (max-width: 767px) {
  .modal-actions { width: 100%; justify-content: flex-end; }
}

/* Todas as seções da galeria herdam fundo branco */
.gallery-section {
  background: #fff;
}

/* -----------------------------------------------------------------
   SEÇÃO SOBRE
   ----------------------------------------------------------------- */
.section-about { background: #fff; }

.about-photo-frame {
  border: 4px solid;
  border-color: white white black black;
  padding: 4px;
  background: var(--retro-gray);
  box-shadow: var(--shadow-retro-out);
}
.about-photo-frame .inner {
  border: 2px solid;
  border-color: black black white white;
}
.about-photo-frame img {
  width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(125%) sepia(30%);
  display: block;
}

.about-socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }

/* -----------------------------------------------------------------
   SEÇÃO CONTATO
   ----------------------------------------------------------------- */
.contact-form-wrap {
  max-width: 672px;
  margin: 0 auto;
  background: var(--retro-gray);
  padding: 4px;
  border: 2px solid;
  border-color: white white black black;
  box-shadow: 0 0 16px rgba(0,0,0,.2);
}

.contact-form-inner {
  background: #fff;
  padding: 1.5rem;
  border: 2px solid;
  border-color: black black white white;
}

.contact-notice {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fefce8;
  border: 1px solid #ca8a04;
  padding: 8px;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.retro-field-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 1rem; }
.retro-label { font-weight: bold; font-size: 0.875rem; text-transform: uppercase; font-family: var(--font-sans); }

.retro-input,
.retro-select,
.retro-textarea {
  width: 100%;
  background: white;
  border: 2px solid;
  border-color: black black white white;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  outline: none;
}
.retro-input:focus,
.retro-textarea:focus { background: #fefce8; }
.retro-select { cursor: pointer; }
.retro-textarea { resize: vertical; rows: 6; }

.contact-phone-info { margin-top: 3rem; text-align: center; font-family: var(--font-mono); font-size: 0.875rem; }
.contact-phone-info .phone { font-weight: bold; font-size: 1.125rem; margin-top: 4px; }

/* Feedback de envio */
.form-feedback {
  padding: 12px;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border: 2px solid;
  display: none;
}
.form-feedback.success { border-color: green; background: #f0fff4; color: #166534; }
.form-feedback.error   { border-color: red;   background: #fff0f0; color: #991b1b; }
.form-feedback.visible { display: block; }

/* -----------------------------------------------------------------
   SEÇÃO CURSO — layout antigo removido, ver bloco abaixo
   ----------------------------------------------------------------- */

/* -----------------------------------------------------------------
   BOTÕES RETRO
   ----------------------------------------------------------------- */
.retro-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--retro-gray);
  color: black;
  padding: 4px 16px;
  border: 2px solid;
  border-color: white white black black;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.1s;
  text-decoration: none;
}
@media (min-width: 768px) { .retro-button { min-height: 28px; } }
.retro-button:hover  { background: #ff0000; border-color: #ff0000;}
.retro-button:active {
  background: #ff0000; border-color: #ff0000;
  padding-top: 5px; padding-left: 17px;
}

.retro-button-primary {
  background: var(--retro-titlebar);
  color: white;
  border-color: #3333aa;
}
.retro-button-primary:hover { background: #ff0000; border-color: #ff0000;}
.retro-button-primary:active { background: #00007a; }

/* -----------------------------------------------------------------
   FOOTER / ASSINATURA
   ----------------------------------------------------------------- */
.gallery-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid black;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.gallery-footer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.gallery-footer a:hover {
  background: black;
  color: white;
  padding: 0 2px;
}

/* -----------------------------------------------------------------
   TASKBAR (barra de tarefas)
   ----------------------------------------------------------------- */
#nuno-taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: max(36px, calc(36px + env(safe-area-inset-bottom, 0px)));
  min-height: 44px;
  display: flex;
  align-items: center;
  background: var(--retro-gray);
  border-top: 2px solid #dfdfdf;
  box-shadow: inset 1px 1px 0 0 #ffffff;
  z-index: 99999;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Botão Início */
.taskbar-start-btn {
  height: 100%;
  min-height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--retro-gray);
  color: black;
  border: none;
  border-right: 2px solid;
  border-bottom: 2px solid;
  border-color: transparent #404040 #404040 transparent;
  box-shadow: 1px 1px 0 0 #dfdfdf;
  font-family: var(--font-sans);
  font-weight: bold;
  font-size: 0.875rem;
  cursor: pointer;
}
.taskbar-start-btn:hover  { background: #ff0000; border-color: #ff0000; }
.taskbar-start-btn:active {
  background: #ff0000; border-color: #ff0000;
  box-shadow: none;
  padding-top: 1px; padding-left: 17px;
}

/* Menu Início popup */
.taskbar-start-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 2px;
  width: 224px;
  background: var(--retro-gray);
  border: 2px solid;
  border-color: white white #404040 #404040;
  box-shadow: 2px 2px 0 0 #808080;
  z-index: 10000;
  display: none;
}
.taskbar-start-menu.is-open { display: block; }

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: black;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.start-menu-item:hover { background: var(--retro-titlebar); color: white; }

.start-menu-divider {
  height: 1px;
  background: #808080;
  margin: 4px 0;
  box-shadow: 0 1px 0 white;
}

/* Área de abas das janelas */
.taskbar-windows {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  overflow-x: auto;
  min-width: 0;
}

.taskbar-window-btn {
  height: 28px;
  min-width: 120px;
  max-width: 200px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 2px solid;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) { .taskbar-window-btn { min-width: 100px; } }

.taskbar-window-btn.is-active {
  background: var(--retro-titlebar);
  color: white;
  border-color: var(--retro-titlebar);
  box-shadow: inset 1px 1px 0 0 #000;
}
.taskbar-window-btn.is-inactive {
  background: var(--retro-gray);
  color: black;
  border-color: #dfdfdf #404040 #404040 #dfdfdf;
  box-shadow: 1px 1px 0 0 #808080;
}
.taskbar-window-btn.is-inactive:hover { background: #d0d0d0; }

/* Área do relógio / ícones direita */
.taskbar-tray {
  height: 100%;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 2px solid #808080;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: black;
  flex-shrink: 0;
}

.taskbar-tray a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 2px;
  color: black;
}
.taskbar-tray a:hover  { background: #a0a0a0; }
.taskbar-tray a:active { background: #808080; }

/* -----------------------------------------------------------------
   UTILITÁRIOS GERAIS
   ----------------------------------------------------------------- */
.year-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.year-filter-btn {
  background: var(--retro-gray);
  border: 2px solid;
  border-color: white white black black;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: bold;
  padding: 3px 10px;
  cursor: pointer;
  min-height: 28px;
}
.year-filter-btn:hover  { background: white; }
.year-filter-btn:active { border-color: black black white white; }
.year-filter-btn.is-active {
  background: var(--retro-titlebar);
  color: white;
  border-color: var(--retro-titlebar);
}

.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;
}

.safe-area-inset {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Double-line separator */
.double-line { height: 2px; background: black; }
.double-line + .double-line { margin-top: 3px; }

/* -----------------------------------------------------------------
   SEÇÃO CURSOS — layout texto + grade + grid de imagens
   ----------------------------------------------------------------- */
.section-course-wrap {
  font-family: var(--font-serif);
  max-width: 720px;
  margin: 0 auto;
}

/* Layout principal: fluxo vertical */
.course-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.course-description {
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: justify;
  border-left: 4px double black;
  padding-left: 1.5rem;
}

.course-schedule-box {
  background: rgba(192,192,192,.15);
  padding: 1.25rem 1.5rem;
  border: 2px solid black;
  box-shadow: var(--shadow-retro-in);
}

.course-schedule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,.25);
}

.course-schedule-box h3 {
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.course-schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.course-schedule-list li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted rgba(0,0,0,.15);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.course-schedule-list li:last-child {
  border-bottom: none;
}

.course-schedule-list li::before {
  content: '▸';
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.6;
}

.course-cta {
  margin-top: 0.5rem;
}

/* Grid de imagens 4 colunas */
.course-image-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 1.5rem;
}

.course-grid-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e8e8e8;
  border: 1px solid #ccc;
  cursor: pointer;
}

.course-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.course-grid-item:hover img {
  opacity: 0.85;
}

/* Lightbox de imagem do curso */
#course-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cil-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.cil-frame {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cil-frame img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.cil-close {
  position: absolute;
  top: -2rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.cil-close:hover { opacity: 0.7; }

/* Responsive */
@media (max-width: 767px) {
  .course-description {
    border-left: 3px double black;
    padding-left: 1rem;
  }

  .course-image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .course-image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
  }
}

/* -----------------------------------------------------------------
   SEÇÃO FORTUNA CRÍTICA
   ----------------------------------------------------------------- */
.section-fortuna {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-serif);
}

.fortuna-entries {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fortuna-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,.12);
}

.fortuna-card:first-child {
  padding-top: 0;
}

.fortuna-card:last-child {
  border-bottom: none;
}

.fortuna-card-title {
  font-size: 1.15rem;
  font-weight: bold;
  margin: 0 0 0.25rem;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
}

.fortuna-title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.25);
  transition: border-color 0.15s;
}

.fortuna-title-link:hover {
  border-bottom-color: black;
}

.fortuna-link-icon {
  font-size: 0.8em;
  opacity: 0.5;
  margin-left: 2px;
}

.fortuna-card-subtitle {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.75rem;
  font-style: italic;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.02em;
}

.fortuna-card-excerpt {
  font-size: 1rem;
  line-height: 1.75;
  text-align: justify;
  color: #333;
}

.fortuna-card-excerpt p {
  margin: 0;
}

.fortuna-empty {
  color: #666;
  font-style: italic;
  font-size: 1rem;
}

/* -----------------------------------------------------------------
   SEÇÃO CV
   ----------------------------------------------------------------- */
.section-cv {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  font-family: var(--font-serif);
}

.cv-empty {
  color: #888;
  font-style: italic;
  font-size: 1rem;
}

/* Grupo de categoria */
.cv-group {
  margin-bottom: 2.25rem;
}

.cv-group-title {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.35rem;
  margin: 0 0 0.75rem;
}

/* Lista de entradas */
.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cv-item:last-child {
  border-bottom: none;
}

/* Entrada com link */
.cv-item-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.1s;
  border-radius: 2px;
  padding-right: 1.4rem;
}

.cv-item-link:hover .cv-item-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-item-title {
  font-size: 0.95rem;
  font-weight: normal;
  line-height: 1.4;
  color: var(--retro-black, #111);
}

.cv-item-subtitle {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

.cv-item-ext-icon {
  position: absolute;
  right: 0;
  top: 0.1rem;
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1;
  font-style: normal;
  transition: color 0.15s;
}

.cv-item-link:hover .cv-item-ext-icon {
  color: #555;
}

.cv-item-description {
  display: block;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.6;
  margin-top: 0.25rem;
  font-style: normal;
  font-family: var(--font-serif);
}

.cv-item-description p {
  margin: 0 0 0.25rem;
}

.cv-item-description p:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .section-cv { padding: 1.25rem 0.75rem 2rem; }
}

/* -----------------------------------------------------------------
   RESPONSIVIDADE GERAL
   ----------------------------------------------------------------- */
@media (max-width: 767px) {
  .retro-gallery { min-height: 300px; }
  .artwork-card img { height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-logo-fill,
  .window-minimize-wrap.window-minimizing,
  .retro-sidebar { transition: none !important; animation: none !important; }
}
