/* ==========================================================
   Evandro de Castro Melo — evandro.eng.br
   Layout moderno, leve e sem dependências externas
   ========================================================== */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1d2a25;
  --muted: #5b6a64;
  --primary: #1f5c4a;
  --primary-hover: #17463a;
  --accent: #c9a24a;
  --line: #e4e8e5;
  --alt: #f1f5f2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 40, 32, .06), 0 8px 24px rgba(20, 40, 32, .08);
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1714;
    --surface: #17221e;
    --text: #e6eeea;
    --muted: #9fb3aa;
    --primary: #5fbf9d;
    --primary-hover: #7fd3b4;
    --accent: #e0bb64;
    --line: #26342f;
    --alt: #131d19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

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

html { scroll-behavior: smooth; }

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

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 1rem;
}
.brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { color: var(--primary); }

.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); font-weight: 500; font-size: .95rem;
  padding: .5rem .8rem; border-radius: 999px;
}
.site-nav a:hover { color: var(--text); background: var(--alt); }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--alt); }

.nav-toggle {
  display: none; background: none; border: 0; padding: .5rem; cursor: pointer;
  flex-direction: column; gap: 5px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .25s, opacity .25s;
}

/* ---------- Herói ---------- */
.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%),
    radial-gradient(700px 350px at -10% 110%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center;
}
.hero-art { margin: 0; }
.hero-art img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: 24px; box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  font-weight: 700; color: var(--primary); margin-bottom: .75rem;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 42rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .98rem;
  border: 1.5px solid transparent; transition: background .2s, color .2s, transform .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Seções ---------- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-alt { background: var(--alt); }
.section-title { margin-bottom: 2rem; }

.about {
  max-width: 46rem; font-size: 1.1rem; color: var(--muted);
}
.about p:first-child { color: var(--text); font-size: 1.2rem; }

/* ---------- Cards ---------- */
.cards {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
  color: var(--text); transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); color: var(--text); }
.card p { color: var(--muted); font-size: .98rem; }
.card-link { margin-top: auto; font-weight: 600; color: var(--primary); }

.card-tag {
  align-self: flex-start; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary); background: var(--alt);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}

/* ---------- Ensino ---------- */
.teaching {
  border-left: 4px solid var(--accent); padding: .25rem 0 .25rem 1.5rem;
  max-width: 44rem;
}
.teaching p { color: var(--muted); }

/* ---------- Páginas internas ---------- */
.page-hero {
  padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
  background: linear-gradient(180deg, var(--alt), var(--bg));
  border-bottom: 1px solid var(--line);
}
.page-figure { margin: 0; }
.page-figure img {
  width: 100%; height: auto; display: block; aspect-ratio: auto; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; box-shadow: var(--shadow);
}

.subtitle { display: block; font-size: .5em; font-weight: 500; color: var(--muted); margin-top: .35rem; }

.features {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature {
  padding: 1.5rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.feature p { color: var(--muted); margin: 0 0 .75rem; }
.feature ul { color: var(--muted); padding-left: 1.25rem; margin: 0; }
.feature li { margin-bottom: .5rem; }

.download-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature.notice { border-left: 4px solid var(--accent); }
.section-tight { padding-top: 1.5rem; }

/* ---------- Artigos ---------- */
.year-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.5rem; }
.year-nav a {
  font-size: .9rem; font-weight: 600; padding: .35rem .75rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.year-nav a:hover { color: var(--primary); border-color: var(--primary); }

.year { margin-bottom: 1rem; color: var(--primary); }
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li {
  padding: .75rem 0 .75rem 1rem; border-bottom: 1px solid var(--line);
  position: relative; color: var(--text);
}
.article-list li::before {
  content: ""; position: absolute; left: 0; top: 1.2rem; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}

.articles {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.article {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
}
.article h3 { font-size: 1.05rem; line-height: 1.35; }
.article .meta { color: var(--muted); font-size: .95rem; }
.article .btn { margin-top: .5rem; }

.install-title { font-size: 1.05rem; margin: .5rem 0 .4rem; }
.install-steps { color: var(--muted); padding-left: 1.25rem; margin: 0 0 1rem; }
.install-steps li { margin-bottom: .35rem; }

.install-hint {
  width: 100%; max-width: 360px; height: auto;
  border-radius: 12px; border: 1px solid var(--line);
  margin: .25rem 0 1.25rem; background: #fff;
}

kbd {
  font-family: ui-monospace, Consolas, monospace; font-size: .9em;
  padding: .1rem .4rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--alt); color: var(--text);
}

.versions {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.version {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: flex-start;
}
.version p { color: var(--muted); }
.version .btn { margin-top: .5rem; }

.cta-row {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 1.5rem;
}
.cta-row p { color: var(--muted); margin: 0; }

.profiles {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.profile {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.5rem 1.75rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); transition: border-color .2s, transform .2s;
}
.profile:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--text); }
.profile-name { font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.profile-desc { color: var(--muted); font-size: .95rem; }

/* ---------- Rodapé ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0; margin-top: 2rem;
  color: var(--muted); font-size: .95rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
}
.footer-inner p { margin: 0; }
.footer-inner strong { color: var(--text); }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; order: -1; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: .5rem 1.25rem 1rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .85rem .5rem; border-radius: 8px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

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