/* LeanVersity design system.
   An old university's habits: ivory paper and black ink, one face (EB
   Garamond) with real small capitals, square corners and ruled lines, a gown
   masthead with the crest at its head, and gilt for what is ceremonial.
   Every colour, length and face below is a token; components use only these.
   DESIGN.md documents them, and /design shows them live. */

@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/eb-garamond.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400 800; font-display: swap; src: url("fonts/eb-garamond-italic.woff2") format("woff2"); }

:root {
  /* Type */
  --serif: "EB Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Colour: reading */
  --paper: #F7F3EA;
  --surface: #FFFDF8;
  --ink: #1F1C17;
  --muted: #5E574B;
  --rule: #D6CBB6;
  --logo-ground: #FFFFFF;

  /* Colour: action */
  --accent: #1F4380;
  --accent-soft: #DDE4EF;
  --on-accent: #FFFFFF;

  /* Colour: ceremony */
  --gown: #14213D;
  --on-gown: #F1ECE0;
  --on-gown-muted: #B3B9C8;
  --gown-rule: #2A3858;
  --gilt: #C9A24A;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  /* Shape: square, as on paper */
  --radius-sm: 2px;
  --radius-md: 2px;

  /* Measure */
  --measure: 40rem;
  --wide: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13151C;
    --surface: #1B1E27;
    --ink: #EDE7DA;
    --muted: #A8A193;
    --rule: #343846;
    --accent: #9DB7E4;
    --accent-soft: #24304A;
    --on-accent: #0B1222;
    --gown: #0B1428;
    --on-gown: #F1ECE0;
    --on-gown-muted: #A9B1C3;
    --gown-rule: #222E48;
    --gilt: #C9A24A;
    color-scheme: dark;
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 2.5rem);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
}

main:has(.frontpage) { max-width: calc(var(--wide) + 2.5rem); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: lining-nums;
}

/* The page title, centred over a short gilt rule, as on a title page. */
main h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  text-align: center;
  margin: 0 0 2.25rem;
}

main h1::after {
  content: "";
  display: block;
  width: 4rem;
  margin: 1.1rem auto 0;
  border-top: 2px solid var(--gilt);
}

main h2 {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  margin: 3rem 0 1rem;
}

main h3 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }

p { margin: 0 0 1em; }

/* The opening paragraph of a page reads as a lede. */
article > h1 + p {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 1.5em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover { text-decoration-thickness: 2px; }

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

ul, ol { padding-left: 1.25rem; }
li > p { margin: 0.2em 0; }
img { max-width: 100%; height: auto; }

hr { border: none; border-top: 3px double var(--rule); margin: 2.5em 0; }

/* Labels: small capitals, tracked. Blue on paper, gilt on gown. */
.eyebrow, .science .library, .chip, .course .track, .course .facts dt,
.campus .kind, .person .role, .project .link.soon, .footer-column h2,
.utility-bar .founded, .button, .site-nav ul a {
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  letter-spacing: 0.09em;
  font-weight: 600;
}

/* Utility bar: the thin gown band above the masthead */

.utility-bar { background: var(--gown); color: var(--on-gown-muted); font-size: 0.85rem; border-bottom: 1px solid var(--gown-rule); }

.utility-inner {
  max-width: calc(var(--wide) + 2.5rem);
  margin: 0 auto;
  padding: var(--space-1) 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}

.utility-bar .founded { color: var(--gilt); }
.utility-bar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-4); }
.utility-bar a { color: var(--on-gown-muted); text-decoration: none; }
.utility-bar a:hover, .utility-bar a[aria-current="page"] { color: var(--on-gown); text-decoration: underline; text-decoration-color: var(--gilt); }

/* Masthead: the crest over the name, and the main tabs beneath, on gown */

.site-header { background: var(--gown); color: var(--on-gown); border-bottom: 3px solid var(--gilt); }

.site-nav {
  max-width: calc(var(--wide) + 2.5rem);
  margin: 0 auto;
  padding: var(--space-4) 1.25rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.site-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--on-gown);
}

/* Optical centring: the tracking adds space after the last letter. */
.site-name span { margin-right: -0.2em; }
.site-name .crest { width: auto; height: 3.6rem; }
.site-name:hover { color: var(--on-gown); text-decoration: none; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 2rem;
  border-top: 1px solid var(--gown-rule);
}

