:root {
  /* Neocities / Web 1.0 Typography */
  --font-sans: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;

  /* Chaotic High-Contrast Palette - GRAYSCALE VERSION */
  --bg: #000000;
  /* Deep space black */
  --bg-card: #111111;
  /* Slightly lighter block */
  --bg-hover: #ffffff;
  /* White hover */
  --fg: #ffffff;
  /* White text */
  --fg-muted: #aaaaaa;
  --fg-faint: #555555;
  --accent: #ffffff;
  /* White links/borders */
  --accent-dim: #888888;
  --border-light: #ffffff;
  --border-dark: #666666;
  --border-darker: #333333;
  --tag-bg: #ffffff;
  --tag-fg: #000000;

  --max-width: 800px;
  --transition: 0s;
  /* Keep it snappy */
  --radius: 0px;

  /* Harsh Web 1.0 Shadows Instead of 3D inset/outset */
  --win-border-outset: 4px 4px 0px var(--accent);
  --win-border-inset: 2px 2px 0px var(--border-dark);
}

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

html {
  font-size: 16px;
  background: var(--bg);
  /* Optional: We can add a tiled background image here later */
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* Hard Custom Scrollbar */
::-webkit-scrollbar {
  width: 20px;
  height: 20px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: 2px dashed var(--accent);
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border: 2px solid var(--fg);
}

::-webkit-scrollbar-thumb:active {
  background: var(--bg-hover);
}

body {
  font-family: var(--font-mono);
  /* Force Courier New as base */
  background: var(--bg-card);
  color: var(--fg);
  line-height: 1.6;
  margin: 0 auto;
  max-width: var(--max-width);
  border: 4px dashed var(--accent);
  box-shadow: 8px 8px 0px var(--border-dark);
  padding: 1rem;
}

.skip-link {
  position: absolute;
  top: -9rem;
  left: 1rem;
  background: var(--bg-card);
  color: var(--fg);
  padding: .4rem .9rem;
  font-size: .78rem;
  box-shadow: var(--win-border-outset);
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* Neocities Brutalist Header */
header {
  padding: 1rem 0;
  text-align: center;
  border-bottom: 4px dashed var(--accent);
  margin-bottom: 2rem;
}

nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-name {
  font-family: var(--font-sans);
  font-size: 3rem;
  font-weight: bold;
  color: var(--fg);
  text-shadow: 4px 4px 0px var(--border-dark);
  text-decoration: none;
  text-transform: uppercase;
}

.site-name span {
  color: var(--fg);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  padding: 0;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  font-size: 1.2rem;
  font-weight: bold;
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--fg-muted);
  background: transparent;
  text-decoration: underline;
  text-decoration-style: wavy;
}

main {
  padding: 2rem 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  min-height: auto;
}

section {
  margin-bottom: 5.5rem;
  scroll-margin-top: 2rem;
}

.intro p {
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 1rem;
  font-weight: 400;
  /* Drop bold weights for standard rendering */
}

.intro p:last-child {
  margin-bottom: 0;
}

.intro strong {
  font-weight: 600;
  color: var(--fg);
}

.intro em {
  font-style: italic;
  color: var(--accent);
}

h2 {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--fg);
  margin-bottom: 2rem;
  padding-bottom: .5rem;
  border-bottom: 2px dashed var(--accent);
  text-transform: uppercase;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 2px dotted var(--fg);
  box-shadow: 4px 4px 0px var(--accent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px;
  transition: transform 0.1s;
}

.project-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--border-dark);
  border-color: var(--border-dark);
}

/* Style the project thumb */
.project-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 2px solid var(--fg);
  display: block;
  background: #000;
  filter: contrast(120%) grayscale(100%);
}

.project-content {
  padding: .8rem 4px 4px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-header {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin-bottom: .45rem;
  flex-wrap: wrap;
}

.project-card h3 {
  font-size: 1.2rem;
  font-family: var(--font-sans);
  font-weight: bold;
  letter-spacing: .05em;
  color: var(--accent);
}

.project-card h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card h3 a:hover {
  color: var(--bg-hover);
  text-decoration: underline;
  text-decoration-style: dashed;
}

.project-tag {
  font-size: .8rem;
  font-weight: bold;
  font-family: var(--font-mono);
  background: var(--fg);
  color: var(--tag-fg);
  padding: 2px 8px;
  border: 1px solid var(--accent);
}

.project-card p {
  font-size: .92rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.project-card p:last-child {
  margin-bottom: 0;
}

.project-meta {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.project-meta span {
  font-size: .85rem;
  font-weight: bold;
  color: var(--border-dark);
}

.em-breve {
  color: var(--fg-faint);
  /* Text looks disabled in win98 */
}

#sobre p {
  font-size: .95rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

#sobre p:last-child {
  margin-bottom: 0;
}

#sobre strong {
  color: var(--fg);
  font-weight: 600;
}

.post-list {
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: .8rem;
  align-items: baseline;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border-dark);
}

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

