/* ==========================================================================
   Matheus Souza · academic homepage
   Short single page with light/dark themes.
     1. Design tokens (light + dark palette)
     2. Base
     3. Components (buttons, venue badge, icons)
     4. Intro
     5. Sections & publications
     6. Experience / education rows
     7. Awards & service, footer
     8. Responsive & print
   ========================================================================== */


/* 1. DESIGN TOKENS ========================================================= */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, Cambria, "Times New Roman", serif;

  --content: 820px;
  --gutter: 24px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-full: 999px;

  /* Light palette (from the favicon: navy #13233b, sky #e9f2ff, amber #ffc46b) */
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f5f7fa;
  --surface: #ffffff;
  --border: #e3e8ef;
  --border-strong: #cdd5e0;
  --ink: #13233b;
  --text: #2b3a52;
  --muted: #566579;
  --accent: #1d5bc4;
  --accent-strong: #15479e;
  --accent-line: rgba(29, 91, 196, .35);
  --accent-soft: #ebf2fe;
  --chip-text: #1a4d9e;
  --banner-bg: #f3f7fe;
  --banner-border: #d8e4f7;
  --amber: #f5a524;
  --amber-glow: rgba(245, 165, 36, .35);
  --paper: #f2f5f9;
  --btn-primary-bg: #13233b;
  --btn-primary-hover: #223a5e;
  --btn-primary-text: #ffffff;
  --glow: rgba(29, 91, 196, .07);
  --shadow-sm: 0 1px 2px rgba(19, 35, 59, .06);
  --shadow-photo: 0 2px 4px rgba(19, 35, 59, .06), 0 24px 48px -26px rgba(19, 35, 59, .45);
}

/* Dark palette: (a) OS prefers dark and the visitor has not picked light,
   (b) visitor picked dark with the toggle. Keep the two blocks identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1422;
    --bg-subtle: #0f1a2c;
    --surface: #111d31;
    --border: #1f2d45;
    --border-strong: #2e4060;
    --ink: #eef3fa;
    --text: #c9d3e2;
    --muted: #93a2b9;
    --accent: #8ab6ff;
    --accent-strong: #b5d1ff;
    --accent-line: rgba(138, 182, 255, .4);
    --accent-soft: #15284a;
    --chip-text: #aecbff;
    --banner-bg: #0f2140;
    --banner-border: #1d3a66;
    --amber: #ffc46b;
    --amber-glow: rgba(255, 196, 107, .35);
    --paper: #dde4ee;
    --btn-primary-bg: #e9f2ff;
    --btn-primary-hover: #ffffff;
    --btn-primary-text: #13233b;
    --glow: rgba(70, 130, 230, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-photo: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -26px rgba(0, 0, 0, .9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1422;
  --bg-subtle: #0f1a2c;
  --surface: #111d31;
  --border: #1f2d45;
  --border-strong: #2e4060;
  --ink: #eef3fa;
  --text: #c9d3e2;
  --muted: #93a2b9;
  --accent: #8ab6ff;
  --accent-strong: #b5d1ff;
  --accent-line: rgba(138, 182, 255, .4);
  --accent-soft: #15284a;
  --chip-text: #aecbff;
  --banner-bg: #0f2140;
  --banner-border: #1d3a66;
  --amber: #ffc46b;
  --amber-glow: rgba(255, 196, 107, .35);
  --paper: #dde4ee;
  --btn-primary-bg: #e9f2ff;
  --btn-primary-hover: #ffffff;
  --btn-primary-text: #13233b;
  --glow: rgba(70, 130, 230, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-photo: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -26px rgba(0, 0, 0, .9);
}


/* 2. BASE ================================================================== */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(820px 420px at 85% -140px, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
strong { font-weight: 600; color: var(--ink); }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--accent-line);
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.nowrap { white-space: nowrap; }

.page {
  position: relative;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 56px var(--gutter) 40px;
}


/* 3. COMPONENTS ============================================================ */

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink);
  font-size: .9063rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }

.btn-primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); color: var(--btn-primary-text); }

/* small link buttons under each paper: 30px visual, 40px hit area */
.btn-sm { position: relative; min-height: 30px; gap: 6px; padding: 0 11px; font-size: .8125rem; }
.btn-sm::after { content: ""; position: absolute; inset: -5px 0; }
.btn-sm .icon { width: 14px; height: 14px; }

.venue {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--chip-text);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}

/* theme toggle in the top-right corner of the page */
.theme-toggle {
  position: absolute;
  top: 18px;
  right: var(--gutter);
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.js .theme-toggle { display: grid; }
.theme-toggle:hover { color: var(--ink); background: var(--bg-subtle); border-color: var(--border); }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}


