/* =========================================================
   DMarkInfo | Portfólio de Eduardo Marques
   Paleta original do site + cores da logo, com tema claro e escuro.
   ========================================================= */

/* ---------- Tema escuro (padrão) ---------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #101214;
  --surface: #181A1D;
  --surface-2: #202225;
  --line: #2A2D31;
  --line-strong: #3A3E44;

  --text: #F0F0F0;
  --text-soft: #C8CACD;
  --muted: #A0A0A0;

  --navy: #0A2540;            /* azul-marinho / petróleo */
  --blue: #3399FF;            /* azul de destaque */
  --link: #3399FF;
  --logo-blue: #3594C7;       /* azul das pétalas da logo */
  --logo-gray: #E8EAED;       /* pétala cinza (clareada no escuro) */

  --btn-bg: #3399FF;
  --btn-text: #0A2540;
  --btn-bg-hover: #5CADFF;

  --tag-engia: #00FF4C;
  --tag-ml: #3399FF;
  --tag-analise: #FFAB00;
  --tag-automacao: #E53935;
  --tag-visao: #A64DFF;
  --tag-jogo: #FF4D79;

  --header-bg: rgba(16, 18, 20, .85);
  --shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

/* ---------- Tema claro ---------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EDF1F6;
  --line: #DCE2EA;
  --line-strong: #C3CCD8;

  --text: #14181D;
  --text-soft: #2E343B;
  --muted: #595A5B;           /* cinza da logo */

  --navy: #0A2540;
  --blue: #3399FF;
  --link: #0B66C3;            /* mesmo azul, escurecido para leitura no claro */
  --logo-blue: #3594C7;
  --logo-gray: #595A5B;

  --btn-bg: #0A2540;
  --btn-text: #FFFFFF;
  --btn-bg-hover: #123A63;

  --tag-engia: #0E9F45;
  --tag-ml: #1F7FE0;
  --tag-analise: #C98400;
  --tag-automacao: #D32F2F;
  --tag-visao: #7B2FD0;
  --tag-jogo: #D81B4F;

  --header-bg: rgba(245, 247, 250, .88);
  --shadow: 0 18px 40px rgba(10, 37, 64, .10);
}

:root {
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-code: ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius: 1rem;
  --radius-sm: .6rem;
  --container: 1160px;
  --header-h: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; }

a { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: var(--container); margin-inline: auto; padding-inline: 2rem; }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--btn-text);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Barra de rolagem discreta (mantida do site original) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--navy); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: 0 1.6rem;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn i { font-size: 1.2em; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-text); }
.btn-outline { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--blue); color: var(--text); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  padding-top: env(safe-area-inset-top, 0px);
  transition: border-color .25s ease, background-color .25s ease;
}
/* O desfoque fica num pseudo-elemento: no próprio header ele prenderia o menu mobile (position: fixed) */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--header-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.site-header.scrolled { border-bottom-color: var(--line); }

.nav { min-height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }

.brand { display: inline-flex; align-items: center; margin-right: auto; }
.brand img { height: 42px; width: auto; }
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light,
:root:not([data-theme]) .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark,
:root:not([data-theme]) .logo-on-dark { display: block; }

.menu { display: flex; align-items: center; gap: 2rem; list-style: none; }
.menu a {
  position: relative; color: var(--muted); text-decoration: none;
  font-family: var(--font-display); font-size: 1rem; font-weight: 500;
  padding-block: .4rem;
  transition: color .2s ease;
}
.menu a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 2px; width: 0; border-radius: 2px; background: var(--blue);
  transition: width .25s ease;
}
.menu a:hover, .menu a[aria-current] { color: var(--text); }
.menu a:hover::after, .menu a[aria-current]::after { width: 100%; }

.icon-btn {
  width: 2.75rem; height: 2.75rem; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-size: 1.25rem; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.icon-btn:hover { border-color: var(--blue); background: var(--surface); }

.theme-toggle .ph-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ph-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .ph-moon { display: none; }

.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: center; gap: 3rem;
  min-height: min(calc(100svh - var(--header-h)), 820px);
  padding-block: 4rem 5rem;
}

.hero-hello { font-family: var(--font-display); font-size: 1.25rem; color: var(--muted); }

.hero h1 {
  margin-top: .4rem;
  font-size: clamp(3rem, 8.4vw, 6.4rem);
  font-weight: 700; letter-spacing: -.035em; line-height: .95;
  color: var(--text);
}

