@font-face {
  font-family: "Omni Hand";
  src: url("/assets/fonts/charm-handwriting-straight.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f3f2ee;
  --paper: #fdfdfb;
  --ink: #1c1b19;
  --muted-ink: #6c6962;
  --line: #d8d5ce;
  --line-strong: #97938a;
  --error: #93473e;
  --focus: rgba(28, 27, 25, 0.12);
  --error-focus: rgba(147, 71, 62, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  caret-color: transparent;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

.page,
.completion-page {
  min-height: 100vh;
  min-height: 100svh;
}

.page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate {
  width: min(100%, 464px);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  padding: 16px 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(28, 27, 25, 0.03),
    0 12px 32px rgba(28, 27, 25, 0.045);
  -webkit-user-select: none;
  user-select: none;
}

.gate__label,
.completion-text {
  font-family: "Omni Hand", "Segoe Print", cursive;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
}

.gate__label {
  font-size: 28px;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-2px);
}

.gate__field {
  position: relative;
  min-width: 0;
}

.gate__control {
  min-width: 0;
  height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px var(--line-strong),
    inset 0 1px 2px rgba(28, 27, 25, 0.035);
  transition: box-shadow 120ms ease;
}

.gate__control:focus-within {
  box-shadow:
    inset 0 0 0 1px var(--ink),
    inset 0 1px 2px rgba(28, 27, 25, 0.025),
    0 0 0 2px var(--focus);
}

.gate__input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px 0 0 7px;
  outline: 0;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.14em;
  caret-color: var(--ink);
  -webkit-user-select: text;
  user-select: text;
}

.gate__input::selection {
  color: #fff;
  background: rgba(28, 27, 25, 0.82);
}

.gate__submit {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  align-self: center;
  padding: 0;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.gate__submit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate__submit:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--paper);
}

.gate__submit:active {
  background: #050505;
}

.gate__submit:disabled {
  cursor: default;
  opacity: 0.62;
}

.gate__feedback {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  margin: 0;
  color: var(--error);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.02em;
}

.gate[data-state="invalid"] .gate__control {
  box-shadow:
    inset 0 0 0 1px var(--error),
    0 0 0 2px var(--error-focus);
}

.completion-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.completion-text {
  color: var(--muted-ink);
  font-size: 20px;
  line-height: 24px;
}

@media (hover: hover) {
  .gate__submit:hover {
    background: #34322f;
  }
}

@media (max-width: 352px) {
  .page {
    padding: 16px;
  }

  .gate {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .gate__label {
    transform: none;
  }
}
