@font-face {
  font-family: Fraunces;
  src: url('/fonts/Fraunces-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

.portal-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vh, 24px);
  isolation: isolate;
  background: #302037;
}
.portal-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 53% 44%, transparent 24%, #302038 91%),
    linear-gradient(145deg, #57405455, #39233b80),
    url('/grimfist-portal.webp') center 49% / cover;
  filter: blur(36px) saturate(.78);
  transform: scale(1.12);
}
.portal-scene {
  width: min(100%, 880px, max(560px, calc((100svh - 44px) * .914)));
  max-width: none;
  position: relative;
  margin: 0;
  padding: 0;
  isolation: isolate;
}
.portal-art, .portal-art img {
  display: block;
  width: 100%;
  height: auto;
}
@media (min-width: 561px) {
  .portal-art {
    mask-image:
      linear-gradient(to right, transparent 1%, #000 9%, #000 91%, transparent 99%),
      linear-gradient(to bottom, transparent 1%, #000 8%, #000 93%, transparent 99%);
    mask-composite: intersect;
  }
}
.portal-controls {
  position: absolute;
  top: 39.4%;
  left: 50.3%;
  width: 35.1%;
  font: 500 1rem Fraunces, Georgia, serif;
  color: #352239;
}
.portal-controls fieldset {
  min-inline-size: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
.portal-controls form, .portal-controls fieldset {
  display: grid;
  gap: clamp(6px, 1.3vh, 14px);
}
.portal-field {
  position: relative;
  display: block;
  margin: 0;
  font: inherit;
}
.portal-field svg, #show-password svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.portal-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  color: #684832;
}
.portal-field input {
  min-height: 44px;
  margin: 0;
  padding: .55rem .65rem .55rem 2.4rem;
  color: #352239;
  background: radial-gradient(ellipse at 50% 20%, #fff3d8, #f5dfbc);
  border: 1px solid #775144;
  border-radius: 10px;
  box-shadow: inset 0 0 7px #a96c3d42, 0 2px 4px #3f204b64;
}
.portal-field input::placeholder { color: #594137; opacity: 1; }
.portal-password { position: relative; }
.portal-password input { padding-right: 44px; }
#show-password {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0 0 0 auto;
  min-width: 44px;
  padding: 0;
  background: transparent;
  color: #684832;
}
#show-password .eye-slash { visibility: hidden; }
#show-password[aria-pressed="true"] .eye-slash { visibility: visible; }
.portal-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: .45rem .25rem;
  color: #fff1ce;
  background: radial-gradient(ellipse at 50% 15%, #77435f, #44263f);
  border: 2px solid #e1af76;
  outline: 1px solid #43283d;
  outline-offset: 0;
  border-radius: 14px 7px;
  box-shadow: inset 0 0 0 2px #48283a, 0 3px 4px #3f204b80;
  font: 650 clamp(1.15rem, 2.2vw, 1.7rem) Fraunces, Georgia, serif;
}
.portal-submit span { color: #ffd68f; font-size: .7em; }
.portal-submit:hover:not(:disabled) { background: #744561; }
#forgot {
  justify-self: center;
  padding: .25rem .65rem;
  color: #3b2140;
  background: #f8e1ee;
  border: 1px solid #694663;
  border-radius: 8px;
  font: 550 .9rem Fraunces, Georgia, serif;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.portal-controls :is(input, button):focus-visible {
  outline: 3px solid #ffde90;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #43213f;
}
.portal-controls #status, .portal-notice {
  position: relative;
  margin: .4rem 0 0;
  padding: .45rem .55rem;
  color: #3b2140;
  background: #fff0df;
  border: 1px solid #78516c;
  border-radius: 8px;
  font: 600 .82rem/1.35 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.portal-controls #status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.portal-page .verification {
  width: min(450px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: clamp(1rem, 4vw, 1.65rem);
  color: #fff1d8;
  background:
    radial-gradient(ellipse at 50% 4%, #69475c, transparent 60%),
    linear-gradient(145deg, #4d304b, #2b1b33);
  border: 1px solid #deac73;
  border-radius: 22px 12px;
  box-shadow: inset 0 0 0 4px #dca97133, 0 20px 55px #1a0d24b3;
}
.portal-page .verification::backdrop {
  background: #211326b8;
  backdrop-filter: blur(5px);
}
.verification-cryptex {
  display: block;
  width: clamp(106px, 29vw, 148px);
  height: auto;
  margin: 0 auto .7rem;
  filter: drop-shadow(0 4px 10px #211328a6);
}
.portal-page .verification h2 {
  margin: 0;
  color: #ffe1a9;
  text-align: center;
  font: 650 clamp(1.38rem, 5vw, 1.85rem) Fraunces, Georgia, serif;
}
.portal-page #verification-help {
  margin: .5rem 0 .85rem;
  text-align: center;
  font-size: .92rem;
  line-height: 1.45;
}
.portal-page #verification-status {
  margin: .35rem 0;
  color: #ffdba9;
  font-size: .875rem;
}
.portal-page .verification input {
  min-height: 44px;
  color: #38243a;
  background: #fff1d5;
  border-color: #d2a57a;
}
.portal-page #verification-code {
  font: 650 1.25rem ui-monospace, monospace;
  letter-spacing: .3em;
  text-align: center;
}
.portal-page .verification .toolbar { margin-bottom: 0; }
.portal-page .verification button {
  background: #674058;
  border-color: #d9ac7b;
  color: #fff1d8;
}
.portal-page #verification-submit {
  flex: 1;
  color: #39223a;
  background: linear-gradient(#ffe4af, #e6ba81);
  font-weight: 700;
}
.portal-page .verification button:hover:not(:disabled) { filter: brightness(1.12); }
.portal-page .verification :is(input, button):focus-visible { outline-color: #ffdb91; }

@media (max-width: 560px) {
  .portal-page { padding: 6px; }
  .portal-page::before { background: radial-gradient(ellipse, #62456c, #302038 75%); }
  .portal-scene { width: min(100%, 440px); }
  .portal-welcome { display: none; }
  .portal-controls {
    top: 43%;
    left: 19%;
    width: 62%;
  }
}
