/* ============================================================
   DIGITAL COURTS — Landing page
   Minimalist editorial style
   Typography: Fraunces (display serif) + IBM Plex Sans (body)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --paper: #f5f2ec;      /* warm off-white background */
  --paper-2: #ece8df;    /* slightly darker paper */
  --ink: #14181f;        /* deep ink for text */
  --ink-soft: #4a4f59;   /* muted ink */
  --rule: #1a1f2a1a;     /* hairline rule */
  --accent: #8a3324;     /* deep burgundy accent (sparingly) */

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --maxw: 1200px;
  --pad-x: clamp(20px, 5vw, 64px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* subtle paper texture using a tiny SVG noise */
  background-image:
    radial-gradient(circle at 100% 0%, rgba(138, 51, 36, 0.04), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(20, 24, 31, 0.025), transparent 40%);
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; padding: 0; }

/* ---------- HEADER ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--pad-x);
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 242, 236, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
}
.brand__mark {
  height: 28px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.site-nav a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
  position: relative;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--ink);
  transition: right 0.3s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.lang-btn {
  color: var(--ink-soft);
  padding: 4px 2px;
  transition: color 0.2s ease;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  color: var(--ink);
  font-weight: 500;
}
.lang-divider { color: var(--ink-soft); opacity: 0.5; }

/* ---------- HERO ---------- */
.hero {
  padding: clamp(64px, 12vh, 140px) var(--pad-x) clamp(80px, 14vh, 160px);
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--ink-soft);
  vertical-align: middle;
  margin-right: 12px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(54px, 11vw, 160px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
  font-variation-settings: "opsz" 144;
}
.hero__title-line { display: block; }
.hero__title-line--italic {
  font-style: italic;
  font-weight: 300;
  padding-left: clamp(40px, 8vw, 120px);
  color: var(--ink);
}

.hero__sub {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.35;
  color: var(--ink-soft);
  max-width: 28ch;
  margin: clamp(32px, 5vw, 56px) 0 0;
}

.hero__divider {
  height: 1px;
  background: var(--ink);
  margin: clamp(48px, 7vw, 80px) 0 32px;
  width: 100%;
  opacity: 0.85;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px;
  margin: 0;
}
.hero__facts > div { margin: 0; }
.hero__facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.hero__facts dd {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------- SECTIONS ---------- */
.section {
  padding: clamp(80px, 12vh, 140px) var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 6vw, 96px);
  border-top: 1px solid var(--rule);
}
@media (max-width: 800px) {
  .section { grid-template-columns: 1fr; gap: 24px; }
}

.section__label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 12px;
  position: sticky;
  top: 100px;
  align-self: start;
  height: fit-content;
}
.section__label .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
}
@media (max-width: 800px) {
  .section__label { position: static; }
}

.section__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 40px;
  max-width: 22ch;
}

.prose p {
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 1.4em;
  max-width: 62ch;
}
.prose p:last-child { margin-bottom: 0; }

/* ---------- OBJECTIVES ---------- */
.objectives {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.objective {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.objective:first-child { border-top: none; padding-top: 0; }
.objective:last-child { padding-bottom: 0; }

.objective__num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 28px;
  color: var(--ink);
  letter-spacing: 0;
}
.objective p {
  margin: 0;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.5;
  max-width: 56ch;
}

/* ---------- RESEARCHERS ---------- */
.researchers {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.researcher {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: clamp(24px, 4vw, 56px);
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
.researcher:first-child { border-top: none; padding-top: 0; }
.researcher:last-child { padding-bottom: 0; }

@media (max-width: 640px) {
  .researcher { grid-template-columns: 100px 1fr; gap: 20px; }
}

.researcher__portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Placeholder initials shown when no portrait image is available */
.researcher__portrait::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--ink);
  opacity: 0.55;
  z-index: 0;
}
.researcher__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.researcher__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  line-height: 1.1;
}
.researcher__role {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 16px;
}
.researcher__affil {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.5;
}
.researcher__bio {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  max-width: 56ch;
}

/* ---------- CONTACT ---------- */
.contact__lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.4;
  margin: 0 0 40px;
  max-width: 32ch;
  color: var(--ink);
}
.contact__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact__list li {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.contact__list li:last-child { border-bottom: 1px solid var(--rule); }
@media (max-width: 640px) {
  .contact__list li { grid-template-columns: 1fr; gap: 4px; padding: 16px 0; }
}
.contact__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.contact__list a {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--ink);
  transition: color 0.2s ease;
  word-break: break-word;
}
.contact__list a:hover { color: var(--accent); }

/* ---------- FOOTER ---------- */
.site-footer {
  padding: clamp(64px, 10vh, 100px) var(--pad-x) 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.footer__support {
  margin-bottom: 48px;
  max-width: 60ch;
}
.footer__support-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.footer__logos {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 5vw, 64px) clamp(40px, 6vw, 80px);
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.footer__logo {
  display: flex;
  align-items: center;
  min-height: 64px;
}
.footer__logo img {
  width: auto;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
.footer__logo img:hover { opacity: 1; }

/* University wordmark logos (UofT, Brock) — moderately tall */
.footer__logo--wordmark img {
  max-height: 56px;
  max-width: 200px;
  object-fit: contain;
}

/* Wide banner logos (Government of Canada / SSHRC signature) — much wider than tall */
.footer__logo--banner img {
  max-height: 28px;
  max-width: 320px;
  object-fit: contain;
}
@media (max-width: 640px) {
  .footer__logo--banner img { max-width: 260px; }
  .footer__logo--wordmark img { max-height: 48px; max-width: 160px; }
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.footer__dot { opacity: 0.5; }

/* ---------- Selection ---------- */
::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
