.hamdi-entry:not([open]) {
  display: none;
}

.hamdi-entry[open] {
  --entry-white: #fff8e8;
  --entry-gold: #dfbc83;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  /* Also cover the viewport if showModal is unavailable (older browsers). */
  z-index: 2147483000;
  isolation: isolate;
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100vh;
  block-size: 100dvh;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  border: 0;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--entry-white);
  background:
    radial-gradient(ellipse at 50% 45%, #66523775, transparent 56%),
    radial-gradient(ellipse at 8% 10%, #45504770, transparent 48%),
    #14201c;
  font: 400 1rem/1.5 Tahoma, Arial, sans-serif;
}

.hamdi-entry::backdrop {
  background: #14201c;
}

html:has(.hamdi-entry[open]) {
  overflow: hidden;
}

.hamdi-entry-content {
  position: relative;
  inline-size: min(100%, 570px);
  padding-block: 2rem;
  text-align: center;
}

.hamdi-entry-content::before,
.hamdi-entry-content::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 50% auto auto 50%;
  inline-size: 96%;
  block-size: 84%;
  border: 1px solid #e5cba648;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  pointer-events: none;
}

.hamdi-entry-content::after {
  inline-size: 86%;
  block-size: 96%;
  border-color: #fff8df37;
  transform: translate(-50%, -50%) rotate(22deg);
}

.hamdi-entry-logo {
  display: grid;
  justify-items: center;
  gap: .48rem;
}

.hamdi-entry-logo b {
  padding-inline-start: .13em;
  font: 500 clamp(2.5rem, 11vw, 5.6rem)/1 Georgia, serif;
  letter-spacing: .13em;
  text-shadow: 0 0 34px #fff4ce49;
}

.hamdi-entry-logo span {
  padding-inline-start: .31em;
  color: var(--entry-gold);
  font: 500 clamp(.65rem, 2.9vw, .93rem)/1.35 Arial, sans-serif;
  letter-spacing: .31em;
}

@media (prefers-reduced-motion: no-preference) {
  .hamdi-entry[open] .hamdi-entry-content::before {
    animation: hamdi-entry-ring 3s ease-out both;
  }

  .hamdi-entry[open] .hamdi-entry-content::after {
    animation: hamdi-entry-ring 2.9s .1s ease-out reverse both;
  }

  .hamdi-entry[open] .hamdi-entry-logo {
    animation: hamdi-entry-logo 1.2s ease-out both;
  }
}

@keyframes hamdi-entry-ring {
  from { opacity: .23; scale: .85; }
  55% { opacity: 1; }
  to { opacity: .58; scale: 1.04; }
}

@keyframes hamdi-entry-logo {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-height: 400px) {
  .hamdi-entry-content {
    padding-block: .5rem;
  }
}


/* Automatic entry greeting: readable on mobile, no buttons or taps needed. */
.hamdi-entry-greeting {
  margin: clamp(1rem, 4vh, 2rem) auto 0;
  max-width: 25ch;
  color: #fff5dc;
  font: 500 clamp(1rem, 3.8vw, 1.3rem)/1.6 Tahoma, Arial, sans-serif;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 22px rgba(244, 209, 139, .38);
}
@media (max-width: 760px) {
  .hamdi-entry[open] {
    z-index: 2147483000;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .hamdi-entry-content { inline-size: 100%; max-inline-size: 460px; }
  .hamdi-entry-logo b { font-size: clamp(3rem, 13vw, 5.1rem); }
  .hamdi-entry-greeting { margin-top: 1.6rem; }
}
