/*
 * The pair of STATIC: one typeface, one weight, two sizes, near-white paper, structure from space and hairlines.
 * Red means one thing only: the time between a site's first certificate and its listing.
 */

@font-face {
  font-family: "Helvetica Now Display";
  src: url("/static/fonts/HelveticaNowDisplayMedium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fafafa;
  --ink: #0a0a0a;
  --mute: #6b6b6b;
  --rule: #d9d9d9;
  --fill: #e6e6e4;
  --red: #e00b00;
  --gutter: 16px;
  --size: 17px;
  --lead: 1.38;
}

@media (min-width: 900px) {
  :root {
    --gutter: 24px;
    --size: 18px;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: var(--size);
  font-synthesis-weight: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Now Display", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: var(--lead);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

h1,
h2,
h3,
b,
strong,
th,
dt {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

p,
ol,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

p a,
dd a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red);
}

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

code {
  font: inherit;
  overflow-wrap: anywhere;
}

/* top and bottom */

.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.2rem 1.5rem;
  padding: var(--gutter);
}

.top nav {
  display: flex;
  gap: 1.1em;
}

.top nav a {
  color: var(--mute);
}

.top nav a[aria-current],
.top nav a:hover {
  color: var(--ink);
}

.foot {
  margin-top: 4rem;
  padding: var(--gutter);
  border-top: 1px solid var(--rule);
  color: var(--mute);
  display: grid;
  gap: 0.5rem;
  max-width: 62rem;
  text-wrap: pretty;
}

/* text */

.lead {
  font-size: 1.55rem;
  line-height: 1.16;
  letter-spacing: 0;
  text-wrap: balance;
  max-width: 24em;
}

.lead .big {
  color: var(--red);
}

@media (min-width: 900px) {
  .lead {
    font-size: 2rem;
  }
}

.note {
  color: var(--mute);
  text-wrap: pretty;
  max-width: 46rem;
}

h2 {
  margin-top: 2.2rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--ink);
}

h3 {
  margin-top: 0.6rem;
}

.column {
  padding: 1.5rem var(--gutter) 0;
  display: grid;
  gap: 1rem;
  max-width: 46rem;
  min-width: 0;
}

.column.wide {
  max-width: 68rem;
}

.column > * {
  min-width: 0;
}

.column > p {
  text-wrap: pretty;
  max-width: 46rem;
}

.column > h2 {
  margin-top: 1.6rem;
}

/* charts */

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid {
  stroke: var(--rule);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart .lab,
.heat .lab {
  fill: var(--mute);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.heat .lab {
  font-size: 14px;
}

.chart .band {
  fill: var(--fill);
}

.chart .band1 {
  stroke: var(--fill);
  stroke-width: 3;
}

.chart .med {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart .pt {
  fill: var(--red);
}

.chart .bar {
  fill: var(--ink);
}

.chart.small {
  max-width: 46rem;
}

.only-narrow {
  display: none;
}

@media (max-width: 700px) {
  svg.only-wide {
    display: none;
  }

  svg.only-narrow {
    display: block;
  }
}

.heat {
  display: block;
  width: 100%;
  max-width: 46rem;
  height: auto;
}

.heat rect {
  fill: var(--ink);
}

/* the strip: one listed domain per row, every row ending at its own listing */

.axis {
  position: relative;
  height: 1.4rem;
  color: var(--mute);
  margin: 0 13.5rem 0 16rem;
}

.axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* positions on the log scale from two years (left) to one minute (right): see web/charts.py */
.axis .ax-y { left: 5%; }
.axis .ax-mo { left: 23%; }
.axis .ax-w { left: 33.5%; }
.axis .ax-d { left: 47.6%; }
.axis .ax-h { left: 70.5%; }
.axis .ax-l { left: auto; right: 0; transform: none; }

.strip li,
.rows li,
.rows summary {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 6.5rem 5rem;
  column-gap: 1rem;
  align-items: center;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--rule);
}

.rows li {
  display: block;
  padding: 0;
}

.rows.plain li,
.rows summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9rem 5rem;
  padding: 0.42rem 0;
}

.rows summary {
  border-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.rows summary::-webkit-details-marker {
  display: none;
}

.rows summary:hover .d {
  color: var(--red);
}

.rows .proof {
  color: var(--mute);
  padding: 0 0 0.7rem;
  max-width: 46rem;
  text-wrap: pretty;
}

.strip .d,
.rows .d {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.strip .w,
.rows .w {
  text-align: right;
  white-space: nowrap;
}

.strip .w.off,
.rows .w.off,
.when {
  color: var(--mute);
}

.when {
  text-align: right;
  white-space: nowrap;
}

.track {
  display: block;
  width: 100%;
  height: 1.3rem;
}

.track line {
  vector-effect: non-scaling-stroke;
  stroke-linecap: butt;
}

.track .pre {
  stroke: #bdbdbb;
  stroke-width: 1;
}

.track .win {
  stroke: var(--red);
  stroke-width: 3;
}

.track .tick {
  stroke-width: 1.5;
}

.track .tick.reg {
  stroke: #9a9a98;
}

.track .tick.cert,
.track .tick.listed {
  stroke: var(--ink);
}

.key .track {
  display: inline-block;
  width: 3.4rem;
  height: 1.1rem;
  vertical-align: -0.22rem;
  margin-right: 0.3rem;
}

@media (max-width: 760px) {
  .axis {
    margin: 0;
  }

  .axis .ax-y {
    transform: none;
  }

  .axis .ax-mo {
    display: none;
  }

  .strip li {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "d w" "t t";
    row-gap: 0.15rem;
  }

  .strip .d { grid-area: d; }
  .strip .w { grid-area: w; }
  .strip .t { grid-area: t; }
  .strip .when { display: none; }

  .rows.plain li,
  .rows summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .rows .when {
    display: none;
  }
}

/* facts and tables */

.facts {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  max-width: 46rem;
}

.facts dt {
  color: var(--mute);
}

@media (max-width: 600px) {
  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .facts dd {
    margin-bottom: 0.6rem;
  }
}

.scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
}

th,
td {
  text-align: left;
  padding: 0.38rem 1rem 0.38rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
  white-space: nowrap;
}

th {
  color: var(--mute);
}

td.n,
th.n {
  text-align: right;
  padding-right: 0;
  padding-left: 1rem;
}

td.b,
th.b {
  width: 34%;
  padding-right: 0;
  padding-left: 1rem;
}

.hbar {
  display: block;
  width: 100%;
  height: 0.55rem;
}

.hbar rect {
  fill: var(--ink);
}

@media (max-width: 600px) {
  td.b,
  th.b {
    display: none;
  }
}

td:first-child,
th:first-child {
  white-space: normal;
  overflow-wrap: anywhere;
}
