/* ============================================================
   PERSONAL ACADEMIC WEBSITE — style.css
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f9f8f5;
  --text:      #1c1c1a;
  --muted:     #6b6b67;
  --accent:    #2a5c8f;   /* change this to any colour you like */
  --border:    #dddbd5;
  --max-width: 720px;
  --serif:     Georgia, 'Times New Roman', serif;
  --sans:      'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.75;
  padding: 0 1.25rem;
}

/* --- Layout ----------------------------------------------- */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 0 5rem;
}

/* --- Navigation ------------------------------------------- */
nav {
  display: flex;
  align-items: baseline;
  gap: 1.75rem;
  padding: 1.5rem 0 2.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.03em;
}

nav .site-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;       /* pushes links to the right */
  font-size: 0.95rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover,
nav a.active { color: var(--accent); }

/* --- Home page -------------------------------------------- */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 2.5rem;
  align-items: start;
}

.home-grid .bio h1 {
  font-family: var(--sans);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
  line-height: 1.25;
}

.home-grid .bio .position {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.home-grid .bio p {
  margin-bottom: 1.1rem;
  font-size: 1rem;
}

/* Portrait */
.portrait img {
  width: 280px;      /* desired default width */
  max-width: 40vw;   /* scale down on small screens */
  height: auto;
  display: block;
  margin: 0 auto;    /* center inside its container */
  border-radius: 4px;/* optional rounding */
}

/* Contact / icon links */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  margin-top: 1.75rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.links a:hover { border-color: var(--accent); }

/* --- Section heading (Research, etc.) --------------------- */
h2.section-title {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* --- Research page ---------------------------------------- */
.paper-list {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.paper {
  /* each paper block */
}

.paper-title {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
}

.paper-title:hover { color: var(--accent); }

.paper-meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
  margin-bottom: 0.75rem;
}

/* Collapsible abstract using native <details> — no JS needed */
details.abstract {
  margin-top: 0.5rem;
}

details.abstract summary {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  list-style: none;         /* hides the default triangle */
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

details.abstract summary::before {
  content: '＋';
  font-size: 0.75rem;
  transition: transform 0.2s;
}

details[open].abstract summary::before { content: '－'; }

details.abstract summary::-webkit-details-marker { display: none; }

details.abstract .abstract-body {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  padding-left: 0;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

/* Motivational figure */
.paper-figure {
  margin-top: 1rem;
  display: none;            /* hidden by default, shown when abstract opens */
}

details[open] + .paper-figure,
details[open] ~ .paper-figure {
  /* CSS-only reveal doesn't work cross-browser for sibling; use JS below */
  display: block;
}

.paper-figure img {
  width: 100%;
  max-width: 540px;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 0.5rem;
}

.paper-figure figcaption {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.45;
}

/* Paper links (PDF, slides, etc.) */
.paper-links {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.9rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.paper-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.paper-links a:hover { border-color: var(--accent); }

/* Work in progress tag */
.tag-wip {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #eee9df;
  color: var(--muted);
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* --- Footer ----------------------------------------------- */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 560px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .portrait {
    order: -1;          /* photo above bio on mobile */
    width: 130px;
  }
}
