/* Ernestine Hoegen — stylesheet */

@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fbfaf7;
  --surface: #f2efe9;
  --text: #1f2423;
  --muted: #5a6361;
  --line: #e2ded6;
  --accent: #3f6f69;        /* darker shade of the original teal, readable as text */
  --accent-soft: #588f89;   /* the original brand teal */
  --on-accent: #ffffff;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 65ch;
  --wide: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .12);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a19;
    --surface: #1e2321;
    --text: #e9ebe8;
    --muted: #a6afac;
    --line: #2f3633;
    --accent: #8cc3bc;
    --accent-soft: #6ea9a2;
    --on-accent: #10201e;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}

/* Base ------------------------------------------------------------------ */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
h3 { font-size: 1.25rem; }
.book-title { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }

p { margin: 0 0 1em; text-wrap: pretty; }

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

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* Header ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.site-name {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: .5rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent-soft);
}

/* Mobile menu: only collapses when JavaScript is available */
@media (max-width: 47.99rem) {
  .js .nav-toggle { display: inline-flex; }

  .js .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgb(0 0 0 / .08);
  }
  .js .site-nav[hidden] { display: none; }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: .5rem var(--gutter) 1rem;
  }
  .site-nav a {
    padding: .75rem 0;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--line);
  }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--line); }

  /* Without JavaScript the links simply wrap below the name */
  html:not(.js) .site-header .container { flex-wrap: wrap; padding-block: .75rem; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 0 1.25rem; padding: 0; }
  html:not(.js) .site-nav a { border-bottom: 0; font-size: 1rem; padding: .25rem 0; }
}

/* Page intro ------------------------------------------------------------ */

.page-intro {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.page-intro p {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.125em;
}
.eyebrow {
  display: block;
  margin-bottom: .5rem;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Books ----------------------------------------------------------------- */

.book {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding-block: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}

.book-cover {
  max-width: 14rem;
}
.book-cover img {
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.book-cover a { display: block; transition: transform .2s ease; }
.book-cover a:hover { transform: translateY(-3px); }

.book-text { max-width: var(--measure); }
.book-text h3:not(.book-title) { margin-top: 1.75em; }
.book-text .byline {
  margin-top: -.25em;
  color: var(--muted);
  font-weight: 500;
}
.book-text .lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.125em;
  color: var(--muted);
}

@media (min-width: 48rem) {
  .book { grid-template-columns: 17rem minmax(0, 1fr); }
  .book-cover { max-width: none; }
}

.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  padding: .7rem 1.25rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color .2s ease;
}
.button:hover { background: color-mix(in srgb, var(--accent) 85%, black); }

/* Card grid (yearbooks, translations) ----------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 0;
  margin: 0 0 clamp(3rem, 6vw, 5rem);
  list-style: none;
}

.card a { color: inherit; text-decoration: none; display: block; }
.card img {
  border-radius: 3px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: transform .2s ease;
  width: 100%;
}
.card a:hover img { transform: translateY(-3px); }
.card a:hover h3 { text-decoration: underline; text-underline-offset: .2em; }
.card h3 { margin-bottom: .25rem; }
.card p { margin: 0; color: var(--muted); font-size: .9375rem; }

/* Sections within a page ----------------------------------------------- */

.section { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-title {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.section-title + .book { border-top: 0; padding-top: 0; }
.section > .book:last-child { padding-bottom: 0; }
.section .card-grid { margin-bottom: 0; }

.card .note {
  margin-top: .375rem;
  color: var(--accent);
  font-weight: 500;
}

.contribution {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9375em;
}
.contribution p { margin: 0; }
.contribution .label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}

/* Publication list ----------------------------------------------------- */

.pub-year {
  display: grid;
  gap: .5rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}
.pub-year:last-child { margin-bottom: clamp(3rem, 6vw, 5rem); }
.pub-year h2 {
  font-size: 1.25rem;
  color: var(--accent);
  margin: 0;
}
@media (min-width: 48rem) {
  .pub-year { grid-template-columns: 6rem minmax(0, 1fr); }
}

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}
.pubs li + li { margin-top: 1.5rem; }
.pub-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: .25rem;
}
a.pub-title { text-decoration: none; }
a.pub-title:hover { color: var(--accent); text-decoration: underline; }
.pub-meta { margin: 0; color: var(--muted); font-size: .9375rem; }
.pub-meta a { color: var(--accent); }

/* Home: introduction ---------------------------------------------------- */

.hero {
  display: grid;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(2rem, 6vw, 5rem);
}
.hero-portrait { margin: 0; max-width: 16rem; }
.hero-portrait img {
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(2.5rem, 1.75rem + 3vw, 4rem); margin-bottom: .4em; }
.hero-intro {
  max-width: 34em;
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.65;
}
.hero-intro p:last-child { margin-bottom: 0; }
.hero .button { margin-top: 1.5rem; }
@media (min-width: 48rem) {
  .hero { grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr); }
  .hero-portrait { max-width: none; }
}

/* Home: news highlight -------------------------------------------------- */

.highlight {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border-radius: var(--radius);
}
.highlight img { border-radius: 3px; box-shadow: var(--shadow); }
.highlight h3 { margin-bottom: .25rem; }
.highlight p { margin: 0 0 .5rem; color: var(--muted); }
.highlight p:last-child { margin: 0; }
@media (min-width: 48rem) {
  .highlight { grid-template-columns: 8rem minmax(0, 1fr); }
}

/* Home: role tiles ----------------------------------------------------- */

.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.roles a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}
.roles a:hover { border-color: var(--accent); transform: translateY(-2px); }
.roles h3 { margin-bottom: 1.25rem; flex: 1; }
.roles p { margin: 0 0 1rem; color: var(--muted); font-size: .9375rem; flex: 1; }
.roles .more {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .9375rem;
}

/* Fold-out for longer book descriptions --------------------------------- */

.more-info { margin: 1rem 0; }
.more-info summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}
.more-info[open] summary { margin-bottom: .75rem; }

/* Prose section --------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.5em; }

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
@media (min-width: 52rem) {
  .split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.split .card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0;
}

/* Bio & contact --------------------------------------------------------- */

.portrait { margin: 0; }
.portrait img {
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--text);
}
.contact-list a:hover span:last-child { text-decoration: underline; text-underline-offset: .2em; }
.contact-list .icon { color: var(--accent); width: 1.5rem; height: 1.5rem; }
.contact-list small { display: block; color: var(--muted); font-size: .875rem; }

/* Footer ---------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  padding-block: 2.5rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9375rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--text); }
.footer-name {
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--text);
  margin: 0 0 .25rem;
}
.footer-meta { margin: 0; }

.social {
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  transition: border-color .2s ease, color .2s ease;
}
.social a:hover { border-color: var(--accent); color: var(--accent); }

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

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