.site-nav ul a {
  display: block;
  padding: 0.6rem 0 0.55rem;
  font-size: 1.05rem;
  color: var(--on-gown-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}

.site-nav ul a:hover { color: var(--on-gown); }
.site-nav ul a[aria-current="page"] { color: var(--on-gown); border-bottom-color: var(--on-gown); }

/* Footer: the gown band with the crest and the motto */

.site-footer { background: var(--gown); color: var(--on-gown-muted); font-size: 0.95rem; border-top: 3px solid var(--gilt); }
.site-footer p { margin: 0; }

.footer-inner {
  max-width: calc(var(--wide) + 2.5rem);
  margin: 0 auto;
  padding: var(--space-6) 1.25rem var(--space-5);
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.footer-brand { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-brand .crest { align-self: flex-start; width: auto; height: 3.5rem; margin-bottom: var(--space-2); }
.footer-name { font-size: 1.4rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-gown); }
.motto { font-size: 1.1rem; color: var(--gilt); }
.motto-en { font-style: italic; max-width: 24rem; }

.footer-column h2 {
  font-size: 0.95rem;
  color: var(--gilt);
  margin: 0 0 var(--space-3);
}

.footer-column ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer a { color: var(--on-gown); text-decoration: none; }
.site-footer a:hover { color: var(--on-gown); text-decoration: underline; text-decoration-color: var(--gilt); }

.footer-base {
  max-width: calc(var(--wide) + 2.5rem);
  margin: 0 auto;
  padding: var(--space-3) 1.25rem var(--space-4);
  border-top: 1px solid var(--gown-rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  font-size: 0.85rem;
}

/* Front page: a centred title page, then ruled sections */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0 3rem;
}

.hero-crest { order: -1; margin: 0 0 var(--space-4); }
.hero-crest img { display: block; width: auto; height: 9rem; }

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero .eyebrow::before, .hero .eyebrow::after { content: ""; width: 3rem; border-top: 1px solid var(--gilt); }

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 500;
  line-height: 1;
  margin: 0 0 1.75rem;
}

.hero h1::after { display: none; }

.hero-lede p { font-size: 1.3rem; line-height: 1.55; max-width: 34rem; margin-left: auto; margin-right: auto; }

/* Front-page sections: the heading sits in a narrow left column. */
.frontpage > section:not(.hero) {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 0 3rem;
  padding: 2.75rem 0;
  border-top: 3px double var(--rule);
}

.frontpage > section:not(.hero) > :not(h2) { grid-column: 2; }

.frontpage > section:not(.hero) > h2 {
  font-size: 1.6rem;
  margin: 0;
}

.frontpage > section:not(.hero) > h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  margin-bottom: 0.75rem;
  border-top: 2px solid var(--gilt);
}

/* Cards: square, ruled, with a blue head rule */

.path, .science, .course, .campus, .person {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
}

.paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.path {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s;
}

.path .emblem { font-size: 2.6rem; line-height: 1; }
.path .name { font-size: 1.6rem; font-weight: 500; line-height: 1.2; }
.path .description p { margin: 0; color: var(--muted); }
.path .link { margin-top: auto; padding-top: 0.75rem; color: var(--accent); font-style: italic; }

a.path:hover { color: inherit; border-color: var(--accent); }
a.path:hover .name { color: var(--accent); }

.sciences {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
}

.science { padding: 1.25rem 1.4rem; }

.frontpage .science h3 { font-size: 1.3rem; margin: 0 0 0.35rem; }
.science .library { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--accent); }
.science .description p { margin: 0; color: var(--muted); }

/* Buttons and chips: square, in small capitals */

.actions { margin: var(--space-4) 0 0; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1.3rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.05rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.button:hover { background: transparent; color: var(--accent); text-decoration: none; }

.chip {
  display: inline-block;
  padding: 0.15rem 0.75rem 0.25rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--accent);
}

/* Courses */

.courses { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-4) 0; }

.course { padding: var(--space-4); }

.course .track { margin: 0 0 var(--space-1); font-size: 0.95rem; color: var(--accent); }

main .course h3 { font-size: 1.75rem; margin: 0 0 var(--space-3); }
.course h3 a { color: inherit; text-decoration: none; }
.course h3 a:hover { color: var(--accent); }

.course .facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.course .facts dt { font-size: 0.9rem; color: var(--muted); }
.course .facts dd { margin: 0; }
.course .description p:last-child { margin-bottom: 0; }

/* Goals: the mission's figures */

