/* Alisa E. White: a quiet academic site. White page between two cardinal-red
   ribbons, one sans-serif (Mulish), near-black name and headings, gray text.
   See ../README.md for the look. */

:root {
  --red: #8c1515;      /* cardinal: the ribbons, the current tab, link hover */
  --ink: #121212;      /* name, headings, links */
  --text: #3f3f3f;     /* body text */
  --muted: #6b6b6b;    /* menu, dates, footer */
  --rule: #dcdcdc;     /* hairlines */
  --link-line: #b5b5b5;
  --width: 848px;      /* header, page and footer share one column */
  --font: "Mulish", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* The ribbons across the top and bottom of every page */
body::before,
body::after {
  content: "";
  display: block;
  flex: none;
  height: 16px;
  background: var(--red);
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--link-line);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
a:hover { text-decoration-color: var(--red); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 1px; }

p { margin: 0 0 1.1em; }

/* Small capitals, as in the CV: "Stan. Env’t L.J." */
.sc { font-variant-caps: small-caps; letter-spacing: 0.02em; }

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  z-index: 10;
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header: the name on the left, the tabs on the right ---------- */

.header-inner {
  display: flex;
  flex-wrap: wrap; /* on narrow screens the tabs drop under the name */
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 40px;
  padding-top: 64px;
}
/* The rule under the header, drawn inside the column's padding */
.header-inner { background: linear-gradient(var(--rule), var(--rule)) no-repeat 24px 100% / calc(100% - 48px) 1px; }

.site-name {
  margin: 0;
  padding-bottom: 20px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.005em;
}
.site-name a { color: var(--ink); text-decoration: none; }

.site-nav ul {
  display: flex;
  gap: 0 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  position: relative;
  z-index: 0; /* keeps the glow behind the word, not behind the page */
  display: block;
  padding-bottom: 20px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--red); }

/* The selected tab: a red line with a spotlight shining up from it. The beam is
   a trapezoid, as wide as the line at the bottom and --beam wider on each side
   at the top, with crisp angled sides. It fades out a little above the word.
   Hovering (or focusing) another tab shows a fainter beam, with no line. */
.site-header { overflow-x: clip; } /* keeps a beam at the edge from widening the page */
.site-nav { --beam: 28px; --beam-rise: 26px; }
.site-nav a::before,
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
/* The light is a brighter red than the line: cardinal at low strength turns mauve. */
.site-nav a::before {
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s ease;
  top: calc(-1 * var(--beam-rise));
  bottom: -2px;
  left: calc(-1 * var(--beam));
  right: calc(-1 * var(--beam));
  clip-path: polygon(var(--beam) 100%, calc(100% - var(--beam)) 100%, 100% 0, 0 0);
  background: linear-gradient(
    to top,
    rgba(214, 38, 38, 0.22) 0%,
    rgba(214, 38, 38, 0.1) 35%,
    rgba(214, 38, 38, 0.035) 70%,
    rgba(214, 38, 38, 0) 100%
  );
}
.site-nav a:focus-visible::before { opacity: 0.45; }
@media (hover: hover) {
  .site-nav a:hover::before { opacity: 0.45; }
}
.site-nav a[aria-current="page"]::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .site-nav a::before { transition: none; }
}
.site-nav a[aria-current="page"]::after {
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--red);
}

/* ---------- Page body ---------- */

main {
  display: block;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 72px 24px 0;
}

/* Section headings, set like the CV's: small capitals over a rule */
h2 {
  margin: 80px 0 30px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
section:first-of-type > h2 { margin-top: 0; }

h3 {
  margin: 40px 0 16px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}
h2 + h3 { margin-top: 0; }
h3.group { font-style: italic; font-weight: 600; }

/* Citations: publications and reports */
.citations {
  margin: 0;
  padding: 0;
  list-style: none;
}
.citations li { margin: 0 0 20px; }
.citations li:last-child { margin-bottom: 0; }

/* Bulleted lists, as in the CV */
.bullets {
  margin: 0;
  padding: 0 0 0 1.2em;
}
.bullets li { margin: 0 0 8px; padding-left: 0.2em; }
.bullets li::marker { color: var(--muted); }

/* Label and text pairs: "Primary:", "Honors:", "Thesis:" */
.pairs {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 6px 20px;
  margin: 0;
}
.pairs dt { font-style: italic; }
.pairs dd { margin: 0; }
.pairs .line { display: block; margin-bottom: 6px; }
.pairs .line:last-child { margin-bottom: 0; }

/* Entries with dates on the right: appointments, education, experience */
.entry { margin: 0 0 36px; }
.entry:last-child { margin-bottom: 0; }
.entry > p { margin: 0 0 4px; }
.entry .pairs { margin-top: 10px; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 32px;
  margin: 0 0 4px;
}
.entry-head h3 {
  margin: 0;
  color: var(--text);
  font-weight: 400;
}
.entry-head h3 strong { color: var(--ink); font-weight: 700; }
.dates {
  flex: none;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Home ---------- */

.home {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}

.profile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.titles {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  line-height: 1.45;
}
.titles li { margin: 0 0 8px; }
.titles li:first-child { color: var(--ink); font-weight: 700; font-size: 18px; }
.profile-links {
  margin: 24px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  line-height: 1.5;
}
.profile-links li { margin: 0 0 10px; }

.bio { margin-top: -0.4em; } /* lines the first line up with the top of the photo */
.bio p:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */

.notice {
  margin: 40px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
}

/* ---------- Footer: address on the left, links on the right ---------- */

.site-footer {
  flex: none;
  margin-top: 120px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px 40px;
  padding-top: 40px;
  padding-bottom: 56px;
  background: linear-gradient(var(--rule), var(--rule)) no-repeat 24px 0 / calc(100% - 48px) 1px;
}
.site-footer address { font-style: normal; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li + li::before {
  content: "·";
  margin: 0 12px;
  color: var(--muted);
}

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding-left: 20px; padding-right: 20px; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 36px;
    background-position: 20px 100%;
    background-size: calc(100% - 40px) 1px;
  }
  .site-name { padding-bottom: 0; font-size: 27px; }
  /* Five tabs spread across the width, shrinking a little on narrow phones */
  .site-nav { width: 100%; --beam: 12px; --beam-rise: 6px; }
  .site-nav ul { justify-content: space-between; gap: 0 10px; }
  .site-nav a { padding-bottom: 14px; font-size: min(15px, 3.6vw); }

  main { padding: 48px 20px 0; }
  h2 { margin-top: 60px; }

  .home { grid-template-columns: 1fr; gap: 36px; }
  .profile { max-width: 280px; }
  .bio { margin-top: 0; }

  .entry-head { flex-direction: column; gap: 0; }

  .pairs { grid-template-columns: 1fr; gap: 0; }
  .pairs dd { margin-bottom: 10px; }

  .site-footer { margin-top: 88px; }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    background-position: 20px 0;
    background-size: calc(100% - 40px) 1px;
  }
}
