/* Exam Society: one page, one stylesheet. No script, nothing from another host. */

/* The page's three typefaces, served from this site (licences in fonts/). */
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-bold-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #fff;
  --grey: #969696;          /* the old page's copyright grey, rgb(150,150,150): 7.4:1 on black */
  --black: #000;
  --band: #161616;          /* what shows behind the photograph while it loads */
  --veil: rgba(0, 0, 0, 0.32);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --caps: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --sans: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
  --edge: 24px;             /* side margin and the gap above the name */
}

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

html {
  background: var(--black);
  color: var(--white);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* One screen: the photograph takes all the height the copyright band does not. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 1 0 auto;
  min-height: 20rem;          /* 320px: a phone held sideways (390px tall) still sees one screen */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* the bottom padding mirrors the name's block, so the big line sits at the true centre of the photograph */
  padding: var(--edge) var(--edge) calc(var(--edge) * 2 + 1.2em);
  font-size: 22px;          /* = the name's size; drives the 1.2em above */
  text-align: center;
  background: var(--band);
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;  /* each picture file is cut around its focus point, so the centre is the focus */
}

/* The darkened photograph, as on the old page: one even veil, no gradient. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--veil);
}

.name {
  margin: 0 -4px 0 0;        /* the last letter's spacing would push the word 2px left of centre */
  font: 700 1em/1.2 var(--caps);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.line {
  margin: auto 0;
  max-width: 15em;
  font: 400 40px/1.2 var(--serif);
  text-wrap: balance;
}

.foot {
  padding: 20px var(--edge);
  background: var(--black);
  color: var(--grey);
  text-align: center;
  font-size: 14px;
  line-height: 21px;
}
.foot p { margin: 0; }

/* The page not found: same frame, a smaller line and one link home, centred together. */
.msg { margin: auto 0; }
.msg .line { margin: 0; }
.line--small { font-size: 32px; }
.home {
  margin: 16px 0 0;
  font: 400 18px/1.4 var(--sans);
}
/* Small text over a photograph cannot rely on the picture for contrast: the link carries its own dark ground. */
.home a {
  display: inline-block;
  padding: 10px 20px;        /* a 46px target */
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  text-decoration: none;
}
.home a:hover { background: rgba(0, 0, 0, 0.7); border-color: var(--white); }
.home a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Tablet: the old page's sizes at 768px. */
@media (min-width: 768px) {
  .hero { font-size: 24px; }
  .line { font-size: 48px; }
  .line--small { font-size: 40px; }
}

/* Wide: the old page's sizes at 1440px. */
@media (min-width: 1200px) {
  :root { --edge: 28px; }
  .hero { font-size: 26px; }
  .line { font-size: 62px; }
  .line--small { font-size: 48px; }
}
