/* ==========================================================================
   The Smear lab. One stylesheet, no framework, no build step.

   Day mode: white page, lavender title, blue headings and links, gold note
   boxes. Night mode is the Osees homage: black page, gold ink, glowing
   links. Same content either way. Arial throughout, per house rule, and
   there is exactly one font stack declared in this file.

   Every chromatic value comes from riley.mat and nothing else. Colour
   roles below were assigned by measured contrast, not by eye: anything
   carrying body text clears 4.5:1, anything used only at heading size
   clears 3:1. If you change one, measure it.

   The gradient rule under the header is a real cubehelix ramp, computed
   from Green (2011) with the standard parameters (start 0.5, rotations
   -1.5, hue 1, gamma 1), not eyeballed.
   ========================================================================== */

:root {
  /* Palette: riley.mat, Matt's file. Only these seven colours are used for
     anything chromatic. Neutral white/near-black grounds are not "colours"
     in that sense and stay neutral.
       #0195c3 cyan     #a983b4 muted violet   #3167d1 blue
       #c990d4 orchid   #6bb36a green          #395a7d slate   #fee098 gold
     The green is deliberately unused. Matt does not want green in the UI. */
  --bg:       #ffffff;
  --panel:    #fee098;   /* gold, for note boxes */
  --ink:      #1a1a1a;
  --dim:      #395a7d;   /* slate, 7.2:1 on white */
  --title:    #a983b4;   /* lavender, Matt's favourite. 3.2:1, which clears
                            the 3:1 large-text floor but only just, so keep
                            it on the 2.1em h1 and nothing smaller. */
  --heading:  #3167d1;   /* blue, 5.3:1 */
  --link:     #3167d1;   /* blue, 5.3:1 */
  --visited:  #395a7d;   /* slate, 7.2:1 */
  --rule:     #a983b4;   /* lavender, decorative only */
  --panellink:#395a7d;   /* slate. The gold panel is light enough that the
                            ordinary blue link only reaches 4.1:1 on it. */
  --glow:     none;
  --navmark:  #395a7d;   /* slate, 7.2:1. The nav sits at 0.92em, too small
                            for the 3:1 floor, so this needs a text-grade
                            colour rather than an accent. */
}

html.night {
  --bg:       #0a0a0a;
  --panel:    #16202b;
  --ink:      #ececec;
  --dim:      #a983b4;   /* violet, 6.2:1 on black */
  --title:    #fee098;   /* gold, 15.4:1 */
  --heading:  #0195c3;   /* cyan, 5.7:1 */
  --link:     #fee098;   /* gold, 15.4:1 */
  --visited:  #a983b4;   /* violet, 6.2:1 */
  --rule:     #395a7d;   /* slate */
  --panellink:#fee098;   /* gold, 12.8:1 on the dark panel */
  --glow:     0 0 6px currentColor;
  --navmark:  #fee098;
}

/* Respect the OS preference on a first visit. A stored choice wins over
   this, applied by the script in each page's <head>. */
@media (prefers-color-scheme: dark) {
  html.auto {
    --bg:       #0a0a0a;
    --panel:    #16202b;
    --ink:      #ececec;
    --dim:      #a983b4;
    --title:    #fee098;
    --heading:  #0195c3;
    --link:     #fee098;
    --visited:  #a983b4;
    --rule:     #395a7d;
    --panellink:#fee098;
    --glow:     0 0 6px currentColor;
    --navmark:  #fee098;
  }
}

html { background: var(--bg); }

body {
  max-width: 46em;
  margin: 0 auto;
  padding: 1.2em 1.2em 3em;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.06em;
  line-height: 1.5;
}

/* keyboard users get a way past the nav */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1em;
  top: 1em;
  background: var(--panel);
  padding: 0.4em 0.7em;
  border: 1px solid var(--heading);
  z-index: 10;
}

/* ---- masthead ---------------------------------------------------------- */

header { text-align: center; margin-bottom: 0.4em; }

.glyphs {
  font-size: 2.5em;
  line-height: 1;
  margin: 0 0 0.1em;
  letter-spacing: 0.12em;
}

header h1 {
  color: var(--title);
  font-size: 2.1em;
  margin: 0.1em 0 0.05em;
  letter-spacing: 0.02em;
  text-shadow: var(--glow);
}
header h1 a { color: inherit; text-decoration: none; }
header h1 a:visited { color: var(--title); }

.tagline { font-style: italic; margin: 0; }
.affil   { font-size: 0.92em; margin: 0.15em 0 0; color: var(--dim); }

/* ---- navigation -------------------------------------------------------- */

