/* The gate to the Halls of Mandos. Dark by default; follows the site's light theme too. */
.halls {
  --gate-bg: #061a1e; --gate-ink: #f4ede1; --gate-muted: #9db6b4; --gate-card: rgba(11, 42, 48, .78);
  --gate-line: rgba(207, 227, 224, .22); --gate-warp: rgba(207, 227, 224, .05); --gate-weft: rgba(207, 227, 224, .16);
  --gate-amber: #f2a93b; --gate-coral: #f07a57; --gate-v0: rgba(6, 26, 30, 0); --gate-v1: rgba(2, 10, 12, .92);
  min-height: 100vh; margin: 0; background: var(--gate-bg); color: var(--gate-ink);
  display: grid; place-items: center; overflow-x: hidden; position: relative;
  font: 400 16px/1.5 "Space Grotesk", system-ui, sans-serif;
}
:root[data-theme="light"] .halls {
  --gate-bg: #f4ede1; --gate-ink: #0b2a30; --gate-muted: #4d6468; --gate-card: rgba(251, 247, 240, .86);
  --gate-line: rgba(11, 42, 48, .22); --gate-warp: rgba(11, 42, 48, .05); --gate-weft: rgba(11, 42, 48, .14);
  --gate-amber: #d98a14; --gate-coral: #d14e2c; --gate-v0: rgba(244, 237, 225, 0); --gate-v1: rgba(225, 214, 196, .9);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .halls {
    --gate-bg: #f4ede1; --gate-ink: #0b2a30; --gate-muted: #4d6468; --gate-card: rgba(251, 247, 240, .86);
    --gate-line: rgba(11, 42, 48, .22); --gate-warp: rgba(11, 42, 48, .05); --gate-weft: rgba(11, 42, 48, .14);
    --gate-amber: #d98a14; --gate-coral: #d14e2c; --gate-v0: rgba(244, 237, 225, 0); --gate-v1: rgba(225, 214, 196, .9);
  }
}

/* light/dark artwork swap */
.mark-light, .wm-light { display: none; }
:root[data-theme="light"] .mark-light, :root[data-theme="light"] .wm-light { display: block; }
:root[data-theme="light"] .mark-dark, :root[data-theme="light"] .wm-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .mark-light, :root:not([data-theme="dark"]) .wm-light { display: block; }
  :root:not([data-theme="dark"]) .mark-dark, :root:not([data-theme="dark"]) .wm-dark { display: none; }
}

/* background: the loom and a great arch */
.loom { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.loom .warp-line { stroke: var(--gate-warp); stroke-width: 1.2; }
.loom .v0 { stop-color: var(--gate-v0); } .loom .v1 { stop-color: var(--gate-v1); }
.weft { fill: none; stroke: var(--gate-weft); stroke-width: 1.4; stroke-dasharray: 6 10; animation: drift 38s linear infinite; }
.weft.w2 { animation-duration: 52s; animation-direction: reverse; }
.weft.w3 { animation-duration: 64s; }
.fate-weft { stroke: var(--gate-amber); stroke-width: 2; opacity: .35; stroke-dasharray: 2400; stroke-dashoffset: 2400;
  animation: weave 6s cubic-bezier(.6, .1, .2, 1) .6s forwards; filter: drop-shadow(0 0 6px var(--gate-amber)); }
@keyframes drift { to { stroke-dashoffset: -640; } }
@keyframes weave { to { stroke-dashoffset: 0; } }
.great-arch { position: fixed; left: 50%; bottom: -2vh; transform: translateX(-50%); height: 112vh; width: auto; z-index: 0; }
.great-arch path { fill: none; stroke: var(--gate-line); stroke-width: .35; }

/* the gate */
.gate { position: relative; z-index: 1; width: min(420px, calc(100vw - 32px)); padding: 6vh 0 4vh; display: flex; flex-direction: column;
  align-items: center; text-align: center; animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.sigil { position: relative; width: 300px; height: 300px; display: grid; place-items: center; margin-bottom: 6px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: turn 120s linear infinite; }
.ring .ring-line { fill: none; stroke: var(--gate-line); stroke-width: 1.2; }
.ring .ring-line.thin { stroke-dasharray: 2 6; }
.ring text { fill: var(--gate-muted); font: 700 11.5px "Space Grotesk", sans-serif; letter-spacing: .32em; }
@keyframes turn { to { transform: rotate(360deg); } }
.mark { position: relative; width: 136px; margin-top: -6px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.mark svg { width: 100%; height: auto; display: block; }
.mark .fate { stroke-dasharray: 120; stroke-dashoffset: 120; animation: weave 2.4s cubic-bezier(.6, .1, .2, 1) .5s forwards; }
.mark .doom { transform-box: fill-box; transform-origin: center; opacity: 0; animation: arrive .5s ease 2.7s forwards, pulse 3.2s ease-in-out 3.4s infinite; }
.mark .glint { animation: glint 7s ease-in-out 1.2s infinite; }
.mark .keystone { transform-box: fill-box; transform-origin: center; animation: shine 7s ease-in-out 2s infinite; }
@keyframes arrive { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); filter: none; } 50% { transform: scale(1.25); filter: drop-shadow(0 0 4px var(--gate-coral)); } }
@keyframes glint { 0%, 86%, 100% { opacity: .85; } 90% { opacity: .1; } 93% { opacity: .9; } }
@keyframes shine { 0%, 80%, 100% { filter: none; } 88% { filter: drop-shadow(0 0 6px var(--gate-amber)) brightness(1.3); } }

.wordmark { margin: 4px 0 0; line-height: 0; }
.wordmark img { width: 230px; height: auto; margin: 0 auto; }
.motto { margin: 12px 0 26px; font: italic 400 1.05rem/1.4 Fraunces, Georgia, serif; color: var(--gate-muted); }

.gate-card { width: 100%; box-sizing: border-box; padding: 24px 24px 22px; text-align: left; background: var(--gate-card);
  border: 1px solid var(--gate-line); border-top: 3px solid var(--gate-amber); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); display: grid; gap: 14px; }
