/*
  Academic website template — styling.
  Colours, fonts and spacing are exposed as CSS variables below so the
  whole visual theme can be adjusted from one place without hunting
  through the rest of the file.
*/

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600&display=swap');

:root {
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-heading: #262626;
  --color-muted: #767676;
  /* Vivid brand orange — reserved for graphic/decorative elements (social
     icons, the heading underline) where a lighter tone still reads clearly. */
  --color-accent: #ff512f;
  --color-accent-hover: #fe5d3c;
  /* Darker orange used for actual link/nav TEXT, so body-sized text keeps
     comfortable contrast against the white background. */
  --color-link: #b3401f;
  --color-link-hover: #8a3012;
  --color-border: #eeeeee;

  --font-body: Raleway, sans-serif;
  --font-name: Georgia, "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --font-mono: Menlo, Consolas, "Courier New", monospace;

  --content-width: 600px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--color-text);
  background-color: var(--color-bg);
}

::selection {
  background-color: var(--color-accent);
  color: #fff;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.name {
  font-family: var(--font-name);
  font-size: 2rem;
  font-weight: normal;
  color: var(--color-heading);
}

.name a {
  color: inherit;
  text-decoration: none;
}

.email-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 16px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: var(--color-accent-hover);
}

.social-links svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Navigation */
nav {
  margin-bottom: 40px;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 25px;
  list-style: none;
}

nav a {
  font-family: var(--font-mono);
  color: var(--color-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

nav a:hover,
nav a:focus-visible {
  color: var(--color-link-hover);
}

/* Profile photo */
.profile-photo {
  text-align: center;
  margin: 60px 0;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--color-border);
}

.profile-img-wrapper {
  display: inline-block;
  position: relative;
  max-width: 320px;
  width: 100%;
}

.profile-photo img {
  max-width: 320px;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.profile-photo .profile-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 200ms ease;
}

.profile-photo .profile-default {
  transition: opacity 200ms ease;
}

/* Hover crossfade for devices with a real pointer */
@media (hover: hover) {
  .profile-img-wrapper:hover .profile-hover {
    opacity: 1;
  }

  .profile-img-wrapper:hover .profile-default {
    opacity: 0;
  }
}

/* Tap-to-toggle for touch devices (applied via JS) */
.profile-img-wrapper.show-alt .profile-hover {
  opacity: 1;
}

.profile-img-wrapper.show-alt .profile-default {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .profile-photo .profile-hover,
  .profile-photo .profile-default {
    transition: none;
  }
}

/* Sections */
section {
  margin-bottom: 60px;
  padding-top: 20px;
}

section h2 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: normal;
  margin-bottom: 20px;
  color: var(--color-heading);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 2px;
  display: inline-block;
}

section p {
  margin-bottom: 15px;
}

section > ul {
  margin-left: 20px;
}

section > ul > li {
  margin-bottom: 10px;
}

section a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: var(--color-link);
  transition: color 0.2s, text-decoration-color 0.2s;
  overflow-wrap: anywhere;
}

section a:hover,
section a:focus-visible {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

/* Publications / research list */
.publications {
  list-style: none;
  margin-left: 0;
}

.publication {
  margin-bottom: 25px;
}

.pub-thumb {
  max-width: 160px;
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 8px;
}

.pub-title {
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-link);
  border: 1px solid var(--color-link);
  border-radius: 3px;
  padding: 1px 6px;
  line-height: 1.6;
}

.pub-authors {
  color: var(--color-heading);
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.pub-venue {
  color: var(--color-heading);
  font-style: italic;
  margin-bottom: 0;
}

.pub-description {
  margin-top: 5px;
  color: var(--color-muted);
}

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

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--color-link);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.pub-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.pub-link:hover,
.pub-link:focus-visible {
  color: var(--color-link-hover);
}

/* Awards */
#awards ul {
  list-style: none;
  margin-left: 0;
}

#awards li {
  margin-bottom: 8px;
}

.award-year {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-left: 6px;
}

/* Fun facts (expandable/collapsible entries in the misc section) */
#misc-body details {
  margin-bottom: 12px;
}

#misc-body summary {
  cursor: pointer;
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: var(--color-link);
  list-style: none;
  transition: color 0.2s, text-decoration-color 0.2s;
}

#misc-body summary::-webkit-details-marker {
  display: none;
}

#misc-body summary:hover,
#misc-body summary:focus-visible {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

#misc-body details p {
  margin-top: 6px;
  margin-bottom: 0;
  color: var(--color-muted);
}

/* Smooth scrolling for in-page nav, disabled if the user prefers less motion */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Footer */
footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

footer .social-links {
  justify-content: center;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 480px) {
  .name {
    font-size: 1.6rem;
  }

  nav ul {
    gap: 8px 18px;
  }

  .profile-photo {
    margin: 40px 0;
    padding-bottom: 40px;
  }
}
