/* The Veil — members-only gate (sign in / join), shown before Veil OS loads.
   A fixed dark look of its own: themes belong to signed-in members, so none apply here. */

:root {
  color-scheme: dark;
  --g-page: #04070d;
  --g-card: #0e1622;
  --g-bar: #121b29;
  --g-line: #2a3445;
  --g-field: #1a2433;
  --g-field-line: #3a475b;
  --g-text: #e9eef5;
  --g-soft: #c4ccd8;
  --g-dim: #8a96a8;
  --g-steel: #9ec3e6;
  --g-link: #8fd6ff;
  --g-gold: #d8b56a;
  --g-danger: #ff8a80;
  --g-ok: #7fdca4;
  --g-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --g-serif: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: calc(15px * var(--ts, 1))/1.5 var(--g-font); color: var(--g-text); background-color: var(--g-page);
  /* A faint starfield */
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1px 1px at 33% 72%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 88% 64%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 55% 40%, rgba(200,220,255,.4), transparent 60%),
    radial-gradient(1px 1px at 6% 88%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1px 1px at 64% 92%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(40,60,110,.25), transparent 60%);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }

.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }

/* ---------- Card: compact, centred ---------- */
.gate-card {
  width: min(720px, 100%); background: var(--g-card); border: 1px solid var(--g-line); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02) inset; overflow: hidden;
  animation: gate-in .45s cubic-bezier(.16, 1, .3, 1);
}
.gate-card.wide { width: min(820px, 100%); }
@keyframes gate-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.gate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 36px; padding: 0 14px; background: var(--g-bar); border-bottom: 1px solid var(--g-line);
}
#gate-bar-title { font-size: calc(12.8px * var(--ts, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.gate-bar-tag { font-size: calc(12.2px * var(--ts, 1)); font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--g-steel); }

.gate-body { display: grid; grid-template-columns: 250px 1fr; min-height: 375px; }

