/* time.epochcipher.com. The tokens, fonts, resets and ec- classes come from
   shared/base.css (copied to /base.css at build, with /tokens.css beside it);
   this file holds only what this page adds. */

/* Header ------------------------------------------------------------------ */
/* The main site's header (sites/www/src/components/SiteHeader.astro), with a
   badge naming this host beside the mark, as the demo has. The rules are that
   component's; a change there is made here too. */
.hdr {
  border-bottom: 1px solid var(--ec-rule);
  background: var(--ec-ground);
}

.hdr__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.mark {
  display: inline-flex;
  line-height: 0;
}

.mark img {
  display: block;
  height: 28px;
  width: auto;
}

.badge {
  line-height: 1.3;
  color: var(--ec-graphite);
  border: 1px solid var(--ec-rule);
  border-radius: var(--ec-radius);
  padding: 0.1rem 0.45rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: var(--ec-step--1);
}

.nav a {
  white-space: nowrap;
}

.nav a:not(.nav__cta) {
  color: var(--ec-graphite);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
}

.nav a:not(.nav__cta):hover {
  color: var(--ec-ink);
  border-bottom-color: var(--ec-ink);
}

.nav__cta {
  padding: 0.42rem 0.85rem;
  font-size: var(--ec-step--1);
}

/* Narrow: the four links take a row of their own and the contact button
   moves up beside the logo, so nothing wraps mid-label. */
@media (max-width: 44rem) {
  .hdr__in {
    position: relative;
  }
  .nav {
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
  }
  .nav__cta {
    position: absolute;
    top: 0.8rem;
    right: var(--ec-gutter);
  }
}

/* Page -------------------------------------------------------------------- */
/* One column on a phone, with the code first: that is what the phone is held
   up for. Two on a wide screen: what to do on the left, the code on the right. */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-block: clamp(1.5rem, 4vw, 3.5rem);
}

.now {
  order: -1;
}

@media (min-width: 56rem) {
  .page {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
  }

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

  .now {
    order: 0;
  }
}

h1 {
  font-size: var(--ec-step-3);
  margin-bottom: 1rem;
}

.lede {
  font-size: var(--ec-step-1);
  line-height: 1.45;
}

.steps {
  max-width: var(--ec-measure);
  margin: 1.5rem 0;
  padding-left: 1.4em;
}

.steps li {
  margin-bottom: 0.6em;
  padding-left: 0.3em;
}

.steps li::marker {
  font-family: var(--ec-font-ui);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The code -------------------------------------------------------------- */
/* Always dark on white, whatever the page around it: a scanner wants the
   contrast, and the white edge is part of the symbol. As wide as its column,
   but never so tall that the code and the time under it leave the screen. */
.plate {
  background: #ffffff;
  border: 1px solid var(--ec-rule);
  border-radius: var(--ec-radius);
  margin: 0 0 1rem;
  padding: 0;
  width: min(100%, 34rem, max(16rem, 100vh - 17rem));
  aspect-ratio: 1;
}

.plate svg {
  display: block;
  width: 100%;
  height: 100%;
}

#qr-ground {
  fill: #ffffff;
}

#qr-modules {
  fill: #000000;
}

.plate[data-state="none"] {
  background: var(--ec-rule-soft);
}

.plate[data-state="none"] #qr-ground {
  fill: var(--ec-rule-soft);
}

.code,
.mono {
  font-family: var(--ec-font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
}

.code {
  font-weight: 500;
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}

.mono {
  font-size: 0.92em;
  white-space: nowrap;
}

.words {
  font-family: var(--ec-font-ui);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

.status,
.note {
  font-family: var(--ec-font-ui);
  font-size: var(--ec-step--1);
  line-height: 1.5;
  color: var(--ec-graphite);
}

/* Said in words and in weight, never by colour alone. */
.status[data-state="problem"] {
  color: var(--ec-ink);
  font-weight: 600;
}

/* Footer ------------------------------------------------------------------ */
.ftr {
  border-top: 1px solid var(--ec-rule);
  margin-top: 2rem;
  font-family: var(--ec-font-ui);
  font-size: var(--ec-step--1);
  color: var(--ec-graphite);
}

.ftr__in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-block: 1.5rem 2.5rem;
}

.ftr p {
  margin: 0;
}
