/* BSMM site styles
   Colours, type sizes and layout measurements are variables in :root. */

@font-face {
  font-family: "Sofia Sans";
  src: url("../fonts/sofia-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("../fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2") format("woff2");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Palette, named after the parts of a longcase clock */
  --dial: #ffffff;      /* enamel dial: page background */
  --ink: #000000;       /* text */
  --graphite: #5e5e5e;  /* secondary text */
  --hairline: #cccccc;  /* the pendulum rod and page rule */
  --steel: #26348f;     /* blued steel: pendulum bob and focus ring */

  --sans: "Sofia Sans", "Helvetica Neue", Arial, sans-serif;
  --tall: "Sofia Sans Extra Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;

  --t-small: 0.9375rem;
  --t-body: 1.125rem;
  --t-head: 1.3125rem;
  --t-lede: 1.5rem;
  --t-sub: 2.25rem;
  --t-title: clamp(3rem, 1.9rem + 5.2vw, 6rem);
  --t-display: clamp(3.25rem, 0.6rem + 8.8vw, 9rem);

  --max: 90rem;
  --margin: clamp(1.25rem, 4vw, 4rem);
  --meta: clamp(12rem, 27vw, 25rem);
  --gap: clamp(2.5rem, 5vw, 5rem);
  --rule-x: calc(var(--margin) + var(--meta));
  --bob: 1.5rem;
  --hero-pad: clamp(3rem, 8vh, 6rem);
  --header-h: 5.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --dial: #000000;
    --ink: #ffffff;
    --graphite: #a3a3a3;
    --hairline: #3d3d3d;
    --steel: #8c9bff;
  }
}

/* Base */

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: var(--dial);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, dl, dd {
  margin: 0;
}

h1, h2, h3 {
  font-size: inherit;
  font-weight: inherit;
}

ol, ul {
  padding: 0;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 4px;
}

::selection {
  background: var(--steel);
  color: var(--dial);
}

.skip {
  position: absolute;
  top: 0.75rem;
  left: var(--margin);
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--dial);
  text-decoration: none;
  transform: translateY(-300%);
}

.skip:focus {
  transform: none;
}

.caps {
  letter-spacing: 0.05em;
}

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

/* Grid: every page hangs off one vertical line at --rule-x.
   Labels sit to its left, content to its right. */

.frame {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
}

.cols {
  display: grid;
  grid-template-columns: var(--margin) var(--meta) minmax(0, 1fr) var(--margin);
  align-items: baseline;
}

.meta {
  grid-column: 2;
  padding-right: var(--gap);
  text-align: right;
}

.main-col {
  grid-column: 3;
  padding-left: var(--gap);
}

.ruled {
  background-image:
    linear-gradient(var(--hairline), var(--hairline)),
    linear-gradient(var(--hairline), var(--hairline));
  background-repeat: no-repeat;
  background-size: 1px 100%, 9px 1px;
  background-position: var(--rule-x) 0, calc(var(--rule-x) - 4px) 0;
}

/* Header */

.site-header {
  padding-block: 1.75rem 1.25rem;
}