/* ---------- Art panel: the Veil emblem on a nebula ---------- */
.gate-art {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 18px; border-right: 1px solid var(--g-line); overflow: hidden; isolation: isolate;
  background:
    radial-gradient(ellipse 60% 45% at 50% 38%, rgba(120, 150, 210, .28), transparent 70%),
    radial-gradient(ellipse 45% 60% at 85% 10%, rgba(150, 120, 200, .22), transparent 70%),
    radial-gradient(ellipse 55% 40% at 10% 85%, rgba(70, 110, 180, .25), transparent 70%),
    linear-gradient(160deg, #0b1220, #070b14 60%, #0a0f1c);
}
.gate-art::before, .gate-art::after {
  content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent 60%), radial-gradient(1px 1px at 30% 70%, #dfe8ff, transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 26%, #fff, transparent 60%), radial-gradient(1px 1px at 88% 78%, #cfe0ff, transparent 60%),
    radial-gradient(1px 1px at 52% 88%, #fff, transparent 60%), radial-gradient(1px 1px at 20% 48%, #fff, transparent 60%),
    radial-gradient(1px 1px at 62% 56%, #e6eeff, transparent 60%), radial-gradient(1.5px 1.5px at 40% 12%, #fff, transparent 60%),
    radial-gradient(1px 1px at 92% 44%, #fff, transparent 60%), radial-gradient(1px 1px at 6% 64%, #dfe8ff, transparent 60%);
  background-size: 150px 150px; opacity: .55; animation: gate-twinkle 7s ease-in-out infinite alternate;
}
.gate-art::after { background-size: 220px 220px; background-position: 40px 90px; opacity: .35; animation-duration: 11s; }
@keyframes gate-twinkle { to { opacity: .15; } }

.gate-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
  -webkit-mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent);
}
.gate-card.wide .gate-art img { object-fit: contain; }
.gate-emblem { width: 150px; aspect-ratio: 1; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .7)) drop-shadow(0 0 24px rgba(216, 181, 106, .16)); }
.gate-emblem .vl { width: 100%; height: 100%; }
.gate-word {
  margin-top: 14px; font: 700 calc(30px * var(--ts, 1))/1 var(--g-serif); letter-spacing: .04em; white-space: nowrap;
  background: linear-gradient(#f6e3a8, #c99a48 55%, #7d5624); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8));
}
.gate-rule { position: relative; width: 80%; height: 1px; margin: 9px 0 8px; background: linear-gradient(90deg, transparent, #b8924c, transparent); }
.gate-rule span { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; transform: translate(-50%, -50%) rotate(45deg); background: #3b5bb0; border: 1px solid #d8b56a; }
.gate-tagline { font: 500 calc(11.8px * var(--ts, 1))/1.2 var(--g-serif); letter-spacing: .24em; text-transform: uppercase; color: #d7d2c4; white-space: nowrap; }

/* ---------- Form pane ---------- */
.gate-pane { padding: 26px 28px 24px; display: flex; flex-direction: column; justify-content: center; font-size: calc(14px * var(--ts, 1)); }
.gate-eyebrow { margin: 0 0 6px; font-size: calc(12.5px * var(--ts, 1)); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--g-steel); }
.gate-title { margin: 0 0 4px; font-size: calc(20px * var(--ts, 1)); line-height: 1.2; font-weight: 700; letter-spacing: .01em; text-transform: uppercase; }
.gate-lead { margin: 0 0 16px; color: var(--g-dim); font-size: calc(13.7px * var(--ts, 1)); }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gate-field > label { font-size: calc(12.5px * var(--ts, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g-soft); }
.gate-hint { font-size: calc(13.3px * var(--ts, 1)); color: var(--g-dim); }
.gate-input {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--g-field-line); border-radius: 6px;
  background: var(--g-field); color: var(--g-text); font-size: calc(14px * var(--ts, 1)); transition: border-color .15s, box-shadow .15s;
}
select.gate-input { appearance: auto; padding-right: 6px; cursor: pointer; }
.gate-input[type="date"] { color-scheme: dark; }
.gate-input::placeholder { color: #6f7b8e; }
.gate-input:focus { outline: none; border-color: #7aa7d6; box-shadow: 0 0 0 3px rgba(122, 167, 214, .22); }
.gate-input:-webkit-autofill { -webkit-text-fill-color: var(--g-text); -webkit-box-shadow: 0 0 0 40px var(--g-field) inset; caret-color: var(--g-text); }
.gate-pass { position: relative; }
.gate-pass .gate-input { padding-right: 40px; }
.gate-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--g-dim); cursor: pointer;
}
.gate-eye:hover { background: rgba(255, 255, 255, .06); color: var(--g-text); }
.gate-eye svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.gate-under { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; }
.gate-link {
  padding: 0; border: 0; background: none; color: var(--g-link); font-size: calc(13.7px * var(--ts, 1)); font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.gate-link:hover { color: #c3ebff; text-decoration: underline; text-underline-offset: 3px; }
.gate-check { display: inline-flex; align-items: center; gap: 8px; font-size: calc(13.7px * var(--ts, 1)); color: var(--g-soft); cursor: pointer; user-select: none; }
.gate-check input { width: 14px; height: 14px; margin: 0; accent-color: #7aa7d6; }
/* Join: "I agree to the Terms of Use and Privacy Policy" (required) */
.gate-agree { align-items: flex-start; line-height: 1.5; margin-top: 2px; }
.gate-agree input { flex: none; margin-top: 3px; }
.gate-agree .gate-link { display: inline; min-height: 0; font-size: inherit; padding: 0; }

.gate-msg { margin: 0; padding: 8px 10px; border-radius: 6px; font-size: calc(13.7px * var(--ts, 1)); border: 1px solid; }
.gate-msg:empty { display: none; }
.gate-msg.err { color: var(--g-danger); border-color: rgba(255, 138, 128, .35); background: rgba(255, 138, 128, .07); }
.gate-msg.info { color: var(--g-soft); border-color: var(--g-line); background: rgba(255, 255, 255, .03); }
.gate-msg.ok { color: var(--g-ok); border-color: rgba(127, 220, 164, .35); background: rgba(127, 220, 164, .07); }

.gate-btn {
  height: 38px; padding: 0 16px; border: 1px solid var(--g-line); border-radius: 6px; background: #121b28;
  font-size: calc(13.2px * var(--ts, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g-soft); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.gate-btn:hover { background: #1a2536; border-color: #4a5870; color: var(--g-text); }
.gate-btn.primary { width: 100%; margin-top: 2px; background: linear-gradient(#2c4366, #1f3150); border-color: #4f6a92; color: #fff; }
.gate-btn.primary:hover { filter: brightness(1.12); }
.gate-btn:focus-visible, .gate-link:focus-visible, .gate-eye:focus-visible { outline: 2px solid #7aa7d6; outline-offset: 2px; }
.gate-btn:disabled { opacity: .55; cursor: default; }
.gate-alt { margin: 2px 0 0; text-align: center; font-size: calc(13.7px * var(--ts, 1)); color: var(--g-dim); }
.gate-dot { margin: 0 8px; color: var(--g-line); }
.gate-note { margin: 0 0 14px; color: var(--g-soft); }

/* ---------- The Veil logo (same rules as css/veil.css; the gate does not load that file) ---------- */
.vl { display: block; overflow: visible; }
.vl-pt { fill: var(--g); stroke: #5b4019; stroke-width: .8; }
.vl-gem { fill: var(--j); stroke: #e9cf8a; stroke-width: 1.2; }
.vl-ring { fill: none; stroke: var(--g); stroke-width: 8; }
.vl-ring2 { fill: none; stroke: #6d4f22; stroke-width: 1.4; }
.vl-tick { stroke: #3c2a10; stroke-width: 1.3; }
.vl-ticks { animation: vl-spin 60s linear infinite; transform-origin: center; transform-box: fill-box; }
.vl-iris { fill: var(--i); stroke: #2a1f10; stroke-width: 1.2; }
.vl-fib { stroke: rgba(225, 235, 255, .45); stroke-width: .6; animation: vl-spin 24s linear infinite; transform-origin: 0 0; }
.vl-pupil { fill: #05070c; animation: vl-dilate 7s ease-in-out infinite; transform-origin: 0 0; }
.vl-glint { fill: rgba(255, 255, 255, .75); }
.vl-socket { fill: #0e1522; }
.vl-look { transition: transform .25s ease-out; }
.vl-lid { fill: var(--g); stroke: #4a3412; stroke-width: 1.2; transform: scaleY(0); transition: transform .09s ease-in; }
.vl-lid-t { transform-origin: 0 -26.5px; } .vl-lid-b { transform-origin: 0 26.5px; }
.vl-eye.blink .vl-lid { transform: scaleY(1.02); transition-timing-function: ease-out; }
@keyframes vl-spin { to { transform: rotate(360deg); } }
@keyframes vl-dilate { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* ---------- Smaller screens ---------- */
@media (max-width: 680px) {
  .gate { place-items: start center; padding: 12px; }
  .gate-body { grid-template-columns: 1fr; }
  .gate-art { flex-direction: row; gap: 12px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--g-line); height: 150px; }
  .gate-art img, .gate-card.wide .gate-art img { object-fit: cover; object-position: center 34%; -webkit-mask-image: none; mask-image: none; }
  .gate-emblem { width: 52px; }
  .gate-word { margin-top: 0; font-size: calc(22px * var(--ts, 1)); }
  .gate-rule, .gate-tagline { display: none; }
  .gate-pane { padding: 20px 18px; }
}
@media (max-width: 420px) { .gate-row { grid-template-columns: 1fr; } }
/* Phones (Jordan, 2026-11-25): the card fills the screen, readable 12px+ labels, 16px fields so iPhone doesn't zoom, 44px taps */
@media (max-width: 680px) {
  .gate { place-items: center; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .gate-card { width: 100%; }
  .gate-art { height: 30vh; min-height: 150px; max-height: 240px; }
  .gate-bar-tag, .gate-eyebrow, .gate-field > label { font-size: calc(13.3px * var(--ts, 1)); }
  .gate-input { height: 46px; font-size: calc(16px * var(--ts, 1)); border-radius: 10px; }
  .gate-eye { width: 44px; height: 44px; }
  .gate-link { display: inline-flex; align-items: center; min-height: 40px; }
  .gate-btn { min-height: 48px; font-size: calc(15px * var(--ts, 1)); border-radius: 10px; }
  .gate-check input { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
