/* =============================================================
   Schlomann Lab — stylesheet
   Change the values in :root below to restyle the whole site.
   ============================================================= */

:root {
  --ink:        #1c1c1e;   /* body text                */
  --ink-soft:   #5c5f66;   /* captions, secondary text */
  --rule:       #e2e2e4;   /* hairlines                */
  --bg:         #ffffff;   /* page background ffffff, f9f9f9         */
  --bg-soft:    #f7f7f5;   /* banded sections          */
  --accent:     #a6192e;   /* SFU red — links, accents */
  --accent-dim: #7d1322;

  /* Widths.
     Every block on every page sits in a box --page wide, so all
     content shares one left edge with the "Schlomann Lab" header.
     Inside that box, running text is capped at --measure (kept
     short enough to read comfortably) and movies, figures and
     citations at --media. Everything is left-aligned. */
  --page:       1080px;    /* outer page box — sets the left edge */
  --gutter:     24px;      /* space from the page box to the edge */
  --measure:    580px;     /* line length for running text (~72ch) */
  --media:      880px;     /* width cap for movies and figures    */

  /* Type. Avenir, with progressively more common fallbacks. */
  --font: "Avenir Next", "Avenir", "Nunito Sans", "Segoe UI",
          Roboto, system-ui, -apple-system, BlinkMacSystemFont,
          Helvetica, Arial, sans-serif;
  --font-ui: var(--font);  /* kept as an alias; same family now */

  --weight-body: 500;      /* Avenir Medium    */
  --weight-bold: 600;      /* Avenir Demi Bold */

  /* Six sizes, used everywhere. Nothing on the site sets a font
     size that isn't one of these.
       --fs-title  page titles AND the "Schlomann Lab" header
       --fs-h2     section headings within a page
       --fs-h3     names, project titles, paper titles
       --fs-body   running text
       --fs-small  nav, tagline, captions, notes, citations
       --fs-xs     footer, labels, press links                  */
  --fs-title:   30px;
  --fs-h2:      22px;
  --fs-h3:      18px;
  --fs-body:    17px;
  --fs-small:   14.5px;
  --fs-xs:      13px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: var(--weight-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); text-decoration: underline; }

b, strong { font-weight: var(--weight-bold); }

img, video { max-width: 100%; display: block; }

/* ---------- layout ------------------------------------------
   .wrap is the shared page box. Every top-level block on every
   page uses it (directly or via the rules further down), which
   is what keeps the whole site flush-left with the header.
   ------------------------------------------------------------ */

