﻿html.is-gated,
html.is-gated body {
  overflow: hidden;
}

.entry-gate[hidden] {
  display: none;
}

.entry-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: #f1eeea;
  background: #172127;
  isolation: isolate;
  transition: background-color 620ms ease;
}

.entry-gate::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 51% 37%, #50606366, transparent 67%);
  pointer-events: none;
  transition: opacity 620ms ease;
}

.entry-bars {
  position: fixed;
  z-index: -1;
  inset: -20%;
  background: repeating-linear-gradient(90deg, transparent 0 15%, #090f1480 15% 18%);
  transform: perspective(700px) rotateY(-12deg) rotate(-15deg) scale(1.3);
  opacity: 0.85;
  pointer-events: none;
  transition: transform 760ms cubic-bezier(.2, .72, .2, 1), opacity 700ms ease;
}

.gate-skip {
  position: sticky;
  z-index: 5;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  width: max-content;
  min-height: 44px;
  margin: 18px 24px 0 auto;
  padding: 7px 15px;
  border: 1px solid #b29a6870;
  border-radius: 2px;
  background: #202a30;
  color: #f1eeea;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.gate-skip span {
  color: #c8b17f;
  font-size: 20px;
}

.gate-stage {
  display: grid;
  justify-items: center;
  align-content: center;
  width: min(600px, 100%);
  min-height: calc(100svh - 80px);
  margin: 0 auto;
  padding: 10px 24px 26px;
  box-sizing: border-box;
  perspective: 1200px;
}

.gate-invitation,
.gate-footnote {
  margin: 0;
  text-align: center;
  color: #c7c7c1;
  font-size: 12px;
  line-height: 1.6;
  transition: opacity 350ms ease;
}

.gate-invitation {
  margin-bottom: 25px;
  letter-spacing: .08em;
}

.gate-footnote {
  margin-top: 23px;
  color: #aeb2b0;
}

.grant-paper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 35px clamp(24px, 5vw, 62px) 25px;
  color: #293036;
  background: #ddd7ca;
  background-image: linear-gradient(105deg, #fff8 0, transparent 5%, transparent 96%, #9f90762e 100%);
  border: 1px solid #aaa18e;
  box-shadow: 0 24px 100px #0007, inset 0 0 60px #9c8b6412;
  text-align: center;
  transform-origin: center 20%;
  animation: grant-arrive 900ms cubic-bezier(.19, 1, .22, 1) both;
  transition: transform 600ms cubic-bezier(.4, 0, .75, .4), opacity 480ms ease;
}

.grant-paper::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #77684a55;
  pointer-events: none;
}

.grant-origin {
  margin: 0;
  color: #64563b;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .22em;
}

.grant-rule {
  width: 48px;
  height: 1px;
  margin: 16px auto 13px;
  background: #8e7c50;
}

.grant-paper h2 {
  margin: 0;
  padding-left: .34em;
  font-family: var(--serif);
  font-size: clamp(35px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: .34em;
  line-height: 1.45;
}

.grant-decree,
.grant-choice {
  font-family: var(--serif);
  word-break: keep-all;
}

.grant-decree {
  margin: 21px 0 12px;
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 600;
  line-height: 1.95;
}

.grant-choice {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.grant-note {
  margin: 16px auto 0;
  max-width: 28em;
  color: #625f55;
  font-size: 10px;
  word-break: keep-all;
  line-height: 1.7;
}

.grant-signature {
  position: relative;
  margin-top: 20px;
  border-bottom: 1px solid #877d6480;
  text-align: left;
}

.signature-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #625d4f;
  font-size: 11px;
}

.signature-label button {
  min-width: 56px;
  min-height: 36px;
  margin-right: -9px;
  padding: 5px 9px;
  border: 0;
  border-radius: 2px;
  color: #5e594d;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#grant-signature {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 88px;
  cursor: crosshair;
  touch-action: none;
}

.signature-guide {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  color: #827968;
  font-family: var(--serif);
  font-size: 15px;
  text-align: center;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.has-ink .signature-guide,
.is-accepting .signature-guide {
  opacity: 0;
}

.gate-status {
  min-height: 20px;
  margin: 9px 0 17px;
  color: #676055;
  font-size: 10px;
  line-height: 1.7;
}

.gate-accept {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid #4b4e43;
  background: transparent;
  color: #31382f;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: color 200ms ease, background-color 200ms ease;
}

.gate-accept:hover,
.gate-accept:focus-visible {
  color: #f1eeea;
  background: #202a30;
}

.entry-gate button:focus-visible {
  outline: 3px solid #9c6b38;
  outline-offset: 4px;
}

.gate-skip:focus-visible {
  outline-color: #e6c587;
}

.entry-gate button:disabled {
  cursor: default;
}

.is-accepting #grant-signature {
  pointer-events: none;
}

.entry-gate.is-leaving {
  background-color: transparent;
  pointer-events: none;
}

.entry-gate.is-leaving .gate-skip {
  pointer-events: auto;
}

.is-leaving::before,
.is-leaving .gate-invitation,
.is-leaving .gate-footnote {
  opacity: 0;
}

.is-leaving .entry-bars {
  transform: perspective(700px) rotateY(-12deg) rotate(-15deg) translateX(-70%) scale(1.3);
  opacity: 0;
}

.is-leaving .grant-paper {
  animation: none;
  transform: translateY(20vh) rotateX(12deg) rotate(-5deg) scale(.94);
  opacity: 0;
}

@keyframes grant-arrive {
  from { opacity: 0; transform: translateY(35px) rotateX(8deg) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0) rotate(0); }
}

@media (max-width: 480px) {
  .gate-stage { padding-inline: 19px; }
  .gate-skip { top: 12px; margin: 12px 16px 0 auto; font-size: 11px; }
  .gate-invitation { margin-bottom: 18px; font-size: 11px; }
  .grant-paper { padding: 28px 28px 23px; }
  .grant-note { font-size: 9px; }
}

@media (max-height: 720px) and (min-width: 481px) {
  .gate-stage { padding-top: 3px; }
  .gate-invitation { margin-bottom: 13px; }
  .grant-paper { padding-top: 24px; padding-bottom: 20px; }
  .grant-decree { margin-top: 13px; }
  .grant-signature { margin-top: 10px; }
  #grant-signature { height: 68px; }
  .signature-guide { top: 53px; }
  .gate-footnote { margin-top: 14px; }
}
