/* vision.ics.uci.edu
 *
 * One hand-written stylesheet, no framework, no build step.
 * Targets WCAG 2.2 AA: verified contrast, visible focus, honours reduced motion.
 *
 * Colour is defined once as tokens on :root, then redefined only inside the
 * dark-scheme block. No colour gets its sole definition inside a media query.
 */

:root {
  color-scheme: light dark;

  --bg: #fbfbfa;
  --bg-raised: #ffffff;
  --bg-sunken: #f0efec;
  --text: #1a1a18;
  --text-dim: #55534d;
  --text-faint: #75726a;
  --rule: #dedbd4;
  --rule-strong: #c3bfb5;
  --accent: #1c5d99;
  --accent-hover: #14456f;
  --accent-bg: #e8f0f7;
  --focus: #b8560f;

  --measure: 68ch;
  --page: 74rem;
  --gap: clamp(1rem, 0.6rem + 1.6vw, 2rem);
  --radius: 4px;

  /* Display is a system-serif stack: scholarly, and it costs no network
     request, no webfont licence and nothing to rot. Body stays sans for
     legibility at small sizes in dense author and venue lines. */
  --font-display: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia,
                  "Times New Roman", serif;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161a;
    --bg-raised: #1d1f24;
    --bg-sunken: #101115;
    --text: #e9e8e4;
    --text-dim: #b0aea7;
    --text-faint: #8a8880;
    --rule: #2f3239;
    --rule-strong: #454952;
    --accent: #7ab6e8;
    --accent-hover: #a3cef2;
    --accent-bg: #17293a;
    --focus: #f0a868;
  }
}

:root[data-theme="dark"] {
  --bg: #15161a;
  --bg-raised: #1d1f24;
  --bg-sunken: #101115;
  --text: #e9e8e4;
  --text-dim: #b0aea7;
  --text-faint: #8a8880;
  --rule: #2f3239;
  --rule-strong: #454952;
  --accent: #7ab6e8;
  --accent-hover: #a3cef2;
  --accent-bg: #17293a;
  --focus: #f0a868;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.97rem + 0.14vw, 1.0625rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* -- links and focus ------------------------------------------------------ */

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-raised);
  color: var(--text);
  padding: 0.6rem 1rem;
  z-index: 100;
  border: 1px solid var(--rule-strong);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* -- layout --------------------------------------------------------------- */

.shell {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gap);
}

main { padding-block: clamp(1.5rem, 1rem + 2vw, 3rem); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }

/* -- masthead and nav ----------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raised);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-block: 1.1rem;
}

.masthead__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.masthead__title a { color: inherit; text-decoration: none; }
.masthead__title a:hover { color: var(--accent); }

.masthead__where { color: var(--text-faint); font-size: 0.875rem; }

.nav { border-bottom: 1px solid var(--rule); background: var(--bg-raised); }
.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  /* Block only. This ul is the .shell, and a padding shorthand here also sets
     padding-inline, which cancelled the shell's own and left the navigation
     hard against the edge of the window while every other row was indented. */
  padding-block: 0 0.1rem;
  list-style: none;
}
.nav a {
  display: inline-block;
  padding: 0.55rem 0;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9375rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); border-bottom-color: var(--rule-strong); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; }

h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}
h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.25;
  margin: 2.2rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.125rem; margin: 1.6rem 0 0.5rem; }

.lede { color: var(--text-dim); font-size: 1.0625em; max-width: var(--measure); }

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

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: var(--gap);
  padding: 0;
  margin: 0;
  list-style: none;
}

.person-card { text-align: center; }
.person-card img,
.person-card .avatar {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  /* Anchor above centre. People supply full-body shots as often as headshots,
     and a centred 4:5 crop of a standing figure cuts the head off. */
  object-position: center 22%;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
}
.person-card .avatar {
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 1.6rem;
  font-weight: 600;
}
.person-card__name { display: block; margin-top: 0.5rem; font-weight: 600; font-size: 0.9375rem; }
.person-card__meta { display: block; color: var(--text-faint); font-size: 0.8125rem; }

.group { margin-top: 2rem; }
.group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.group__head h2 { border: 0; margin-bottom: 0.4rem; }
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

/* -- alumni list ---------------------------------------------------------- */

.alumni { list-style: none; margin: 0; padding: 0; }
.alumni li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.alumni .year { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 0.9375rem; }
.pubyear, .alumni .year, .pub__venue { font-variant-numeric: tabular-nums; }
.alumni .who { font-weight: 600; }
.alumni .what { color: var(--text-dim); font-size: 0.9375rem; font-weight: 400; }

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

