@font-face {
  font-family: Onest;
  src: url("./assets/fonts/onest.ttf") format("truetype");
  font-display: swap;
  font-weight: 100 900;
}

@font-face {
  font-family: Geologica;
  src: url("./assets/fonts/geologica.ttf") format("truetype");
  font-display: swap;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --ink: #232323;
  --muted: #545d68;
  --blue: #0047bb;
  --lime: #e1f593;
  --line: #e1e5eb;
  --gutter: 22px;
  font: 400 16px/1.4 Onest, Arial, sans-serif;
  color: var(--ink);
  background: #edf2f8;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
h1, h2 {
  font-family: Geologica, Arial, sans-serif;
  font-variation-settings: "CRSV" 0, "SHRP" 0;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
main:focus { outline: none; }
button { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(72px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

.brand { display: flex; align-items: center; gap: 10px; transform: translateX(3px); }
.brand img, .back img { display: block; }
.brand span {
  display: grid;
  place-items: center;
  height: 26px;
  padding-inline: 10px;
  border-radius: 13px;
  background: var(--lime);
  font-size: 13px;
  line-height: 17px;
  font-weight: 600;
}

.back {
  position: absolute;
  left: max(8px, env(safe-area-inset-left, 0px));
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 52px;
  border: 0;
  border-radius: 26px;
  background: transparent;
}

#screen {
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
  scrollbar-width: thin;
}

#actions {
  background: #fff;
  box-shadow: inset 0 1px var(--line);
  padding: 18px max(var(--gutter), env(safe-area-inset-right, 0px))
    calc(18px + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
}

.primary-action {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border: 0;
  border-radius: 28px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  line-height: 20px;
}
.primary-action.secondary { color: var(--blue); background: #ebf2fd; }
@media (hover: hover) {
  .primary-action:hover { filter: brightness(.94); }
  .back:hover { background: #f5f6f8; }
}
.primary-action:active { filter: brightness(.88); }

.preview-note {
  position: absolute;
  inset-inline: 0;
  bottom: calc(2px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--muted);
  pointer-events: none;
  font-size: 10px;
  line-height: 13px;
}

@media (prefers-reduced-motion: no-preference) {
  #screen [data-enter] {
    --enter-offset: 20px;
    animation: screen-enter 230ms cubic-bezier(.22, 1, .36, 1);
  }
  #screen [data-enter="back"] { --enter-offset: -20px; }

  #actions .action-enter { animation: action-enter 160ms ease-out; }

  @keyframes screen-enter {
    from { opacity: .2; transform: translateX(var(--enter-offset)); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes action-enter {
    from { opacity: .6; }
    to { opacity: 1; }
  }
}
