/* Thainara Lima: academic site. Orbital pass: one thin ground track, stations, photographs.
   Tokens first; every component below consumes them. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/public-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/public-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/public-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Primitives */
  --ink: #0a2540;
  --sea: #0b6fa4;
  --sky: #7fb8d6;
  --sun: #e8a33d;
  --ground: #f7f9fb;
  --slate: #3d566e;

  /* Semantic roles */
  --bg: var(--ground);
  --text: var(--ink);
  --text-muted: var(--slate);
  --link: var(--sea);
  --link-hover: var(--ink);
  --track: var(--sea);
  --marker: var(--sun);
  --rule: rgb(10 37 64 / 0.16);
  --focus: var(--sea);

  /* Type */
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-lead: clamp(1.6rem, 1.15rem + 1.6vw, 2.1rem);
  --step-title: clamp(1.9rem, 1.5rem + 1.2vw, 2.5rem);

  /* Space and shape */
  --gutter: clamp(20px, 5vw, 64px);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --measure: 40rem;
  --page: 74rem;
  --portrait: 20.6rem;
  --radius: 3px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Home only: a night sky. The reading pages keep the light ground; the same roles are
   re-pointed here, so the nav, links and news list adapt without extra rules. */
body.home {
  color-scheme: dark;
  --bg: #060d26;
  --text: #eef4fc;
  --text-muted: #b9c9e0;
  --link: #8cc3e3;
  --link-hover: #fff;
  --track: rgb(127 184 214 / 0.7);
  --rule: rgb(238 244 252 / 0.18);
  --focus: #9fd0ee;
  --aside: 24rem;
  background-color: var(--bg);
  background-image:
    url("stars-near.svg"),
    url("stars-far.svg"),
    radial-gradient(ellipse 42rem 30rem at 82% 16rem, rgb(46 104 196 / 0.34), transparent 70%),
    radial-gradient(ellipse 38rem 26rem at 6% 62rem, rgb(86 62 168 / 0.22), transparent 70%),
    linear-gradient(118deg, transparent 28%, rgb(126 168 240 / 0.07) 46%, rgb(160 140 235 / 0.06) 54%, transparent 72%),
    linear-gradient(180deg, #050a1f 0%, #0a1b45 55%, #060e2a 100%);
  background-size: 940px 940px, 520px 520px, auto, auto, auto, auto;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  scrollbar-color: #3a5a86 var(--bg);
}
body.home ::selection { background: rgb(127 184 214 / 0.4); color: #fff; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.65 var(--font);
  scrollbar-color: var(--sky) var(--bg);
  overflow-x: clip;
}

::selection { background: rgb(127 184 214 / 0.45); color: var(--ink); }

img { max-width: 100%; height: auto; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 160ms var(--ease-out);
}
a:hover { color: var(--link-hover); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }
.skip-link:hover { color: #fff; }

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

/* Header: stations on a hairline track */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-3) var(--gutter) 0;
  position: relative;
  z-index: 2;
}
.brand {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav li {
  padding-right: 1.75rem;
  border-top: 1px solid var(--track);
}
.site-nav li:last-child { padding-right: 0.5rem; }
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.9rem 0 0.35rem;
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--track);
  transition: transform 200ms var(--ease-out);
}
.site-nav a:hover { color: var(--link-hover); }
.site-nav a:hover::before { transform: scale(1.3); }
.site-nav a[aria-current="page"]::before {
  background: var(--marker);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--marker);
}

/* Home */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside);
  grid-template-rows: auto 1fr;
  grid-template-areas: "text portrait" "text contact";
  column-gap: var(--space-5);
  row-gap: var(--space-3);
  align-items: start;
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-5) var(--gutter) var(--space-5);
}
.hero-text { grid-area: text; max-width: var(--measure); }

.hero h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-title);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.tagline {
  margin: 0 0 var(--space-4);
  max-width: 34rem;
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.5;
  text-wrap: pretty;
}
.profile { max-width: var(--measure); }
.profile p {
  margin: 0 0 var(--space-2);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: justify;
  hyphens: auto;
}
.profile p:last-child { margin-bottom: 0; }