.hero-claim {
  margin-top: 1.6rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.3;
  color: var(--text-soft);
  min-height: 1.3em;
}
.typing { color: var(--blue); }
:root[data-theme="light"] .typing { color: var(--link); }
.typing { border-right: 2px solid currentColor; padding-right: 3px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-right-color: transparent; } }

.hero-role { margin-top: 1.25rem; max-width: 34rem; color: var(--muted); font-size: 1.125rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

/* Símbolo da marca (pétalas da logo) */
.hero-mark { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 1; }
.pinwheel { width: 100%; height: 100%; overflow: visible; animation: spin 60s linear infinite; }
.pinwheel .petal { fill: var(--logo-blue); }
.pinwheel .petal-gray { fill: var(--logo-gray); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Seções ---------- */
.section { padding-block: 6rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

.section-title {
  font-size: clamp(2rem, 4.2vw, 2.75rem); font-weight: 700; letter-spacing: -.02em;
}
.section-intro { margin-top: .8rem; max-width: 38rem; color: var(--muted); }
.section-head { margin-bottom: 2.75rem; }

/* ---------- Sobre ---------- */
.about { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 4rem; align-items: start; }

.about-photo { position: sticky; top: calc(var(--header-h) + 2rem); display: flex; flex-direction: column; gap: 1.25rem; }
.about-photo img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  border: 3px solid var(--surface-2);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--logo-blue);
}
.about-links { display: flex; flex-direction: column; gap: .6rem; }
.about-links .btn { width: 100%; }

.about-text h2 { margin-bottom: 1.5rem; }
.about-text p { color: var(--text-soft); max-width: 42rem; }
.about-text p + p { margin-top: 1.1rem; }
.about-text .hl { color: var(--text); font-weight: 700; }

/* ---------- Tecnologias ---------- */
.stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stack-card {
  padding: 1.5rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line);
}
.stack-card h3 {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem;
}
.stack-card h3 i { font-size: 1.35rem; color: var(--logo-blue); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; }
.chips li {
  padding: .25rem .7rem; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft);
  font-size: .9rem;
}

/* ---------- Projetos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 2.75rem; padding: 0 1.1rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--text-soft); font-family: var(--font-body); font-size: .95rem;
  cursor: pointer; transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.filter:hover { border-color: var(--blue); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.dot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; }
.dot.engia { background: var(--tag-engia); }
.dot.ml { background: var(--tag-ml); }
.dot.analise { background: var(--tag-analise); }
.dot.automacao { background: var(--tag-automacao); }
.dot.visao { background: var(--tag-visao); }
.dot.jogo { background: var(--tag-jogo); }

.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; list-style: none; }
.project[hidden] { display: none; }

.card {
  display: flex; flex-direction: column; height: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--text); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.25rem 1.4rem 1.5rem; flex: 1; }
.card-body h3 { font-size: 1.3rem; font-weight: 600; }
.card-body p { color: var(--muted); font-size: .98rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem .9rem; list-style: none; font-size: .85rem; color: var(--muted); }
.tags li { display: inline-flex; align-items: center; gap: .4rem; }

/* Projeto em destaque: ocupa a largura toda */
.project.featured { grid-column: 1 / -1; }
.project.featured .card { flex-direction: row; }
.project.featured .card-media { flex: 1.35; aspect-ratio: auto; min-height: 340px; }
.project.featured .card-body { flex: 1; justify-content: center; padding: 2.5rem; gap: .9rem; }
.project.featured h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.01em; }
.project.featured p { font-size: 1.05rem; }
.badge-new {
  align-self: flex-start; padding: .2rem .7rem; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: .8rem; font-weight: 700;
}

.empty { color: var(--muted); padding-top: 1rem; }

/* ---------- Contato / rodapé ---------- */
.contact { text-align: center; padding-block: 6.5rem; }
.contact .section-title { max-width: 18ch; margin-inline: auto; }
.contact .section-intro { margin-inline: auto; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2.2rem; }
.socials { display: flex; justify-content: center; gap: .8rem; margin-top: 1.6rem; list-style: none; }
.socials a { font-size: 1.5rem; color: var(--text); text-decoration: none; }
.socials a:hover { color: var(--blue); }

.site-footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.6rem; font-size: .92rem; color: var(--muted);
}
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--text); }