.goals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.goal { padding-top: var(--space-3); border-top: 3px solid var(--gilt); }
.goal .figure { font-size: clamp(3.5rem, 8vw, 5rem); font-weight: 500; line-height: 1; margin: 0 0 var(--space-2); color: var(--ink); font-variant-numeric: lining-nums; }
.goal .label { font-weight: 600; margin: 0 0 var(--space-1); }
.goal .detail p { margin: 0; color: var(--muted); }

/* Campuses */

.campuses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.campus {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}

.campus .kind { margin: 0; font-size: 0.95rem; color: var(--accent); }

main .campus h3 { font-size: 1.75rem; margin: 0; }
.campus .description p { margin: 0 0 var(--space-2); color: var(--muted); }
.campus .foot { margin-top: auto; padding-top: var(--space-2); }

/* Signature, under a statement */

.signature {
  display: flex;
  flex-direction: column;
  margin: var(--space-5) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--gilt);
  max-width: 20rem;
}

.signature .name { font-size: 1.5rem; font-style: italic; }
.signature .role { color: var(--muted); font-variant-caps: small-caps; letter-spacing: 0.04em; }

/* Swatches, on the design page */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
}

.swatch { display: flex; flex-direction: column; gap: var(--space-1); }
.swatch .sample { display: block; height: 3.5rem; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.swatch code { font-size: 0.8rem; }
.swatch .usage p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* People: portraits are upright, as in a college hall */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.person { padding: 1.25rem; }

.person .portrait {
  display: block;
  width: 6rem;
  height: 7.5rem;
  object-fit: cover;
  border: 1px solid var(--rule);
  margin-bottom: 1rem;
}

.person .role { margin: 0 0 0.25rem; font-size: 0.95rem; color: var(--accent); }

main .person h3 { font-size: 1.35rem; margin: 0 0 0.4rem; }
.person h3 a { color: inherit; text-decoration: none; }
.person h3 a:hover { color: var(--accent); }
.person .bio p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.person.vacancy { background: transparent; border-style: dashed; border-top-style: dashed; border-top-color: var(--rule); }
.person.vacancy .portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--rule);
  font-size: 2.2rem;
  font-style: italic;
  color: var(--muted);
}
.person.vacancy h3 { color: var(--muted); }

/* Projects */

.projects { list-style: none; margin: 2.5rem 0 0; padding: 0; border-top: 3px double var(--rule); }
.projects li { border-bottom: 1px solid var(--rule); }

.project {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 0;
  color: inherit;
  text-decoration: none;
}

.project .logo {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  background: var(--logo-ground);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
}

.project .logo img { width: 100%; height: 100%; object-fit: contain; }

.project .name { font-size: 1.45rem; font-weight: 500; line-height: 1.2; }
.project .description p { margin: 0.2rem 0 0; color: var(--muted); }

.project .link {
  font-style: italic;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s;
}

.project .link.soon { font-style: normal; font-size: 0.95rem; color: var(--accent); }

a.project:hover { color: inherit; text-decoration: none; }
a.project:hover .name, a.project:hover .link { color: var(--accent); }

/* Quotes: set in italic between gilt rules, like an epigraph */

.pullquote {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-style: italic;
  line-height: 1.3;
  text-align: center;
  margin: 2.5rem auto;
  padding: 1.5rem 1rem;
  max-width: 40rem;
  border-top: 1px solid var(--gilt);
  border-bottom: 1px solid var(--gilt);
}

.pullquote p { margin: 0; }
.pullquote p + p { margin-top: 0.75rem; font-style: normal; font-size: 1.05rem; font-variant-caps: small-caps; letter-spacing: 0.06em; color: var(--muted); }

/* Code */

code, pre { font-family: var(--mono); font-size: 0.8em; }

pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

/* Small screens */

@media (max-width: 760px) {
  html { font-size: 18px; }
  main { padding-top: 2.25rem; }

  .site-name { font-size: 1.5rem; }
  .site-name .crest { height: 2.8rem; }
  .site-nav ul { gap: 0 1.25rem; padding: 0.3rem 0; }
  .site-nav ul a { padding: 0.3rem 0 0.25rem; }

  .frontpage > section:not(.hero) { grid-template-columns: 1fr; gap: 1.25rem; }
  .frontpage > section:not(.hero) > :not(h2) { grid-column: 1; }

  .hero-crest img { height: 6rem; }

  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
  .footer-brand { grid-column: 1 / -1; }

  .project { grid-template-columns: 3.25rem minmax(0, 1fr); gap: 1rem; }
  .project .logo { width: 3.25rem; height: 3.25rem; }
  .project .link { grid-column: 2; }
}
