/* Felipe Leno da Silva - personal website styles.
   Plain CSS with no build step, so GitHub Pages serves it as-is. */

:root {
  color-scheme: light;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ink: #0d1b2e;
  --text: #253142;
  --muted: #536175;
  --line: #e3e8ef;
  --line-strong: #cfd7e2;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --accent: #1d5bb0;
  --accent-strong: #154789;
  --accent-soft: #eaf1fb;
  --accent-ink: #164a8e;
  --header-h: 68px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(13, 27, 46, .05), 0 1px 3px rgba(13, 27, 46, .04);
  --shadow-lg: 0 30px 60px -30px rgba(13, 27, 46, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
a:not([href]), a:not([href]):hover { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid rgba(29, 91, 176, .55); outline-offset: 3px; }
::selection { background: #cfe0f7; color: var(--ink); }
[hidden] { display: none !important; }

.container { width: min(1140px, 100% - 48px); margin-inline: auto; }
.icon { width: 1em; height: 1em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; top: -60px; left: 16px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }
main:focus { outline: none; }

/* Content is filled in from content.yml; fade it in once ready (shown anyway after 3s). */
.js main { opacity: 0; animation: reveal-content 0s linear 3s forwards; }
.js.content-ready main { opacity: 1; animation: none; transition: opacity .15s ease; }
@keyframes reveal-content { to { opacity: 1; } }
.page-message { width: min(1140px, 100% - 48px); margin: 24px auto; padding: 16px 20px; border: 1px solid #efc6c6; border-radius: 12px; background: #fff6f6; color: #7a1f1f; font-size: .9375rem; }
.page-message pre { margin: 10px 0 0; overflow-x: auto; font-size: .8125rem; line-height: 1.5; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.brand { color: var(--ink); font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.site-nav ul { display: flex; align-items: center; gap: 2px; }
.site-nav a { position: relative; display: inline-flex; align-items: center; min-height: var(--header-h); padding: 0 12px; color: var(--muted); font-size: .875rem; font-weight: 500; text-decoration: none; transition: color .15s ease; }
.site-nav a::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .2s ease; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current]::after { transform: scaleX(1); }
.nav-toggle { display: none; }

/* Home */
.hero {
  padding: 76px 0 84px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1000px 460px at 85% -20%, rgba(29, 91, 176, .1), rgba(29, 91, 176, 0) 70%),
    linear-gradient(180deg, #f5f8fc 0%, #ffffff 100%);
  scroll-margin-top: var(--header-h);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 72px; }
.hero-text { container-type: inline-size; }
/* The full name stays on one line: the size scales with the available width. */
.hero h1 { color: var(--ink); font-size: clamp(1.375rem, 1rem + 2.4vw, 3.25rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
@supports (font-size: 1cqi) {
  .hero h1 { font-size: clamp(1.25rem, 7.6cqi, 3.25rem); }
}
.hero-role { margin-top: 24px; color: var(--ink); font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.hero-org { margin-top: 2px; color: var(--accent); font-size: 1.3125rem; font-weight: 600; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 20px; color: var(--muted); font-size: .9375rem; }
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .icon { color: var(--accent); font-size: 1.125rem; }
.hero-meta a { color: var(--text); text-decoration: none; }
.hero-meta a:hover { color: var(--accent-strong); text-decoration: underline; }
.profile-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.profile-links a { display: block; border-radius: 12px; transition: transform .15s ease, filter .15s ease; }
.profile-links a:hover { transform: translateY(-2px); filter: drop-shadow(0 6px 10px rgba(13, 27, 46, .18)); }
.profile-links img { width: 48px; height: 48px; object-fit: contain; }
.hero-updated { margin-top: 22px; color: var(--muted); font-size: .8125rem; }
.photo-frame { display: block; padding: 10px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow-lg); }
.hero-photo img { width: 320px; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }

/* Sections */
.section { padding: 88px 0; scroll-margin-top: calc(var(--header-h) - 1px); }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }
.section-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 64px; }
.section-header { position: sticky; top: calc(var(--header-h) + 36px); }
.section-title { color: var(--ink); font-size: 1.625rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.section-title::before { content: ""; display: block; width: 32px; height: 3px; margin-bottom: 18px; border-radius: 3px; background: var(--accent); }
.section-note { margin-top: 14px; color: var(--muted); font-size: .9375rem; line-height: 1.6; }

.prose { max-width: 72ch; color: var(--text); font-size: 1.0625rem; line-height: 1.8; }
.prose p + p { margin-top: 1.15em; }
.prose a[href]:not(.button) { font-weight: 500; text-decoration: underline; text-decoration-color: rgba(29, 91, 176, .35); }
.prose a[href]:not(.button):hover { text-decoration-color: currentColor; }
.prose em { color: var(--ink); }
.prose .section-actions { margin-top: 32px; }

.button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-size: .9375rem; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.button .icon { font-size: 1.125rem; transition: transform .15s ease; }
.button:hover .icon { transform: translateX(2px); }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 20px -12px rgba(29, 91, 176, .9); }
.button-primary:hover { background: var(--accent-strong); color: #fff; }

/* Shared list panels */
.group + .group { margin-top: 44px; }
.group-title { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: var(--accent-ink); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.panel > li + li { border-top: 1px solid var(--line); }
.badge-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 1.375rem; }

/* Publications */
.pub { padding: 20px 24px; }
.pub-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.45; letter-spacing: -.005em; }
.pub-title a { color: var(--accent-ink); text-decoration: none; }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-authors { margin-top: 6px; color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-venue { margin-top: 2px; color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.pub-venue em { color: var(--text); font-style: italic; }

/* Awards (compact) */
.award-list { display: grid; gap: 2px; }
.award-list li { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 6px 0; }
.award-list p { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.award-list strong { color: var(--ink); font-weight: 600; }
.tag { display: inline-block; justify-self: start; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .6875rem; font-weight: 700; line-height: 1.75; letter-spacing: .02em; white-space: nowrap; }

/* Service */
.service-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 28px; padding: 16px 24px; }
.service-venue { display: flex; flex-direction: column; }
.service-acronym { color: var(--ink); font-weight: 700; line-height: 1.4; }
.service-name { color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.years { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.years a, .years span { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.years a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.link-list a, .link-list .link-text { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; color: var(--ink); font-weight: 600; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.link-list a:hover { background: var(--bg-alt); color: var(--accent-strong); }
.link-list a:focus-visible { outline-offset: -3px; }
.link-list .icon { color: var(--muted); font-size: 1.0625rem; }
.link-list a:hover .icon { color: currentColor; }

/* Other passions (small and discreet) */
.passion-list { display: grid; gap: 6px; }
.passion-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: baseline; gap: 12px; }
.passion-label { color: var(--text); font-size: .8125rem; font-weight: 600; }
.passion-list p { max-width: 75ch; color: var(--muted); font-size: .8125rem; line-height: 1.6; }

.section-compact { padding: 56px 0; }
.section-minor { padding: 44px 0; }
.section-minor .section-title { font-size: 1.125rem; }
.section-minor .section-title::before { width: 24px; height: 2px; margin-bottom: 12px; }

/* Downloads */
.download { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 18px; padding: 18px 24px; }
.download p { color: var(--text); line-height: 1.6; }
.download-link { display: inline-flex; align-items: center; gap: 6px; margin-left: 2px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.download-link:hover { text-decoration: underline; }
.download-link .icon { font-size: 1.0625rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { padding: 28px 0; color: var(--muted); font-size: .8125rem; text-align: center; }

.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 12px 28px -14px rgba(13, 27, 46, .5); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease, border-color .15s ease, color .15s ease; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top .icon { font-size: 1.25rem; }

/* Responsive layout */
@media (max-width: 1080px) {
  .hero-grid { gap: 48px; }
  .hero-photo img { width: 280px; }
  .section-grid { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
}

@media (max-width: 900px) {
  /* The collapsible menu is only used when JavaScript is available. */
  .js .nav-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
  .js .nav-toggle:hover { background: var(--bg-alt); }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, background-color .2s ease; }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .js .site-nav { position: absolute; top: 100%; right: 0; left: 0; display: none; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 4px 24px 12px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 18px 30px -24px rgba(13, 27, 46, .45); }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav a { display: flex; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .js .site-nav li:last-child a { border-bottom: 0; }
  .js .site-nav a::after { display: none; }
  .js .site-nav a[aria-current] { color: var(--accent); }
  html:not(.js) .site-header { position: static; }
  html:not(.js) .header-inner { flex-wrap: wrap; gap: 4px 24px; padding: 12px 0; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
  html:not(.js) .site-nav a { min-height: 44px; padding: 0 16px 0 0; }
  html:not(.js) .site-nav a::after { display: none; }

  .hero { padding: 52px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo img { width: 300px; }
  .photo-frame { width: fit-content; }
  .section { padding: 64px 0; }
  .section-compact { padding: 48px 0; }
  .section-minor { padding: 40px 0; }
  .section-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-compact .section-grid { gap: 20px; }
  .section-header { position: static; }
  .section-note { max-width: 60ch; }
}

@media (max-width: 560px) {
  .container { width: min(1140px, 100% - 32px); }
  .js .site-nav { padding-inline: 16px; }
  .hero { padding: 40px 0 48px; }
  .hero-role { margin-top: 18px; font-size: 1.125rem; }
  .hero-org { font-size: 1.1875rem; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .profile-links { margin-top: 24px; gap: 12px; }
  .section { padding: 52px 0; }
  .section-compact { padding: 40px 0; }
  .section-minor { padding: 32px 0; }
  .section-title { font-size: 1.5rem; }
  .section-minor .section-title { font-size: 1.125rem; }
  .prose { font-size: 1rem; line-height: 1.75; }
  .pub, .service-row, .download { padding: 16px 18px; }
  .link-list a, .link-list .link-text { padding: 16px 18px; }
  .award-list li { display: block; padding: 5px 0; font-size: .8125rem; line-height: 1.6; }
  .award-list .tag { margin-right: 6px; vertical-align: 1px; }
  .award-list p { display: inline; font-size: inherit; }
  .passion-list { gap: 10px; }
  .passion-list li { grid-template-columns: 1fr; gap: 0; }
  .service-row { grid-template-columns: 1fr; }
  .years { justify-content: flex-start; }
  .download { grid-template-columns: 1fr; gap: 12px; }
  .to-top { right: 16px; bottom: 16px; }
}

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

@media print {
  .site-header, .skip-link, .to-top, .hero-photo { display: none !important; }
  body { color: #000; }
  .hero, .section-alt { background: none; }
  .hero, .section { padding: 24px 0; }
  .section-grid { grid-template-columns: 1fr; gap: 12px; }
  .section-header { position: static; }
  .panel { box-shadow: none; }
  .pub, .award-list li, .service-row, .passion-list li, .download { break-inside: avoid; }
}
