@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Jost:wght@300;400;500&display=swap');

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Tokens ─── */
:root {
  --white:      #fefefe;
  --ink:        #111110;
  --mid:        #666460;
  --faint:      #aaa9a5;
  --rule:       #e4e2de;
  --max:        660px;
  --nav-h:      52px;
  --serif:      'Spectral', Georgia, serif;
  --sans:       'Jost', system-ui, sans-serif;
}

/* ─── Base ─── */
html {
  background: var(--white);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

em { font-style: italic; }

/* ─── Nav ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 6vw, 64px);
}

.nav-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav-name:hover { color: var(--mid); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3.5vw, 44px);
  list-style: none;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.12s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

/* Bars are drawn with a border in currentColor, not a background fill: browsers that
   force a dark theme (Chrome/Samsung "auto dark") lighten foreground colours but leave a
   dark background fill dark, which made the icon vanish on a darkened nav. */
.nav-toggle span {
  display: block;
  width: 20px;
  height: 0;
  border-top: 2px solid currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── Page Shell ─── */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px clamp(24px, 6vw, 40px) 120px;
}

/* ─── Page heading ─── */
.page-label {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 52px;
}

/* ─── Hero ─── */
.hero-line {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 32px;
}

.hero-emph {
  font-size: 33px;
}

.hero-body {
  font-size: 16px;
  line-height: 1.82;
  color: var(--mid);
}

/* ─── Prose ─── */
.prose p {
  font-size: 16px;
  line-height: 1.82;
  color: var(--mid);
  margin-bottom: 1.3em;
}

.prose p:last-child { margin-bottom: 0; }

.prose .light {
  color: var(--mid);
  font-size: 17px;
}

.prose a {
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.12s, color 0.12s;
}

.prose a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ─── Contact ─── */
.contact {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
}

.contact-row {
  display: flex;
  gap: 0;
  margin-bottom: 5px;
  font-size: 16px;
  line-height: 1.6;
}

.contact-key {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  width: 60px;
  flex-shrink: 0;
  padding-top: 3px;
}

.contact-val {
  color: var(--mid);
}

.contact-val a {
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  transition: color 0.12s, border-color 0.12s;
}

.contact-val a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ─── Publications ─── */
.pub-group {
  margin-bottom: 56px;
}

.pub-group:last-child { margin-bottom: 0; }

.pub-group-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 10px;
}

/* book entry */
.pub-book {
  padding: 18px 0 0;
  font-size: 18px;
  color: var(--ink);
}

/* journal list */
ol.pubs {
  list-style: none;
}

ol.pubs li {
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  line-height: 1.65;
}

ol.pubs li:last-child { border-bottom: none; }

.pub-cite {
  color: var(--mid);
  font-size: 16px;
}

.pub-summary {
  display: block;
  color: var(--mid);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  margin-top: 6px;
}

/* unnumbered list (edited volumes, reviews) */
ul.pubs-plain {
  list-style: none;
}

ul.pubs-plain li {
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  line-height: 1.65;
}

ul.pubs-plain li:last-child { border-bottom: none; }

.pub-book a,
ol.pubs a,
ul.pubs-plain a {
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.12s;
}

.pub-book a:hover,
ol.pubs a:hover,
ul.pubs-plain a:hover {
  border-color: var(--ink);
}

/* ─── Media list ─── */
.media-intro {
  margin-bottom: 40px;
  color: var(--ink);
}

ul.media {
  list-style: none;
}

ul.media li {
  padding: 13px 0 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  line-height: 1.68;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 0 14px;
  align-items: baseline;
  color: var(--ink);
}

ul.media li:last-child { border-bottom: none; }

ul.media li::before {
  content: '–';
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
}

ul.media a {
  border-bottom: 1px solid var(--rule);
  color: inherit;
  transition: border-color 0.12s;
}

ul.media a:hover {
  border-color: var(--ink);
}

/* ─── Teaching (per-institution accordion) ─── */
.teaching-item {
  border-bottom: 1px solid var(--rule);
}

.teaching-item:last-of-type { border-bottom: none; }