.exp-details {
  display: flex;
  flex-direction: column;
}

.post-list time {
  font-size: .68rem;
  font-weight: 500;
  color: var(--fg-faint);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: .1rem;
}

.post-list a {
  font-size: 1.1rem;
  font-weight: bold;
  font-family: var(--font-sans);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: solid;
}

.post-list a:hover {
  color: var(--bg-hover);
  text-decoration-style: wavy;
}

#contato p {
  font-size: .95rem;
  color: var(--fg-muted);
}

footer {
  max-width: var(--max-width);
  margin: 2rem 0;
  padding: 1rem;
  border-top: 4px dashed var(--border-dark);
  text-align: center;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0;
}

.footer-links a {
  font-size: .85rem;
  font-weight: 400;
  color: var(--accent);
  text-decoration: underline;
}

.footer-links a:hover {
  color: var(--fg);
}

.sep {
  color: var(--fg-faint);
}

.footer-copy {
  font-size: .68rem;
  color: var(--fg-faint);
  letter-spacing: .04em;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.overlay-modal {
  background: var(--bg);
  color: var(--fg);
  padding: 8px;
  max-width: 600px;
  width: 92%;
  margin: auto;
  position: relative;
  border: 4px dotted var(--fg);
  box-shadow: 12px 12px 0px var(--accent);
  overflow: hidden;
}

.overlay-modal::backdrop {
  background: transparent;
}

.overlay-modal[open] {
  animation: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: var(--border-dark);
  border-bottom: 2px dashed var(--fg);
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: normal;
  text-transform: none;
}

.close-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: red;
  border: 2px solid white;
  box-shadow: 4px 4px 0px #000;
  font-weight: bold;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}

.close-modal:hover {
  background: var(--bg-hover);
}

.close-modal:active {
  box-shadow: var(--win-border-inset);
  padding-top: 2px;
  padding-left: 2px;
}

.modal-body {
  padding: 1.75rem;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.modal-gallery img {
  width: 100%;
  height: auto;
  border-radius: 0;
  display: block;
  box-shadow: var(--win-border-inset);
}

.modal-body p {
  font-size: .92rem;
  color: var(--fg-muted);
  line-height: 1.75;
}

.page-back {
  margin-bottom: 3rem;
}

.page-back a {
  font-size: 1.1rem;
  font-weight: bold;
  font-family: var(--font-sans);
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: underline;
}

.page-back a:hover {
  color: var(--bg-hover);
  text-decoration-style: dashed;
}

.page-hero {
  margin-bottom: 3.5rem;
}

.page-hero-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.note-date {
  font-size: .85rem;
  font-weight: 400;
  color: var(--fg);
}

.page-hero h1 {
  font-size: 2.5rem;
  font-family: var(--font-sans);
  font-weight: bold;
  letter-spacing: normal;
  line-height: 1.2;
  color: var(--fg);
  margin-bottom: 1rem;
  text-shadow: 3px 3px 0 var(--border-dark);
}

.page-hero-desc {
  font-size: 1.1rem;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  line-height: 1.75;
  max-width: 560px;
}

.page-gallery {
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.page-gallery>img {
  width: 100%;
  height: auto;
  border-radius: 0;
  display: block;
  box-shadow: var(--win-border-inset);
}

.btn-gh,
.btn-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.5rem;
  padding: 8px 16px;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 4px 4px 0px var(--fg);
  color: var(--accent);
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--font-mono);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.1s;
}

.btn-gh:hover,
.btn-tg:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 6px 6px 0px var(--border-dark);
  transform: translate(-2px, -2px);
}

.btn-gh:active,
.btn-tg:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px transparent;
}

.contact-buttons {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.contact-buttons .btn-gh,
.contact-buttons .btn-tg {
  margin-top: 0;
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  border: 1px solid var(--border);
}

.page-content h2 {
  font-size: .62rem;
  letter-spacing: .12em;
  margin-bottom: .8rem;
  margin-top: 2.5rem;
  padding-bottom: .4rem;
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content p {
  font-size: .95rem;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.page-content p:last-child {
  margin-bottom: 0;
}

.note-content p {
  font-size: 1.05rem;
  line-height: 1.85;
}

/* =========================================================================
   Componentes Extras / Interativos
   ========================================================================= */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--bg-hover);
  color: #000000;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition), border-color var(--transition);
  z-index: 99;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--bg-card);
  border-color: var(--accent-dim);
  color: var(--accent);
}