.gate-card.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.gate-field { display: grid; gap: 6px; }
.gate-field > span { font: 700 .66rem "Space Grotesk"; letter-spacing: .22em; text-transform: uppercase; color: var(--gate-muted); }
.gate-field input { width: 100%; box-sizing: border-box; font: 500 1rem "Space Grotesk"; color: var(--gate-ink); background: transparent;
  border: 0; border-bottom: 1.5px solid var(--gate-line); padding: 8px 2px; border-radius: 0; transition: border-color .15s; }
.gate-field input:focus { outline: none; border-bottom-color: var(--gate-amber); }
.gate-field input:disabled { opacity: .45; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-toggle { background: none; border: 0; color: var(--gate-muted); font: 700 .66rem "Space Grotesk"; letter-spacing: .16em;
  text-transform: uppercase; cursor: pointer; padding: 6px; }
.pw-toggle:hover { color: var(--gate-amber); }
.gate-error { margin: 0; color: var(--gate-coral); font-size: .9rem; }
.gate-card.sealed { text-align: center; }
.gate-btn { margin-top: 4px; display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; padding: 13px 16px;
  border: 0; cursor: pointer; background: var(--gate-amber); color: #061a1e; font: 700 .8rem "Space Grotesk";
  letter-spacing: .22em; text-transform: uppercase; position: relative; overflow: hidden; transition: transform .12s, box-shadow .2s; }
.gate-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; transition: transform .2s; }
.gate-btn:hover { box-shadow: 0 0 0 1px var(--gate-amber), 0 10px 30px -10px var(--gate-amber); }
.gate-btn:hover svg { transform: translateX(4px); }
.gate-btn:active { transform: translateY(1px); }
.gate-btn::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); animation: sheen 6s ease-in-out 3s infinite; }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.gate-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.gate-btn:focus-visible, .pw-toggle:focus-visible { outline: 2px solid var(--gate-ink); outline-offset: 3px; }
.gate-foot { margin-top: 28px; display: flex; gap: 10px; align-items: center; color: var(--gate-muted); font-size: .74rem; letter-spacing: .04em; }

@media (max-width: 480px) { .sigil { width: 250px; height: 250px; } .mark { width: 112px; } .gate { padding-top: 3vh; } }
@media (prefers-reduced-motion: reduce) {
  .halls *, .halls *::before, .halls *::after { animation: none !important; }
  .mark .fate, .fate-weft { stroke-dashoffset: 0; } .mark .doom { opacity: 1; }
}

/* join / request pages */
.gate-alt { margin: 14px 0 0; font-size: .86rem; color: var(--gate-muted); }
.gate-alt a, .gate-error a, .gate-card a { color: var(--gate-amber); text-underline-offset: 3px; }
.gate-note { margin: 2px 0 0; font-size: .78rem; color: var(--gate-muted); }
.gate-field textarea { width: 100%; box-sizing: border-box; font: 500 .95rem "Space Grotesk"; color: var(--gate-ink); background: transparent;
  border: 1.5px solid var(--gate-line); padding: 8px; border-radius: 0; resize: vertical; }
.gate-field textarea:focus { outline: none; border-color: var(--gate-amber); }
.gate-field input::placeholder, .gate-field textarea::placeholder { color: var(--gate-muted); opacity: .6; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
