:root { color-scheme: light; --ink: #30483a; --plum: #4d7052; --line: #849c84; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #eaf0e7 linear-gradient(155deg, #f7f7ef, #edf1e8 54%, #e5ece2);
  color: var(--ink);
  font: 1rem/1.5 Georgia, "Times New Roman", serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 4px; }
.page {
  position: relative;
  width: min(100%, 96rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  container-type: inline-size;
}
header { position: absolute; z-index: 1; top: 1.76cqw; right: 1.95cqw; }
.languages {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 9.18cqw;
  padding-inline: .85cqw;
  min-height: max(2.75rem, 3.26cqw);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #f8faf033;
  font-size: clamp(1rem, 1.66cqw, 1.6rem);
}
.languages button {
  display: grid;
  place-items: center;
  padding: 0 .4cqw;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
}
.languages button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: .18em; }
main { position: relative; isolation: isolate; }
.scene-art {
  /* Blend the paper at the edge of the illustration into the page background. */
  --paper-edge: clamp(1.25rem, 3vw, 2.75rem);
  --paper-bottom: linear-gradient(to bottom, #000 calc(100% - var(--paper-edge)), transparent);
  overflow: hidden;
  -webkit-mask-image: var(--paper-bottom);
  mask-image: var(--paper-bottom);
}
.scene-art img { display: block; width: 100%; height: auto; }

.cover-artwork { position: relative; width: 100%; }
@media (min-width: 96rem) {
  .cover-artwork {
    --paper-sides: linear-gradient(to right, transparent, #000 var(--paper-edge),
      #000 calc(100% - var(--paper-edge)), transparent);
    -webkit-mask-image: var(--paper-sides);
    mask-image: var(--paper-sides);
  }
}
.crown-sparkle {
  position: absolute;
  left: 20.35%;
  top: 31.9%;
  z-index: 4;
  width: 1.6%;
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, #fffef3 0 8%, #ffdd83 15%, #e5ad3b 28%, transparent 65%);
  border-radius: 50%;
  filter: drop-shadow(0 0 .16rem #f5cd6f);
  animation: crown-glint 4s ease-in-out 1.7s infinite;
}
html[lang="en"] .crown-sparkle { left: 22.1%; top: 32.4%; }
.crown-sparkle::before, .crown-sparkle::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #fff7ce;
}
.crown-sparkle::before { width: 16%; height: 16%; top: 9%; left: 83%; }
.crown-sparkle::after { width: 11%; height: 11%; top: 75%; left: 8%; }
@keyframes crown-glint {
  0%, 18%, 60%, 100% { opacity: 0; transform: scale(.35); }
  32% { opacity: .9; transform: scale(1); }
  43% { opacity: .5; transform: scale(.65); }
}
@media (prefers-reduced-motion: reduce) {
  .crown-sparkle { animation: none; }
}
#sign-in { position: absolute; z-index: 5; top: 12.88cqw; left: 64.52%; width: 31.51%; }
h1 {
  margin: 0;
  text-align: center;
  font-size: 4.95cqw;
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.1;
}
html[lang="lv"] h1 { font-size: 4.58cqw; line-height: 1.19; }
h1 span { display: block; white-space: nowrap; }
.divider {
  display: flex;
  align-items: center;
  gap: 1.05cqw;
  width: 73.5%;
  height: 2.22cqw;
  margin: 2.02cqw auto 3.43cqw;
  color: var(--plum);
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1.5px solid currentColor; }
.divider span { font: 2.2cqw/1 Georgia, serif; }
.password-row { position: relative; }
input {
  width: 100%;
  min-height: max(2.75rem, 4.82cqw);
  padding: .4rem 3.15rem .4rem 17.8%;
  border: 1.5px solid var(--line);
  border-radius: max(.5rem, .78cqw);
  color: var(--ink);
  background: #f8faf0aa;
  font-size: clamp(1rem, 1.9cqw, 1.82rem);
}
input::placeholder { color: #657a68; opacity: 1; }
.lock {
  position: absolute;
  inset: 50% auto auto 6.1%;
  translate: 0 -28%;
  width: .9em;
  height: .78em;
  border: 2px solid var(--ink);
  border-radius: .18em;
  font-size: clamp(1rem, 1.72cqw, 1.65rem);
  pointer-events: none;
}
.lock::before {
  content: "";
  position: absolute;
  inset: -.55em .08em auto;
  height: .48em;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: .4em .4em 0 0;
}
.lock::after {
  content: "";
  position: absolute;
  inset: .17em auto auto 50%;
  translate: -50%;
  width: .13em;
  height: .29em;
  border-radius: 99px;
  background: var(--ink);
}
.eye {
  position: absolute;
  inset: 50% .25rem auto auto;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  opacity: 0;
}
.password-row:focus-within .eye, .password-row:has(input:not(:placeholder-shown)) .eye { opacity: 1; }
.eye svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.eye .slash { opacity: 0; }
.eye[aria-pressed="true"] .slash { opacity: 1; }
.open {
  width: 100%;
  min-height: max(2.75rem, 4.82cqw);
  margin-top: 2.15cqw;
  padding: .35rem 1rem;
  border: 0;
  border-radius: max(.55rem, 1.04cqw);
  background: var(--plum);
  color: #fffaf5;
  font-size: clamp(1.15rem, 2.45cqw, 2.35rem);
  line-height: 1.1;
}
.open:disabled { opacity: .72; cursor: wait; }
#status { text-align: center; margin: .7rem 0 0; font-size: clamp(.875rem, 1.1cqw, 1.05rem); }
.sample-preview:not([hidden]) {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  margin-top: .4rem;
  color: var(--ink);
  text-align: center;
}
footer {
  position: absolute;
  inset: auto 9% 4.65%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2cqw;
  text-align: center;
  font: italic clamp(.6875rem, .94cqw, .875rem)/1.3 Georgia, serif;
}
footer::before, footer::after {
  content: "";
  flex: 0 0 4.35cqw;
  height: .95cqw;
  background: #789078;
  clip-path: polygon(0 47%, 53% 47%, 48% 30%, 60% 33%, 68% 47%, 79% 47%, 71% 12%, 82% 23%, 91% 47%, 100% 47%, 100% 53%, 91% 53%, 82% 77%, 71% 88%, 79% 53%, 68% 53%, 60% 67%, 48% 70%, 53% 53%, 0 53%);
}
footer::after { transform: scaleX(-1); }
@media (max-width: 54rem) {
  .page { display: flex; flex-direction: column; }
  header { top: .75rem; right: .75rem; }
  .languages { padding-inline: .28rem; background: #fff8efaa; }
  .scene-art .cover-artwork { width: 156%; max-width: none; }
  #sign-in { position: static; width: auto; max-width: 27rem; margin: 0 auto; padding: .4rem 1.25rem 1.5rem; }
  h1, html[lang="lv"] h1 { font-size: clamp(1.8rem, 7.8vw, 3.2rem); line-height: 1.06; }
  .divider { height: 1.75rem; gap: .7rem; margin: .65rem auto 1.1rem; }
  .divider span { font-size: 1.5rem; }
  input, .open { min-height: 3rem; }
  input { padding-left: 3rem; }
  .open { margin-top: .7rem; }
  footer {
    position: static;
    margin-top: auto;
    padding: .45rem .375rem 1.15rem;
    font-size: clamp(.375rem, 1.9cqw, .6875rem);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  footer::before, footer::after { display: none; }
}

@media (hover: hover) {
  .languages button:hover,
  .eye:hover {
    color: #684453;
    background: #f4e5e9;
  }
  .open:hover {
    color: #684453;
    background: #f4e5e9;
    box-shadow: 0 .4rem 1rem #8e61702e;
  }
}