nav.main {
  text-align: center;
  font-size: 0.92em;
  letter-spacing: 0.06em;
  margin: 0.9em 0 0;
  line-height: 2;
}
nav.main a {
  text-decoration: none;
  padding: 0.1em 0.15em;
  white-space: nowrap;
}
nav.main a:hover,
nav.main a:focus { text-decoration: underline; }
nav.main a[aria-current="page"] {
  color: var(--navmark);
  font-weight: bold;
  text-shadow: var(--glow);
}
/* the brackets are drawn in CSS so the HTML stays clean */
nav.main a[aria-current="page"]::before { content: "["; }
nav.main a[aria-current="page"]::after  { content: "]"; }
nav.main .sep { color: var(--rule); }

/* ---- the day/night switch --------------------------------------------- */

#mode {
  display: block;
  margin: 0.6em auto 0;
  font-size: 0.82em;
  letter-spacing: 0.06em;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--link);
  text-decoration: underline;
}
#mode:hover { text-shadow: var(--glow); }

/* ---- the rule under the masthead --------------------------------------- */

/* Matt's own ramp, from mycubehelix.mat:
       1 - CubeHelix(256, 0.5, -1, 1.5, 1.0)
   Sampled at 25 points straight out of that file. I checked the formula
   against the file first and it reproduces it exactly, so the stops below
   are his colormap, not a lookalike.

   Being the inverse, it runs white to black rather than black to white,
   and the raised hue (1.5 against the default 1) makes the traverse more
   saturated. It still passes through green early and pink in the middle,
   because a cubehelix ramp cycles through the hues by construction. That
   is what the scheme is. Matt chose this one knowing it. */

/* The hairline is not decoration. This ramp runs white to black, so on the
   white page the left end disappears and on the black page the right end
   does. The border shows where the bar actually starts and stops without
   altering a single colour in it. */