.wordmark {
  grid-column: 2;
  justify-self: start;
  font-family: var(--tall);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.site-nav {
  grid-column: 3;
  padding-left: var(--gap);
  font-size: 1.0625rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
}

.site-nav a {
  color: var(--graphite);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  text-decoration-line: underline;
}

/* Page openings */

.intro {
  padding-block: clamp(3.5rem, 9vw, 8rem) clamp(4rem, 9vw, 8.5rem);
}

.title {
  font-family: var(--tall);
  font-size: var(--t-title);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.lede {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 30em;
  font-size: var(--t-lede);
  font-weight: 450;
  line-height: 1.35;
  text-wrap: pretty;
}

.address {
  margin-top: clamp(2rem, 4vw, 3rem);
  font-family: var(--tall);
  font-size: clamp(2rem, 1rem + 3.4vw, 3.75rem);
  font-weight: 300;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.address a {
  text-decoration-thickness: 0.035em;
  text-underline-offset: 0.12em;
}

.address a:hover {
  text-decoration-thickness: 0.07em;
}

/* Content rows */

.row {
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}

.row:last-child {
  padding-bottom: clamp(5rem, 10vw, 9rem);
}

.row-head {
  font-size: var(--t-head);
  font-weight: 680;
  line-height: 1.25;
  text-wrap: balance;
}

.row-body > * {
  max-width: 34em;
}

.row-body > * + * {
  margin-top: 1.5rem;
}

.specs {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.5rem 2.5rem;
}

.specs dt {
  color: var(--graphite);
}

.specs dd,
.people dd {
  font-variant-numeric: tabular-nums lining-nums;
}

.people {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 0.625rem 2rem;
  max-width: 26em;
}

.people dd {
  color: var(--graphite);
  text-align: right;
}

.terms dt {
  font-weight: 680;
}

.terms dd {
  margin-top: 0.25rem;
}

.terms dd + dt {
  margin-top: 1.5rem;
}

.plain {
  list-style: none;
}

.plain li + li {
  margin-top: 0.75rem;
}

/* Decision steps: a real sequence, so they are numbered */

.steps {
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  column-gap: 1.25rem;
  align-items: baseline;
}

.steps li + li {
  margin-top: 2rem;
}

.steps li::before {
  content: counter(step);
  font-family: var(--tall);
  font-size: var(--t-sub);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: lining-nums proportional-nums;
}

.steps h3 {
  font-weight: 680;
}

/* History */

.timeline {
  list-style: none;
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}

.timeline li + li {
  margin-top: 2.25rem;
}

.year {
  font-family: var(--tall);
  font-size: var(--t-sub);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: lining-nums proportional-nums;
}

.timeline .main-col {
  max-width: calc(34em + var(--gap));
}

/* Home */

.hero {
  position: relative;
  min-height: max(34rem, calc(min(100svh, 72rem) - var(--header-h)));
  align-items: end;
  padding-bottom: var(--hero-pad);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--rule-x) - 4px);
  width: 9px;
  height: 1px;
  background: var(--hairline);
}

.pendulum {
  position: absolute;
  top: 0;
  bottom: var(--hero-pad);
  left: var(--rule-x);
  width: 1px;
  background: var(--hairline);
  transform-origin: 50% 0;
}

.bob {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--bob);
  height: var(--bob);
  margin-left: calc(var(--bob) / -2);
  border-radius: 50%;
  background: var(--steel);
}

.display {
  font-family: var(--tall);
  font-size: var(--t-display);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.01em;
  max-width: 8.5em;
  text-wrap: balance;
}

.hero .lede {
  margin-top: clamp(1.75rem, 3.5vw, 3rem);
}

.index {
  padding-block: clamp(4rem, 9vw, 8rem) clamp(5rem, 10vw, 9rem);
}

.index ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 4vw, 3.5rem) var(--gap);
}

.index a {
  font-family: var(--tall);
  font-size: var(--t-sub);
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
}

.index a:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 0.04em;
}

.index p {
  margin-top: 0.5rem;
  max-width: 22em;
  color: var(--graphite);
}

/* Footer */

.site-footer {
  padding-block: 2rem 2.5rem;
  color: var(--graphite);
  font-size: var(--t-small);
}

/* Small screens: the rule moves to the left edge and labels stack above content */

@media (max-width: 44.99rem) {
  :root {
    --t-body: 1.0625rem;
    --t-head: 1.1875rem;
    --t-lede: 1.25rem;
    --t-sub: 1.875rem;
    --meta: 0.625rem;
    --gap: 1.875rem;
    --bob: 1rem;
    --header-h: 7rem;
  }

  .meta {
    grid-column: 3;
    padding-right: 0;
    padding-left: var(--gap);
    text-align: left;
  }

  .row-head,
  .year {
    margin-bottom: 0.5rem;
  }

  .wordmark {
    grid-column: 3;
    margin-left: var(--gap);
  }

  .site-nav {
    margin-top: 0.75rem;
  }

  .site-nav ul {
    gap: 0.25rem 1.25rem;
  }

  .index ul {
    grid-template-columns: minmax(0, 1fr);
  }
}