.wrap,
.prose,
.banner,
.projects,
.gallery,
.pubs,
.people,
.people-heading,
.contact-grid,
h1.page-title {
  max-width: var(--page);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Running text stops at a comfortable line length — roughly 70
   characters — left-aligned rather than centred in the page box.
   Movies and figures stay wide; only prose narrows. */
.prose > * { max-width: var(--measure); }
.prose p:first-child { margin-top: 0; }

main { padding-bottom: 72px; }

/* ---------- header / nav ------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding-top: 16px;
  padding-bottom: 14px;
}

.brand { text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }

/* Same size and weight as a page title. */
.brand-name {
  font-size: var(--fs-title);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* Same size as the nav labels. */
.brand-tagline {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  margin-top: 5px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-size: var(--fs-small);
}
.site-nav a {
  color: var(--ink-soft);
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.is-current {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- headings ---------------------------------------- */

h1.page-title {
  font-size: var(--fs-title);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-top: 44px;
  margin-bottom: 26px;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--weight-bold);
  letter-spacing: -0.005em;
  margin: 56px 0 18px;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--weight-bold);
  margin: 0 0 6px;
}

.section-note {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  margin: -10px 0 26px;
}

/* ---------- banner movie ------------------------------------
   Left-aligned with the header, capped at --media, and sized
   entirely in relative terms: no fixed height and no cropping,
   so the movie scales with the page (including browser zoom)
   and always shows its full frame.
   ------------------------------------------------------------ */

.banner {
  margin-top: 28px;
  line-height: 0;
}
.banner video {
  width: 100%;
  max-width: var(--media);
  height: auto;          /* aspect ratio comes from the file */
  background: #000;
}

/* ---------- gallery ----------------------------------------- */

.figure {
  max-width: var(--media);
  margin: 0 0 56px;
}

.player {
  position: relative;
  background: #000;
  line-height: 0;
  cursor: pointer;
  border: 1px solid var(--rule);
}
.player video {
  width: 100%;
  height: auto;
  background: #000;
}

.player-button {
  font: inherit;         /* buttons don't inherit type by default */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.15s ease;
}
.player-button:hover { background: rgba(0, 0, 0, 0.05); }
.player-button::after {
  content: "";
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9)
              url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%231c1c1e'/%3E%3C/svg%3E")
              no-repeat center / 30px 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}
.player-button:hover::after { transform: scale(1.06); }
.player.is-playing .player-button { display: none; }
.player.is-playing { cursor: default; }

/* Captions are the one place prose sits under a wide figure, so
   they get their own, narrower cap. */
.caption {
  max-width: var(--measure);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 12px 0 0;
}
.caption b { color: var(--ink); }

/* ---------- research projects ------------------------------- */

.project {
  max-width: var(--media);
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}
.project:last-child { border-bottom: 1px solid var(--rule); }

/* The always-visible row: figure on the left, title on the right.
   On a project with detail text this element is a <summary>, so
   the whole row is the click target. */
.project-head {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: center;
  list-style: none;      /* hide the default disclosure triangle */
}
.project-head::-webkit-details-marker { display: none; }
details.project > .project-head { cursor: pointer; }
details.project > .project-head:hover h3 { color: var(--accent); }
.project-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.project-head img { width: 100%; height: auto; }
.project-head h3 { line-height: 1.4; }

/* Chevron: points right when closed, down when open. Drawn from
   two borders so it needs no image. */
details.project > .project-head h3::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 7px;
  height: 7px;
  margin-right: 13px;
  margin-bottom: 2px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
details.project[open] > .project-head h3::before { transform: rotate(45deg); }

/* Revealed text, indented to line up under the title. */
.project-detail {
  padding-top: 16px;
  padding-left: 328px;   /* 300px figure + 28px gap */
}
.project-detail p {
  margin: 0;
  max-width: var(--measure);
}

/* ---------- people ------------------------------------------ */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 40px 32px;
}

.person img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
}
.person h3 { margin-top: 14px; }
.person .role {
  font-size: var(--fs-small);
  color: var(--accent);
  margin: 0 0 6px;
}
.person ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- publications ------------------------------------ */

.pubs { list-style: none; }
.pub {
  max-width: var(--media);
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  line-height: 1.55;
}
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub .authors { color: var(--ink-soft); font-size: var(--fs-small); }
.pub .title { font-size: var(--fs-h3); font-weight: var(--weight-bold); }
.pub .journal {
  color: var(--ink-soft);
  font-size: var(--fs-small);
  font-style: italic;
}
.pub .press {
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  margin-top: 6px;
}

/* ---------- contact ----------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: start;
  gap: 40px;
  align-items: start;
}
.address {
  line-height: 1.75;
  color: var(--ink);
}
.address .label {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 22px 0 4px;
}
.address .label:first-child { margin-top: 0; }
.photo-credit {
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  margin-top: 6px;
}

.callout {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  padding: 18px 24px;
  margin: 26px 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child  { margin-bottom: 0; }

ol.qualities { padding-left: 22px; }
ol.qualities li { margin-bottom: 8px; }

/* ---------- footer ------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 26px 0 40px;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); text-decoration: underline; }

/* ---------- responsive -------------------------------------- */

@media (max-width: 760px) {
  :root {
    --gutter:   20px;
    --fs-title: 26px;
    --fs-h2:    20px;
    --fs-body:  16.5px;
  }
  .site-header .wrap { padding-top: 14px; padding-bottom: 10px; }
  .site-nav { gap: 4px 16px; }
  h1.page-title { margin-top: 32px; }
  .banner { margin-top: 20px; }
  .project-head { grid-template-columns: 1fr; gap: 14px; }
  .project-detail { padding-left: 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
