/* ------------------------------------------------------------------
   Luis Antonio Brasil Kowada — folha de estilo única do site
   Sem dependências externas. Claro/escuro automático + alternador.
   ------------------------------------------------------------------ */

:root {
  --paper:        #ffffff;
  --paper-2:      #f4f6f9;
  --paper-3:      #e9edf3;
  --ink:          #16202b;
  --ink-2:        #47566a;
  --ink-3:        #6b7a8d;
  --line:         #d9e0ea;
  --accent:       #0b5c9e;
  --accent-soft:  #e8f1fa;
  --accent-ink:   #08477a;
  --shadow:       0 1px 2px rgba(16, 32, 48, .06), 0 8px 24px rgba(16, 32, 48, .06);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 68rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #10161e;
    --paper-2:     #161f2a;
    --paper-3:     #1e2935;
    --ink:         #e6ecf3;
    --ink-2:       #a9b7c6;
    --ink-3:       #8595a6;
    --line:        #2a3745;
    --accent:      #6fb3f2;
    --accent-soft: #16263a;
    --accent-ink:  #9ccbf8;
    --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --paper:       #10161e;
  --paper-2:     #161f2a;
  --paper-3:     #1e2935;
  --ink:         #e6ecf3;
  --ink-2:       #a9b7c6;
  --ink-3:       #8595a6;
  --line:        #2a3745;
  --accent:      #6fb3f2;
  --accent-soft: #16263a;
  --accent-ink:  #9ccbf8;
  --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* --- estrutura ---------------------------------------------------- */

.wrap { width: min(var(--wrap), 100% - 2rem); margin-inline: auto; }

main { padding-block: 2.5rem 4rem; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* --- cabeçalho ---------------------------------------------------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.75rem; flex-wrap: wrap;
}

.brand {
  font-weight: 650; letter-spacing: -.01em; color: var(--ink);
  text-decoration: none; margin-right: auto; font-size: 1rem;
  display: flex; align-items: baseline; gap: .5rem;
}
.brand span { color: var(--ink-3); font-weight: 400; font-size: .8rem; }

.nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }

.nav a {
  color: var(--ink-2); text-decoration: none;
  padding: .4rem .65rem; border-radius: 7px;
  font-size: .9rem; white-space: nowrap;
}
.nav a:hover { background: var(--paper-3); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 550; }

.tools { display: flex; gap: .35rem; align-items: center; }

.lang {
  font-size: .78rem; text-decoration: none; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 7px;
  padding: .3rem .55rem; letter-spacing: .04em; text-transform: uppercase;
}
.lang:hover { border-color: var(--accent); color: var(--accent-ink); }

.theme-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  border-radius: 7px; width: 2.1rem; height: 1.95rem; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.theme-btn svg { width: 1rem; height: 1rem; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun,
:root:not([data-theme="light"]) .theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-sun  { display: block; }
}
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun  { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
:root[data-theme="light"] .theme-btn .i-sun  { display: none; }

/* --- tipografia --------------------------------------------------- */

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.018em; margin: 0 0 .5rem; font-weight: 640; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); margin-top: 2.75rem; }
h3 { font-size: 1.08rem; margin-top: 1.75rem; }

p { margin: 0 0 1rem; }
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 46rem; }
.muted { color: var(--ink-3); }
small, .small { font-size: .85rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

/* --- página inicial ----------------------------------------------- */

.hero { display: grid; grid-template-columns: 11rem 1fr; gap: 2.25rem; align-items: start; }
@media (max-width: 40rem) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero img { width: 8.5rem; }
}

.hero img {
  width: 100%; height: auto;          /* height:auto é essencial: sem ele o
                                         atributo height do HTML fixa a altura
                                         enquanto a largura escala, e a foto
                                         deforma */
  aspect-ratio: 467 / 443;            /* reserva o espaço antes de carregar */
  border-radius: var(--radius);
  box-shadow: var(--shadow); display: block;
}

.role { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 1.25rem; }
.role strong { color: var(--ink); font-weight: 600; }