.teaching-item summary {
  cursor: pointer;
  padding: 13px 0;
  font-size: 17px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.teaching-item summary::marker { color: var(--faint); }

.teaching-item[open] summary { padding-bottom: 4px; }

.teaching-item ul.pubs-plain {
  margin: 0 0 18px 0;
  padding-left: 4px;
  border-left: 1px solid var(--rule);
}

.teaching-item ul.pubs-plain li {
  padding: 8px 0 8px 16px;
  font-size: 15px;
  color: var(--mid);
  border-bottom: none;
}

/* ─── Office Hours ─── */
.oh-intro {
  margin-bottom: 40px;
}

.calendar-frame {
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 56px 24px;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

/* ─── Calendar button ─── */
.cal-btn {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 10px 18px;
  transition: border-color 0.12s, color 0.12s;
}

.cal-btn:hover {
  border-color: var(--ink);
}

/* ─── Events ─── */
.event + .event {
  margin-top: 56px;
  padding-top: 56px;
  border-top: 1px solid var(--rule);
}

.event-title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--ink);
}

.event p {
  font-size: 17.5px;
  line-height: 1.75;
  margin-bottom: 1.1em;
  color: var(--ink);
}

.event p:last-child { margin-bottom: 0; }

.event a {
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  transition: color 0.12s, border-color 0.12s;
}

.event a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--rule);
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px clamp(24px, 6vw, 40px) 40px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--faint);
  border-bottom: 1px solid var(--rule);
  transition: color 0.12s;
}

footer a:hover { color: var(--ink); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.is-open {
    max-height: 320px;
    visibility: visible;
  }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 14px clamp(24px, 6vw, 64px);
    font-size: 12px;
    letter-spacing: 0.1em;
  }
}

/* ─── Forms ─── */
.form-back {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 40px;
  transition: color 0.12s;
}
.form-back:hover { color: var(--ink); }

.form-group { margin-bottom: 28px; }

.form-label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  transition: border-color 0.12s;
  line-height: 1.5;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--mid);
}

.form-textarea { min-height: 160px; resize: vertical; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa9a5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--mid);
  margin-top: 6px;
  letter-spacing: 0.03em;
}
.form-hint.over { color: var(--ink); font-weight: 500; }

.form-submit {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.12s;
  margin-top: 8px;
}
.form-submit:hover { background: var(--mid); border-color: var(--mid); }
.form-submit:disabled { opacity: 0.35; cursor: default; }

.alert {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  margin-bottom: 36px;
  border: 1px solid var(--rule);
  color: var(--mid);
}
.alert-error   { border-color: #b94040; color: #b94040; }
.alert-success { border-color: var(--ink); color: var(--ink); }

/* ─── Submit options ─── */
.submit-options {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submit-option {
  display: block;
  padding: 20px 24px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  transition: border-color 0.12s, background-color 0.12s;
}
.submit-option:hover {
  border-color: var(--mid);
  background: rgba(17, 17, 16, 0.02);
}

.submit-option-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.submit-option-title::after {
  content: "→";
  color: var(--faint);
  transition: color 0.12s, transform 0.12s;
}
.submit-option:hover .submit-option-title::after {
  color: var(--ink);
  transform: translateX(3px);
}
.submit-option-desc {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--mid);
  line-height: 1.6;
}

/* ─── Appointment divider ─── */
.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* ─── Admin ─── */
.admin-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px clamp(24px, 6vw, 40px) 100px;
  font-family: var(--serif);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.admin-title {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.admin-logout {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.12s;
}
.admin-logout:hover { color: var(--ink); }

.admin-tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.admin-tab {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  padding-bottom: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
}
.admin-tab:hover { color: var(--mid); }
.admin-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.submission {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.submission-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 16px;
}

.submission-name { font-size: 18px; color: var(--ink); }
.submission-name.unread { font-weight: 500; }

.submission-time {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.submission-fields { margin-bottom: 14px; }

.submission-field {
  display: flex;
  gap: 12px;
  font-size: 16px;
  line-height: 1.65;
}

.submission-field-key {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  width: 72px;
  flex-shrink: 0;
  padding-top: 3px;
}

.submission-field-val { color: var(--mid); }

.submission-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-btn {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  background: none;
  border: 1px solid var(--rule);
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
  display: inline-block;
}
.admin-btn:hover { color: var(--ink); border-color: var(--ink); }

.empty-state {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  padding: 40px 0;
}

.admin-field-group { margin-bottom: 20px; }

.admin-input {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 8px 12px;
  border-radius: 0;
  outline: none;
  transition: border-color 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.admin-input:focus { border-color: var(--mid); }

.courses-list { margin-bottom: 32px; }

.course-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  color: var(--mid);
}

.unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