.cube-rule {
  border: 1px solid var(--rule);
  box-sizing: border-box;
  height: 11px;
  margin: 1.1em 0 0.2em;
  background: linear-gradient(to right,
    #ffffff 0%, #ebfbe9 4.2%, #dff4d1 8.3%, #d8eab7 12.5%,
    #d8dda1 16.7%, #ddcc8e 20.8%, #e4b882 25%, #eaa47e 29.2%,
    #ef8f80 33.3%, #ee7b89 37.5%, #e86b94 41.7%, #da5da3 45.8%,
    #c553af 50%, #ac4db7 54.2%, #8d49ba 58.3%, #6f48b5 62.5%,
    #4f49a9 66.7%, #324895 70.8%, #1c477e 75%, #0a4361 79.2%,
    #003c46 83.3%, #00312b 87.5%, #002215 91.7%, #001307 95.8%,
    #000000 100%);
}

html.night .cube-rule { box-shadow: 0 0 14px #fee09855, 0 0 4px #0195c355; }
@media (prefers-color-scheme: dark) {
  html.auto .cube-rule { box-shadow: 0 0 14px #fee09855, 0 0 4px #0195c355; }
}

/* The masthead strip when it holds an image instead of the ramp. Same slot,
   same margins, so the two are interchangeable. The height is fixed and the
   image is cropped to it rather than scaled, because the slot is a band
   across the page and the image has to earn its place at that height. If a
   picture needs more room to read, raise this and check both modes. */
.banner {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--rule);
  box-sizing: border-box;
  margin: 1.1em 0 0.2em;
}
html.night .banner { box-shadow: 0 0 14px #fee09833; }
@media (prefers-color-scheme: dark) {
  html.auto .banner { box-shadow: 0 0 14px #fee09833; }
}
@media (max-width: 34em) {
  .banner { height: 64px; }
}

.cube-caption {
  text-align: right;
  font-size: 0.72em;
  letter-spacing: 0.03em;
  margin: 0 0 1.4em;
  color: var(--dim);
}

hr.plain {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.8em 0;
}

/* ---- body copy --------------------------------------------------------- */

h2 {
  color: var(--heading);
  font-size: 1.35em;
  margin: 1.6em 0 0.4em;
  text-shadow: var(--glow);
}
h2:first-of-type { margin-top: 0; }

h3 {
  color: var(--ink);
  font-size: 1.08em;
  margin: 1.4em 0 0.3em;
}

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { text-shadow: var(--glow); }
html:not(.night) a:hover { color: #0195c3; }

ul.research { padding-left: 1.4em; }
ul.research li { margin-bottom: 0.7em; }

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

.person {
  display: flex;
  gap: 1em;
  align-items: flex-start;
  margin-bottom: 1.6em;
}
.person img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border: 1px solid var(--rule);
  flex: 0 0 auto;
}
.person h3 { margin-top: 0; }
.person .role {
  font-size: 0.78em;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
  margin-bottom: 0.35em;
}
.person p { margin: 0.35em 0; }

ul.alumni { padding-left: 1.4em; }
ul.alumni li { margin-bottom: 0.3em; }

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

.pubyear {
  color: var(--heading);
  font-size: 0.95em;
  font-weight: bold;
  letter-spacing: 0.14em;
  margin: 1.6em 0 0.5em;
  border-bottom: 1px solid var(--rule);
  text-shadow: var(--glow);
}
ol.pubs {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
ol.pubs li {
  margin-bottom: 1em;
  padding-left: 1.4em;
  text-indent: -1.4em;
}
ol.pubs .authors { font-size: 0.95em; }
ol.pubs .venue { font-style: italic; }
ol.pubs b { color: var(--ink); }
.tag {
  font-size: 0.7em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  padding: 0 0.35em;
  margin-left: 0.3em;
  color: var(--dim);
  white-space: nowrap;
}

/* ---- boxes ------------------------------------------------------------- */

.note {
  border: 1px solid var(--heading);
  background: var(--panel);
  padding: 0.6em 1em;
  margin: 1.2em 0;
}
.note a, .note a:visited { color: var(--panellink); }
.note p:first-child { margin-top: 0.3em; }
.note p:last-child  { margin-bottom: 0.3em; }

figure { margin: 1.4em 0; }
figure img {
  display: block;
  max-width: min(100%, 24em);
  height: auto;
  border: 1px solid var(--rule);
}

/* Placement and size for figures, set from the editor's image toolbar.
   Sizes are in em so a figure keeps its proportion to the text if the base
   size ever changes. */
figure.fig-left  { float: left;  margin: 0.3em 1.4em 0.8em 0; }
figure.fig-right { float: right; margin: 0.3em 0 0.8em 1.4em; }
figure.fig-wide  { float: none;  clear: both; }

figure.fig-s img { max-width: min(100%, 11em); }
figure.fig-m img { max-width: min(100%, 20em); }
figure.fig-l img { max-width: 100%; }
figure.fig-l { width: 100%; }

/* floats must not escape their section */
main::after, .note::after { content: ""; display: table; clear: both; }
hr.plain { clear: both; }

@media (max-width: 34em) {
  /* one narrow column: floating a figure beside text stops helping */
  figure.fig-left, figure.fig-right { float: none; margin: 1.4em 0; }
  figure.fig-s img, figure.fig-m img { max-width: 100%; }
}
figcaption {
  font-size: 0.82em;
  color: var(--dim);
  margin-top: 0.4em;
  letter-spacing: 0.03em;
}

/* a real attribution, not an unfinished line */
.credit {
  font-size: 0.88em;
  color: var(--dim);
  font-style: italic;
}

/* things still to fill in, visible on purpose */
.todo {
  font-size: 0.9em;
  letter-spacing: 0.03em;
  color: var(--dim);
}

/* ---- affiliation logos ------------------------------------------------- */

/* The UO mark is the official file from UO's own web design framework, the
   same one ion.uoregon.edu serves. It ships white for use on the UO green
   bar, so it is set near-black here and inverted for night mode. That is a
   one-colour treatment, not a redraw. The ION mark is Matt's own file,
   which ships white-on-opaque-black; it was converted to black artwork on
   a transparent ground so it sits on the page rather than in a box, and it
   inverts for night mode the same way. Neither logo was redrawn.
   To replace either, drop a new file at static/media/uo-logo.svg or
   static/media/ion-logo.png and this all keeps working. */

.affiliations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4em;
  margin-bottom: 1.4em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
}
.affiliations a { text-decoration: none; }
.affiliations .uo img {
  display: block;
  width: 190px;
  height: auto;
}
html.night .affiliations .uo img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  html.auto .affiliations .uo img { filter: invert(1); }
}
.affiliations .ion {
  border-left: 1px solid var(--rule);
  padding-left: 1.4em;
}
.affiliations .ion img {
  display: block;
  width: 74px;
  height: auto;
}
html.night .affiliations .ion img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  html.auto .affiliations .ion img { filter: invert(1); }
}

@media (max-width: 34em) {
  .affiliations { flex-direction: column; gap: 0.9em; }
  .affiliations .ion {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 0.9em;
  }
}

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

footer {
  text-align: center;
  font-size: 0.85em;
  margin-top: 2.5em;
  color: var(--dim);
}
footer nav { margin-bottom: 0.5em; letter-spacing: 0.06em; }

/* ---- narrow screens ---------------------------------------------------- */

@media (max-width: 34em) {
  body { font-size: 1em; padding: 1em 0.9em 2.5em; }
  header h1 { font-size: 1.7em; }
  nav.main { font-size: 0.86em; }
  nav.main .sep { display: none; }
  nav.main a { display: inline-block; margin: 0 0.35em; }
  .person { flex-direction: column; gap: 0.5em; }
  .person img { width: 130px; height: 130px; }
}

/* ---- print ------------------------------------------------------------- */

@media print {
  #mode, nav.main { display: none; }
  body { max-width: none; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
