@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/EBGaramond.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/EBGaramond-Italic.ttf') format('truetype');
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond Initials';
  src: url('fonts/EBGaramond-Initials.otf') format('opentype');
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  background: #fff;
  color: #000;
  font: 400 21px/1.5 'EB Garamond', 'Hoefler Text', Garamond, Georgia, serif;
  font-variant-numeric: oldstyle-nums;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  padding: 1.2rem 1.4rem 4rem;
  max-width: 34rem;
}

a { color: inherit; }

/* language switch */
.switch {
  text-align: right;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}
.switch a { text-decoration: none; text-underline-offset: 0.2em; }
html[data-lang='cs'] .switch a[data-set-lang='cs'],
html[data-lang='en'] .switch a[data-set-lang='en'] {
  text-decoration: underline;
  cursor: default;
}

/* one language at a time */
article[data-l] { display: none; }
html[data-lang='cs'] article[data-l='cs'],
html[data-lang='en'] article[data-l='en'] { display: block; }

/* the letter */
h1 {
  margin: 3.5rem 0 0;
  font-size: 1.7rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  text-align: center;
}
.date {
  margin: 0.5rem 0 3rem;
  text-align: center;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

article p { margin: 0 0 1.5rem; text-wrap: pretty; }

.to {
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
}

/* four lines tall: top on the cap height of line one, bottom on the baseline
   of line four. The glyph fills its em square, so the numbers follow from the
   text face (cap height 0.694em, line height 1.5): 3 * 1.5 + 0.694 = 5.19rem
   of ink, which is 0.99em of the initial. */
.initial {
  float: left;
  font: 400 5.25rem/1 'EB Garamond Initials', 'EB Garamond', serif;
  margin: 0.38rem 0.6rem 0 0;
}
/* the English opener is longer: a five-line initial (4 * 1.5 + 0.694 = 6.69rem
   of ink) keeps the whole paragraph beside it */
article[lang='en'] .initial {
  font-size: 6.76rem;
  margin: 0.38rem 0.7rem 0 0;
}
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.sig {
  width: max-content;
  max-width: 100%;
  margin: 2.5rem 0 0 auto;
}
.sig p { margin: 0; }
.sig .name { margin-top: 0.3rem; padding-left: 9rem; }

/* counter and signing */
.stand {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid #000;
  text-align: center;
}
.total {
  margin: 0;
  font-size: 3.4rem;
  line-height: 1;
  font-variant-numeric: lining-nums;
}
.total-label {
  margin: 0.5rem 0 0;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}
.countries {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.35em;
}
.countries li { white-space: nowrap; }
.countries li:not(:last-child)::after { content: ' ·'; }
.countries b { font-weight: 400; font-variant-numeric: lining-nums; margin-left: 0.25em; }

.step { margin-top: 3.5rem; }
.step[hidden] { display: none; }
.ask, .done {
  margin: 0 0 1.3rem;
  font-size: 1.35rem;
  font-style: italic;
}
.sso {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
button, select {
  font: inherit;
  color: #000;
  background: #fff;
  border: 1px solid #000;
  border-radius: 0;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 8.4rem;
  padding: 0.45rem 1rem 0.5rem;
  cursor: pointer;
}
button img { width: 1rem; height: 1rem; }
button[hidden] { display: none; }
button:hover, button:focus-visible { background: #000; color: #fff; }
button:hover img, button:focus-visible img { filter: invert(1); }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

.note {
  margin: 1.3rem 0 0;
  font-size: 0.8rem;
}

.via { margin: 0 0 1.3rem; }
.via-icon {
  width: 0.9rem; height: 0.9rem;
  margin-right: 0.5rem;
  vertical-align: -0.08em;
}
.country { display: block; margin: 0 0 1.3rem; }
.country span { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; }
select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 17rem;
  padding: 0.4rem 2rem 0.45rem 0.8rem;
  text-align: left;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 0.8rem center / 0.55rem;
}
.go { min-width: 11rem; }

.mock {
  width: max-content;
  margin: 4rem auto 0;
  padding: 0.1rem 0.5rem;
  font: 11px/1.6 ui-monospace, Menlo, monospace;
  border: 1px dashed #000;
}

@media (max-width: 36rem) {
  html { font-size: 19px; }
  .sso { flex-direction: column; align-items: center; }
  .sso button { width: 100%; max-width: 17rem; }
  .sig .name { padding-left: 5rem; }
  /* too wide for a narrow column: back to three lines, text wraps under it */
  article[lang='en'] .initial {
    font-size: 3.73rem;
    margin: 0.39rem 0.5rem 0 0;
  }
}

@media print {
  .switch, .stand, .mock { display: none; }
}