.id-list { list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .94rem; }
.id-list li { color: var(--ink-2); padding-left: 1.1rem; position: relative; }
.id-list li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: .3rem; height: .3rem; border-radius: 50%; background: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.5rem; list-style: none; }
.chips li a, .chips li span {
  display: inline-block; font-size: .85rem; text-decoration: none;
  background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink-2); padding: .3rem .7rem; border-radius: 999px;
}
.chips li a:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none; font-size: .9rem; font-weight: 550;
  padding: .5rem .95rem; border-radius: 8px;
  border: 1px solid var(--line); color: var(--ink);
  background: var(--paper-2);
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }

/* --- cartões ------------------------------------------------------ */

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0 0; padding: 0; list-style: none; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; background: var(--paper-2);
  display: flex; flex-direction: column; gap: .35rem;
}
.card h3 { margin: 0; font-size: 1rem; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card h3 a:hover { color: var(--accent-ink); }
.card p { margin: 0; font-size: .9rem; color: var(--ink-2); }

/* --- publicações -------------------------------------------------- */

.filters {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin: 1.5rem 0 .5rem; padding: .85rem 1rem;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters label { font-size: .85rem; color: var(--ink-3); }
.filters input, .filters select {
  font: inherit; font-size: .9rem; padding: .35rem .55rem;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--paper); color: var(--ink);
}
.filters input { flex: 1 1 12rem; min-width: 9rem; }
.filter-count { font-size: .85rem; color: var(--ink-3); margin-left: auto; }

.pubs { list-style: none; padding: 0; margin: 0; counter-reset: pub; }

.pub {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: 1rem;
  padding: 1rem 0; border-top: 1px solid var(--line);
}
.pub:first-child { border-top: 0; }
.pub[hidden] { display: none; }

.pub .year {
  font-variant-numeric: tabular-nums; font-size: .88rem;
  color: var(--ink-3); padding-top: .15rem;
}
.pub .title { font-weight: 560; color: var(--ink); }
.pub .authors { font-size: .92rem; color: var(--ink-2); }
.pub .authors .me { color: var(--ink); font-weight: 600; }
.pub .venue { font-size: .89rem; color: var(--ink-3); }
.pub .venue em { font-style: italic; }

.tag {
  display: inline-block; font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 600;
  padding: .12rem .45rem; border-radius: 4px; vertical-align: .12em;
  background: var(--accent-soft); color: var(--accent-ink); margin-left: .4rem;
}

@media (max-width: 34rem) {
  .pub { grid-template-columns: 1fr; gap: .2rem; }
  .pub .year { padding-top: 0; }
}

/* --- listas de ensino / orientações -------------------------------- */

.term {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); padding: 1rem 1.25rem; margin-bottom: .75rem;
}
.term > summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: .5rem;
}
.term > summary::-webkit-details-marker { display: none; }
.term > summary::before {
  content: "▸"; color: var(--ink-3); font-size: .8rem; transition: transform .15s;
}
.term[open] > summary::before { transform: rotate(90deg); }
.term ul { margin: .75rem 0 0; padding-left: 1.4rem; }
.term li { color: var(--ink-2); }

.plain { list-style: none; padding: 0; margin: 0; }
.plain > li {
  padding: .7rem 0; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: .95rem;
}
.plain > li:first-child { border-top: 0; }
.plain .who { color: var(--ink); font-weight: 560; }
.plain .what { font-style: italic; }

/* --- avisos ------------------------------------------------------- */

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: .9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem; color: var(--ink-2); margin: 1.25rem 0;
}
.note strong { color: var(--ink); }

.todo {
  border-left: 3px solid #d08a1e;
  background: color-mix(in srgb, #d08a1e 10%, var(--paper));
  padding: .9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem; color: var(--ink-2); margin: 1.25rem 0;
}

/* --- rodapé ------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line); background: var(--paper-2);
  padding-block: 2rem; font-size: .88rem; color: var(--ink-3);
}
.site-foot .wrap { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.site-foot h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin: 0 0 .5rem; }
.site-foot address { font-style: normal; line-height: 1.6; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent-ink); text-decoration: underline; }
.colophon { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; font-size: .8rem; }

/* --- tabela de arquivo -------------------------------------------- */

.grid-links { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); padding: 0; list-style: none; margin: .75rem 0 0; }
.grid-links a {
  display: block; text-decoration: none; font-size: .88rem;
  border: 1px solid var(--line); border-radius: 7px;
  padding: .45rem .7rem; color: var(--ink-2); background: var(--paper-2);
}
.grid-links a:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

@media print {
  .site-head, .site-foot, .filters, .skip { display: none; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}