/* 4. INTRO ================================================================= */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 48px;
  isolation: isolate;
}

.intro h1 {
  font-size: clamp(2.25rem, 1.8rem + 1.8vw, 2.875rem);
  line-height: 1.05;
  letter-spacing: -.025em;
}

/* Role line: items separated by "·". The row is shifted left by one separator width
   and clipped, so a separator that would start a wrapped line is hidden. */
.role {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-left: -1.25em;
  clip-path: inset(0 0 0 1.25em);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}
.role span::before {
  content: "·";
  display: inline-block;
  width: 1.25em;
  text-align: center;
  color: var(--border-strong);
}

.bio {
  margin-top: 18px;
  font-size: 1.03rem;
  line-height: 1.68;
}

.job {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 11px 15px;
  border: 1px solid var(--banner-border);
  border-radius: var(--r-md);
  background: var(--banner-bg);
  font-size: .9375rem;
  line-height: 1.55;
}

.dot {
  position: relative;
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--banner-bg), 0 0 0 4px var(--amber-glow);
}
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--amber); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.intro-photo { position: relative; }
.intro-photo::before {          /* soft offset frame in the brand's sky tone */
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  z-index: -1;
}
.intro-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-photo);
  background: var(--bg-subtle);
}


/* 5. SECTIONS & PUBLICATIONS =============================================== */

.section { padding-top: 52px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { font-size: 1.5rem; letter-spacing: -.015em; }

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.section-link .icon { width: 15px; height: 15px; }
.section-link:hover { text-decoration: underline; }

.pub {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 20px 0;
}
.pub + .pub { border-top: 1px solid var(--border); }

/* thumbnail on a light "paper" panel; white image backgrounds blend into it (no glare in dark mode) */
.pub-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.pub-media img {
  position: absolute;
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.pub-title { font-size: 1.09rem; line-height: 1.35; letter-spacing: -.005em; }
.pub-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); }

.authors { margin-top: 6px; font-size: .9rem; line-height: 1.5; }
.authors a { color: inherit; text-decoration-color: var(--border-strong); }
.authors a:hover { color: var(--accent); text-decoration-color: currentColor; }
.note { color: var(--muted); font-size: .78rem; white-space: nowrap; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 9px;
}
.meta-note { color: var(--muted); font-size: .78rem; }

.summary { margin-top: 9px; color: var(--muted); font-size: .9rem; line-height: 1.55; }

.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }


/* 6. EXPERIENCE / EDUCATION ROWS =========================================== */

.rows { display: grid; }

.row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 0;
}
.row + .row { border-top: 1px solid var(--border); }

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;          /* logos always sit on white, in both themes */
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.logo img { width: 26px; height: 26px; object-fit: contain; }
.logo--full img { width: 36px; height: 36px; }   /* the UFRN logo has its own white padding */

.row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 16px;
}
.row-title { color: var(--ink); font-weight: 600; line-height: 1.45; }
.date { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-sub { font-size: .9375rem; }
.row-detail { margin-top: 3px; color: var(--muted); font-size: .9rem; line-height: 1.55; }


/* 7. AWARDS & SERVICE, FOOTER ============================================== */

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  padding-top: 14px;
}

.plain li {
  position: relative;
  padding-left: 16px;
  font-size: .9375rem;
  line-height: 1.55;
}
.plain li + li { margin-top: 9px; }
.plain li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}
.yr { color: var(--muted); white-space: nowrap; }
.yr::before { content: "· "; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }


/* 8. RESPONSIVE, MOTION & PRINT ============================================ */

@media (prefers-reduced-motion: no-preference) {
  @keyframes pulse { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
  .dot::after { animation: pulse 2.4s ease-out infinite; }
}

@media (max-width: 720px) {
  .page { padding-top: 32px; }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .intro-photo { order: -1; width: 120px; }
  .intro-photo img { aspect-ratio: 1; border-radius: 26px; }
  .intro-photo::before { inset: 8px -8px -8px 8px; border-radius: 26px; }
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .two-col .plain + .plain { margin-top: 0; }
}

@media (max-width: 600px) {
  :root { --gutter: 18px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pub-media { aspect-ratio: 2 / 1; }
  .row-head { flex-direction: column; gap: 0; }
  .footer { flex-direction: column; }
}

@media (max-width: 400px) {
  .btn { padding: 0 13px; }
}

@media print {
  .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .pub-links { display: none; }
  a { color: inherit; }
}
