/* rossteixeira.com */

@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --text: #222;
  --heading: #333636;
  --muted: #739696;
  --link: #447799;
  --gray: #f0f0ed;
  --white: #fff;
  --dark: #333636;
  --line: #d9d9d4;

  --sans: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --display: "Playfair Display", Georgia, serif;

  --width: 60rem;
  --gutter: 1.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.15s, border-color 0.15s;
}
a:hover { color: #2c5470; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
ul { margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: calc(var(--width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--dark);
  color: #fff;
  border: 0;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  color: #fff;
  text-align: center;
  background: #1b1d22 url("../img/skyline-1200.jpg") center 40% / cover no-repeat;
  background-image: image-set(url("../img/skyline-1200.webp") type("image/webp"), url("../img/skyline-1200.jpg") type("image/jpeg"));
}
@media (min-width: 1200px) {
  .hero {
    background-image: image-set(url("../img/skyline-2000.webp") type("image/webp"), url("../img/skyline-2000.jpg") type("image/jpeg"));
  }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.28);
}
.hero > * { position: relative; }

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding-block: 4.5rem 2.25rem;
}
.avatar {
  flex: none;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  box-shadow: 0 2px 14px rgb(0 0 0 / 0.35);
}
.hero h1 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.4);
}
.tagline {
  margin: 0.4rem 0 0;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem);
  font-style: italic;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
}
.hero-email {
  margin: 1.4rem 0 0;
  font-style: italic;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
}

.hero-nav {
  display: flex;
  justify-content: center;
  padding: 0.6rem 0.5rem 4rem;
}
.hero-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0.5rem;
  border-top: 2px solid rgb(255 255 255 / 0.85);
  border-bottom: 1px solid rgb(255 255 255 / 0.6);
}
.hero-nav a, .topbar a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 0;
}
.hero-nav a { color: #fff; }
.hero-nav a:hover, .hero-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }

@media (max-width: 40rem) {
  .hero-inner { flex-direction: column; gap: 1.25rem; padding-top: 3rem; }
  .avatar { width: 8rem; height: 8rem; }
}

/* Slim bar that appears once the hero scrolls away */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgb(255 255 255 / 0.96);
  border-top: 3px solid var(--dark);
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform 0.25s ease;
}
.topbar.is-visible { transform: none; }
.topbar ul {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  padding: 0.6rem 0;
}
.topbar a { color: var(--heading); font-weight: 400; }
.topbar a:hover, .topbar a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }

/* ---------- Sections ---------- */

.section { padding-block: 3.5rem; }
.section.gray { background: var(--gray); }

.section-title {
  font-size: 1.6rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--heading);
}
.section-title::after {
  content: "";
  display: block;
  width: 2.9rem;
  height: 3px;
  margin: 0.65rem 0 2.25rem;
  background: var(--dark);
}
* + .section-title { margin-top: 3.5rem; }

.subtitle {
  margin: -1rem 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.875rem);
  line-height: 1.45;
  color: var(--muted);
}

.intro p {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.45;
}
.intro p:last-child { margin-bottom: 0; }
@media (min-width: 48rem) {
  .intro p { text-align: justify; }
}

/* ---------- Timeline (experience, publications, reporting) ---------- */

.timeline {
  --dot-bg: var(--white);
  list-style: none;
  margin-left: 0.4rem;
  padding-left: 2.25rem;
  border-left: 1px dotted #555;
}
.gray .timeline { --dot-bg: var(--gray); }
.timeline > li { position: relative; padding-bottom: 2.25rem; }
.timeline > li:last-child { padding-bottom: 0.5rem; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-2.25rem - 5.5px);
  top: 0.8rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #555;
  background: var(--dot-bg);
}

.timeline h3 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.875rem);
  line-height: 1.25;
  color: var(--heading);
}
.timeline h3 a { color: inherit; border: 0; }
.timeline h3 a:hover { color: var(--link); }

