@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-roman.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Beiruti";
  src: url("../fonts/beiruti.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

html,
body {
  margin: 0;
  background: transparent;
  color: var(--cyr-bone);
  font-family: var(--font-ui);
  color-scheme: dark;
}

body>div:first-child:not(.ghost-display) {
  background: var(--cyr-surface-overlay);
  backdrop-filter: blur(4px);
}

.ghost-display {
  width: 100%;
  height: 100dvh;
  padding: clamp(24px, 12vh, 112px) 24px 24px;
  overflow-y: auto;
  font-family: var(--font-ui);
}

.ghost-display>div {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  overflow: hidden;
  background: var(--cyr-surface);
  border: 1px solid var(--cyr-line-strong);
  border-radius: 0;
  box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  animation: cyr-search-arrive 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ghost-display>div>div:first-child {
  min-height: 78px;
  padding: 12px 20px;
  gap: 8px;
  background: var(--cyr-surface);
  border-radius: 0;
  box-shadow: none;
}

.ghost-display>div>div:first-child:focus-within {
  box-shadow: inset 0 -2px var(--cyr-cobalt-bright);
}

.ghost-display>div>div:first-child>div:first-child {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
}

.ghost-display input {
  width: 0;
  min-width: 0;
  margin: 0;
  padding: 12px 0;
  background: transparent;
  color: var(--cyr-bone-bright);
  font-family: var(--font-reading);
  font-size: 24px;
  line-height: 1.4;
  text-overflow: ellipsis;
  caret-color: var(--cyr-cobalt-bright);
}

.ghost-display input::placeholder {
  color: var(--cyr-bone-muted);
  opacity: 1;
}

.ghost-display button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  color: var(--cyr-bone-muted);
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.2;
  border-radius: 0;
}

.ghost-display button[alt="Cancel"] {
  padding: 8px 12px;
  border: 1px solid var(--cyr-line-strong);
}

.ghost-display svg {
  color: var(--cyr-bone-muted);
}

.ghost-display button:hover,
.ghost-display button:hover svg {
  color: var(--cyr-bone-bright);
}

.ghost-display button:focus-visible {
  outline: 2px solid var(--cyr-cobalt-bright);
  outline-offset: 2px;
}

.ghost-display .overflow-y-auto {
  max-height: min(65dvh, calc(100dvh - 200px));
  margin-top: 0;
  overscroll-behavior: contain;
  scrollbar-color: var(--cyr-line-strong) var(--cyr-surface);
}

.ghost-display .border-t {
  padding: 18px 28px;
  border-color: var(--cyr-line);
}

.ghost-display h1 {
  margin: 0 0 8px;
  color: var(--cyr-gold);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.ghost-display .cursor-pointer {
  margin-inline: -28px;
  padding: 16px 28px;
  color: var(--cyr-bone);
}

.ghost-display .bg-neutral-100,
.ghost-display .cursor-pointer:hover {
  background: var(--cyr-cobalt-glow);
}

.ghost-display h2 {
  color: var(--cyr-bone-bright);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ghost-display p {
  color: var(--cyr-bone-muted);
  font-family: var(--font-reading);
  font-size: 20px;
  line-height: 1.5;
}

.ghost-display .cursor-pointer>p:last-child {
  margin-top: 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.ghost-display .font-bold {
  color: var(--cyr-bone-bright);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--cyr-cobalt-bright);
  text-underline-offset: 3px;
}

@keyframes cyr-search-arrive {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .ghost-display {
    padding: 24px 12px;
  }

  .ghost-display>div>div:first-child {
    padding: 10px 8px;
    gap: 4px;
  }

  .ghost-display input {
    font-size: 20px;
  }

  .ghost-display button[alt="Cancel"] {
    padding-inline: 8px;
  }

  .ghost-display .border-t {
    padding-inline: 20px;
  }

  .ghost-display .cursor-pointer {
    margin-inline: -20px;
    padding-inline: 20px;
  }

  .ghost-display h2 {
    font-size: 28px;
  }

  .ghost-display .overflow-y-auto {
    max-height: calc(100dvh - 148px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ghost-display>div {
    animation: none;
  }
}