@media (max-width: 520px) {
  html {
    font-size: 16px;
  }

  body {
    padding: 0 1rem;
  }

  header {
    padding: 1.4rem 0 1.2rem;
  }

  .site-name {
    font-size: 1rem;
  }

  .nav-links {
    gap: .6rem;
    flex-wrap: wrap;
    margin-top: .4rem;
  }

  .nav-links a {
    padding: .4rem 0;
    /* Aumenta a área de toque no mobile */
    display: inline-block;
  }

  main {
    padding: 3rem 0 5rem;
  }

  section {
    margin-bottom: 3.5rem;
    scroll-margin-top: 1rem;
  }

  .intro p {
    font-size: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    bottom: 1.2rem;
    right: 1.2rem;
    width: 40px;
    height: 40px;
  }

  .project-content {
    padding: 1.2rem;
  }

  .post-list li {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .6rem 0;
  }

  .post-list time {
    font-size: .62rem;
  }

  .page-back {
    margin-bottom: 2rem;
  }

  .page-hero {
    margin-bottom: 2.5rem;
  }

  .page-hero h1 {
    font-size: 1.4rem;
    /* Um pouco menor para caber melhor em telas estreitas */
    line-height: 1.25;
  }

  .page-hero-desc {
    font-size: .95rem;
  }

  .page-gallery {
    margin-bottom: 2rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .note-content p {
    font-size: .98rem;
  }

  .project-meta {
    gap: .8rem;
    /* Menor espaçamento entre tags no mobile */
  }

  footer {
    padding: 1.5rem 0 3rem;
  }
}

@media (max-width: 380px) {
  html {
    font-size: 15px;
  }

  .nav-links {
    gap: .5rem;
  }

  .page-hero h1 {
    font-size: 1.3rem;
  }
}

/* =========================================================================
   Print Styles (Currículo em PDF Mode)
   ========================================================================= */

/* Language Toggle Rules */
html[lang="en"] [lang="pt-BR"],
html[lang="pt-BR"] [lang="en"] {
  display: none !important;
}

.lang-btn {
  background: transparent;
  border: 1px dotted var(--fg);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  font-weight: bold;
  cursor: pointer;
  color: var(--fg);
  box-shadow: 2px 2px 0px var(--accent);
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.lang-btn:hover {
  background: var(--bg-hover);
  color: #000;
  box-shadow: 4px 4px 0px var(--border-dark);
  transform: translate(-2px, -2px);
}

.lang-btn:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

@media print {

  @page {
    margin: 1.5cm;
  }

  html,
  body {
    background: #fff;
    color: #111;
    font-size: 10.5pt;
    line-height: 1.5;
    padding: 0;
  }

  /* Ocultar elementos interativos e desnecessários na impressão */
  header,
  footer,
  .skip-link,
  .lang-btn,
  .back-to-top {
    display: none !important;
  }

  main {
    padding: 0;
    margin: 0;
    max-width: 100%;
  }

  /* Simplificar grid de projetos para lista em impressão */
  .projects-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .project-card {
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    border-radius: 0;
    padding-bottom: 1rem;
    page-break-inside: avoid;
    box-shadow: none !important;
  }

  .project-card:last-child {
    border-bottom: none !important;
  }

  .project-thumb {
    display: none !important;
    /* Sem imagens na impressão */
  }

  .project-content {
    padding: 0;
  }

  h2 {
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 0.3rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-size: 11pt;
    letter-spacing: .1em;
  }

  h3,
  .project-card h3 {
    font-size: 12pt;
    color: #000;
    margin-bottom: 0.2rem;
  }

  .project-tag {
    border: 1px solid #888 !important;
    color: #333 !important;
    background: transparent !important;
    padding: 1px 6px;
    font-size: 8pt;
  }

  /* Transformar os botões de contato em texto simples */
  .btn-gh {
    background: transparent !important;
    padding: 0 !important;
    color: #000 !important;
    display: inline !important;
    text-decoration: underline !important;
  }

  .contact-buttons {
    display: block !important;
  }

  .contact-buttons a {
    margin-right: 1rem;
  }

  .project-meta span {
    color: #555 !important;
    font-weight: 600;
    font-size: 8.5pt;
  }

  .post-list li {
    border-bottom: 1px solid #eaeaea;
    padding: 0.8rem 0;
    page-break-inside: avoid;
    grid-template-columns: 8rem 1fr;
  }

  .post-list time {
    color: #555 !important;
    font-size: 9pt;
  }

  .exp-details strong {
    color: #000 !important;
  }

  .intro p {
    color: #222 !important;
    font-size: 11pt;
  }

  p {
    color: #333 !important;
  }

  a,
  a:visited {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Mostrar a URL ao lado dos links de contato na impressão */
  #contato .footer-links a::after {
    content: " (" attr(href) ")";
    font-size: 9.5pt;
    color: #444 !important;
    text-decoration: none !important;
    font-weight: 400;
  }

  /* Remover links que sejam âncoras internas no modo impressão para manter visual limpo */
  a[href^="#"] {
    text-decoration: none;
    color: #000 !important;
  }

  /* Forçar quebra de página antes da seção de habilidades para separar o currículo */
  #sobre {
    page-break-before: always;
  }

  /* Evitar que os contatos quebrem no meio */
  #contato {
    page-break-inside: avoid;
  }

  /* Redefinir cores globais para alto contraste na impressão */
  * {
    color: #111 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}