/* CMST Signals — site styles.
   Colours and fonts for Bootstrap are set in theme.scss; everything else is here. */

@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stix-two-text-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stix-two-text-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/stix-two-text-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #FAFBFC;
  --panel: #F0F3F6;
  --ink: #10202F;
  --muted: #536273;
  --rule: #D3DAE2;
  --accent: #00637F;
  --series-smooth: #00789A;
  --series-hann: #B8620E;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: 1080px;
  --gutter: clamp(20px, 5vw, 48px);
  --label-col: 220px;
}

/* ---- page frame --------------------------------------------------------- */

.site-main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- navbar ------------------------------------------------------------- */

.navbar {
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.navbar > .container-fluid {
  max-width: var(--page);
  padding: 0 var(--gutter);
}
.navbar .navbar-brand {
  font-family: "STIX Two Text", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.005em;
}
.navbar .nav-link {
  font-size: 0.86rem;
  font-weight: 500;
}
.navbar .navbar-nav .nav-link.active { color: var(--ink); }

/* ---- opening ------------------------------------------------------------ */

.opening {
  padding: clamp(48px, 9vw, 104px) 0 clamp(28px, 4vw, 44px);
  max-width: 21em;            /* measured in h1 ems via the font-size below */
  font-size: clamp(2.05rem, 4.6vw, 3.3rem);
}
.opening h1 {
  font-size: 1em;
  line-height: 1.1;
  letter-spacing: -0.012em;
  font-weight: 600;
  margin: 0;
  border: 0;
  padding: 0;
  text-wrap: balance;
}
.lede {
  max-width: 62ch;
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 1.6rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: clamp(36px, 6vw, 64px);
}
.actions p { margin: 0; display: contents; }
.actions a.primary {
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.15rem;
  border-radius: 3px;
  text-decoration: none;
}
.actions a.primary:hover { background: var(--accent); }
.actions a:not(.primary) { text-underline-offset: 0.2em; }

/* ---- figure ------------------------------------------------------------- */

.decay {
  margin: 0 0 clamp(48px, 8vw, 88px);
  padding: clamp(14px, 2.4vw, 26px) clamp(8px, 2vw, 22px) clamp(12px, 2vw, 18px);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.decay-plot { display: block; width: 100%; height: auto; }
.decay-plot text { font-family: var(--sans); fill: var(--muted); }
.decay-plot .tick { font-size: 12px; font-variant-numeric: tabular-nums; }
.decay-plot .axis-title { font-size: 12.5px; }
.decay-plot .label { font-size: 14px; font-weight: 600; fill: var(--ink); }
.decay-plot .grid { stroke: var(--rule); stroke-width: 1; opacity: 0.6; }
.decay-plot .axis { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.decay-plot .series {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
}
.decay-plot path.series-hann { stroke: var(--series-hann); }
.decay-plot path.series-smooth { stroke: var(--series-smooth); }
.decay-plot .dot { stroke: #fff; stroke-width: 2; }
.decay-plot circle.series-hann { fill: var(--series-hann); }
.decay-plot circle.series-smooth { fill: var(--series-smooth); }
.decay figcaption, .decay .caption {
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 78ch;
  margin: 0.6rem 0 0;
  padding: 0 clamp(4px, 1vw, 12px);
}
.decay .caption p { margin: 0; }

/* ---- sections: heading in the left column, body on the right ------------- */

.part {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: clamp(24px, 4vw, 56px);
  border-top: 1px solid var(--rule);
  padding: clamp(28px, 4.5vw, 48px) 0 clamp(32px, 5vw, 56px);
}
.part > h2 {
  grid-column: 1;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
}
.part > :not(h2) { grid-column: 2; max-width: 66ch; }
.part p { margin: 0 0 1rem; }
.part > :last-child, .part > :last-child > :last-child { margin-bottom: 0; }

/* properties and talks: term / description pairs */
.part dl { margin: 0.4rem 0 0; }
.part dl + p { margin-top: 1.4rem; }
.part dt {
  font-weight: 600;
  margin-top: 1.15rem;
}
.part dl > dt:first-child { margin-top: 0; }
.part dd { margin: 0.15rem 0 0; color: var(--ink); }
.talks dt { font-style: italic; font-weight: 400; }
.talks dd {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--muted);
}

.contact-line { font-size: 1.3rem; }
.contact-line a { text-underline-offset: 0.18em; }

/* ---- footer ------------------------------------------------------------- */

.nav-footer {
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.6;
  padding: 1.5rem 0 2rem;
  min-height: 0;
  margin-top: clamp(24px, 4vw, 48px);
}
.nav-footer .nav-footer-left {
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: left;
  flex: 1 1 100%;
}
.nav-footer .nav-footer-left p { margin: 0; }
.nav-footer .nav-footer-center, .nav-footer .nav-footer-right { display: none; }

/* ---- focus, small screens ---------------------------------------------- */

a:focus-visible, .navbar-toggler:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
  box-shadow: none;
}

@media (max-width: 760px) {
  .part { grid-template-columns: minmax(0, 1fr); }
  .part > h2, .part > :not(h2) { grid-column: 1; }
  .part > h2 { margin: 0 0 0.9rem; }
  .decay-plot .tick, .decay-plot .axis-title { font-size: 23px; }
  .decay-plot .label { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}
