/*
 * Jamie Setch — research portfolio
 * Minimal layout set in Cormorant Garamond: white text on the sky, centred nav
 * in spaced capitals, fine rules, and NIGHT TIDE filling the homepage.
 *
 * The sky follows the visitor's local time: js/time-of-day.js sets --sky-top
 * and --sky-low (black, the night sky, until it runs or if it can't).
 */

/*
 * Cormorant Garamond, served from this site rather than Google Fonts so the
 * page doesn't wait on another server (SIL Open Font License: fonts/OFL.txt).
 * One variable file per style covers weights 500 to 700; Latin and extended
 * Latin only, which covers English and accented names.
 */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.75);
  --sky-top: #000;
  --sky-low: #000;
  /* an elegant serif; falls back to classic Mac/Windows serifs if it can't load */
  --font: "Cormorant Garamond", Didot, "Bodoni 72", "Hoefler Text", Garamond, "Palatino Linotype", Palatino,
    Georgia, serif;
}

html {
  box-sizing: border-box;
  background: var(--sky-top); /* also fills the overscroll area */
}

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

body {
  margin: 0 auto;
  max-width: 50rem;
  padding: 1rem;
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.2rem; /* this face runs small, so body text is set a size up */
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* the sky, fixed behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(var(--sky-top), var(--sky-low));
}

/* its stars (drawn by js/time-of-day.js), added onto the sky like light */
.sky-stars {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: plus-lighter;
}

strong,
b {
  font-weight: 700;
}

/* Links */

a,
a:visited {
  color: var(--fg);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover,
a:visited:hover {
  color: var(--fg);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* Header nav: spaced capitals, current page underlined */

nav ul {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  text-align: center;
}

nav li {
  display: inline-block;
}

nav a,
nav a:visited {
  display: inline-block;
  margin: 0.5rem 1.1rem;
  padding: 0 0 0 0.24em; /* balances the trailing letter-spacing so each word stays centred */
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
}

nav a:hover,
nav a:focus-visible,
nav a.active {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
}

/* Rules */

hr {
  background: var(--fg);
  border: 0;
  height: 1px;
  margin: 2rem 0;
  width: 100%;
}

/* Page content */

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
}

main h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 0.75rem;
}

main ul {
  padding-left: 1.5rem;
}

main li {
  margin-bottom: 0.5rem;
}

.intro {
  margin-top: 0;
}

/* Project / research entries */

.entry {
  margin: 0 0 2rem;
}

.entry h2 {
  font-size: 1.9rem;
  margin: 0 0 0.5rem;
}

/* Entries nested under a section heading sit one step below it */
.entry h3 {
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}

.entry p {
  margin: 0 0 0.6rem;
}

.date {
  opacity: 0.75;
  font-size: 1.1rem;
  font-style: italic;
}

/* Projects: a small app-style icon beside each name */

.entry h2.with-icon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.app-icon {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 22%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Compact lists (publications, awards): the title, then where it appeared */

main .pubs {
  list-style: none;
  padding: 0;
  margin: 0;
}

main .pubs li {
  margin: 0 0 0.9rem;
}

.pubs .title {
  font-weight: 600;
}

.pubs .venue {
  display: block;
  font-size: 1.05rem;
  font-style: italic;
  opacity: 0.75;
}

/* Footer */

footer {
  margin: 2rem 0;
}

footer small {
  font-size: 1rem;
}

/*
 * Homepage: NIGHT TIDE fills the whole window, and the nav sits in white in
 * the middle of its sky. All the headings look the same here (no underline
 * on the current page).
 */

body.home {
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
}

.home a,
.home a:visited {
  color: #fff;
}

.tide-frame {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.tide-frame canvas {
  display: block;
}

.home main {
  position: relative;
  z-index: 1;
}

/* centred in the sky: the horizon sits 22% of the way down the window */
.home header {
  position: fixed;
  top: 11vh;
  top: 11dvh;
  left: 0;
  right: 0;
  z-index: 1;
  transform: translateY(-50%);
}

.home nav ul {
  margin: 0;
}

.home nav a,
.home nav a:visited,
.home nav a.active {
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.home nav a:hover,
.home nav a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

/* Read by screen readers and search engines, not shown */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  nav a,
  nav a:visited {
    margin: 0.25rem 0.3rem;
    padding-left: 0.12em;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
  }
}