/* ---------- Páginas internas: cabeçalho ---------- */
.page-head { padding-block: 4.5rem 2.5rem; }
.breadcrumb { padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; font-size: .95rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.025em; max-width: 22ch; }
.page-head .lead { margin-top: 1.1rem; max-width: 44rem; color: var(--muted); font-size: 1.2rem; }
.page-head .tags { margin-top: 1.4rem; font-size: .95rem; }

/* ---------- Artigo do projeto ---------- */
.cover { margin-bottom: 3.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.cover img, .cover video { width: 100%; height: auto; max-height: 560px; object-fit: cover; }

.article { max-width: 46rem; margin-inline: auto; padding-bottom: 4rem; }
.article h2 {
  font-size: 1.65rem; font-weight: 600; letter-spacing: -.01em;
  margin: 3rem 0 1rem; color: var(--text);
}
.article h2:first-child { margin-top: 0; }
.article p { color: var(--text-soft); margin-bottom: 1.15rem; }
.article ul { margin: 0 0 1.4rem; padding-left: 1.25rem; color: var(--text-soft); }
.article li { margin-bottom: .6rem; padding-left: .25rem; }
.article li::marker { color: var(--logo-blue); }
.article strong { color: var(--text); }
.article code { font-family: var(--font-code); font-size: .9em; padding: .1em .4em; border-radius: 6px; background: var(--surface-2); }
.article .highlight-text { color: var(--text); font-weight: 700; }
.article figure { margin: 2rem 0 2.2rem; }
.article figure img {
  width: 100%; height: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff;
}
.article figcaption { margin-top: .6rem; font-size: .9rem; color: var(--muted); }

/* Próximo projeto */
.next-project { border-top: 1px solid var(--line); padding-block: 3rem 5rem; }
.next-label { font-family: var(--font-display); color: var(--muted); margin-bottom: 1rem; }
.next-card {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: center;
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .2s ease;
}
.next-card:hover { border-color: var(--blue); color: var(--text); }
.next-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); }
.next-card h3 { font-size: 1.4rem; font-weight: 600; }
.next-card p { color: var(--muted); margin-top: .35rem; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; margin-top: 2rem; font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Certificações ---------- */
.cert-wrap { max-width: 54rem; padding-bottom: 4rem; }
.cert-year { margin-top: 3rem; }
.cert-year:first-child { margin-top: 0; }
.cert-year h2 {
  font-size: 1.1rem; font-weight: 600; color: var(--muted);
  padding-bottom: .7rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem;
}
.cert-list { list-style: none; }
.cert {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 1.2rem; align-items: center;
  padding-block: 1.1rem; border-bottom: 1px solid var(--line);
}
.cert img { width: 48px; height: 48px; border-radius: 12px; }
.cert h3 { font-size: 1.15rem; font-weight: 600; }
.cert p { color: var(--muted); font-size: .95rem; margin-top: .15rem; }
.cert .btn { min-height: 2.75rem; padding: 0 1.1rem; font-size: .92rem; }

/* ---------- Revelar ao rolar (só com JS ativo) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; padding-block: 3rem 4rem; gap: 2rem; }
  .hero-claim { min-height: 2.6em; }
  .hero-mark { order: -1; justify-self: start; width: 130px; }
  .about { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-photo { position: static; max-width: 220px; }
  .project.featured .card { flex-direction: column; }
  .project.featured .card-media { min-height: 0; aspect-ratio: 16 / 9; }
  .project.featured .card-body { padding: 1.5rem; }

  .menu-toggle { display: inline-flex; }
  .menu {
    position: fixed; inset: 0 0 0 auto; width: min(80%, 320px); z-index: 150;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.6rem;
    padding: 2rem 2.2rem; background: var(--surface);
    border-left: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s ease, visibility .3s;
  }
  .menu.open { transform: none; visibility: visible; }
  .menu a { font-size: 1.4rem; }
  .menu-close { position: absolute; top: 1rem; right: 1rem; }
}
@media (min-width: 861px) { .menu-close { display: none; } }

@media (max-width: 620px) {
  .container { padding-inline: 1.25rem; }
  .section { padding-block: 4.5rem; }
  .projects, .stack { grid-template-columns: 1fr; }
  .brand img { height: 36px; }
  .hero-actions .btn, .contact-actions .btn { flex: 1 1 100%; }
  .next-card { grid-template-columns: 1fr; }
  .cert { grid-template-columns: 40px minmax(0, 1fr); }
  .cert img { width: 40px; height: 40px; }
  .cert .btn { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