/* Portrait: a round photograph with one tilted orbit and three small satellites around it */
.portrait { grid-area: portrait; position: relative; aspect-ratio: 1; }
.portrait img {
  position: absolute;
  inset: 12%;
  z-index: 1;
  display: block;
  width: 76%;
  height: 76%;
  object-fit: cover;
  object-position: 50% 8%;
  border-radius: 50%;
  border: 1.5px solid rgb(127 184 214 / 0.55);
}
.orbit {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ring {
  fill: none;
  stroke: var(--sky);
  stroke-opacity: 0.55;
  stroke-width: 0.4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.8s var(--ease-out) 0.2s forwards;
}
.sats { opacity: 0; animation: appear 600ms var(--ease-out) 1.3s forwards; }
#sat * {
  vector-effect: non-scaling-stroke;
  stroke: #a9d3ec;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sat rect { fill: #0c2247; }
#sat path { fill: none; }
#sat .beacon { fill: var(--sun); stroke: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* Affiliation, links and CV sit under the photograph */
.contact { grid-area: contact; text-align: center; }
.affiliation {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--text-muted);
}
.affiliation strong { display: block; color: var(--text); font-weight: 600; }
.affiliation span { display: block; text-wrap: balance; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem var(--space-3);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  font-weight: 500;
}

.links li:first-child { flex-basis: 100%; text-align: center; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: var(--space-3);
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--link);
  border-radius: 100vmax;
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button:hover { background: var(--link); color: var(--bg); }

/* News: events on a vertical hairline */
.news {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-4) var(--gutter) var(--space-5);
}
h2.section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.news-list {
  max-width: 50rem;
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
  border-left: 1px solid var(--track);
}
.news-item {
  position: relative;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: var(--space-2);
  padding: 0.7rem 0;
}
.news-item::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 4.5px);
  top: 1.15rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--track);
}
.news-item time {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}
.news-item p { margin: 0; }

/* Inner pages */
.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-5) var(--gutter) var(--space-5);
}
.page-head { max-width: var(--measure); margin-bottom: var(--space-4); }
.page h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-title);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.lede {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--text-muted);
  text-wrap: pretty;
}
.prose { max-width: var(--measure); }
.prose h2 {
  margin: var(--space-5) 0 var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
}
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose p { margin: 0 0 var(--space-2); text-wrap: pretty; }
.prose ul { margin: 0 0 var(--space-2); padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* Entry lists: publications, projects, repositories */
.group-title {
  margin: var(--space-5) 0 var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--track);
  max-width: 50rem;
  font-size: var(--step-1);
  font-weight: 600;
}
.group-title:first-of-type { margin-top: 0; }
.entries { max-width: 50rem; margin: 0; padding: 0; list-style: none; }
.entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 0; }
.entry-title { margin: 0 0 0.25rem; font-weight: 600; line-height: 1.4; }
.entry p { margin: 0; }
.entry .meta { font-size: var(--step--1); color: var(--text-muted); }
.entry .meta strong { color: var(--text); font-weight: 600; }
.entry .status {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--sea);
  border-radius: 100vmax;
  color: var(--sea);
  font-size: var(--step--1);
  font-weight: 500;
}
.entry .actions { margin-top: 0.4rem; font-size: var(--step--1); font-weight: 500; }

/* Photos: photographs lead, one-line captions with a credit */
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5) var(--space-4);
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery li { margin: 0; }
.gallery figure { margin: 0; }
.gallery img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: var(--radius); }
.gallery figcaption {
  margin-top: 0.7rem;
  max-width: 34rem;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--text-muted);
}
.gallery a { display: block; }
@media (min-width: 56.01rem) {
  .gallery { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .gallery .w4 { grid-column: span 4; }
  .gallery .w5 { grid-column: span 5; }
  .gallery .w7 { grid-column: span 7; }
  .gallery .w8 { grid-column: span 8; }
}

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-4);
  font-size: var(--step--1);
  color: var(--text-muted);
}
.site-footer p { margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--rule); }

/* Narrow screens: portrait, then the text, then the contact block */
@media (max-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "portrait" "text" "contact";
    row-gap: var(--space-4);
    padding-top: var(--space-4);
    padding-bottom: var(--space-5);
  }
  .portrait { width: min(100%, 17rem); }
  .contact { text-align: left; }
  .links { justify-content: flex-start; }
  .links li:first-child { text-align: left; }
  .site-nav { margin-left: 0; }
}
@media (max-width: 34rem) {
  .site-nav { width: 100%; }
  .site-nav ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-nav li, .site-nav li:last-child { padding-right: 0.5rem; }
  .news-item { grid-template-columns: 1fr; gap: 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; stroke-dashoffset: 0; }
  .sats { animation: none; opacity: 1; }
  .site-nav a::before, a, .button { transition: none; }
}