.pubyear {
  font-family: var(--font-display);
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 0.4rem 0 0.3rem;
  margin-top: 2rem;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}

.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1.1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 34rem) {
  .pub { grid-template-columns: 1fr; }
  .pub__icon { display: none; }
}

.pub__icon img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
}

.pub__title { font-weight: 600; }
.pub__title a { color: var(--text); text-decoration: none; }
.pub__title a:hover { color: var(--accent); text-decoration: underline; }
.pub__authors { font-size: 0.9375rem; color: var(--text-dim); }
.pub__authors a { color: var(--text-dim); }
.pub__venue { font-size: 0.9375rem; color: var(--text-faint); font-style: italic; }
.pub__links { margin-top: 0.2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.875rem; }

.tag {
  font-size: 0.75rem;
  color: var(--text-faint);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

/* -- paper page ----------------------------------------------------------- */

.paper__figure {
  float: right;
  max-width: min(22rem, 45%);
  margin: 0 0 1rem 1.5rem;
}
.paper__figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--rule); }
@media (max-width: 40rem) {
  .paper__figure { float: none; max-width: 100%; margin: 0 0 1rem; }
}

.meta { color: var(--text-dim); font-size: 0.9375rem; }

.cite {
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre;
}

/* -- profile -------------------------------------------------------------- */

.profile { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: flex-start; }
.profile__photo { flex: 0 0 11rem; }
.profile__photo img,
.profile__photo .avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
}
.profile__photo .avatar { display: grid; place-items: center; color: var(--text-faint); font-size: 2.4rem; font-weight: 600; }
.profile__body { flex: 1 1 22rem; }

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

.footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-raised);
  color: var(--text-faint);
  font-size: 0.875rem;
}
.footer__inner { padding-block: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.footer a { color: var(--text-dim); }

/* -- archived page notice -------------------------------------------------- */

/* Only the datasets area sees this, via the SSI shims. Amber rather than the
   accent blue, so it reads as a status about the page instead of a link. */
.archive-note {
  /* Plain values first: color-mix is recent, and this page is the one most
     likely to be reached from a very old bookmark, on a very old browser. */
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--focus) 12%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--focus) 35%, var(--bg));
  color: var(--text-dim);
  font-size: 0.9375rem;
}
.archive-note .shell { padding-block: 0.7rem; max-width: var(--page); }
.archive-note strong { color: var(--text); }

/* -- legacy SSI page ------------------------------------------------------ */

/* /datasets/index.html is still an Apache SSI page served from the
   /extra/vision1 mount and is out of scope for the rebuild. It wraps its body
   in <div id="content">. Styling that selector lets the one remaining legacy
   page inherit this design instead of looking like 2018. */
#content { max-width: var(--measure); }
#content > * + * { margin-top: 1em; }
#content ul { padding-left: 1.2rem; }
#content li { margin-bottom: 0.6rem; }

/* -- utilities ------------------------------------------------------------ */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.scroll-x { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nav, .skip-link, .footer { display: none; }
  body { background: #fff; color: #000; }
}


/* -- news ----------------------------------------------------------------- */

.news { list-style: none; margin: 0; padding: 0; }
.news__item { padding-block: 1.6rem; border-bottom: 1px solid var(--rule); }
.news__item:first-child { padding-top: 0.6rem; }
.news__item:last-child { border-bottom: 0; }
.news__date { margin: 0; font-size: 0.8125rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-faint); }
.news__title { margin: 0.15rem 0 0.6rem; font-size: 1.15rem; }
.news__figure { margin: 0 0 0.75rem; }
/* Half the column. Full width made a snapshot look like a hero image, which is
   the wrong weight for a picnic. Height follows the photograph rather than
   being capped and cropped: cutting the top off a group photo to save vertical
   space is not a trade worth making. */
.news__figure img { display: block; width: 50%; height: auto; border-radius: 3px; }
.news__link { margin: 0.5rem 0 0; font-size: 0.9375rem; }
.news__papers { list-style: none; margin: 0.6rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.6rem; }
.news__papers li { display: flex; flex-direction: column; gap: 0.1rem; }
.news__papers-meta { font-size: 0.875rem; color: var(--text-dim); }

/* An archival banner inside a page, rather than the full-width band the SSI
   shims put above /datasets/. Same amber, so the two read as the same status. */
.page-note {
  background: color-mix(in srgb, var(--focus) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--focus) 35%, var(--bg));
  border-radius: 3px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.3rem;
  font-size: 0.9375rem;
  color: var(--text-dim);
}
.page-note strong { color: var(--text); }