.meta {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.meta b { font-weight: 700; }
.authors b { color: var(--text); font-weight: 700; }
.venue { margin: 0.1rem 0 0; font-size: 0.85rem; font-style: italic; color: #444; }

.points {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  max-width: 48rem;
}
.points li { margin-bottom: 0.3rem; }
.project { margin: 0.9rem 0 0; font-style: italic; color: #444; }

.buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.button {
  display: inline-block;
  padding: 0.65rem 1rem;
  background: var(--dark);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  border: 0;
  border-radius: 2px;
  transition: background-color 0.15s;
}
.button:hover { background: #4a4f4f; color: #fff; }

/* ---------- Education ---------- */

.schools { list-style: none; }
.schools li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1rem 2.5rem;
  align-items: center;
  padding-block: 1.25rem;
}
.schools .logo { display: flex; justify-content: center; }
.schools .logo img { max-height: 9rem; width: auto; max-width: 100%; }
.schools h3 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.875rem); line-height: 1.3; color: var(--heading); }
.schools .degree { margin: 0.35rem 0 0; color: var(--muted); font-weight: 700; }
.schools .years { margin: 0; color: var(--muted); }
.schools .detail { margin: 0.35rem 0 0; font-size: 0.95rem; }
.schools .detail b { font-weight: 700; }
@media (max-width: 40rem) {
  .schools li { grid-template-columns: 1fr; gap: 0.75rem; }
  .schools .logo { justify-content: flex-start; }
  .schools .logo img { max-height: 5rem; }
}

/* ---------- Teaching: courses + video gallery ---------- */

.courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem 2.5rem;
  margin-top: 2.5rem;
  list-style: none;
}
.courses h3 { font-size: 1.25rem; color: var(--heading); }
.courses .meta { margin: 0.1rem 0 0.4rem; }
.courses ul { padding-left: 1.1rem; font-size: 0.95rem; }
.courses ul li { margin-bottom: 0.2rem; }

.gallery { background: #000; }
.gallery ul {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  list-style: none;
}
/* 12 videos: every column count divides evenly, so no empty tiles */
@media (max-width: 64rem) { .gallery ul { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 44rem) { .gallery ul { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 30rem) { .gallery ul { grid-template-columns: repeat(2, 1fr); } }

.gallery a {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #111;
  overflow: hidden;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery a::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.9rem;
  height: 2.9rem;
  margin: -1.45rem 0 0 -1.45rem;
  border-radius: 50%;
  background: rgb(60 60 60 / 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%23fff'/%3E%3C/svg%3E") center / 60% no-repeat;
  transition: background-color 0.2s, transform 0.2s;
}
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.05); }
.gallery a:hover::after, .gallery a:focus-visible::after { background-color: rgb(0 0 0 / 0.85); transform: scale(1.08); }
.gallery a:focus-visible { outline-offset: -3px; outline-color: #fff; }

.gallery-note { margin: 1.5rem 0 0; }

.video-dialog {
  width: min(92vw, 60rem);
  padding: 0;
  border: 0;
  background: #000;
  overflow: visible;
}
.video-dialog::backdrop { background: rgb(0 0 0 / 0.85); }
.video-dialog .frame { position: relative; aspect-ratio: 16 / 9; }
.video-dialog iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-dialog .caption { margin: 0; padding: 0.6rem 0.9rem; color: #ddd; font-size: 0.9rem; }
.video-dialog .close {
  position: absolute;
  right: 0;
  top: -2.6rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Contact ---------- */

.contacts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  list-style: none;
  text-align: center;
}
@media (max-width: 48rem) { .contacts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.contacts a { display: block; border: 0; color: var(--link); }
.contacts svg {
  display: block;
  width: 100%;
  max-width: 7.5rem;
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  transition: transform 0.2s ease;
}
.contacts a:hover svg { transform: translateY(-3px); }
.contacts .label { font-size: 1.4rem; border-bottom: 1px solid currentColor; }
.contacts .quip { display: block; margin-top: 0.15rem; font-size: 1.4rem; line-height: 1.3; color: var(--heading); }

/* ---------- Teaching page ---------- */

.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2rem 2.5rem;
}
.resources h3 { font-size: 1.15rem; font-weight: 700; color: var(--heading); margin-bottom: 0.5rem; }
.resources ul { list-style: none; }
.resources li { margin-bottom: 0.45rem; }
.resources li span { color: #555; }

/* ---------- Footer ---------- */

.footer {
  padding-block: 1.75rem;
  background: var(--gray);
  color: #777;
  font-size: 0.85rem;
  text-align: center;
}

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